/*
* XmlDigitalTeaching v0.0.1
* Copyright ©Wed Jun 12 2024 12:02:25 GMT+0800 (中国标准时间) smile
* Released under the ISC License.
*/
import Vue from 'vue';
import crypto$1 from 'crypto';

let componentNamespace = 'xml';
// 组件前缀命名只能更新一次，防止重复执行修改组件注册出错
let isUpdated = false;
// scss 命名不能通过 js 更改，在 SCSS 编译已经打包好了
const cssNamespace = 'xml';
const statePrefix = 'is-';
function createNamespace$1(name, {
  prefix,
  isUnPrefix
}) {
  let useNamespace;
  if (!isUpdated) {
    isUpdated = true;
    useNamespace = prefix || componentNamespace; // 更改前缀
  }
  if (prefix) {
    if (name.indexOf(componentNamespace) === 0) {
      return name.replace(componentNamespace, prefix);
    }
    return useNamespace.charAt(0).toUpperCase() + useNamespace.substr(1) + name;
  }
  if (name.indexOf(componentNamespace) === 0 || name.indexOf(componentNamespace.charAt(0).toUpperCase()) === 0) {
    return name.charAt(0).toUpperCase() + name.substr(1);
  }
  return isUnPrefix ? name.charAt(0).toLowerCase() + name.substr(1) : componentNamespace + name.charAt(0).toUpperCase() + name.substr(1);
}

/**
 * 生成 bem
 * @param {} namespace 命名空间
 * @param {*} block 块
 * @param {*} blockSuffix 块多个单词
 * @param {*} element 元素
 * @param {*} modifier 修饰符
 * @returns
 */
const _bem = (namespace, block, blockSuffix, element, modifier) => {
  let cls = `${namespace}-${block}`;
  if (blockSuffix) {
    cls += `-${blockSuffix}`;
  }
  if (element) {
    cls += `__${element}`;
  }
  if (modifier) {
    cls += `--${modifier}`;
  }
  return cls;
};
const useNamespace = (block, namespace = cssNamespace) => {
  const b = (blockSuffix = '') => _bem(namespace, block, blockSuffix, '', '');
  const e = element => element ? _bem(namespace, block, '', element, '') : '';
  const m = modifier => modifier ? _bem(namespace, block, '', '', modifier) : '';
  const be = (blockSuffix, element) => blockSuffix && element ? _bem(namespace, block, blockSuffix, element, '') : '';
  const em = (element, modifier) => element && modifier ? _bem(namespace, block, '', element, modifier) : '';
  const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace, block, blockSuffix, '', modifier) : '';
  const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace, block, blockSuffix, element, modifier) : '';
  const is = (name, ...args) => {
    const state = args.length >= 1 ? args[0] : true;
    return name && state ? `${statePrefix}${name}` : '';
  };

  // for css var
  // --el-xxx: value;
  const cssVar = object => {
    const styles = {};
    for (const key in object) {
      styles[`--${namespace}-${key}`] = object[key];
    }
    return styles;
  };

  // with block
  const cssVarBlock = object => {
    const styles = {};
    for (const key in object) {
      styles[`--${namespace}-${block}-${key}`] = object[key];
    }
    return styles;
  };
  const cssVarName = name => `--${namespace}-${name}`;
  const cssVarBlockName = name => `--${namespace}-${block}-${name}`;
  return {
    cssNamespace,
    componentNamespace,
    b,
    e,
    m,
    be,
    em,
    bm,
    bem,
    is,
    // css
    cssVar,
    cssVarName,
    cssVarBlock,
    cssVarBlockName
  };
};

// 样式资源包
let chalk = '';
// 默认主题
let defaultTheme = '#409EFF';
const tintColor = (color, tint) => {
  color = color.replace('#', '');
  let red = parseInt(color.slice(0, 2), 16);
  let green = parseInt(color.slice(2, 4), 16);
  let blue = parseInt(color.slice(4, 6), 16);
  if (tint === 0) {
    // when primary color is in its rgb space
    return [red, green, blue].join(',');
  } else {
    red += Math.round(tint * (255 - red));
    green += Math.round(tint * (255 - green));
    blue += Math.round(tint * (255 - blue));
    red = red.toString(16);
    green = green.toString(16);
    blue = blue.toString(16);
    console.log('tintColor return', color, tint, `#${red}${green}${blue}`);
    return `#${red}${green}${blue}`;
  }
};
const shadeColor = (color, shade) => {
  let red = parseInt(color.slice(0, 2), 16);
  let green = parseInt(color.slice(2, 4), 16);
  let blue = parseInt(color.slice(4, 6), 16);
  red = Math.round((1 - shade) * red);
  green = Math.round((1 - shade) * green);
  blue = Math.round((1 - shade) * blue);
  red = red.toString(16);
  green = green.toString(16);
  blue = blue.toString(16);
  console.log('shadeColor return', color, shade, `#${red}${green}${blue}`);
  return `#${red}${green}${blue}`;
};
const getThemeCluster = function (theme) {
  const clusters = [theme];
  for (let i = 0; i <= 9; i++) {
    clusters.push(tintColor(theme, Number((i / 10).toFixed(2))));
  }
  clusters.push(shadeColor(theme, 0.1));
  console.log('getThemeCluster return', theme, clusters);
  return clusters;
};
const getCSSString = function (url) {
  return new Promise(resolve => {
    const xhr = new XMLHttpRequest();
    xhr.onreadystatechange = () => {
      if (xhr.readyState === 4 && xhr.status === 200) {
        chalk = xhr.responseText.replace(/@font-face{[^}]+}/, '');
        console.log('getCSSString: chalk', chalk);
        resolve();
      }
    };
    xhr.onerror = err => {
      console.error('样式下载失败', err);
    };
    xhr.open('GET', url);
    xhr.send();
  });
};
const updateStyle = function (style, oldCluster, newCluster) {
  let newStyle = style;
  oldCluster.forEach((color, index) => {
    newStyle = newStyle.replace(new RegExp(color, 'ig'), newCluster[index]);
  });
  console.log('updateStyle: newStyle', newStyle);
  return newStyle;
};
const updateElementTheme = async function (options = {}) {
  const {
    version = '2.15.8',
    oldTheme,
    primaryColor,
    appendDom,
    insertBefore,
    cssUrl,
    chalkStyle = 'chalk-style'
  } = options;
  if (typeof primaryColor !== 'string') return;
  const themeCluster = getThemeCluster(primaryColor.replace('#', ''));
  const originalCluster = getThemeCluster((oldTheme || defaultTheme).replace('#', ''));
  const chalkHandler = id => {
    const newStyle = updateStyle(chalk, originalCluster, themeCluster);
    // 覆盖原来的样式
    chalk = newStyle;
    let styleTag = document.querySelector(id);
    if (!styleTag) {
      styleTag = document.createElement('style');
      styleTag.setAttribute('id', id);
      if (appendDom) {
        if (insertBefore) {
          appendDom.parentNode.insertBefore(styleTag, appendDom.nextSibling);
        } else {
          appendDom.appendChild(styleTag);
        }
      } else {
        document.head.appendChild(styleTag);
      }
    }
    styleTag.innerText = newStyle;
  };
  if (!chalk) {
    const url = cssUrl || `https://unpkg.com/element-ui@${version}/lib/theme-chalk/index.css`;
    await getCSSString(url);
  }
  chalkHandler(chalkStyle);
  defaultTheme = primaryColor;
};

const updateUITheme = async function (options) {
  const {
    oldTheme = '#409EFF',
    primaryColor,
    primarySecondColor,
    opacity = 0.7,
    elementUI,
    button = {
      disabledFontColorPrimary: '#fff',
      disabledBgColorPrimary: '#ccc',
      disabledFontColorPlain: '#999',
      disabledBgColorPlain: '#f5f5f5',
      disabledFontColorGhost: '#999',
      disabledBorderColorGhost: '#ccc'
    }
  } = options;
  if (!primaryColor) return;
  if (elementUI) {
    try {
      await updateElementTheme({
        oldTheme,
        primaryColor: primaryColor
      });
    } catch (err) {
      console.error(err);
    }
  }

  // const primaryOpc = colorPalette(primary, opacity)
  // 第二种主题透明

  const primarySecOpc = primarySecondColor ? tintColor(primarySecondColor, Number((1 - opacity).toFixed(2))) : '';
  // const primaryDis = colorPalette(primary, disOpacity)
  // const primarySecDis = colorPalette(primarySecondColor, disOpacity)
  const primaryLightColors = [];
  const el = document.documentElement;
  el.style.setProperty(`--${cssNamespace}-color-primary`, primaryColor);
  for (let i = 1; i <= 9; i++) {
    const color = tintColor(primaryColor, Number((0.1 * i).toFixed(2)));
    primaryLightColors.push(color);
    el.style.setProperty(`--${cssNamespace}-color-primary-light-${i}`, color);
  }

  // disabled primary
  el.style.setProperty(`--${cssNamespace}-button-disabled-font-color-primary`, button.disabledFontColorPrimary);
  el.style.setProperty(`--${cssNamespace}-button-disabled-bg-color-primary`, button.disabledBgColorPrimary);
  el.style.setProperty(`--${cssNamespace}-button-disabled-border-color-primary`, button.disabledBgColorPrimary);
  // plain
  el.style.setProperty(`--${cssNamespace}-button-disabled-font-color-primary-plain`, button.disabledFontColorPlain);
  el.style.setProperty(`--${cssNamespace}-button-disabled-bg-color-primary-plain`, button.disabledBgColorPlain);
  // ghost
  el.style.setProperty(`--${cssNamespace}-button-disabled-font-color-primary-ghost`, button.disabledFontColorGhost);
  el.style.setProperty(`--${cssNamespace}-button-disabled-border-color-primary-ghost`, button.disabledBorderColorGhost);
  const buttonTheme = {
    primary: {
      'button-font-color': primarySecondColor ? primaryColor : '#fff',
      'button-bg-color': primarySecondColor ? primarySecondColor : primaryColor,
      'button-hover-font-color': primarySecondColor ? primaryColor : '#fff',
      'button-hover-bg-color': primarySecondColor ? primarySecOpc : primaryLightColors[1],
      'button-active-font-color': primarySecondColor ? primaryColor : '#fff',
      'button-active-bg-color': primarySecondColor ? primarySecondColor : primaryColor
    },
    plain: {
      'button-font-color-primary': primarySecondColor ? primarySecondColor : primaryColor,
      'button-bg-color-primary': primarySecondColor ? primaryLightColors[3] : primaryLightColors[7],
      'button-hover-font-color-primary': primarySecondColor ? primarySecondColor : primaryColor,
      'button-hover-bg-color-primary': primarySecondColor ? primaryLightColors[4] : primaryLightColors[7],
      'button-active-font-color-primary': primarySecondColor ? primarySecondColor : primaryColor,
      'button-active-bg-color-primary': primarySecondColor ? primaryLightColors[3] : primaryLightColors[7]
    }
  };
  Object.keys(buttonTheme).forEach(type => {
    const item = buttonTheme[type];
    Object.keys(item).forEach(property => {
      el.style.setProperty(`--${cssNamespace}-${property}-${type}`, item[property]);
    });
  });
};

var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};

function commonjsRequire () {
	throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');
}

function unwrapExports (x) {
	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}

function createCommonjsModule(fn, module) {
	return module = { exports: {} }, fn(module, module.exports), module.exports;
}

function getCjsExportFromNamespace (n) {
	return n && n['default'] || n;
}

var vhCheck = createCommonjsModule(function (module, exports) {
(function (global, factory) {
  module.exports = factory() ;
})(commonjsGlobal, function () {

  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation. All rights reserved.
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  this file except in compliance with the License. You may obtain a copy of the
  License at http://www.apache.org/licenses/LICENSE-2.0
    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  MERCHANTABLITY OR NON-INFRINGEMENT.
    See the Apache Version 2.0 License for specific language governing permissions
  and limitations under the License.
  ***************************************************************************** */
  var __assign = function () {
    __assign = Object.assign || function __assign(t) {
      for (var s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i];
        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
      }
      return t;
    };
    return __assign.apply(this, arguments);
  };

  // don't know a better way to get the size of a CSS 100vh…
  function createTestElement() {
    var testElement = document.createElement('div');
    testElement.style.cssText = 'position: fixed; top: 0; height: 100vh; pointer-events: none;';
    document.documentElement.insertBefore(testElement, document.documentElement.firstChild);
    return testElement;
  }
  function removeTestElement(element) {
    document.documentElement.removeChild(element);
  }
  //  in some browsers this will be bigger than window.innerHeight
  function checkSizes() {
    var vhTest = createTestElement();
    var windowHeight = window.innerHeight;
    var vh = vhTest.offsetHeight;
    var offset = vh - windowHeight;
    removeTestElement(vhTest);
    return {
      vh: vh,
      windowHeight: windowHeight,
      offset: offset,
      isNeeded: offset !== 0,
      value: 0
    };
  }
  // export
  function noop() {}
  function computeDifference() {
    var sizes = checkSizes();
    sizes.value = sizes.offset;
    return sizes;
  }
  function redefineVhUnit() {
    var sizes = checkSizes();
    sizes.value = sizes.windowHeight * 0.01;
    return sizes;
  }
  var methods = /*#__PURE__*/Object.freeze({
    noop: noop,
    computeDifference: computeDifference,
    redefineVhUnit: redefineVhUnit
  });
  function isString(text) {
    return typeof text === "string" && text.length > 0;
  }
  function isFunction(f) {
    return typeof f === "function";
  }
  var defaultOptions = Object.freeze({
    cssVarName: 'vh-offset',
    redefineVh: false,
    method: computeDifference,
    force: false,
    bind: true,
    updateOnTouch: false,
    onUpdate: noop
  });
  function getOptions(options) {
    // old options handling: only redefine the CSS var name
    if (isString(options)) {
      return __assign({}, defaultOptions, {
        cssVarName: options
      });
    }
    // be sure to have a configuration object
    if (typeof options !== 'object') return defaultOptions;
    // make sure we have the right options to start with
    var finalOptions = {
      force: options.force === true,
      bind: options.bind !== false,
      updateOnTouch: options.updateOnTouch === true,
      onUpdate: isFunction(options.onUpdate) ? options.onUpdate : noop
    };
    // method change
    var redefineVh = options.redefineVh === true;
    finalOptions.method = methods[redefineVh ? 'redefineVhUnit' : 'computeDifference'];
    finalOptions.cssVarName = isString(options.cssVarName) ? options.cssVarName : redefineVh ?
    /*
    when redefining vh unit we follow this article name convention
    https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
    */
    'vh' : defaultOptions.cssVarName;
    return finalOptions;
  }

  // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
  var passiveSupported = false;
  var eventListeners = [];
  /* istanbul ignore next */
  try {
    var options = Object.defineProperty({}, "passive", {
      get: function () {
        passiveSupported = true;
      }
    });
    window.addEventListener("test", options, options);
    window.removeEventListener("test", options, options);
  } catch (err) {
    passiveSupported = false;
  }
  function addListener(eventName, callback) {
    eventListeners.push({
      eventName: eventName,
      callback: callback
    });
    window.addEventListener(eventName, callback, /* istanbul ignore next */
    passiveSupported ? {
      passive: true
    } : false);
  }
  function removeAll() {
    eventListeners.forEach(function (config) {
      window.removeEventListener(config.eventName, config.callback);
    });
    eventListeners = [];
  }
  function updateCssVar(cssVarName, result) {
    document.documentElement.style.setProperty("--" + cssVarName, result.value + "px");
  }
  function formatResult(sizes, options) {
    return __assign({}, sizes, {
      unbind: removeAll,
      recompute: options.method
    });
  }
  function vhCheck(options) {
    var config = Object.freeze(getOptions(options));
    var result = formatResult(config.method(), config);
    // usefulness check
    if (!result.isNeeded && !config.force) {
      return result;
    }
    updateCssVar(config.cssVarName, result);
    config.onUpdate(result);
    // enabled by default
    if (!config.bind) return result;
    function onWindowChange() {
      window.requestAnimationFrame(function () {
        var sizes = config.method();
        updateCssVar(config.cssVarName, sizes);
        config.onUpdate(formatResult(sizes, config));
      });
    }
    // be sure we don't duplicates events listeners
    result.unbind();
    // listen for orientation change
    // - this can't be configured
    // - because it's convenient and not a real performance bottleneck
    addListener('orientationchange', onWindowChange);
    // listen to touch move for scrolling
    // – disabled by default
    // - listening to scrolling can be expansive…
    if (config.updateOnTouch) {
      addListener('touchmove', onWindowChange);
    }
    return result;
  }
  return vhCheck;
});
});

function _extends$2() {
  return _extends$2 = Object.assign ? Object.assign.bind() : function (n) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
    }
    return n;
  }, _extends$2.apply(null, arguments);
}

function _extends$1() {
  return _extends$1 = Object.assign ? Object.assign.bind() : function (a) {
    for (var b, c = 1; c < arguments.length; c++) for (var d in b = arguments[c], b) Object.prototype.hasOwnProperty.call(b, d) && (a[d] = b[d]);
    return a;
  }, _extends$1.apply(this, arguments);
}
var normalMerge = ["attrs", "props", "domProps"],
  toArrayMerge = ["class", "style", "directives"],
  functionalMerge = ["on", "nativeOn"],
  mergeJsxProps = function (a) {
    return a.reduce(function (c, a) {
      for (var b in a) if (!c[b]) c[b] = a[b];else if (-1 !== normalMerge.indexOf(b)) c[b] = _extends$1({}, c[b], a[b]);else if (-1 !== toArrayMerge.indexOf(b)) {
        var d = c[b] instanceof Array ? c[b] : [c[b]],
          e = a[b] instanceof Array ? a[b] : [a[b]];
        c[b] = [].concat(d, e);
      } else if (-1 !== functionalMerge.indexOf(b)) {
        for (var f in a[b]) if (c[b][f]) {
          var g = c[b][f] instanceof Array ? c[b][f] : [c[b][f]],
            h = a[b][f] instanceof Array ? a[b][f] : [a[b][f]];
          c[b][f] = [].concat(g, h);
        } else c[b][f] = a[b][f];
      } else if ("hook" === b) for (var i in a[b]) c[b][i] = c[b][i] ? mergeFn(c[b][i], a[b][i]) : a[b][i];else c[b] = a[b];
      return c;
    }, {});
  },
  mergeFn = function (a, b) {
    return function () {
      a && a.apply(this, arguments), b && b.apply(this, arguments);
    };
  };
var helper = mergeJsxProps;

var _mergeJSXProps = helper;

/**
 * bem helper
 * b() // 'button'
 * b('text') // 'button__text'
 * b({ disabled }) // 'button button--disabled'
 * b('text', { disabled }) // 'button__text button__text--disabled'
 * b(['disabled', 'primary']) // 'button button--disabled button--primary'
 */
function gen(name, mods) {
  if (!mods) {
    return '';
  }
  if (typeof mods === 'string') {
    return " " + name + "--" + mods;
  }
  if (Array.isArray(mods)) {
    return mods.reduce(function (ret, item) {
      return ret + gen(name, item);
    }, '');
  }
  return Object.keys(mods).reduce(function (ret, key) {
    return ret + (mods[key] ? gen(name, key) : '');
  }, '');
}
function createBEM(name) {
  return function (el, mods) {
    if (el && typeof el !== 'string') {
      mods = el;
      el = '';
    }
    el = el ? name + "__" + el : name;
    return "" + el + gen(el, mods);
  };
}

var hasOwnProperty$3 = Object.prototype.hasOwnProperty;
function assignKey(to, from, key) {
  var val = from[key];
  if (!isDef(val)) {
    return;
  }
  if (!hasOwnProperty$3.call(to, key) || !isObject$2(val)) {
    to[key] = val;
  } else {
    // eslint-disable-next-line @typescript-eslint/no-use-before-define
    to[key] = deepAssign(Object(to[key]), from[key]);
  }
}
function deepAssign(to, from) {
  Object.keys(from).forEach(function (key) {
    assignKey(to, from, key);
  });
  return to;
}

var defaultMessages = {
  name: '姓名',
  tel: '电话',
  save: '保存',
  confirm: '确认',
  cancel: '取消',
  delete: '删除',
  complete: '完成',
  loading: '加载中...',
  telEmpty: '请填写电话',
  nameEmpty: '请填写姓名',
  nameInvalid: '请输入正确的姓名',
  confirmDelete: '确定要删除吗',
  telInvalid: '请输入正确的手机号',
  vanCalendar: {
    end: '结束',
    start: '开始',
    title: '日期选择',
    confirm: '确定',
    startEnd: '开始/结束',
    weekdays: ['日', '一', '二', '三', '四', '五', '六'],
    monthTitle: function monthTitle(year, month) {
      return year + "\u5E74" + month + "\u6708";
    },
    rangePrompt: function rangePrompt(maxRange) {
      return "\u9009\u62E9\u5929\u6570\u4E0D\u80FD\u8D85\u8FC7 " + maxRange + " \u5929";
    }
  },
  vanCascader: {
    select: '请选择'
  },
  vanContactCard: {
    addText: '添加联系人'
  },
  vanContactList: {
    addText: '新建联系人'
  },
  vanPagination: {
    prev: '上一页',
    next: '下一页'
  },
  vanPullRefresh: {
    pulling: '下拉即可刷新...',
    loosing: '释放即可刷新...'
  },
  vanSubmitBar: {
    label: '合计：'
  },
  vanCoupon: {
    unlimited: '无使用门槛',
    discount: function discount(_discount) {
      return _discount + "\u6298";
    },
    condition: function condition(_condition) {
      return "\u6EE1" + _condition + "\u5143\u53EF\u7528";
    }
  },
  vanCouponCell: {
    title: '优惠券',
    tips: '暂无可用',
    count: function count(_count) {
      return _count + "\u5F20\u53EF\u7528";
    }
  },
  vanCouponList: {
    empty: '暂无优惠券',
    exchange: '兑换',
    close: '不使用优惠券',
    enable: '可用',
    disabled: '不可用',
    placeholder: '请输入优惠码'
  },
  vanAddressEdit: {
    area: '地区',
    postal: '邮政编码',
    areaEmpty: '请选择地区',
    addressEmpty: '请填写详细地址',
    postalEmpty: '邮政编码格式不正确',
    defaultAddress: '设为默认收货地址',
    telPlaceholder: '收货人手机号',
    namePlaceholder: '收货人姓名',
    areaPlaceholder: '选择省 / 市 / 区'
  },
  vanAddressEditDetail: {
    label: '详细地址',
    placeholder: '街道门牌、楼层房间号等信息'
  },
  vanAddressList: {
    add: '新增地址'
  }
};

var proto$1 = Vue.prototype;
var defineReactive = Vue.util.defineReactive;
defineReactive(proto$1, '$vantLang', 'zh-CN');
defineReactive(proto$1, '$vantMessages', {
  'zh-CN': defaultMessages
});
var Locale$1 = {
  messages: function messages() {
    return proto$1.$vantMessages[proto$1.$vantLang];
  },
  use: function use(lang, messages) {
    var _this$add;
    proto$1.$vantLang = lang;
    this.add((_this$add = {}, _this$add[lang] = messages, _this$add));
  },
  add: function add(messages) {
    if (messages === void 0) {
      messages = {};
    }
    deepAssign(proto$1.$vantMessages, messages);
  }
};

var camelizeRE = /-(\w)/g;
function camelize(str) {
  return str.replace(camelizeRE, function (_, c) {
    return c.toUpperCase();
  });
}
function padZero(num, targetLength) {
  if (targetLength === void 0) {
    targetLength = 2;
  }
  var str = num + '';
  while (str.length < targetLength) {
    str = '0' + str;
  }
  return str;
}

/**
 * Use scopedSlots in Vue 2.6+
 * downgrade to slots in lower version
 */
var SlotsMixin = {
  methods: {
    slots: function slots(name, props) {
      if (name === void 0) {
        name = 'default';
      }
      var $slots = this.$slots,
        $scopedSlots = this.$scopedSlots;
      var scopedSlot = $scopedSlots[name];
      if (scopedSlot) {
        return scopedSlot(props);
      }
      return $slots[name];
    }
  }
};

/**
 * Create a basic component with common options
 */
function install$3(Vue) {
  var name = this.name;
  Vue.component(name, this);
  Vue.component(camelize("-" + name), this);
} // unify slots & scopedSlots

function unifySlots(context) {
  // use data.scopedSlots in lower Vue version
  var scopedSlots = context.scopedSlots || context.data.scopedSlots || {};
  var slots = context.slots();
  Object.keys(slots).forEach(function (key) {
    if (!scopedSlots[key]) {
      scopedSlots[key] = function () {
        return slots[key];
      };
    }
  });
  return scopedSlots;
} // should be removed after Vue 3

function transformFunctionComponent(pure) {
  return {
    functional: true,
    props: pure.props,
    model: pure.model,
    render: function render(h, context) {
      return pure(h, context.props, unifySlots(context), context);
    }
  };
}
function createComponent$1H(name) {
  return function (sfc) {
    if (isFunction$2(sfc)) {
      sfc = transformFunctionComponent(sfc);
    }
    if (!sfc.functional) {
      sfc.mixins = sfc.mixins || [];
      sfc.mixins.push(SlotsMixin);
    }
    sfc.name = name;
    sfc.install = install$3;
    return sfc;
  };
}

function createI18N(name) {
  var prefix = camelize(name) + '.';
  return function (path) {
    var messages = Locale$1.messages();
    var message = get$2(messages, prefix + path) || get$2(messages, path);
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }
    return isFunction$2(message) ? message.apply(void 0, args) : message;
  };
}

function createNamespace(name) {
  name = 'van-' + name;
  return [createComponent$1H(name), createBEM(name), createI18N(name)];
}

function isNumeric(val) {
  return /^\d+(\.\d+)?$/.test(val);
}
function isNaN$1(val) {
  if (Number.isNaN) {
    return Number.isNaN(val);
  } // eslint-disable-next-line no-self-compare

  return val !== val;
}

function addUnit(value) {
  if (!isDef(value)) {
    return undefined;
  }
  value = String(value);
  return isNumeric(value) ? value + "px" : value;
} // cache

var rootFontSize;
function getRootFontSize() {
  if (!rootFontSize) {
    var doc = document.documentElement;
    var fontSize = doc.style.fontSize || window.getComputedStyle(doc).fontSize;
    rootFontSize = parseFloat(fontSize);
  }
  return rootFontSize;
}
function convertRem(value) {
  value = value.replace(/rem/g, '');
  return +value * getRootFontSize();
}
function convertVw(value) {
  value = value.replace(/vw/g, '');
  return +value * window.innerWidth / 100;
}
function convertVh(value) {
  value = value.replace(/vh/g, '');
  return +value * window.innerHeight / 100;
}
function unitToPx(value) {
  if (typeof value === 'number') {
    return value;
  }
  if (inBrowser$2) {
    if (value.indexOf('rem') !== -1) {
      return convertRem(value);
    }
    if (value.indexOf('vw') !== -1) {
      return convertVw(value);
    }
    if (value.indexOf('vh') !== -1) {
      return convertVh(value);
    }
  }
  return parseFloat(value);
}

var inBrowser$2 = typeof window !== 'undefined';
var isServer$1 = Vue.prototype.$isServer; // eslint-disable-next-line @typescript-eslint/no-empty-function

function noop$5() {}
function isDef(val) {
  return val !== undefined && val !== null;
}
function isFunction$2(val) {
  return typeof val === 'function';
}
function isObject$2(val) {
  return val !== null && typeof val === 'object';
}
function isPromise$2(val) {
  return isObject$2(val) && isFunction$2(val.then) && isFunction$2(val.catch);
}
function get$2(object, path) {
  var keys = path.split('.');
  var result = object;
  keys.forEach(function (key) {
    var _result$key;
    result = isObject$2(result) ? (_result$key = result[key]) != null ? _result$key : '' : '';
  });
  return result;
}
/**
 * Checks if `value` is an empty object, collection, map, or set.
 *
 * Objects are considered empty if they have no own enumerable string keyed
 * properties.
 *
 * Array-like values such as `arguments` objects, arrays, buffers, strings, or
 * jQuery-like collections are considered empty if they have a `length` of `0`.
 * Similarly, maps and sets are considered empty if they have a `size` of `0`.
 *
 * @function isEmpty
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is empty, else `false`.
 * @example
 *
 * _.isEmpty(null);
 * // => true
 *
 * _.isEmpty(true);
 * // => true
 *
 * _.isEmpty(1);
 * // => true
 *
 * _.isEmpty([1, 2, 3]);
 * // => false
 *
 * _.isEmpty({ 'a': 1 });
 * // => false
 */

function isEmpty$2(value) {
  if (value == null) {
    return true;
  }
  if (typeof value !== 'object') {
    return true;
  }
  return Object.keys(value).length === 0;
}

var inheritKey = ['ref', 'key', 'style', 'class', 'attrs', 'refInFor', 'nativeOn', 'directives', 'staticClass', 'staticStyle'];
var mapInheritKey = {
  nativeOn: 'on'
}; // inherit partial context, map nativeOn to on

function inherit(context, inheritListeners) {
  var result = inheritKey.reduce(function (obj, key) {
    if (context.data[key]) {
      obj[mapInheritKey[key] || key] = context.data[key];
    }
    return obj;
  }, {});
  if (inheritListeners) {
    result.on = result.on || {};
    _extends$2(result.on, context.data.on);
  }
  return result;
} // emit event

function emit(context, eventName) {
  for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    args[_key - 2] = arguments[_key];
  }
  var listeners = context.listeners[eventName];
  if (listeners) {
    if (Array.isArray(listeners)) {
      listeners.forEach(function (listener) {
        listener.apply(void 0, args);
      });
    } else {
      listeners.apply(void 0, args);
    }
  }
} // mount functional component

function mount(Component, data) {
  var instance = new Vue({
    el: document.createElement('div'),
    props: Component.props,
    render: function render(h) {
      return h(Component, _extends$2({
        props: this.$props
      }, data));
    }
  });
  document.body.appendChild(instance.$el);
  return instance;
}

var context = {
  zIndex: 2000,
  lockCount: 0,
  stack: [],
  find: function find(vm) {
    return this.stack.filter(function (item) {
      return item.vm === vm;
    })[0];
  },
  remove: function remove(vm) {
    var item = this.find(vm);
    if (!item) return;
    item.vm = null;
    item.overlay = null;
    var index = this.stack.indexOf(item);
    this.stack.splice(index, 1);
  }
};

// eslint-disable-next-line import/no-mutable-exports
var supportsPassive$1 = false;
if (!isServer$1) {
  try {
    var opts$1 = {};
    Object.defineProperty(opts$1, 'passive', {
      // eslint-disable-next-line getter-return
      get: function get() {
        /* istanbul ignore next */
        supportsPassive$1 = true;
      }
    });
    window.addEventListener('test-passive', null, opts$1); // eslint-disable-next-line no-empty
  } catch (e) {}
}
function on$2(target, event, handler, passive) {
  if (passive === void 0) {
    passive = false;
  }
  if (!isServer$1) {
    target.addEventListener(event, handler, supportsPassive$1 ? {
      capture: false,
      passive: passive
    } : false);
  }
}
function off$2(target, event, handler) {
  if (!isServer$1) {
    target.removeEventListener(event, handler);
  }
}
function stopPropagation(event) {
  event.stopPropagation();
}
function preventDefault(event, isStopPropagation) {
  /* istanbul ignore else */
  if (typeof event.cancelable !== 'boolean' || event.cancelable) {
    event.preventDefault();
  }
  if (isStopPropagation) {
    stopPropagation(event);
  }
}

var _createNamespace$1C = createNamespace('overlay'),
  createComponent$1G = _createNamespace$1C[0],
  bem$1x = _createNamespace$1C[1];
function preventTouchMove(event) {
  preventDefault(event, true);
}
function Overlay(h, props, slots, ctx) {
  var style = _extends$2({
    zIndex: props.zIndex
  }, props.customStyle);
  if (isDef(props.duration)) {
    style.animationDuration = props.duration + "s";
  }
  return h("transition", {
    "attrs": {
      "name": "van-fade"
    }
  }, [h("div", _mergeJSXProps([{
    "directives": [{
      name: "show",
      value: props.show
    }],
    "style": style,
    "class": [bem$1x(), props.className],
    "on": {
      "touchmove": props.lockScroll ? preventTouchMove : noop$5
    }
  }, inherit(ctx, true)]), [slots.default == null ? void 0 : slots.default()])]);
}
Overlay.props = {
  show: Boolean,
  zIndex: [Number, String],
  duration: [Number, String],
  className: null,
  customStyle: Object,
  lockScroll: {
    type: Boolean,
    default: true
  }
};
var Overlay$1 = createComponent$1G(Overlay);

function removeNode(el) {
  var parent = el.parentNode;
  if (parent) {
    parent.removeChild(el);
  }
}

var defaultConfig$1 = {
  className: '',
  customStyle: {}
};
function mountOverlay(vm) {
  return mount(Overlay$1, {
    on: {
      // close popup when overlay clicked & closeOnClickOverlay is true
      click: function click() {
        vm.$emit('click-overlay');
        if (vm.closeOnClickOverlay) {
          if (vm.onClickOverlay) {
            vm.onClickOverlay();
          } else {
            vm.close();
          }
        }
      }
    }
  });
}
function updateOverlay(vm) {
  var item = context.find(vm);
  if (item) {
    var el = vm.$el;
    var config = item.config,
      overlay = item.overlay;
    if (el && el.parentNode) {
      el.parentNode.insertBefore(overlay.$el, el);
    }
    _extends$2(overlay, defaultConfig$1, config, {
      show: true
    });
  }
}
function openOverlay(vm, config) {
  var item = context.find(vm);
  if (item) {
    item.config = config;
  } else {
    var overlay = mountOverlay(vm);
    context.stack.push({
      vm: vm,
      config: config,
      overlay: overlay
    });
  }
  updateOverlay(vm);
}
function closeOverlay(vm) {
  var item = context.find(vm);
  if (item) {
    item.overlay.show = false;
  }
}
function removeOverlay(vm) {
  var item = context.find(vm);
  if (item) {
    removeNode(item.overlay.$el);
    context.remove(vm);
  }
}

function isWindow$1(val) {
  return val === window;
} // get nearest scroll element
// https://github.com/vant-ui/vant/issues/3823

var overflowScrollReg = /scroll|auto|overlay/i;
function getScroller(el, root) {
  if (root === void 0) {
    root = window;
  }
  var node = el;
  while (node && node.tagName !== 'HTML' && node.tagName !== 'BODY' && node.nodeType === 1 && node !== root) {
    var _window$getComputedSt = window.getComputedStyle(node),
      overflowY = _window$getComputedSt.overflowY;
    if (overflowScrollReg.test(overflowY)) {
      return node;
    }
    node = node.parentNode;
  }
  return root;
}
function getScrollTop(el) {
  var top = 'scrollTop' in el ? el.scrollTop : el.pageYOffset; // iOS scroll bounce cause minus scrollTop

  return Math.max(top, 0);
}
function setScrollTop(el, value) {
  if ('scrollTop' in el) {
    el.scrollTop = value;
  } else {
    el.scrollTo(el.scrollX, value);
  }
}
function getRootScrollTop() {
  return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
}
function setRootScrollTop(value) {
  setScrollTop(window, value);
  setScrollTop(document.body, value);
} // get distance from element top to page top or scroller top

function getElementTop(el, scroller) {
  if (isWindow$1(el)) {
    return 0;
  }
  var scrollTop = scroller ? getScrollTop(scroller) : getRootScrollTop();
  return el.getBoundingClientRect().top + scrollTop;
}
function getVisibleHeight(el) {
  if (isWindow$1(el)) {
    return el.innerHeight;
  }
  return el.getBoundingClientRect().height;
}
function getVisibleTop(el) {
  if (isWindow$1(el)) {
    return 0;
  }
  return el.getBoundingClientRect().top;
}

function getDirection(x, y) {
  if (x > y) {
    return 'horizontal';
  }
  if (y > x) {
    return 'vertical';
  }
  return '';
}
var TouchMixin = {
  data: function data() {
    return {
      direction: ''
    };
  },
  methods: {
    touchStart: function touchStart(event) {
      this.resetTouchStatus();
      this.startX = event.touches[0].clientX;
      this.startY = event.touches[0].clientY;
    },
    touchMove: function touchMove(event) {
      var touch = event.touches[0]; // safari back will set clientX to negative number

      this.deltaX = touch.clientX < 0 ? 0 : touch.clientX - this.startX;
      this.deltaY = touch.clientY - this.startY;
      this.offsetX = Math.abs(this.deltaX);
      this.offsetY = Math.abs(this.deltaY); // lock direction when distance is greater than a certain value

      var LOCK_DIRECTION_DISTANCE = 10;
      if (!this.direction || this.offsetX < LOCK_DIRECTION_DISTANCE && this.offsetY < LOCK_DIRECTION_DISTANCE) {
        this.direction = getDirection(this.offsetX, this.offsetY);
      }
    },
    resetTouchStatus: function resetTouchStatus() {
      this.direction = '';
      this.deltaX = 0;
      this.deltaY = 0;
      this.offsetX = 0;
      this.offsetY = 0;
    },
    // avoid Vue 2.6 event bubble issues by manually binding events
    // https://github.com/vant-ui/vant/issues/3015
    bindTouchEvent: function bindTouchEvent(el) {
      var onTouchStart = this.onTouchStart,
        onTouchMove = this.onTouchMove,
        onTouchEnd = this.onTouchEnd;
      on$2(el, 'touchstart', onTouchStart);
      on$2(el, 'touchmove', onTouchMove);
      if (onTouchEnd) {
        on$2(el, 'touchend', onTouchEnd);
        on$2(el, 'touchcancel', onTouchEnd);
      }
    }
  }
};

function getElement$1(selector) {
  if (typeof selector === 'string') {
    return document.querySelector(selector);
  }
  return selector();
}
function PortalMixin(_temp) {
  var _ref = _temp === void 0 ? {} : _temp,
    ref = _ref.ref,
    afterPortal = _ref.afterPortal;
  return {
    props: {
      getContainer: [String, Function]
    },
    watch: {
      getContainer: 'portal'
    },
    mounted: function mounted() {
      if (this.getContainer) {
        this.portal();
      }
    },
    methods: {
      portal: function portal() {
        var getContainer = this.getContainer;
        var el = ref ? this.$refs[ref] : this.$el;
        var container;
        if (getContainer) {
          container = getElement$1(getContainer);
        } else if (this.$parent) {
          container = this.$parent.$el;
        }
        if (container && container !== el.parentNode) {
          container.appendChild(el);
        }
        if (afterPortal) {
          afterPortal.call(this);
        }
      }
    }
  };
}

/**
 * Bind event when mounted or activated
 */
var uid$1 = 0;
function BindEventMixin(handler) {
  var key = "binded_" + uid$1++;
  function bind() {
    if (!this[key]) {
      handler.call(this, on$2, true);
      this[key] = true;
    }
  }
  function unbind() {
    if (this[key]) {
      handler.call(this, off$2, false);
      this[key] = false;
    }
  }
  return {
    mounted: bind,
    activated: bind,
    deactivated: unbind,
    beforeDestroy: unbind
  };
}

var CloseOnPopstateMixin = {
  mixins: [BindEventMixin(function (bind, isBind) {
    this.handlePopstate(isBind && this.closeOnPopstate);
  })],
  props: {
    closeOnPopstate: Boolean
  },
  data: function data() {
    return {
      bindStatus: false
    };
  },
  watch: {
    closeOnPopstate: function closeOnPopstate(val) {
      this.handlePopstate(val);
    }
  },
  methods: {
    onPopstate: function onPopstate() {
      this.close();
      this.shouldReopen = false;
    },
    handlePopstate: function handlePopstate(bind) {
      /* istanbul ignore if */
      if (this.$isServer) {
        return;
      }
      if (this.bindStatus !== bind) {
        this.bindStatus = bind;
        var action = bind ? on$2 : off$2;
        action(window, 'popstate', this.onPopstate);
      }
    }
  }
};

// Context
var popupMixinProps = {
  // Initial rendering animation
  transitionAppear: Boolean,
  // whether to show popup
  value: Boolean,
  // whether to show overlay
  overlay: Boolean,
  // overlay custom style
  overlayStyle: Object,
  // overlay custom class name
  overlayClass: String,
  // whether to close popup when overlay is clicked
  closeOnClickOverlay: Boolean,
  // z-index
  zIndex: [Number, String],
  // prevent body scroll
  lockScroll: {
    type: Boolean,
    default: true
  },
  // whether to lazy render
  lazyRender: {
    type: Boolean,
    default: true
  }
};
function PopupMixin(options) {
  if (options === void 0) {
    options = {};
  }
  return {
    mixins: [TouchMixin, CloseOnPopstateMixin, PortalMixin({
      afterPortal: function afterPortal() {
        if (this.overlay) {
          updateOverlay();
        }
      }
    })],
    provide: function provide() {
      return {
        vanPopup: this
      };
    },
    props: popupMixinProps,
    data: function data() {
      this.onReopenCallback = [];
      return {
        inited: this.value
      };
    },
    computed: {
      shouldRender: function shouldRender() {
        return this.inited || !this.lazyRender;
      }
    },
    watch: {
      value: function value(val) {
        var type = val ? 'open' : 'close';
        this.inited = this.inited || this.value;
        this[type]();
        if (!options.skipToggleEvent) {
          this.$emit(type);
        }
      },
      overlay: 'renderOverlay'
    },
    mounted: function mounted() {
      if (this.value) {
        this.open();
      }
    },
    /* istanbul ignore next */
    activated: function activated() {
      if (this.shouldReopen) {
        this.$emit('input', true);
        this.shouldReopen = false;
      }
    },
    beforeDestroy: function beforeDestroy() {
      removeOverlay(this);
      if (this.opened) {
        this.removeLock();
      }
      if (this.getContainer) {
        removeNode(this.$el);
      }
    },
    /* istanbul ignore next */
    deactivated: function deactivated() {
      if (this.value) {
        this.close();
        this.shouldReopen = true;
      }
    },
    methods: {
      open: function open() {
        /* istanbul ignore next */
        if (this.$isServer || this.opened) {
          return;
        } // cover default zIndex

        if (this.zIndex !== undefined) {
          context.zIndex = this.zIndex;
        }
        this.opened = true;
        this.renderOverlay();
        this.addLock();
        this.onReopenCallback.forEach(function (callback) {
          callback();
        });
      },
      addLock: function addLock() {
        if (this.lockScroll) {
          on$2(document, 'touchstart', this.touchStart);
          on$2(document, 'touchmove', this.onTouchMove);
          if (!context.lockCount) {
            document.body.classList.add('van-overflow-hidden');
          }
          context.lockCount++;
        }
      },
      removeLock: function removeLock() {
        if (this.lockScroll && context.lockCount) {
          context.lockCount--;
          off$2(document, 'touchstart', this.touchStart);
          off$2(document, 'touchmove', this.onTouchMove);
          if (!context.lockCount) {
            document.body.classList.remove('van-overflow-hidden');
          }
        }
      },
      close: function close() {
        if (!this.opened) {
          return;
        }
        closeOverlay(this);
        this.opened = false;
        this.removeLock();
        this.$emit('input', false);
      },
      onTouchMove: function onTouchMove(event) {
        this.touchMove(event);
        var direction = this.deltaY > 0 ? '10' : '01';
        var el = getScroller(event.target, this.$el);
        var scrollHeight = el.scrollHeight,
          offsetHeight = el.offsetHeight,
          scrollTop = el.scrollTop;
        var status = '11';
        /* istanbul ignore next */

        if (scrollTop === 0) {
          status = offsetHeight >= scrollHeight ? '00' : '01';
        } else if (scrollTop + offsetHeight >= scrollHeight) {
          status = '10';
        }
        /* istanbul ignore next */

        if (status !== '11' && this.direction === 'vertical' && !(parseInt(status, 2) & parseInt(direction, 2))) {
          preventDefault(event, true);
        }
      },
      renderOverlay: function renderOverlay() {
        var _this = this;
        if (this.$isServer || !this.value) {
          return;
        }
        this.$nextTick(function () {
          _this.updateZIndex(_this.overlay ? 1 : 0);
          if (_this.overlay) {
            openOverlay(_this, {
              zIndex: context.zIndex++,
              duration: _this.duration,
              className: _this.overlayClass,
              customStyle: _this.overlayStyle
            });
          } else {
            closeOverlay(_this);
          }
        });
      },
      updateZIndex: function updateZIndex(value) {
        if (value === void 0) {
          value = 0;
        }
        this.$el.style.zIndex = ++context.zIndex + value;
      },
      onReopen: function onReopen(callback) {
        this.onReopenCallback.push(callback);
      }
    }
  };
}

var _createNamespace$1B = createNamespace('info'),
  createComponent$1F = _createNamespace$1B[0],
  bem$1w = _createNamespace$1B[1];
function Info(h, props, slots, ctx) {
  var dot = props.dot,
    info = props.info;
  var showInfo = isDef(info) && info !== '';
  if (!dot && !showInfo) {
    return;
  }
  return h("div", _mergeJSXProps([{
    "class": bem$1w({
      dot: dot
    })
  }, inherit(ctx, true)]), [dot ? '' : props.info]);
}
Info.props = {
  dot: Boolean,
  info: [Number, String]
};
var Info$1 = createComponent$1F(Info);

var _createNamespace$1A = createNamespace('icon'),
  createComponent$1E = _createNamespace$1A[0],
  bem$1v = _createNamespace$1A[1];
function isImage(name) {
  return name ? name.indexOf('/') !== -1 : false;
} // compatible with legacy usage, should be removed in next major version

var LEGACY_MAP = {
  medel: 'medal',
  'medel-o': 'medal-o',
  'calender-o': 'calendar-o'
};
function correctName(name) {
  return name && LEGACY_MAP[name] || name;
}
function Icon$2(h, props, slots, ctx) {
  var _props$badge;
  var name = correctName(props.name);
  var imageIcon = isImage(name);
  return h(props.tag, _mergeJSXProps([{
    "class": [props.classPrefix, imageIcon ? '' : props.classPrefix + "-" + name],
    "style": {
      color: props.color,
      fontSize: addUnit(props.size)
    }
  }, inherit(ctx, true)]), [slots.default && slots.default(), imageIcon && h("img", {
    "class": bem$1v('image'),
    "attrs": {
      "src": name
    }
  }), h(Info$1, {
    "attrs": {
      "dot": props.dot,
      "info": (_props$badge = props.badge) != null ? _props$badge : props.info
    }
  })]);
}
Icon$2.props = {
  dot: Boolean,
  name: String,
  size: [Number, String],
  // @deprecated
  // should be removed in next major version
  info: [Number, String],
  badge: [Number, String],
  color: String,
  tag: {
    type: String,
    default: 'i'
  },
  classPrefix: {
    type: String,
    default: bem$1v()
  }
};
var Icon$3 = createComponent$1E(Icon$2);

var _createNamespace$1z = createNamespace('popup'),
  createComponent$1D = _createNamespace$1z[0],
  bem$1u = _createNamespace$1z[1];
var Popup = createComponent$1D({
  mixins: [PopupMixin()],
  props: {
    round: Boolean,
    duration: [Number, String],
    closeable: Boolean,
    transition: String,
    safeAreaInsetBottom: Boolean,
    closeIcon: {
      type: String,
      default: 'cross'
    },
    closeIconPosition: {
      type: String,
      default: 'top-right'
    },
    position: {
      type: String,
      default: 'center'
    },
    overlay: {
      type: Boolean,
      default: true
    },
    closeOnClickOverlay: {
      type: Boolean,
      default: true
    }
  },
  beforeCreate: function beforeCreate() {
    var _this = this;
    var createEmitter = function createEmitter(eventName) {
      return function (event) {
        return _this.$emit(eventName, event);
      };
    };
    this.onClick = createEmitter('click');
    this.onOpened = createEmitter('opened');
    this.onClosed = createEmitter('closed');
  },
  methods: {
    onClickCloseIcon: function onClickCloseIcon(event) {
      this.$emit('click-close-icon', event);
      this.close();
    }
  },
  render: function render() {
    var _bem;
    var h = arguments[0];
    if (!this.shouldRender) {
      return;
    }
    var round = this.round,
      position = this.position,
      duration = this.duration;
    var isCenter = position === 'center';
    var transitionName = this.transition || (isCenter ? 'van-fade' : "van-popup-slide-" + position);
    var style = {};
    if (isDef(duration)) {
      var key = isCenter ? 'animationDuration' : 'transitionDuration';
      style[key] = duration + "s";
    }
    return h("transition", {
      "attrs": {
        "appear": this.transitionAppear,
        "name": transitionName
      },
      "on": {
        "afterEnter": this.onOpened,
        "afterLeave": this.onClosed
      }
    }, [h("div", {
      "directives": [{
        name: "show",
        value: this.value
      }],
      "style": style,
      "class": bem$1u((_bem = {
        round: round
      }, _bem[position] = position, _bem['safe-area-inset-bottom'] = this.safeAreaInsetBottom, _bem)),
      "on": {
        "click": this.onClick
      }
    }, [this.slots(), this.closeable && h(Icon$3, {
      "attrs": {
        "role": "button",
        "tabindex": "0",
        "name": this.closeIcon
      },
      "class": bem$1u('close-icon', this.closeIconPosition),
      "on": {
        "click": this.onClickCloseIcon
      }
    })])]);
  }
});

var _createNamespace$1y = createNamespace('loading'),
  createComponent$1C = _createNamespace$1y[0],
  bem$1t = _createNamespace$1y[1];
function LoadingIcon(h, props) {
  if (props.type === 'spinner') {
    var Spin = [];
    for (var i = 0; i < 12; i++) {
      Spin.push(h("i"));
    }
    return Spin;
  }
  return h("svg", {
    "class": bem$1t('circular'),
    "attrs": {
      "viewBox": "25 25 50 50"
    }
  }, [h("circle", {
    "attrs": {
      "cx": "50",
      "cy": "50",
      "r": "20",
      "fill": "none"
    }
  })]);
}
function LoadingText(h, props, slots) {
  if (slots.default) {
    var _props$textColor;
    var style = {
      fontSize: addUnit(props.textSize),
      color: (_props$textColor = props.textColor) != null ? _props$textColor : props.color
    };
    return h("span", {
      "class": bem$1t('text'),
      "style": style
    }, [slots.default()]);
  }
}
function Loading(h, props, slots, ctx) {
  var color = props.color,
    size = props.size,
    type = props.type;
  var style = {
    color: color
  };
  if (size) {
    var iconSize = addUnit(size);
    style.width = iconSize;
    style.height = iconSize;
  }
  return h("div", _mergeJSXProps([{
    "class": bem$1t([type, {
      vertical: props.vertical
    }])
  }, inherit(ctx, true)]), [h("span", {
    "class": bem$1t('spinner', type),
    "style": style
  }, [LoadingIcon(h, props)]), LoadingText(h, props, slots)]);
}
Loading.props = {
  color: String,
  size: [Number, String],
  vertical: Boolean,
  textSize: [Number, String],
  textColor: String,
  type: {
    type: String,
    default: 'circular'
  }
};
var Loading$1 = createComponent$1C(Loading);

var _createNamespace$1x = createNamespace('action-sheet'),
  createComponent$1B = _createNamespace$1x[0],
  bem$1s = _createNamespace$1x[1];
function ActionSheet(h, props, slots, ctx) {
  var title = props.title,
    cancelText = props.cancelText,
    closeable = props.closeable;
  function onCancel() {
    emit(ctx, 'input', false);
    emit(ctx, 'cancel');
  }
  function Header() {
    if (title) {
      return h("div", {
        "class": bem$1s('header')
      }, [title, closeable && h(Icon$3, {
        "attrs": {
          "name": props.closeIcon
        },
        "class": bem$1s('close'),
        "on": {
          "click": onCancel
        }
      })]);
    }
  }
  function Option(item, index) {
    var disabled = item.disabled,
      loading = item.loading,
      callback = item.callback;
    function onClickOption(event) {
      event.stopPropagation();
      if (disabled || loading) {
        return;
      }
      if (callback) {
        callback(item);
      }
      if (props.closeOnClickAction) {
        emit(ctx, 'input', false);
      }
      Vue.nextTick(function () {
        emit(ctx, 'select', item, index);
      });
    }
    function OptionContent() {
      if (loading) {
        return h(Loading$1, {
          "class": bem$1s('loading-icon')
        });
      }
      return [h("span", {
        "class": bem$1s('name')
      }, [item.name]), item.subname && h("div", {
        "class": bem$1s('subname')
      }, [item.subname])];
    }
    return h("button", {
      "attrs": {
        "type": "button"
      },
      "class": [bem$1s('item', {
        disabled: disabled,
        loading: loading
      }), item.className],
      "style": {
        color: item.color
      },
      "on": {
        "click": onClickOption
      }
    }, [OptionContent()]);
  }
  function CancelText() {
    if (cancelText) {
      return [h("div", {
        "class": bem$1s('gap')
      }), h("button", {
        "attrs": {
          "type": "button"
        },
        "class": bem$1s('cancel'),
        "on": {
          "click": onCancel
        }
      }, [cancelText])];
    }
  }
  function Description() {
    var description = (slots.description == null ? void 0 : slots.description()) || props.description;
    if (description) {
      return h("div", {
        "class": bem$1s('description')
      }, [description]);
    }
  }
  return h(Popup, _mergeJSXProps([{
    "class": bem$1s(),
    "attrs": {
      "position": "bottom",
      "round": props.round,
      "value": props.value,
      "overlay": props.overlay,
      "duration": props.duration,
      "lazyRender": props.lazyRender,
      "lockScroll": props.lockScroll,
      "getContainer": props.getContainer,
      "closeOnPopstate": props.closeOnPopstate,
      "closeOnClickOverlay": props.closeOnClickOverlay,
      "safeAreaInsetBottom": props.safeAreaInsetBottom
    }
  }, inherit(ctx, true)]), [Header(), Description(), h("div", {
    "class": bem$1s('content')
  }, [props.actions && props.actions.map(Option), slots.default == null ? void 0 : slots.default()]), CancelText()]);
}
ActionSheet.props = _extends$2({}, popupMixinProps, {
  title: String,
  actions: Array,
  duration: [Number, String],
  cancelText: String,
  description: String,
  getContainer: [String, Function],
  closeOnPopstate: Boolean,
  closeOnClickAction: Boolean,
  round: {
    type: Boolean,
    default: true
  },
  closeable: {
    type: Boolean,
    default: true
  },
  closeIcon: {
    type: String,
    default: 'cross'
  },
  safeAreaInsetBottom: {
    type: Boolean,
    default: true
  },
  overlay: {
    type: Boolean,
    default: true
  },
  closeOnClickOverlay: {
    type: Boolean,
    default: true
  }
});
var ActionSheet$1 = createComponent$1B(ActionSheet);

function isMobile(value) {
  value = value.replace(/[^-|\d]/g, '');
  return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
}

var DEFAULT_ITEM_HEIGHT = 44;
var pickerProps = {
  title: String,
  loading: Boolean,
  readonly: Boolean,
  itemHeight: [Number, String],
  showToolbar: Boolean,
  cancelButtonText: String,
  confirmButtonText: String,
  allowHtml: {
    type: Boolean,
    default: true
  },
  visibleItemCount: {
    type: [Number, String],
    default: 6
  },
  swipeDuration: {
    type: [Number, String],
    default: 1000
  }
};

// color
var RED = '#ee0a24'; // border

var BORDER = 'van-hairline';
var BORDER_TOP = BORDER + "--top";
var BORDER_LEFT = BORDER + "--left";
var BORDER_BOTTOM = BORDER + "--bottom";
var BORDER_SURROUND = BORDER + "--surround";
var BORDER_TOP_BOTTOM = BORDER + "--top-bottom";
var BORDER_UNSET_TOP_BOTTOM = BORDER + "-unset--top-bottom";

function deepClone(obj) {
  if (!isDef(obj)) {
    return obj;
  }
  if (Array.isArray(obj)) {
    return obj.map(function (item) {
      return deepClone(item);
    });
  }
  if (typeof obj === 'object') {
    var to = {};
    Object.keys(obj).forEach(function (key) {
      to[key] = deepClone(obj[key]);
    });
    return to;
  }
  return obj;
}

function range$1(num, min, max) {
  return Math.min(Math.max(num, min), max);
}
function trimExtraChar(value, _char, regExp) {
  var index = value.indexOf(_char);
  var prefix = '';
  if (index === -1) {
    return value;
  }
  if (_char === '-' && index !== 0) {
    return value.slice(0, index);
  }
  if (_char === '.' && value.match(/^(\.|-\.)/)) {
    prefix = index ? '-0' : '0';
  }
  return prefix + value.slice(0, index + 1) + value.slice(index).replace(regExp, '');
}
function formatNumber(value, allowDot, allowMinus) {
  if (allowDot === void 0) {
    allowDot = true;
  }
  if (allowMinus === void 0) {
    allowMinus = true;
  }
  if (allowDot) {
    value = trimExtraChar(value, '.', /\./g);
  } else {
    value = value.split('.')[0];
  }
  if (allowMinus) {
    value = trimExtraChar(value, '-', /-/g);
  } else {
    value = value.replace(/-/, '');
  }
  var regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
  return value.replace(regExp, '');
} // add num and avoid float number

function addNumber(num1, num2) {
  var cardinal = Math.pow(10, 10);
  return Math.round((num1 + num2) * cardinal) / cardinal;
}

var DEFAULT_DURATION = 200; // 惯性滑动思路:
// 在手指离开屏幕时，如果和上一次 move 时的间隔小于 `MOMENTUM_LIMIT_TIME` 且 move
// 距离大于 `MOMENTUM_LIMIT_DISTANCE` 时，执行惯性滑动

var MOMENTUM_LIMIT_TIME = 300;
var MOMENTUM_LIMIT_DISTANCE = 15;
var _createNamespace$1w = createNamespace('picker-column'),
  createComponent$1A = _createNamespace$1w[0],
  bem$1r = _createNamespace$1w[1];
function getElementTranslateY(element) {
  var style = window.getComputedStyle(element);
  var transform = style.transform || style.webkitTransform;
  var translateY = transform.slice(7, transform.length - 1).split(', ')[5];
  return Number(translateY);
}
function isOptionDisabled(option) {
  return isObject$2(option) && option.disabled;
} // use standard WheelEvent:
// https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent

var supportMousewheel = inBrowser$2 && 'onwheel' in window;
var mousewheelTimer = null;
var PickerColumn = createComponent$1A({
  mixins: [TouchMixin],
  props: {
    valueKey: String,
    readonly: Boolean,
    allowHtml: Boolean,
    className: String,
    itemHeight: Number,
    defaultIndex: Number,
    swipeDuration: [Number, String],
    visibleItemCount: [Number, String],
    initialOptions: {
      type: Array,
      default: function _default() {
        return [];
      }
    }
  },
  data: function data() {
    return {
      offset: 0,
      duration: 0,
      options: deepClone(this.initialOptions),
      currentIndex: this.defaultIndex
    };
  },
  created: function created() {
    if (this.$parent.children) {
      this.$parent.children.push(this);
    }
    this.setIndex(this.currentIndex);
  },
  mounted: function mounted() {
    this.bindTouchEvent(this.$el);
    if (supportMousewheel) {
      on$2(this.$el, 'wheel', this.onMouseWheel, false);
    }
  },
  destroyed: function destroyed() {
    var children = this.$parent.children;
    if (children) {
      children.splice(children.indexOf(this), 1);
    }
    if (supportMousewheel) {
      off$2(this.$el, 'wheel');
    }
  },
  watch: {
    initialOptions: 'setOptions',
    defaultIndex: function defaultIndex(val) {
      this.setIndex(val);
    }
  },
  computed: {
    count: function count() {
      return this.options.length;
    },
    baseOffset: function baseOffset() {
      return this.itemHeight * (this.visibleItemCount - 1) / 2;
    }
  },
  methods: {
    setOptions: function setOptions(options) {
      if (JSON.stringify(options) !== JSON.stringify(this.options)) {
        this.options = deepClone(options);
        this.setIndex(this.defaultIndex);
      }
    },
    onTouchStart: function onTouchStart(event) {
      if (this.readonly) {
        return;
      }
      this.touchStart(event);
      if (this.moving) {
        var translateY = getElementTranslateY(this.$refs.wrapper);
        this.offset = Math.min(0, translateY - this.baseOffset);
        this.startOffset = this.offset;
      } else {
        this.startOffset = this.offset;
      }
      this.duration = 0;
      this.transitionEndTrigger = null;
      this.touchStartTime = Date.now();
      this.momentumOffset = this.startOffset;
    },
    onTouchMove: function onTouchMove(event) {
      if (this.readonly) {
        return;
      }
      this.touchMove(event);
      if (this.direction === 'vertical') {
        this.moving = true;
        preventDefault(event, true);
      }
      this.offset = range$1(this.startOffset + this.deltaY, -(this.count * this.itemHeight), this.itemHeight);
      var now = Date.now();
      if (now - this.touchStartTime > MOMENTUM_LIMIT_TIME) {
        this.touchStartTime = now;
        this.momentumOffset = this.offset;
      }
    },
    onTouchEnd: function onTouchEnd() {
      var _this = this;
      if (this.readonly) {
        return;
      }
      var distance = this.offset - this.momentumOffset;
      var duration = Date.now() - this.touchStartTime;
      var allowMomentum = duration < MOMENTUM_LIMIT_TIME && Math.abs(distance) > MOMENTUM_LIMIT_DISTANCE;
      if (allowMomentum) {
        this.momentum(distance, duration);
        return;
      }
      var index = this.getIndexByOffset(this.offset);
      this.duration = DEFAULT_DURATION;
      this.setIndex(index, true); // compatible with desktop scenario
      // use setTimeout to skip the click event Emitted after touchstart

      setTimeout(function () {
        _this.moving = false;
      }, 0);
    },
    onMouseWheel: function onMouseWheel(event) {
      var _this2 = this;
      if (this.readonly) {
        return;
      }
      preventDefault(event, true); // simply combine touchstart and touchmove

      var translateY = getElementTranslateY(this.$refs.wrapper);
      this.startOffset = Math.min(0, translateY - this.baseOffset);
      this.momentumOffset = this.startOffset;
      this.transitionEndTrigger = null; // directly use deltaY, see https://caniuse.com/?search=deltaY
      // use deltaY to detect direction for not special setting device
      // https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event

      var deltaY = event.deltaY;
      if (this.startOffset === 0 && deltaY < 0) {
        return;
      } // Calculate the offset based on itemHeight

      var itemOffset = this.itemHeight * (deltaY > 0 ? -1 : 1);
      this.offset = range$1(this.startOffset + itemOffset, -(this.count * this.itemHeight), this.itemHeight);
      if (mousewheelTimer) {
        clearTimeout(mousewheelTimer);
      }
      mousewheelTimer = setTimeout(function () {
        _this2.onTouchEnd();
        _this2.touchStartTime = 0;
      }, MOMENTUM_LIMIT_TIME);
    },
    onTransitionEnd: function onTransitionEnd() {
      this.stopMomentum();
    },
    onClickItem: function onClickItem(index) {
      if (this.moving || this.readonly) {
        return;
      }
      this.transitionEndTrigger = null;
      this.duration = DEFAULT_DURATION;
      this.setIndex(index, true);
    },
    adjustIndex: function adjustIndex(index) {
      index = range$1(index, 0, this.count);
      for (var i = index; i < this.count; i++) {
        if (!isOptionDisabled(this.options[i])) return i;
      }
      for (var _i = index - 1; _i >= 0; _i--) {
        if (!isOptionDisabled(this.options[_i])) return _i;
      }
    },
    getOptionText: function getOptionText(option) {
      if (isObject$2(option) && this.valueKey in option) {
        return option[this.valueKey];
      }
      return option;
    },
    setIndex: function setIndex(index, emitChange) {
      var _this3 = this;
      index = this.adjustIndex(index) || 0;
      var offset = -index * this.itemHeight;
      var trigger = function trigger() {
        if (index !== _this3.currentIndex) {
          _this3.currentIndex = index;
          if (emitChange) {
            _this3.$emit('change', index);
          }
        }
      }; // trigger the change event after transitionend when moving

      if (this.moving && offset !== this.offset) {
        this.transitionEndTrigger = trigger;
      } else {
        trigger();
      }
      this.offset = offset;
    },
    setValue: function setValue(value) {
      var options = this.options;
      for (var i = 0; i < options.length; i++) {
        if (this.getOptionText(options[i]) === value) {
          return this.setIndex(i);
        }
      }
    },
    getValue: function getValue() {
      return this.options[this.currentIndex];
    },
    getIndexByOffset: function getIndexByOffset(offset) {
      return range$1(Math.round(-offset / this.itemHeight), 0, this.count - 1);
    },
    momentum: function momentum(distance, duration) {
      var speed = Math.abs(distance / duration);
      distance = this.offset + speed / 0.003 * (distance < 0 ? -1 : 1);
      var index = this.getIndexByOffset(distance);
      this.duration = +this.swipeDuration;
      this.setIndex(index, true);
    },
    stopMomentum: function stopMomentum() {
      this.moving = false;
      this.duration = 0;
      if (this.transitionEndTrigger) {
        this.transitionEndTrigger();
        this.transitionEndTrigger = null;
      }
    },
    genOptions: function genOptions() {
      var _this4 = this;
      var h = this.$createElement;
      var optionStyle = {
        height: this.itemHeight + "px"
      };
      return this.options.map(function (option, index) {
        var _domProps;
        var text = _this4.getOptionText(option);
        var disabled = isOptionDisabled(option);
        var data = {
          style: optionStyle,
          attrs: {
            role: 'button',
            tabindex: disabled ? -1 : 0
          },
          class: [bem$1r('item', {
            disabled: disabled,
            selected: index === _this4.currentIndex
          })],
          on: {
            click: function click() {
              _this4.onClickItem(index);
            }
          }
        };
        var childData = {
          class: 'van-ellipsis',
          domProps: (_domProps = {}, _domProps[_this4.allowHtml ? 'innerHTML' : 'textContent'] = text, _domProps)
        };
        return h("li", _mergeJSXProps([{}, data]), [_this4.slots('option', option) || h("div", _mergeJSXProps([{}, childData]))]);
      });
    }
  },
  render: function render() {
    var h = arguments[0];
    var wrapperStyle = {
      transform: "translate3d(0, " + (this.offset + this.baseOffset) + "px, 0)",
      transitionDuration: this.duration + "ms",
      transitionProperty: this.duration ? 'all' : 'none'
    };
    return h("div", {
      "class": [bem$1r(), this.className]
    }, [h("ul", {
      "ref": "wrapper",
      "style": wrapperStyle,
      "class": bem$1r('wrapper'),
      "on": {
        "transitionend": this.onTransitionEnd
      }
    }, [this.genOptions()])]);
  }
});

var _createNamespace$1v = createNamespace('picker'),
  createComponent$1z = _createNamespace$1v[0],
  bem$1q = _createNamespace$1v[1],
  t$r = _createNamespace$1v[2];
var Picker = createComponent$1z({
  props: _extends$2({}, pickerProps, {
    defaultIndex: {
      type: [Number, String],
      default: 0
    },
    columns: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    toolbarPosition: {
      type: String,
      default: 'top'
    },
    valueKey: {
      type: String,
      default: 'text'
    }
  }),
  data: function data() {
    return {
      children: [],
      formattedColumns: []
    };
  },
  computed: {
    itemPxHeight: function itemPxHeight() {
      return this.itemHeight ? unitToPx(this.itemHeight) : DEFAULT_ITEM_HEIGHT;
    },
    dataType: function dataType() {
      var columns = this.columns;
      var firstColumn = columns[0] || {};
      if (firstColumn.children) {
        return 'cascade';
      }
      if (firstColumn.values) {
        return 'object';
      }
      return 'text';
    }
  },
  watch: {
    columns: {
      handler: 'format',
      immediate: true
    }
  },
  methods: {
    format: function format() {
      var columns = this.columns,
        dataType = this.dataType;
      if (dataType === 'text') {
        this.formattedColumns = [{
          values: columns
        }];
      } else if (dataType === 'cascade') {
        this.formatCascade();
      } else {
        this.formattedColumns = columns;
      }
    },
    formatCascade: function formatCascade() {
      var formatted = [];
      var cursor = {
        children: this.columns
      };
      while (cursor && cursor.children) {
        var _cursor$defaultIndex;
        var _cursor = cursor,
          children = _cursor.children;
        var defaultIndex = (_cursor$defaultIndex = cursor.defaultIndex) != null ? _cursor$defaultIndex : +this.defaultIndex;
        while (children[defaultIndex] && children[defaultIndex].disabled) {
          if (defaultIndex < children.length - 1) {
            defaultIndex++;
          } else {
            defaultIndex = 0;
            break;
          }
        }
        formatted.push({
          values: cursor.children,
          className: cursor.className,
          defaultIndex: defaultIndex
        });
        cursor = children[defaultIndex];
      }
      this.formattedColumns = formatted;
    },
    emit: function emit(event) {
      var _this = this;
      if (this.dataType === 'text') {
        this.$emit(event, this.getColumnValue(0), this.getColumnIndex(0));
      } else {
        var values = this.getValues(); // compatible with old version of wrong parameters
        // should be removed in next major version
        // see: https://github.com/vant-ui/vant/issues/5905

        if (this.dataType === 'cascade') {
          values = values.map(function (item) {
            return item[_this.valueKey];
          });
        }
        this.$emit(event, values, this.getIndexes());
      }
    },
    onCascadeChange: function onCascadeChange(columnIndex) {
      var cursor = {
        children: this.columns
      };
      var indexes = this.getIndexes();
      for (var i = 0; i <= columnIndex; i++) {
        cursor = cursor.children[indexes[i]];
      }
      while (cursor && cursor.children) {
        columnIndex++;
        this.setColumnValues(columnIndex, cursor.children);
        cursor = cursor.children[cursor.defaultIndex || 0];
      }
    },
    onChange: function onChange(columnIndex) {
      var _this2 = this;
      if (this.dataType === 'cascade') {
        this.onCascadeChange(columnIndex);
      }
      if (this.dataType === 'text') {
        this.$emit('change', this, this.getColumnValue(0), this.getColumnIndex(0));
      } else {
        var values = this.getValues(); // compatible with old version of wrong parameters
        // should be removed in next major version
        // see: https://github.com/vant-ui/vant/issues/5905

        if (this.dataType === 'cascade') {
          values = values.map(function (item) {
            return item[_this2.valueKey];
          });
        }
        this.$emit('change', this, values, columnIndex);
      }
    },
    // get column instance by index
    getColumn: function getColumn(index) {
      return this.children[index];
    },
    // @exposed-api
    // get column value by index
    getColumnValue: function getColumnValue(index) {
      var column = this.getColumn(index);
      return column && column.getValue();
    },
    // @exposed-api
    // set column value by index
    setColumnValue: function setColumnValue(index, value) {
      var column = this.getColumn(index);
      if (column) {
        column.setValue(value);
        if (this.dataType === 'cascade') {
          this.onCascadeChange(index);
        }
      }
    },
    // @exposed-api
    // get column option index by column index
    getColumnIndex: function getColumnIndex(columnIndex) {
      return (this.getColumn(columnIndex) || {}).currentIndex;
    },
    // @exposed-api
    // set column option index by column index
    setColumnIndex: function setColumnIndex(columnIndex, optionIndex) {
      var column = this.getColumn(columnIndex);
      if (column) {
        column.setIndex(optionIndex);
        if (this.dataType === 'cascade') {
          this.onCascadeChange(columnIndex);
        }
      }
    },
    // @exposed-api
    // get options of column by index
    getColumnValues: function getColumnValues(index) {
      return (this.children[index] || {}).options;
    },
    // @exposed-api
    // set options of column by index
    setColumnValues: function setColumnValues(index, options) {
      var column = this.children[index];
      if (column) {
        column.setOptions(options);
      }
    },
    // @exposed-api
    // get values of all columns
    getValues: function getValues() {
      return this.children.map(function (child) {
        return child.getValue();
      });
    },
    // @exposed-api
    // set values of all columns
    setValues: function setValues(values) {
      var _this3 = this;
      values.forEach(function (value, index) {
        _this3.setColumnValue(index, value);
      });
    },
    // @exposed-api
    // get indexes of all columns
    getIndexes: function getIndexes() {
      return this.children.map(function (child) {
        return child.currentIndex;
      });
    },
    // @exposed-api
    // set indexes of all columns
    setIndexes: function setIndexes(indexes) {
      var _this4 = this;
      indexes.forEach(function (optionIndex, columnIndex) {
        _this4.setColumnIndex(columnIndex, optionIndex);
      });
    },
    // @exposed-api
    confirm: function confirm() {
      this.children.forEach(function (child) {
        return child.stopMomentum();
      });
      this.emit('confirm');
    },
    cancel: function cancel() {
      this.emit('cancel');
    },
    genTitle: function genTitle() {
      var h = this.$createElement;
      var titleSlot = this.slots('title');
      if (titleSlot) {
        return titleSlot;
      }
      if (this.title) {
        return h("div", {
          "class": ['van-ellipsis', bem$1q('title')]
        }, [this.title]);
      }
    },
    genCancel: function genCancel() {
      var h = this.$createElement;
      return h("button", {
        "attrs": {
          "type": "button"
        },
        "class": bem$1q('cancel'),
        "on": {
          "click": this.cancel
        }
      }, [this.slots('cancel') || this.cancelButtonText || t$r('cancel')]);
    },
    genConfirm: function genConfirm() {
      var h = this.$createElement;
      return h("button", {
        "attrs": {
          "type": "button"
        },
        "class": bem$1q('confirm'),
        "on": {
          "click": this.confirm
        }
      }, [this.slots('confirm') || this.confirmButtonText || t$r('confirm')]);
    },
    genToolbar: function genToolbar() {
      var h = this.$createElement;
      if (this.showToolbar) {
        return h("div", {
          "class": bem$1q('toolbar')
        }, [this.slots() || [this.genCancel(), this.genTitle(), this.genConfirm()]]);
      }
    },
    genColumns: function genColumns() {
      var h = this.$createElement;
      var itemPxHeight = this.itemPxHeight;
      var wrapHeight = itemPxHeight * this.visibleItemCount;
      var frameStyle = {
        height: itemPxHeight + "px"
      };
      var columnsStyle = {
        height: wrapHeight + "px"
      };
      var maskStyle = {
        backgroundSize: "100% " + (wrapHeight - itemPxHeight) / 2 + "px"
      };
      return h("div", {
        "class": bem$1q('columns'),
        "style": columnsStyle,
        "on": {
          "touchmove": preventDefault
        }
      }, [this.genColumnItems(), h("div", {
        "class": bem$1q('mask'),
        "style": maskStyle
      }), h("div", {
        "class": [BORDER_UNSET_TOP_BOTTOM, bem$1q('frame')],
        "style": frameStyle
      })]);
    },
    genColumnItems: function genColumnItems() {
      var _this5 = this;
      var h = this.$createElement;
      return this.formattedColumns.map(function (item, columnIndex) {
        var _item$defaultIndex;
        return h(PickerColumn, {
          "attrs": {
            "readonly": _this5.readonly,
            "valueKey": _this5.valueKey,
            "allowHtml": _this5.allowHtml,
            "className": item.className,
            "itemHeight": _this5.itemPxHeight,
            "defaultIndex": (_item$defaultIndex = item.defaultIndex) != null ? _item$defaultIndex : +_this5.defaultIndex,
            "swipeDuration": _this5.swipeDuration,
            "visibleItemCount": _this5.visibleItemCount,
            "initialOptions": item.values
          },
          "scopedSlots": {
            option: _this5.$scopedSlots.option
          },
          "on": {
            "change": function change() {
              _this5.onChange(columnIndex);
            }
          }
        });
      });
    }
  },
  render: function render(h) {
    return h("div", {
      "class": bem$1q()
    }, [this.toolbarPosition === 'top' ? this.genToolbar() : h(), this.loading ? h(Loading$1, {
      "class": bem$1q('loading')
    }) : h(), this.slots('columns-top'), this.genColumns(), this.slots('columns-bottom'), this.toolbarPosition === 'bottom' ? this.genToolbar() : h()]);
  }
});

var _createNamespace$1u = createNamespace('area'),
  createComponent$1y = _createNamespace$1u[0],
  bem$1p = _createNamespace$1u[1];
var PLACEHOLDER_CODE = '000000';
function isOverseaCode(code) {
  return code[0] === '9';
}
function pickSlots(instance, keys) {
  var $slots = instance.$slots,
    $scopedSlots = instance.$scopedSlots;
  var scopedSlots = {};
  keys.forEach(function (key) {
    if ($scopedSlots[key]) {
      scopedSlots[key] = $scopedSlots[key];
    } else if ($slots[key]) {
      scopedSlots[key] = function () {
        return $slots[key];
      };
    }
  });
  return scopedSlots;
}
var Area = createComponent$1y({
  props: _extends$2({}, pickerProps, {
    value: String,
    areaList: {
      type: Object,
      default: function _default() {
        return {};
      }
    },
    columnsNum: {
      type: [Number, String],
      default: 3
    },
    isOverseaCode: {
      type: Function,
      default: isOverseaCode
    },
    columnsPlaceholder: {
      type: Array,
      default: function _default() {
        return [];
      }
    }
  }),
  data: function data() {
    return {
      code: this.value,
      columns: [{
        values: []
      }, {
        values: []
      }, {
        values: []
      }]
    };
  },
  computed: {
    province: function province() {
      return this.areaList.province_list || {};
    },
    city: function city() {
      return this.areaList.city_list || {};
    },
    county: function county() {
      return this.areaList.county_list || {};
    },
    displayColumns: function displayColumns() {
      return this.columns.slice(0, +this.columnsNum);
    },
    placeholderMap: function placeholderMap() {
      return {
        province: this.columnsPlaceholder[0] || '',
        city: this.columnsPlaceholder[1] || '',
        county: this.columnsPlaceholder[2] || ''
      };
    }
  },
  watch: {
    value: function value(val) {
      this.code = val;
      this.setValues();
    },
    areaList: {
      deep: true,
      handler: 'setValues'
    },
    columnsNum: function columnsNum() {
      var _this = this;
      this.$nextTick(function () {
        _this.setValues();
      });
    }
  },
  mounted: function mounted() {
    this.setValues();
  },
  methods: {
    // get list by code
    getList: function getList(type, code) {
      var result = [];
      if (type !== 'province' && !code) {
        return result;
      }
      var list = this[type];
      result = Object.keys(list).map(function (listCode) {
        return {
          code: listCode,
          name: list[listCode]
        };
      });
      if (code) {
        // oversea code
        if (this.isOverseaCode(code) && type === 'city') {
          code = '9';
        }
        result = result.filter(function (item) {
          return item.code.indexOf(code) === 0;
        });
      }
      if (this.placeholderMap[type] && result.length) {
        // set columns placeholder
        var codeFill = '';
        if (type === 'city') {
          codeFill = PLACEHOLDER_CODE.slice(2, 4);
        } else if (type === 'county') {
          codeFill = PLACEHOLDER_CODE.slice(4, 6);
        }
        result.unshift({
          code: "" + code + codeFill,
          name: this.placeholderMap[type]
        });
      }
      return result;
    },
    // get index by code
    getIndex: function getIndex(type, code) {
      var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6;
      var list = this.getList(type, code.slice(0, compareNum - 2)); // oversea code

      if (this.isOverseaCode(code) && type === 'province') {
        compareNum = 1;
      }
      code = code.slice(0, compareNum);
      for (var i = 0; i < list.length; i++) {
        if (list[i].code.slice(0, compareNum) === code) {
          return i;
        }
      }
      return 0;
    },
    // parse output columns data
    parseOutputValues: function parseOutputValues(values) {
      var _this2 = this;
      return values.map(function (value, index) {
        // save undefined value
        if (!value) return value;
        value = JSON.parse(JSON.stringify(value));
        if (!value.code || value.name === _this2.columnsPlaceholder[index]) {
          value.code = '';
          value.name = '';
        }
        return value;
      });
    },
    onChange: function onChange(picker, values, index) {
      this.code = values[index].code;
      this.setValues();
      var parsedValues = this.parseOutputValues(picker.getValues());
      this.$emit('change', picker, parsedValues, index);
    },
    onConfirm: function onConfirm(values, index) {
      values = this.parseOutputValues(values);
      this.setValues();
      this.$emit('confirm', values, index);
    },
    getDefaultCode: function getDefaultCode() {
      if (this.columnsPlaceholder.length) {
        return PLACEHOLDER_CODE;
      }
      var countyCodes = Object.keys(this.county);
      if (countyCodes[0]) {
        return countyCodes[0];
      }
      var cityCodes = Object.keys(this.city);
      if (cityCodes[0]) {
        return cityCodes[0];
      }
      return '';
    },
    setValues: function setValues() {
      var code = this.code;
      if (!code) {
        code = this.getDefaultCode();
      }
      var picker = this.$refs.picker;
      var province = this.getList('province');
      var city = this.getList('city', code.slice(0, 2));
      if (!picker) {
        return;
      }
      picker.setColumnValues(0, province);
      picker.setColumnValues(1, city);
      if (city.length && code.slice(2, 4) === '00' && !this.isOverseaCode(code)) {
        code = city[0].code;
      }
      picker.setColumnValues(2, this.getList('county', code.slice(0, 4)));
      picker.setIndexes([this.getIndex('province', code), this.getIndex('city', code), this.getIndex('county', code)]);
    },
    getValues: function getValues() {
      var picker = this.$refs.picker;
      var getValues = picker ? picker.getValues().filter(function (value) {
        return !!value;
      }) : [];
      getValues = this.parseOutputValues(getValues);
      return getValues;
    },
    getArea: function getArea() {
      var values = this.getValues();
      var area = {
        code: '',
        country: '',
        province: '',
        city: '',
        county: ''
      };
      if (!values.length) {
        return area;
      }
      var names = values.map(function (item) {
        return item.name;
      });
      var validValues = values.filter(function (value) {
        return !!value.code;
      });
      area.code = validValues.length ? validValues[validValues.length - 1].code : '';
      if (this.isOverseaCode(area.code)) {
        area.country = names[1] || '';
        area.province = names[2] || '';
      } else {
        area.province = names[0] || '';
        area.city = names[1] || '';
        area.county = names[2] || '';
      }
      return area;
    },
    // @exposed-api
    reset: function reset(code) {
      this.code = code || '';
      this.setValues();
    }
  },
  render: function render() {
    var h = arguments[0];
    var on = _extends$2({}, this.$listeners, {
      change: this.onChange,
      confirm: this.onConfirm
    });
    return h(Picker, {
      "ref": "picker",
      "class": bem$1p(),
      "attrs": {
        "showToolbar": true,
        "valueKey": "name",
        "title": this.title,
        "columns": this.displayColumns,
        "loading": this.loading,
        "readonly": this.readonly,
        "itemHeight": this.itemHeight,
        "swipeDuration": this.swipeDuration,
        "visibleItemCount": this.visibleItemCount,
        "cancelButtonText": this.cancelButtonText,
        "confirmButtonText": this.confirmButtonText
      },
      "scopedSlots": pickSlots(this, ['title', 'columns-top', 'columns-bottom']),
      "on": _extends$2({}, on)
    });
  }
});

/**
 * Vue Router support
 */
function isRedundantNavigation(err) {
  return err.name === 'NavigationDuplicated' ||
  // compatible with vue-router@3.3
  err.message && err.message.indexOf('redundant navigation') !== -1;
}
function route(router, config) {
  var to = config.to,
    url = config.url,
    replace = config.replace;
  if (to && router) {
    var promise = router[replace ? 'replace' : 'push'](to);
    /* istanbul ignore else */

    if (promise && promise.catch) {
      promise.catch(function (err) {
        if (err && !isRedundantNavigation(err)) {
          throw err;
        }
      });
    }
  } else if (url) {
    replace ? location.replace(url) : location.href = url;
  }
}
function functionalRoute(context) {
  route(context.parent && context.parent.$router, context.props);
}
var routeProps = {
  url: String,
  replace: Boolean,
  to: [String, Object]
};

var cellProps = {
  icon: String,
  size: String,
  center: Boolean,
  isLink: Boolean,
  required: Boolean,
  iconPrefix: String,
  titleStyle: null,
  titleClass: null,
  valueClass: null,
  labelClass: null,
  title: [Number, String],
  value: [Number, String],
  label: [Number, String],
  arrowDirection: String,
  border: {
    type: Boolean,
    default: true
  },
  clickable: {
    type: Boolean,
    default: null
  }
};

var _createNamespace$1t = createNamespace('cell'),
  createComponent$1x = _createNamespace$1t[0],
  bem$1o = _createNamespace$1t[1];
function Cell(h, props, slots, ctx) {
  var _props$clickable;
  var icon = props.icon,
    size = props.size,
    title = props.title,
    label = props.label,
    value = props.value,
    isLink = props.isLink;
  var showTitle = slots.title || isDef(title);
  function Label() {
    var showLabel = slots.label || isDef(label);
    if (showLabel) {
      return h("div", {
        "class": [bem$1o('label'), props.labelClass]
      }, [slots.label ? slots.label() : label]);
    }
  }
  function Title() {
    if (showTitle) {
      return h("div", {
        "class": [bem$1o('title'), props.titleClass],
        "style": props.titleStyle
      }, [slots.title ? slots.title() : h("span", [title]), Label()]);
    }
  }
  function Value() {
    var showValue = slots.default || isDef(value);
    if (showValue) {
      return h("div", {
        "class": [bem$1o('value', {
          alone: !showTitle
        }), props.valueClass]
      }, [slots.default ? slots.default() : h("span", [value])]);
    }
  }
  function LeftIcon() {
    if (slots.icon) {
      return slots.icon();
    }
    if (icon) {
      return h(Icon$3, {
        "class": bem$1o('left-icon'),
        "attrs": {
          "name": icon,
          "classPrefix": props.iconPrefix
        }
      });
    }
  }
  function RightIcon() {
    var rightIconSlot = slots['right-icon'];
    if (rightIconSlot) {
      return rightIconSlot();
    }
    if (isLink) {
      var arrowDirection = props.arrowDirection;
      return h(Icon$3, {
        "class": bem$1o('right-icon'),
        "attrs": {
          "name": arrowDirection ? "arrow-" + arrowDirection : 'arrow'
        }
      });
    }
  }
  function onClick(event) {
    emit(ctx, 'click', event);
    functionalRoute(ctx);
  }
  var clickable = (_props$clickable = props.clickable) != null ? _props$clickable : isLink;
  var classes = {
    clickable: clickable,
    center: props.center,
    required: props.required,
    borderless: !props.border
  };
  if (size) {
    classes[size] = size;
  }
  return h("div", _mergeJSXProps([{
    "class": bem$1o(classes),
    "attrs": {
      "role": clickable ? 'button' : null,
      "tabindex": clickable ? 0 : null
    },
    "on": {
      "click": onClick
    }
  }, inherit(ctx)]), [LeftIcon(), Title(), Value(), RightIcon(), slots.extra == null ? void 0 : slots.extra()]);
}
Cell.props = _extends$2({}, cellProps, routeProps);
var Cell$1 = createComponent$1x(Cell);

function isAndroid$1() {
  /* istanbul ignore next */
  return isServer$1 ? false : /android/.test(navigator.userAgent.toLowerCase());
}
function isIOS$1() {
  /* istanbul ignore next */
  return isServer$1 ? false : /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase());
}

/**
 * Hack for iOS12 page scroll
 * https://developers.weixin.qq.com/community/develop/doc/00044ae90742f8c82fb78fcae56800
 */
var isIOS = isIOS$1();
/* istanbul ignore next */

function resetScroll() {
  if (isIOS) {
    setRootScrollTop(getRootScrollTop());
  }
}

var _createNamespace$1s = createNamespace('field'),
  createComponent$1w = _createNamespace$1s[0],
  bem$1n = _createNamespace$1s[1];
var Field = createComponent$1w({
  inheritAttrs: false,
  provide: function provide() {
    return {
      vanField: this
    };
  },
  inject: {
    vanForm: {
      default: null
    }
  },
  props: _extends$2({}, cellProps, {
    name: String,
    rules: Array,
    disabled: {
      type: Boolean,
      default: null
    },
    readonly: {
      type: Boolean,
      default: null
    },
    autosize: [Boolean, Object],
    leftIcon: String,
    rightIcon: String,
    clearable: Boolean,
    formatter: Function,
    maxlength: [Number, String],
    labelWidth: [Number, String],
    labelClass: null,
    labelAlign: String,
    inputAlign: String,
    placeholder: String,
    errorMessage: String,
    errorMessageAlign: String,
    showWordLimit: Boolean,
    value: {
      type: [Number, String],
      default: ''
    },
    type: {
      type: String,
      default: 'text'
    },
    error: {
      type: Boolean,
      default: null
    },
    colon: {
      type: Boolean,
      default: null
    },
    clearTrigger: {
      type: String,
      default: 'focus'
    },
    formatTrigger: {
      type: String,
      default: 'onChange'
    }
  }),
  data: function data() {
    return {
      focused: false,
      validateFailed: false,
      validateMessage: ''
    };
  },
  watch: {
    value: function value() {
      this.updateValue(this.value);
      this.resetValidation();
      this.validateWithTrigger('onChange');
      this.$nextTick(this.adjustSize);
    }
  },
  mounted: function mounted() {
    this.updateValue(this.value, this.formatTrigger);
    this.$nextTick(this.adjustSize);
    if (this.vanForm) {
      this.vanForm.addField(this);
    }
  },
  beforeDestroy: function beforeDestroy() {
    if (this.vanForm) {
      this.vanForm.removeField(this);
    }
  },
  computed: {
    showClear: function showClear() {
      var readonly = this.getProp('readonly');
      if (this.clearable && !readonly) {
        var hasValue = isDef(this.value) && this.value !== '';
        var trigger = this.clearTrigger === 'always' || this.clearTrigger === 'focus' && this.focused;
        return hasValue && trigger;
      }
    },
    showError: function showError() {
      if (this.error !== null) {
        return this.error;
      }
      if (this.vanForm && this.vanForm.showError && this.validateFailed) {
        return true;
      }
    },
    listeners: function listeners() {
      return _extends$2({}, this.$listeners, {
        blur: this.onBlur,
        focus: this.onFocus,
        input: this.onInput,
        click: this.onClickInput,
        keypress: this.onKeypress
      });
    },
    labelStyle: function labelStyle() {
      var labelWidth = this.getProp('labelWidth');
      if (labelWidth) {
        return {
          width: addUnit(labelWidth)
        };
      }
    },
    formValue: function formValue() {
      if (this.children && (this.$scopedSlots.input || this.$slots.input)) {
        return this.children.value;
      }
      return this.value;
    }
  },
  methods: {
    // @exposed-api
    focus: function focus() {
      if (this.$refs.input) {
        this.$refs.input.focus();
      }
    },
    // @exposed-api
    blur: function blur() {
      if (this.$refs.input) {
        this.$refs.input.blur();
      }
    },
    runValidator: function runValidator(value, rule) {
      return new Promise(function (resolve) {
        var returnVal = rule.validator(value, rule);
        if (isPromise$2(returnVal)) {
          return returnVal.then(resolve);
        }
        resolve(returnVal);
      });
    },
    isEmptyValue: function isEmptyValue(value) {
      if (Array.isArray(value)) {
        return !value.length;
      }
      if (value === 0) {
        return false;
      }
      return !value;
    },
    runSyncRule: function runSyncRule(value, rule) {
      if (rule.required && this.isEmptyValue(value)) {
        return false;
      }
      if (rule.pattern && !rule.pattern.test(value)) {
        return false;
      }
      return true;
    },
    getRuleMessage: function getRuleMessage(value, rule) {
      var message = rule.message;
      if (isFunction$2(message)) {
        return message(value, rule);
      }
      return message;
    },
    runRules: function runRules(rules) {
      var _this = this;
      return rules.reduce(function (promise, rule) {
        return promise.then(function () {
          if (_this.validateFailed) {
            return;
          }
          var value = _this.formValue;
          if (rule.formatter) {
            value = rule.formatter(value, rule);
          }
          if (!_this.runSyncRule(value, rule)) {
            _this.validateFailed = true;
            _this.validateMessage = _this.getRuleMessage(value, rule);
            return;
          }
          if (rule.validator) {
            return _this.runValidator(value, rule).then(function (result) {
              if (result === false) {
                _this.validateFailed = true;
                _this.validateMessage = _this.getRuleMessage(value, rule);
              }
            });
          }
        });
      }, Promise.resolve());
    },
    validate: function validate(rules) {
      var _this2 = this;
      if (rules === void 0) {
        rules = this.rules;
      }
      return new Promise(function (resolve) {
        if (!rules) {
          resolve();
        }
        _this2.resetValidation();
        _this2.runRules(rules).then(function () {
          if (_this2.validateFailed) {
            resolve({
              name: _this2.name,
              message: _this2.validateMessage
            });
          } else {
            resolve();
          }
        });
      });
    },
    validateWithTrigger: function validateWithTrigger(trigger) {
      if (this.vanForm && this.rules) {
        var defaultTrigger = this.vanForm.validateTrigger === trigger;
        var rules = this.rules.filter(function (rule) {
          if (rule.trigger) {
            return rule.trigger === trigger;
          }
          return defaultTrigger;
        });
        if (rules.length) {
          this.validate(rules);
        }
      }
    },
    resetValidation: function resetValidation() {
      if (this.validateFailed) {
        this.validateFailed = false;
        this.validateMessage = '';
      }
    },
    updateValue: function updateValue(value, trigger) {
      if (trigger === void 0) {
        trigger = 'onChange';
      }
      value = isDef(value) ? String(value) : ''; // native maxlength have incorrect line-break counting
      // see: https://github.com/vant-ui/vant/issues/5033

      var maxlength = this.maxlength;
      if (isDef(maxlength) && value.length > maxlength) {
        if (this.value && this.value.length === +maxlength) {
          value = this.value;
        } else {
          value = value.slice(0, maxlength);
        }
      }
      if (this.type === 'number' || this.type === 'digit') {
        var isNumber = this.type === 'number';
        value = formatNumber(value, isNumber, isNumber);
      }
      if (this.formatter && trigger === this.formatTrigger) {
        value = this.formatter(value);
      }
      var input = this.$refs.input;
      if (input && value !== input.value) {
        input.value = value;
      }
      if (value !== this.value) {
        this.$emit('input', value);
      }
    },
    onInput: function onInput(event) {
      // not update v-model when composing
      if (event.target.composing) {
        return;
      }
      this.updateValue(event.target.value);
    },
    onFocus: function onFocus(event) {
      this.focused = true;
      this.$emit('focus', event); // https://github.com/vant-ui/vant/issues/9715

      this.$nextTick(this.adjustSize); // readonly not work in legacy mobile safari

      /* istanbul ignore if */

      if (this.getProp('readonly')) {
        this.blur();
      }
    },
    onBlur: function onBlur(event) {
      if (this.getProp('readonly')) {
        return;
      }
      this.focused = false;
      this.updateValue(this.value, 'onBlur');
      this.$emit('blur', event);
      this.validateWithTrigger('onBlur');
      this.$nextTick(this.adjustSize);
      resetScroll();
    },
    onClick: function onClick(event) {
      this.$emit('click', event);
    },
    onClickInput: function onClickInput(event) {
      this.$emit('click-input', event);
    },
    onClickLeftIcon: function onClickLeftIcon(event) {
      this.$emit('click-left-icon', event);
    },
    onClickRightIcon: function onClickRightIcon(event) {
      this.$emit('click-right-icon', event);
    },
    onClear: function onClear(event) {
      preventDefault(event);
      this.$emit('input', '');
      this.$emit('clear', event);
    },
    onKeypress: function onKeypress(event) {
      var ENTER_CODE = 13;
      if (event.keyCode === ENTER_CODE) {
        var submitOnEnter = this.getProp('submitOnEnter');
        if (!submitOnEnter && this.type !== 'textarea') {
          preventDefault(event);
        } // trigger blur after click keyboard search button

        if (this.type === 'search') {
          this.blur();
        }
      }
      this.$emit('keypress', event);
    },
    adjustSize: function adjustSize() {
      var input = this.$refs.input;
      if (!(this.type === 'textarea' && this.autosize) || !input) {
        return;
      }
      var scrollTop = getRootScrollTop();
      input.style.height = 'auto';
      var height = input.scrollHeight;
      if (isObject$2(this.autosize)) {
        var _this$autosize = this.autosize,
          maxHeight = _this$autosize.maxHeight,
          minHeight = _this$autosize.minHeight;
        if (maxHeight) {
          height = Math.min(height, maxHeight);
        }
        if (minHeight) {
          height = Math.max(height, minHeight);
        }
      }
      if (height) {
        input.style.height = height + 'px'; // https://github.com/vant-ui/vant/issues/9178

        setRootScrollTop(scrollTop);
      }
    },
    genInput: function genInput() {
      var h = this.$createElement;
      var type = this.type;
      var disabled = this.getProp('disabled');
      var readonly = this.getProp('readonly');
      var inputSlot = this.slots('input');
      var inputAlign = this.getProp('inputAlign');
      if (inputSlot) {
        return h("div", {
          "class": bem$1n('control', [inputAlign, 'custom']),
          "on": {
            "click": this.onClickInput
          }
        }, [inputSlot]);
      }
      var inputProps = {
        ref: 'input',
        class: bem$1n('control', inputAlign),
        domProps: {
          value: this.value
        },
        attrs: _extends$2({}, this.$attrs, {
          name: this.name,
          disabled: disabled,
          readonly: readonly,
          placeholder: this.placeholder
        }),
        on: this.listeners,
        // add model directive to skip IME composition
        directives: [{
          name: 'model',
          value: this.value
        }]
      };
      if (type === 'textarea') {
        return h("textarea", _mergeJSXProps([{}, inputProps]));
      }
      var inputType = type;
      var inputMode; // type="number" is weird in iOS, and can't prevent dot in Android
      // so use inputmode to set keyboard in modern browsers

      if (type === 'number') {
        inputType = 'text';
        inputMode = 'decimal';
      }
      if (type === 'digit') {
        inputType = 'tel';
        inputMode = 'numeric';
      }
      return h("input", _mergeJSXProps([{
        "attrs": {
          "type": inputType,
          "inputmode": inputMode
        }
      }, inputProps]));
    },
    genLeftIcon: function genLeftIcon() {
      var h = this.$createElement;
      var showLeftIcon = this.slots('left-icon') || this.leftIcon;
      if (showLeftIcon) {
        return h("div", {
          "class": bem$1n('left-icon'),
          "on": {
            "click": this.onClickLeftIcon
          }
        }, [this.slots('left-icon') || h(Icon$3, {
          "attrs": {
            "name": this.leftIcon,
            "classPrefix": this.iconPrefix
          }
        })]);
      }
    },
    genRightIcon: function genRightIcon() {
      var h = this.$createElement;
      var slots = this.slots;
      var showRightIcon = slots('right-icon') || this.rightIcon;
      if (showRightIcon) {
        return h("div", {
          "class": bem$1n('right-icon'),
          "on": {
            "click": this.onClickRightIcon
          }
        }, [slots('right-icon') || h(Icon$3, {
          "attrs": {
            "name": this.rightIcon,
            "classPrefix": this.iconPrefix
          }
        })]);
      }
    },
    genWordLimit: function genWordLimit() {
      var h = this.$createElement;
      if (this.showWordLimit && this.maxlength) {
        var count = (this.value || '').length;
        return h("div", {
          "class": bem$1n('word-limit')
        }, [h("span", {
          "class": bem$1n('word-num')
        }, [count]), "/", this.maxlength]);
      }
    },
    genMessage: function genMessage() {
      var h = this.$createElement;
      if (this.vanForm && this.vanForm.showErrorMessage === false) {
        return;
      }
      var message = this.errorMessage || this.validateMessage;
      if (message) {
        var errorMessageAlign = this.getProp('errorMessageAlign');
        return h("div", {
          "class": bem$1n('error-message', errorMessageAlign)
        }, [message]);
      }
    },
    getProp: function getProp(key) {
      if (isDef(this[key])) {
        return this[key];
      }
      if (this.vanForm && isDef(this.vanForm[key])) {
        return this.vanForm[key];
      }
    },
    genLabel: function genLabel() {
      var h = this.$createElement;
      var colon = this.getProp('colon') ? ':' : '';
      if (this.slots('label')) {
        return [this.slots('label'), colon];
      }
      if (this.label) {
        return h("span", [this.label + colon]);
      }
    }
  },
  render: function render() {
    var _bem;
    var h = arguments[0];
    var slots = this.slots;
    var disabled = this.getProp('disabled');
    var labelAlign = this.getProp('labelAlign');
    var scopedSlots = {
      icon: this.genLeftIcon
    };
    var Label = this.genLabel();
    if (Label) {
      scopedSlots.title = function () {
        return Label;
      };
    }
    var extra = this.slots('extra');
    if (extra) {
      scopedSlots.extra = function () {
        return extra;
      };
    }
    return h(Cell$1, {
      "attrs": {
        "icon": this.leftIcon,
        "size": this.size,
        "center": this.center,
        "border": this.border,
        "isLink": this.isLink,
        "required": this.required,
        "clickable": this.clickable,
        "titleStyle": this.labelStyle,
        "valueClass": bem$1n('value'),
        "titleClass": [bem$1n('label', labelAlign), this.labelClass],
        "arrowDirection": this.arrowDirection
      },
      "scopedSlots": scopedSlots,
      "class": bem$1n((_bem = {
        error: this.showError,
        disabled: disabled
      }, _bem["label-" + labelAlign] = labelAlign, _bem['min-height'] = this.type === 'textarea' && !this.autosize, _bem)),
      "on": {
        "click": this.onClick
      }
    }, [h("div", {
      "class": bem$1n('body')
    }, [this.genInput(), this.showClear && h(Icon$3, {
      "attrs": {
        "name": "clear"
      },
      "class": bem$1n('clear'),
      "on": {
        "touchstart": this.onClear
      }
    }), this.genRightIcon(), slots('button') && h("div", {
      "class": bem$1n('button')
    }, [slots('button')])]), this.genWordLimit(), this.genMessage()]);
  }
});

var lockCount = 0;
function lockClick(lock) {
  if (lock) {
    if (!lockCount) {
      document.body.classList.add('van-toast--unclickable');
    }
    lockCount++;
  } else {
    lockCount--;
    if (!lockCount) {
      document.body.classList.remove('van-toast--unclickable');
    }
  }
}

// Utils
var _createNamespace$1r = createNamespace('toast'),
  createComponent$1v = _createNamespace$1r[0],
  bem$1m = _createNamespace$1r[1];
var VueToast = createComponent$1v({
  mixins: [PopupMixin()],
  props: {
    icon: String,
    className: null,
    iconPrefix: String,
    loadingType: String,
    forbidClick: Boolean,
    closeOnClick: Boolean,
    message: [Number, String],
    type: {
      type: String,
      default: 'text'
    },
    position: {
      type: String,
      default: 'middle'
    },
    transition: {
      type: String,
      default: 'van-fade'
    },
    lockScroll: {
      type: Boolean,
      default: false
    }
  },
  data: function data() {
    return {
      clickable: false
    };
  },
  mounted: function mounted() {
    this.toggleClickable();
  },
  destroyed: function destroyed() {
    this.toggleClickable();
  },
  watch: {
    value: 'toggleClickable',
    forbidClick: 'toggleClickable'
  },
  methods: {
    onClick: function onClick() {
      if (this.closeOnClick) {
        this.close();
      }
    },
    toggleClickable: function toggleClickable() {
      var clickable = this.value && this.forbidClick;
      if (this.clickable !== clickable) {
        this.clickable = clickable;
        lockClick(clickable);
      }
    },
    /* istanbul ignore next */
    onAfterEnter: function onAfterEnter() {
      this.$emit('opened');
      if (this.onOpened) {
        this.onOpened();
      }
    },
    onAfterLeave: function onAfterLeave() {
      this.$emit('closed');
    },
    genIcon: function genIcon() {
      var h = this.$createElement;
      var icon = this.icon,
        type = this.type,
        iconPrefix = this.iconPrefix,
        loadingType = this.loadingType;
      var hasIcon = icon || type === 'success' || type === 'fail';
      if (hasIcon) {
        return h(Icon$3, {
          "class": bem$1m('icon'),
          "attrs": {
            "classPrefix": iconPrefix,
            "name": icon || type
          }
        });
      }
      if (type === 'loading') {
        return h(Loading$1, {
          "class": bem$1m('loading'),
          "attrs": {
            "type": loadingType
          }
        });
      }
    },
    genMessage: function genMessage() {
      var h = this.$createElement;
      var type = this.type,
        message = this.message;
      if (!isDef(message) || message === '') {
        return;
      }
      if (type === 'html') {
        return h("div", {
          "class": bem$1m('text'),
          "domProps": {
            "innerHTML": message
          }
        });
      }
      return h("div", {
        "class": bem$1m('text')
      }, [message]);
    }
  },
  render: function render() {
    var _ref;
    var h = arguments[0];
    return h("transition", {
      "attrs": {
        "name": this.transition
      },
      "on": {
        "afterEnter": this.onAfterEnter,
        "afterLeave": this.onAfterLeave
      }
    }, [h("div", {
      "directives": [{
        name: "show",
        value: this.value
      }],
      "class": [bem$1m([this.position, (_ref = {}, _ref[this.type] = !this.icon, _ref)]), this.className],
      "on": {
        "click": this.onClick
      }
    }, [this.genIcon(), this.genMessage()])]);
  }
});

var defaultOptions$1 = {
  icon: '',
  type: 'text',
  // @deprecated
  mask: false,
  value: true,
  message: '',
  className: '',
  overlay: false,
  onClose: null,
  onOpened: null,
  duration: 2000,
  iconPrefix: undefined,
  position: 'middle',
  transition: 'van-fade',
  forbidClick: false,
  loadingType: undefined,
  getContainer: 'body',
  overlayStyle: null,
  closeOnClick: false,
  closeOnClickOverlay: false
}; // default options of specific type

var defaultOptionsMap = {};
var queue = [];
var multiple = false;
var currentOptions = _extends$2({}, defaultOptions$1);
function parseOptions$3(message) {
  if (isObject$2(message)) {
    return message;
  }
  return {
    message: message
  };
}
function isInDocument$1(element) {
  return document.body.contains(element);
}
function createInstance() {
  /* istanbul ignore if */
  if (isServer$1) {
    return {};
  }
  queue = queue.filter(function (item) {
    return !item.$el.parentNode || isInDocument$1(item.$el);
  });
  if (!queue.length || multiple) {
    var toast = new (Vue.extend(VueToast))({
      el: document.createElement('div')
    });
    toast.$on('input', function (value) {
      toast.value = value;
    });
    queue.push(toast);
  }
  return queue[queue.length - 1];
} // transform toast options to popup props

function transformOptions(options) {
  return _extends$2({}, options, {
    overlay: options.mask || options.overlay,
    mask: undefined,
    duration: undefined
  });
}
function Toast(options) {
  if (options === void 0) {
    options = {};
  }
  var toast = createInstance(); // should add z-index if previous toast has not disappeared

  if (toast.value) {
    toast.updateZIndex();
  }
  options = parseOptions$3(options);
  options = _extends$2({}, currentOptions, defaultOptionsMap[options.type || currentOptions.type], options);
  options.clear = function () {
    toast.value = false;
    if (options.onClose) {
      options.onClose();
      options.onClose = null;
    }
    if (multiple && !isServer$1) {
      toast.$on('closed', function () {
        clearTimeout(toast.timer);
        queue = queue.filter(function (item) {
          return item !== toast;
        });
        removeNode(toast.$el);
        toast.$destroy();
      });
    }
  };
  _extends$2(toast, transformOptions(options));
  clearTimeout(toast.timer);
  if (options.duration > 0) {
    toast.timer = setTimeout(function () {
      toast.clear();
    }, options.duration);
  }
  return toast;
}
var createMethod = function createMethod(type) {
  return function (options) {
    return Toast(_extends$2({
      type: type
    }, parseOptions$3(options)));
  };
};
['loading', 'success', 'fail'].forEach(function (method) {
  Toast[method] = createMethod(method);
});
Toast.clear = function (all) {
  if (queue.length) {
    if (all) {
      queue.forEach(function (toast) {
        toast.clear();
      });
      queue = [];
    } else if (!multiple) {
      queue[0].clear();
    } else {
      queue.shift().clear();
    }
  }
};
Toast.setDefaultOptions = function (type, options) {
  if (typeof type === 'string') {
    defaultOptionsMap[type] = options;
  } else {
    _extends$2(currentOptions, type);
  }
};
Toast.resetDefaultOptions = function (type) {
  if (typeof type === 'string') {
    defaultOptionsMap[type] = null;
  } else {
    currentOptions = _extends$2({}, defaultOptions$1);
    defaultOptionsMap = {};
  }
};
Toast.allowMultiple = function (value) {
  if (value === void 0) {
    value = true;
  }
  multiple = value;
};
Toast.install = function () {
  Vue.use(VueToast);
};
Vue.prototype.$toast = Toast;

var _createNamespace$1q = createNamespace('button'),
  createComponent$1u = _createNamespace$1q[0],
  bem$1l = _createNamespace$1q[1];
function Button$1(h, props, slots, ctx) {
  var _ref;
  var tag = props.tag,
    icon = props.icon,
    type = props.type,
    color = props.color,
    plain = props.plain,
    disabled = props.disabled,
    loading = props.loading,
    hairline = props.hairline,
    loadingText = props.loadingText,
    iconPosition = props.iconPosition;
  var style = {};
  if (color) {
    style.color = plain ? color : 'white';
    if (!plain) {
      // Use background instead of backgroundColor to make linear-gradient work
      style.background = color;
    } // hide border when color is linear-gradient

    if (color.indexOf('gradient') !== -1) {
      style.border = 0;
    } else {
      style.borderColor = color;
    }
  }
  function onClick(event) {
    if (props.loading) {
      event.preventDefault();
    }
    if (!loading && !disabled) {
      emit(ctx, 'click', event);
      functionalRoute(ctx);
    }
  }
  function onTouchstart(event) {
    emit(ctx, 'touchstart', event);
  }
  var classes = [bem$1l([type, props.size, {
    plain: plain,
    loading: loading,
    disabled: disabled,
    hairline: hairline,
    block: props.block,
    round: props.round,
    square: props.square
  }]), (_ref = {}, _ref[BORDER_SURROUND] = hairline, _ref)];
  function renderIcon() {
    if (loading) {
      return slots.loading ? slots.loading() : h(Loading$1, {
        "class": bem$1l('loading'),
        "attrs": {
          "size": props.loadingSize,
          "type": props.loadingType,
          "color": "currentColor"
        }
      });
    }
    if (slots.icon) {
      return h("div", {
        "class": bem$1l('icon')
      }, [slots.icon()]);
    }
    if (icon) {
      return h(Icon$3, {
        "attrs": {
          "name": icon,
          "classPrefix": props.iconPrefix
        },
        "class": bem$1l('icon')
      });
    }
  }
  function renderContent() {
    var content = [];
    if (iconPosition === 'left') {
      content.push(renderIcon());
    }
    var text;
    if (loading) {
      text = loadingText;
    } else {
      text = slots.default ? slots.default() : props.text;
    }
    if (text) {
      content.push(h("span", {
        "class": bem$1l('text')
      }, [text]));
    }
    if (iconPosition === 'right') {
      content.push(renderIcon());
    }
    return content;
  }
  return h(tag, _mergeJSXProps([{
    "style": style,
    "class": classes,
    "attrs": {
      "type": props.nativeType,
      "disabled": disabled
    },
    "on": {
      "click": onClick,
      "touchstart": onTouchstart
    }
  }, inherit(ctx)]), [h("div", {
    "class": bem$1l('content')
  }, [renderContent()])]);
}
Button$1.props = _extends$2({}, routeProps, {
  text: String,
  icon: String,
  color: String,
  block: Boolean,
  plain: Boolean,
  round: Boolean,
  square: Boolean,
  loading: Boolean,
  hairline: Boolean,
  disabled: Boolean,
  iconPrefix: String,
  nativeType: String,
  loadingText: String,
  loadingType: String,
  tag: {
    type: String,
    default: 'button'
  },
  type: {
    type: String,
    default: 'default'
  },
  size: {
    type: String,
    default: 'normal'
  },
  loadingSize: {
    type: String,
    default: '20px'
  },
  iconPosition: {
    type: String,
    default: 'left'
  }
});
var Button$2 = createComponent$1u(Button$1);

function flattenVNodes(vnodes) {
  var result = [];
  function traverse(vnodes) {
    vnodes.forEach(function (vnode) {
      result.push(vnode);
      if (vnode.componentInstance) {
        traverse(vnode.componentInstance.$children.map(function (item) {
          return item.$vnode;
        }));
      }
      if (vnode.children) {
        traverse(vnode.children);
      }
    });
  }
  traverse(vnodes);
  return result;
} // sort children instances by vnodes order

function sortChildren(children, parent) {
  var componentOptions = parent.$vnode.componentOptions;
  if (!componentOptions || !componentOptions.children) {
    return;
  }
  var vnodes = flattenVNodes(componentOptions.children);
  children.sort(function (a, b) {
    return vnodes.indexOf(a.$vnode) - vnodes.indexOf(b.$vnode);
  });
}

function ChildrenMixin(_parent, options) {
  var _inject, _computed;
  if (options === void 0) {
    options = {};
  }
  var indexKey = options.indexKey || 'index';
  return {
    inject: (_inject = {}, _inject[_parent] = {
      default: null
    }, _inject),
    computed: (_computed = {
      parent: function parent() {
        if (this.disableBindRelation) {
          return null;
        }
        return this[_parent];
      }
    }, _computed[indexKey] = function () {
      this.bindRelation();
      if (this.parent) {
        return this.parent.children.indexOf(this);
      }
      return null;
    }, _computed),
    watch: {
      disableBindRelation: function disableBindRelation(val) {
        if (!val) {
          this.bindRelation();
        }
      }
    },
    mounted: function mounted() {
      this.bindRelation();
    },
    beforeDestroy: function beforeDestroy() {
      var _this = this;
      if (this.parent) {
        this.parent.children = this.parent.children.filter(function (item) {
          return item !== _this;
        });
      }
    },
    methods: {
      bindRelation: function bindRelation() {
        if (!this.parent || this.parent.children.indexOf(this) !== -1) {
          return;
        }
        var children = [].concat(this.parent.children, [this]);
        sortChildren(children, this.parent);
        this.parent.children = children;
      }
    }
  };
}
function ParentMixin(parent) {
  return {
    provide: function provide() {
      var _ref;
      return _ref = {}, _ref[parent] = this, _ref;
    },
    data: function data() {
      return {
        children: []
      };
    }
  };
}

var _createNamespace$1p = createNamespace('goods-action'),
  createComponent$1t = _createNamespace$1p[0],
  bem$1k = _createNamespace$1p[1];
var GoodsAction = createComponent$1t({
  mixins: [ParentMixin('vanGoodsAction')],
  props: {
    safeAreaInsetBottom: {
      type: Boolean,
      default: true
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$1k({
        unfit: !this.safeAreaInsetBottom
      })
    }, [this.slots()]);
  }
});

var _createNamespace$1o = createNamespace('goods-action-button'),
  createComponent$1s = _createNamespace$1o[0],
  bem$1j = _createNamespace$1o[1];
var GoodsActionButton = createComponent$1s({
  mixins: [ChildrenMixin('vanGoodsAction')],
  props: _extends$2({}, routeProps, {
    type: String,
    text: String,
    icon: String,
    color: String,
    loading: Boolean,
    disabled: Boolean
  }),
  computed: {
    isFirst: function isFirst() {
      var prev = this.parent && this.parent.children[this.index - 1];
      return !prev || prev.$options.name !== this.$options.name;
    },
    isLast: function isLast() {
      var next = this.parent && this.parent.children[this.index + 1];
      return !next || next.$options.name !== this.$options.name;
    }
  },
  methods: {
    onClick: function onClick(event) {
      this.$emit('click', event);
      route(this.$router, this);
    }
  },
  render: function render() {
    var h = arguments[0];
    return h(Button$2, {
      "class": bem$1j([{
        first: this.isFirst,
        last: this.isLast
      }, this.type]),
      "attrs": {
        "size": "large",
        "type": this.type,
        "icon": this.icon,
        "color": this.color,
        "loading": this.loading,
        "disabled": this.disabled
      },
      "on": {
        "click": this.onClick
      }
    }, [this.slots() || this.text]);
  }
});

var _createNamespace$1n = createNamespace('dialog'),
  createComponent$1r = _createNamespace$1n[0],
  bem$1i = _createNamespace$1n[1],
  t$q = _createNamespace$1n[2];
var VanDialog = createComponent$1r({
  mixins: [PopupMixin()],
  props: {
    title: String,
    theme: String,
    width: [Number, String],
    message: String,
    className: null,
    callback: Function,
    beforeClose: Function,
    messageAlign: String,
    cancelButtonText: String,
    cancelButtonColor: String,
    confirmButtonText: String,
    confirmButtonColor: String,
    showCancelButton: Boolean,
    overlay: {
      type: Boolean,
      default: true
    },
    allowHtml: {
      type: Boolean,
      default: true
    },
    transition: {
      type: String,
      default: 'van-dialog-bounce'
    },
    showConfirmButton: {
      type: Boolean,
      default: true
    },
    closeOnPopstate: {
      type: Boolean,
      default: true
    },
    closeOnClickOverlay: {
      type: Boolean,
      default: false
    }
  },
  data: function data() {
    return {
      loading: {
        confirm: false,
        cancel: false
      }
    };
  },
  methods: {
    onClickOverlay: function onClickOverlay() {
      this.handleAction('overlay');
    },
    handleAction: function handleAction(action) {
      var _this = this;
      this.$emit(action); // show not trigger close event when hidden

      if (!this.value) {
        return;
      }
      if (this.beforeClose) {
        this.loading[action] = true;
        this.beforeClose(action, function (state) {
          if (state !== false && _this.loading[action]) {
            _this.onClose(action);
          }
          _this.loading.confirm = false;
          _this.loading.cancel = false;
        });
      } else {
        this.onClose(action);
      }
    },
    onClose: function onClose(action) {
      this.close();
      if (this.callback) {
        this.callback(action);
      }
    },
    onOpened: function onOpened() {
      var _this2 = this;
      this.$emit('opened');
      this.$nextTick(function () {
        var _this2$$refs$dialog;
        (_this2$$refs$dialog = _this2.$refs.dialog) == null ? void 0 : _this2$$refs$dialog.focus();
      });
    },
    onClosed: function onClosed() {
      this.$emit('closed');
    },
    onKeydown: function onKeydown(event) {
      var _this3 = this;
      if (event.key === 'Escape' || event.key === 'Enter') {
        // skip keyboard events of child elements
        if (event.target !== this.$refs.dialog) {
          return;
        }
        var onEventType = {
          Enter: this.showConfirmButton ? function () {
            return _this3.handleAction('confirm');
          } : noop$5,
          Escape: this.showCancelButton ? function () {
            return _this3.handleAction('cancel');
          } : noop$5
        };
        onEventType[event.key]();
        this.$emit('keydown', event);
      }
    },
    genRoundButtons: function genRoundButtons() {
      var _this4 = this;
      var h = this.$createElement;
      return h(GoodsAction, {
        "class": bem$1i('footer')
      }, [this.showCancelButton && h(GoodsActionButton, {
        "attrs": {
          "size": "large",
          "type": "warning",
          "text": this.cancelButtonText || t$q('cancel'),
          "color": this.cancelButtonColor,
          "loading": this.loading.cancel
        },
        "class": bem$1i('cancel'),
        "on": {
          "click": function click() {
            _this4.handleAction('cancel');
          }
        }
      }), this.showConfirmButton && h(GoodsActionButton, {
        "attrs": {
          "size": "large",
          "type": "danger",
          "text": this.confirmButtonText || t$q('confirm'),
          "color": this.confirmButtonColor,
          "loading": this.loading.confirm
        },
        "class": bem$1i('confirm'),
        "on": {
          "click": function click() {
            _this4.handleAction('confirm');
          }
        }
      })]);
    },
    genButtons: function genButtons() {
      var _this5 = this,
        _ref;
      var h = this.$createElement;
      var multiple = this.showCancelButton && this.showConfirmButton;
      return h("div", {
        "class": [BORDER_TOP, bem$1i('footer')]
      }, [this.showCancelButton && h(Button$2, {
        "attrs": {
          "size": "large",
          "loading": this.loading.cancel,
          "text": this.cancelButtonText || t$q('cancel'),
          "nativeType": "button"
        },
        "class": bem$1i('cancel'),
        "style": {
          color: this.cancelButtonColor
        },
        "on": {
          "click": function click() {
            _this5.handleAction('cancel');
          }
        }
      }), this.showConfirmButton && h(Button$2, {
        "attrs": {
          "size": "large",
          "loading": this.loading.confirm,
          "text": this.confirmButtonText || t$q('confirm'),
          "nativeType": "button"
        },
        "class": [bem$1i('confirm'), (_ref = {}, _ref[BORDER_LEFT] = multiple, _ref)],
        "style": {
          color: this.confirmButtonColor
        },
        "on": {
          "click": function click() {
            _this5.handleAction('confirm');
          }
        }
      })]);
    },
    genContent: function genContent(hasTitle, messageSlot) {
      var h = this.$createElement;
      if (messageSlot) {
        return h("div", {
          "class": bem$1i('content')
        }, [messageSlot]);
      }
      var message = this.message,
        messageAlign = this.messageAlign;
      if (message) {
        var _bem, _domProps;
        var data = {
          class: bem$1i('message', (_bem = {
            'has-title': hasTitle
          }, _bem[messageAlign] = messageAlign, _bem)),
          domProps: (_domProps = {}, _domProps[this.allowHtml ? 'innerHTML' : 'textContent'] = message, _domProps)
        };
        return h("div", {
          "class": bem$1i('content', {
            isolated: !hasTitle
          })
        }, [h("div", _mergeJSXProps([{}, data]))]);
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    if (!this.shouldRender) {
      return;
    }
    var message = this.message;
    var messageSlot = this.slots();
    var title = this.slots('title') || this.title;
    var Title = title && h("div", {
      "class": bem$1i('header', {
        isolated: !message && !messageSlot
      })
    }, [title]);
    return h("transition", {
      "attrs": {
        "name": this.transition
      },
      "on": {
        "afterEnter": this.onOpened,
        "afterLeave": this.onClosed
      }
    }, [h("div", {
      "directives": [{
        name: "show",
        value: this.value
      }],
      "attrs": {
        "role": "dialog",
        "aria-labelledby": this.title || message,
        "tabIndex": 0
      },
      "class": [bem$1i([this.theme]), this.className],
      "style": {
        width: addUnit(this.width)
      },
      "ref": "dialog",
      "on": {
        "keydown": this.onKeydown
      }
    }, [Title, this.genContent(title, messageSlot), this.theme === 'round-button' ? this.genRoundButtons() : this.genButtons()])]);
  }
});

var instance$3;
function isInDocument(element) {
  return document.body.contains(element);
}
function initInstance$1() {
  if (instance$3) {
    instance$3.$destroy();
  }
  instance$3 = new (Vue.extend(VanDialog))({
    el: document.createElement('div'),
    // avoid missing animation when first rendered
    propsData: {
      lazyRender: false
    }
  });
  instance$3.$on('input', function (value) {
    instance$3.value = value;
  });
}
function Dialog(options) {
  /* istanbul ignore if */
  if (isServer$1) {
    return Promise.resolve();
  }
  return new Promise(function (resolve, reject) {
    if (!instance$3 || !isInDocument(instance$3.$el)) {
      initInstance$1();
    }
    _extends$2(instance$3, Dialog.currentOptions, options, {
      resolve: resolve,
      reject: reject
    });
  });
}
Dialog.defaultOptions = {
  value: true,
  title: '',
  width: '',
  theme: null,
  message: '',
  overlay: true,
  className: '',
  allowHtml: true,
  lockScroll: true,
  transition: 'van-dialog-bounce',
  beforeClose: null,
  overlayClass: '',
  overlayStyle: null,
  messageAlign: '',
  getContainer: 'body',
  cancelButtonText: '',
  cancelButtonColor: null,
  confirmButtonText: '',
  confirmButtonColor: null,
  showConfirmButton: true,
  showCancelButton: false,
  closeOnPopstate: true,
  closeOnClickOverlay: false,
  callback: function callback(action) {
    instance$3[action === 'confirm' ? 'resolve' : 'reject'](action);
  }
};
Dialog.alert = Dialog;
Dialog.confirm = function (options) {
  return Dialog(_extends$2({
    showCancelButton: true
  }, options));
};
Dialog.close = function () {
  if (instance$3) {
    instance$3.value = false;
  }
};
Dialog.setDefaultOptions = function (options) {
  _extends$2(Dialog.currentOptions, options);
};
Dialog.resetDefaultOptions = function () {
  Dialog.currentOptions = _extends$2({}, Dialog.defaultOptions);
};
Dialog.resetDefaultOptions();
Dialog.install = function () {
  Vue.use(VanDialog);
};
Dialog.Component = VanDialog;
Vue.prototype.$dialog = Dialog;

var _createNamespace$1m = createNamespace('address-edit-detail'),
  createComponent$1q = _createNamespace$1m[0],
  bem$1h = _createNamespace$1m[1],
  t$p = _createNamespace$1m[2];
var android = isAndroid$1();
var Detail = createComponent$1q({
  props: {
    value: String,
    errorMessage: String,
    focused: Boolean,
    detailRows: [Number, String],
    searchResult: Array,
    detailMaxlength: [Number, String],
    showSearchResult: Boolean
  },
  computed: {
    shouldShowSearchResult: function shouldShowSearchResult() {
      return this.focused && this.searchResult && this.showSearchResult;
    }
  },
  methods: {
    onSelect: function onSelect(express) {
      this.$emit('select-search', express);
      this.$emit('input', ((express.address || '') + " " + (express.name || '')).trim());
    },
    onFinish: function onFinish() {
      this.$refs.field.blur();
    },
    genFinish: function genFinish() {
      var h = this.$createElement;
      var show = this.value && this.focused && android;
      if (show) {
        return h("div", {
          "class": bem$1h('finish'),
          "on": {
            "click": this.onFinish
          }
        }, [t$p('complete')]);
      }
    },
    genSearchResult: function genSearchResult() {
      var _this = this;
      var h = this.$createElement;
      var value = this.value,
        shouldShowSearchResult = this.shouldShowSearchResult,
        searchResult = this.searchResult;
      if (shouldShowSearchResult) {
        return searchResult.map(function (express) {
          return h(Cell$1, {
            "key": express.name + express.address,
            "attrs": {
              "clickable": true,
              "border": false,
              "icon": "location-o",
              "label": express.address
            },
            "class": bem$1h('search-item'),
            "on": {
              "click": function click() {
                _this.onSelect(express);
              }
            },
            "scopedSlots": {
              title: function title() {
                if (express.name) {
                  var text = express.name.replace(value, "<span class=" + bem$1h('keyword') + ">" + value + "</span>");
                  return h("div", {
                    "domProps": {
                      "innerHTML": text
                    }
                  });
                }
              }
            }
          });
        });
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    return h(Cell$1, {
      "class": bem$1h()
    }, [h(Field, {
      "attrs": {
        "autosize": true,
        "rows": this.detailRows,
        "clearable": !android,
        "type": "textarea",
        "value": this.value,
        "errorMessage": this.errorMessage,
        "border": !this.shouldShowSearchResult,
        "label": t$p('label'),
        "maxlength": this.detailMaxlength,
        "placeholder": t$p('placeholder')
      },
      "ref": "field",
      "scopedSlots": {
        icon: this.genFinish
      },
      "on": _extends$2({}, this.$listeners)
    }), this.genSearchResult()]);
  }
});

/**
 * Common Switch Props
 */
var switchProps = {
  size: [Number, String],
  value: null,
  loading: Boolean,
  disabled: Boolean,
  activeColor: String,
  inactiveColor: String,
  activeValue: {
    type: null,
    default: true
  },
  inactiveValue: {
    type: null,
    default: false
  }
};

var FieldMixin = {
  inject: {
    vanField: {
      default: null
    }
  },
  watch: {
    value: function value() {
      var field = this.vanField;
      if (field) {
        field.resetValidation();
        field.validateWithTrigger('onChange');
      }
    }
  },
  created: function created() {
    var field = this.vanField;
    if (field && !field.children) {
      field.children = this;
    }
  }
};

// Utils
var _createNamespace$1l = createNamespace('switch'),
  createComponent$1p = _createNamespace$1l[0],
  bem$1g = _createNamespace$1l[1];
var Switch = createComponent$1p({
  mixins: [FieldMixin],
  props: switchProps,
  computed: {
    checked: function checked() {
      return this.value === this.activeValue;
    },
    style: function style() {
      return {
        fontSize: addUnit(this.size),
        backgroundColor: this.checked ? this.activeColor : this.inactiveColor
      };
    }
  },
  methods: {
    onClick: function onClick(event) {
      this.$emit('click', event);
      if (!this.disabled && !this.loading) {
        var newValue = this.checked ? this.inactiveValue : this.activeValue;
        this.$emit('input', newValue);
        this.$emit('change', newValue);
      }
    },
    genLoading: function genLoading() {
      var h = this.$createElement;
      if (this.loading) {
        var color = this.checked ? this.activeColor : this.inactiveColor;
        return h(Loading$1, {
          "class": bem$1g('loading'),
          "attrs": {
            "color": color
          }
        });
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    var checked = this.checked,
      loading = this.loading,
      disabled = this.disabled;
    return h("div", {
      "class": bem$1g({
        on: checked,
        loading: loading,
        disabled: disabled
      }),
      "attrs": {
        "role": "switch",
        "aria-checked": String(checked)
      },
      "style": this.style,
      "on": {
        "click": this.onClick
      }
    }, [h("div", {
      "class": bem$1g('node')
    }, [this.genLoading()])]);
  }
});

var _createNamespace$1k = createNamespace('address-edit'),
  createComponent$1o = _createNamespace$1k[0],
  bem$1f = _createNamespace$1k[1],
  t$o = _createNamespace$1k[2];
var defaultData = {
  name: '',
  tel: '',
  country: '',
  province: '',
  city: '',
  county: '',
  areaCode: '',
  postalCode: '',
  addressDetail: '',
  isDefault: false
};
function isPostal(value) {
  return /^\d{6}$/.test(value);
}
var AddressEdit = createComponent$1o({
  props: {
    areaList: Object,
    isSaving: Boolean,
    isDeleting: Boolean,
    validator: Function,
    showDelete: Boolean,
    showPostal: Boolean,
    searchResult: Array,
    telMaxlength: [Number, String],
    showSetDefault: Boolean,
    saveButtonText: String,
    areaPlaceholder: String,
    deleteButtonText: String,
    showSearchResult: Boolean,
    showArea: {
      type: Boolean,
      default: true
    },
    showDetail: {
      type: Boolean,
      default: true
    },
    disableArea: Boolean,
    detailRows: {
      type: [Number, String],
      default: 1
    },
    detailMaxlength: {
      type: [Number, String],
      default: 200
    },
    addressInfo: {
      type: Object,
      default: function _default() {
        return _extends$2({}, defaultData);
      }
    },
    telValidator: {
      type: Function,
      default: isMobile
    },
    postalValidator: {
      type: Function,
      default: isPostal
    },
    areaColumnsPlaceholder: {
      type: Array,
      default: function _default() {
        return [];
      }
    }
  },
  data: function data() {
    return {
      data: {},
      showAreaPopup: false,
      detailFocused: false,
      errorInfo: {
        tel: '',
        name: '',
        areaCode: '',
        postalCode: '',
        addressDetail: ''
      }
    };
  },
  computed: {
    areaListLoaded: function areaListLoaded() {
      return isObject$2(this.areaList) && Object.keys(this.areaList).length;
    },
    areaText: function areaText() {
      var _this$data = this.data,
        country = _this$data.country,
        province = _this$data.province,
        city = _this$data.city,
        county = _this$data.county,
        areaCode = _this$data.areaCode;
      if (areaCode) {
        var arr = [country, province, city, county];
        if (province && province === city) {
          arr.splice(1, 1);
        }
        return arr.filter(function (text) {
          return text;
        }).join('/');
      }
      return '';
    },
    // hide bottom field when use search && detail get focused
    hideBottomFields: function hideBottomFields() {
      var searchResult = this.searchResult;
      return searchResult && searchResult.length && this.detailFocused;
    }
  },
  watch: {
    addressInfo: {
      handler: function handler(val) {
        this.data = _extends$2({}, defaultData, val);
        this.setAreaCode(val.areaCode);
      },
      deep: true,
      immediate: true
    },
    areaList: function areaList() {
      this.setAreaCode(this.data.areaCode);
    }
  },
  methods: {
    onFocus: function onFocus(key) {
      this.errorInfo[key] = '';
      this.detailFocused = key === 'addressDetail';
      this.$emit('focus', key);
    },
    onChangeDetail: function onChangeDetail(val) {
      this.data.addressDetail = val;
      this.$emit('change-detail', val);
    },
    onAreaConfirm: function onAreaConfirm(values) {
      values = values.filter(function (value) {
        return !!value;
      });
      if (values.some(function (value) {
        return !value.code;
      })) {
        Toast(t$o('areaEmpty'));
        return;
      }
      this.showAreaPopup = false;
      this.assignAreaValues();
      this.$emit('change-area', values);
    },
    assignAreaValues: function assignAreaValues() {
      var area = this.$refs.area;
      if (area) {
        var detail = area.getArea();
        detail.areaCode = detail.code;
        delete detail.code;
        _extends$2(this.data, detail);
      }
    },
    onSave: function onSave() {
      var _this = this;
      var items = ['name', 'tel'];
      if (this.showArea) {
        items.push('areaCode');
      }
      if (this.showDetail) {
        items.push('addressDetail');
      }
      if (this.showPostal) {
        items.push('postalCode');
      }
      var isValid = items.every(function (item) {
        var msg = _this.getErrorMessage(item);
        if (msg) {
          _this.errorInfo[item] = msg;
        }
        return !msg;
      });
      if (isValid && !this.isSaving) {
        this.$emit('save', this.data);
      }
    },
    getErrorMessage: function getErrorMessage(key) {
      var value = String(this.data[key] || '').trim();
      if (this.validator) {
        var message = this.validator(key, value);
        if (message) {
          return message;
        }
      }
      switch (key) {
        case 'name':
          return value ? '' : t$o('nameEmpty');
        case 'tel':
          return this.telValidator(value) ? '' : t$o('telInvalid');
        case 'areaCode':
          return value ? '' : t$o('areaEmpty');
        case 'addressDetail':
          return value ? '' : t$o('addressEmpty');
        case 'postalCode':
          return value && !this.postalValidator(value) ? t$o('postalEmpty') : '';
      }
    },
    onDelete: function onDelete() {
      var _this2 = this;
      Dialog.confirm({
        title: t$o('confirmDelete')
      }).then(function () {
        _this2.$emit('delete', _this2.data);
      }).catch(function () {
        _this2.$emit('cancel-delete', _this2.data);
      });
    },
    // get values of area component
    getArea: function getArea() {
      return this.$refs.area ? this.$refs.area.getValues() : [];
    },
    // set area code to area component
    setAreaCode: function setAreaCode(code) {
      this.data.areaCode = code || '';
      if (code) {
        this.$nextTick(this.assignAreaValues);
      }
    },
    // @exposed-api
    setAddressDetail: function setAddressDetail(value) {
      this.data.addressDetail = value;
    },
    onDetailBlur: function onDetailBlur() {
      var _this3 = this;

      // await for click search event
      setTimeout(function () {
        _this3.detailFocused = false;
      });
    },
    genSetDefaultCell: function genSetDefaultCell(h) {
      var _this4 = this;
      if (this.showSetDefault) {
        var slots = {
          'right-icon': function rightIcon() {
            return h(Switch, {
              "attrs": {
                "size": "24"
              },
              "on": {
                "change": function change(event) {
                  _this4.$emit('change-default', event);
                }
              },
              "model": {
                value: _this4.data.isDefault,
                callback: function callback($$v) {
                  _this4.$set(_this4.data, "isDefault", $$v);
                }
              }
            });
          }
        };
        return h(Cell$1, {
          "directives": [{
            name: "show",
            value: !this.hideBottomFields
          }],
          "attrs": {
            "center": true,
            "title": t$o('defaultAddress')
          },
          "class": bem$1f('default'),
          "scopedSlots": slots
        });
      }
      return h();
    }
  },
  render: function render(h) {
    var _this5 = this;
    var data = this.data,
      errorInfo = this.errorInfo,
      disableArea = this.disableArea,
      hideBottomFields = this.hideBottomFields;
    var onFocus = function onFocus(name) {
      return function () {
        return _this5.onFocus(name);
      };
    };
    return h("div", {
      "class": bem$1f()
    }, [h("div", {
      "class": bem$1f('fields')
    }, [h(Field, {
      "attrs": {
        "clearable": true,
        "label": t$o('name'),
        "placeholder": t$o('namePlaceholder'),
        "errorMessage": errorInfo.name
      },
      "on": {
        "focus": onFocus('name')
      },
      "model": {
        value: data.name,
        callback: function callback($$v) {
          _this5.$set(data, "name", $$v);
        }
      }
    }), h(Field, {
      "attrs": {
        "clearable": true,
        "type": "tel",
        "label": t$o('tel'),
        "maxlength": this.telMaxlength,
        "placeholder": t$o('telPlaceholder'),
        "errorMessage": errorInfo.tel
      },
      "on": {
        "focus": onFocus('tel')
      },
      "model": {
        value: data.tel,
        callback: function callback($$v) {
          _this5.$set(data, "tel", $$v);
        }
      }
    }), h(Field, {
      "directives": [{
        name: "show",
        value: this.showArea
      }],
      "attrs": {
        "readonly": true,
        "clickable": !disableArea,
        "label": t$o('area'),
        "placeholder": this.areaPlaceholder || t$o('areaPlaceholder'),
        "errorMessage": errorInfo.areaCode,
        "rightIcon": !disableArea ? 'arrow' : null,
        "value": this.areaText
      },
      "on": {
        "focus": onFocus('areaCode'),
        "click": function click() {
          _this5.$emit('click-area');
          _this5.showAreaPopup = !disableArea;
        }
      }
    }), h(Detail, {
      "directives": [{
        name: "show",
        value: this.showDetail
      }],
      "attrs": {
        "focused": this.detailFocused,
        "value": data.addressDetail,
        "errorMessage": errorInfo.addressDetail,
        "detailRows": this.detailRows,
        "detailMaxlength": this.detailMaxlength,
        "searchResult": this.searchResult,
        "showSearchResult": this.showSearchResult
      },
      "on": {
        "focus": onFocus('addressDetail'),
        "blur": this.onDetailBlur,
        "input": this.onChangeDetail,
        "select-search": function selectSearch(event) {
          _this5.$emit('select-search', event);
        }
      }
    }), this.showPostal && h(Field, {
      "directives": [{
        name: "show",
        value: !hideBottomFields
      }],
      "attrs": {
        "type": "tel",
        "maxlength": "6",
        "label": t$o('postal'),
        "placeholder": t$o('postal'),
        "errorMessage": errorInfo.postalCode
      },
      "on": {
        "focus": onFocus('postalCode')
      },
      "model": {
        value: data.postalCode,
        callback: function callback($$v) {
          _this5.$set(data, "postalCode", $$v);
        }
      }
    }), this.slots()]), this.genSetDefaultCell(h), h("div", {
      "directives": [{
        name: "show",
        value: !hideBottomFields
      }],
      "class": bem$1f('buttons')
    }, [h(Button$2, {
      "attrs": {
        "block": true,
        "round": true,
        "loading": this.isSaving,
        "type": "danger",
        "text": this.saveButtonText || t$o('save')
      },
      "on": {
        "click": this.onSave
      }
    }), this.showDelete && h(Button$2, {
      "attrs": {
        "block": true,
        "round": true,
        "loading": this.isDeleting,
        "text": this.deleteButtonText || t$o('delete')
      },
      "on": {
        "click": this.onDelete
      }
    })]), h(Popup, {
      "attrs": {
        "round": true,
        "position": "bottom",
        "lazyRender": false,
        "getContainer": "body"
      },
      "model": {
        value: _this5.showAreaPopup,
        callback: function callback($$v) {
          _this5.showAreaPopup = $$v;
        }
      }
    }, [h(Area, {
      "ref": "area",
      "attrs": {
        "value": data.areaCode,
        "loading": !this.areaListLoaded,
        "areaList": this.areaList,
        "columnsPlaceholder": this.areaColumnsPlaceholder
      },
      "on": {
        "confirm": this.onAreaConfirm,
        "cancel": function cancel() {
          _this5.showAreaPopup = false;
        }
      }
    })])]);
  }
});

var _createNamespace$1j = createNamespace('radio-group'),
  createComponent$1n = _createNamespace$1j[0],
  bem$1e = _createNamespace$1j[1];
var RadioGroup = createComponent$1n({
  mixins: [ParentMixin('vanRadio'), FieldMixin],
  props: {
    value: null,
    disabled: Boolean,
    direction: String,
    checkedColor: String,
    iconSize: [Number, String]
  },
  watch: {
    value: function value(_value) {
      this.$emit('change', _value);
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$1e([this.direction]),
      "attrs": {
        "role": "radiogroup"
      }
    }, [this.slots()]);
  }
});

var _createNamespace$1i = createNamespace('tag'),
  createComponent$1m = _createNamespace$1i[0],
  bem$1d = _createNamespace$1i[1];
function Tag(h, props, slots, ctx) {
  var _style;
  var type = props.type,
    mark = props.mark,
    plain = props.plain,
    color = props.color,
    round = props.round,
    size = props.size,
    textColor = props.textColor;
  var key = plain ? 'color' : 'backgroundColor';
  var style = (_style = {}, _style[key] = color, _style);
  if (plain) {
    style.color = textColor || color;
    style.borderColor = color;
  } else {
    style.color = textColor;
    style.background = color;
  }
  var classes = {
    mark: mark,
    plain: plain,
    round: round
  };
  if (size) {
    classes[size] = size;
  }
  var CloseIcon = props.closeable && h(Icon$3, {
    "attrs": {
      "name": "cross"
    },
    "class": bem$1d('close'),
    "on": {
      "click": function click(event) {
        event.stopPropagation();
        emit(ctx, 'close');
      }
    }
  });
  return h("transition", {
    "attrs": {
      "name": props.closeable ? 'van-fade' : null
    }
  }, [h("span", _mergeJSXProps([{
    "key": "content",
    "style": style,
    "class": bem$1d([classes, type])
  }, inherit(ctx, true)]), [slots.default == null ? void 0 : slots.default(), CloseIcon])]);
}
Tag.props = {
  size: String,
  mark: Boolean,
  color: String,
  plain: Boolean,
  round: Boolean,
  textColor: String,
  closeable: Boolean,
  type: {
    type: String,
    default: 'default'
  }
};
var Tag$1 = createComponent$1m(Tag);

/**
 * Common part of Checkbox & Radio
 */
var CheckboxMixin = function CheckboxMixin(_ref) {
  var parent = _ref.parent,
    bem = _ref.bem,
    role = _ref.role;
  return {
    mixins: [ChildrenMixin(parent), FieldMixin],
    props: {
      name: null,
      value: null,
      disabled: Boolean,
      iconSize: [Number, String],
      checkedColor: String,
      labelPosition: String,
      labelDisabled: Boolean,
      shape: {
        type: String,
        default: 'round'
      },
      bindGroup: {
        type: Boolean,
        default: true
      }
    },
    computed: {
      disableBindRelation: function disableBindRelation() {
        return !this.bindGroup;
      },
      isDisabled: function isDisabled() {
        return this.parent && this.parent.disabled || this.disabled;
      },
      direction: function direction() {
        return this.parent && this.parent.direction || null;
      },
      iconStyle: function iconStyle() {
        var checkedColor = this.checkedColor || this.parent && this.parent.checkedColor;
        if (checkedColor && this.checked && !this.isDisabled) {
          return {
            borderColor: checkedColor,
            backgroundColor: checkedColor
          };
        }
      },
      tabindex: function tabindex() {
        if (this.isDisabled || role === 'radio' && !this.checked) {
          return -1;
        }
        return 0;
      }
    },
    methods: {
      onClick: function onClick(event) {
        var _this = this;
        var target = event.target;
        var icon = this.$refs.icon;
        var iconClicked = icon === target || (icon == null ? void 0 : icon.contains(target));
        if (!this.isDisabled && (iconClicked || !this.labelDisabled)) {
          this.toggle(); // wait for toggle method to complete
          // so we can get the changed value in the click event listener

          setTimeout(function () {
            _this.$emit('click', event);
          });
        } else {
          this.$emit('click', event);
        }
      },
      genIcon: function genIcon() {
        var h = this.$createElement;
        var checked = this.checked;
        var iconSize = this.iconSize || this.parent && this.parent.iconSize;
        return h("div", {
          "ref": "icon",
          "class": bem('icon', [this.shape, {
            disabled: this.isDisabled,
            checked: checked
          }]),
          "style": {
            fontSize: addUnit(iconSize)
          }
        }, [this.slots('icon', {
          checked: checked
        }) || h(Icon$3, {
          "attrs": {
            "name": "success"
          },
          "style": this.iconStyle
        })]);
      },
      genLabel: function genLabel() {
        var h = this.$createElement;
        var slot = this.slots();
        if (slot) {
          return h("span", {
            "class": bem('label', [this.labelPosition, {
              disabled: this.isDisabled
            }])
          }, [slot]);
        }
      }
    },
    render: function render() {
      var h = arguments[0];
      var Children = [this.genIcon()];
      if (this.labelPosition === 'left') {
        Children.unshift(this.genLabel());
      } else {
        Children.push(this.genLabel());
      }
      return h("div", {
        "attrs": {
          "role": role,
          "tabindex": this.tabindex,
          "aria-checked": String(this.checked)
        },
        "class": bem([{
          disabled: this.isDisabled,
          'label-disabled': this.labelDisabled
        }, this.direction]),
        "on": {
          "click": this.onClick
        }
      }, [Children]);
    }
  };
};

var _createNamespace$1h = createNamespace('radio'),
  createComponent$1l = _createNamespace$1h[0],
  bem$1c = _createNamespace$1h[1];
var Radio = createComponent$1l({
  mixins: [CheckboxMixin({
    bem: bem$1c,
    role: 'radio',
    parent: 'vanRadio'
  })],
  computed: {
    currentValue: {
      get: function get() {
        return this.parent ? this.parent.value : this.value;
      },
      set: function set(val) {
        (this.parent || this).$emit('input', val);
      }
    },
    checked: function checked() {
      return this.currentValue === this.name;
    }
  },
  methods: {
    toggle: function toggle() {
      this.currentValue = this.name;
    }
  }
});

var _createNamespace$1g = createNamespace('address-item'),
  createComponent$1k = _createNamespace$1g[0],
  bem$1b = _createNamespace$1g[1];
function AddressItem(h, props, slots, ctx) {
  var disabled = props.disabled,
    switchable = props.switchable;
  function onClick() {
    if (switchable) {
      emit(ctx, 'select');
    }
    emit(ctx, 'click');
  }
  var genRightIcon = function genRightIcon() {
    return h(Icon$3, {
      "attrs": {
        "name": "edit"
      },
      "class": bem$1b('edit'),
      "on": {
        "click": function click(event) {
          event.stopPropagation();
          emit(ctx, 'edit');
          emit(ctx, 'click');
        }
      }
    });
  };
  function genTag() {
    if (slots.tag) {
      return slots.tag(_extends$2({}, props.data));
    }
    if (props.data.isDefault && props.defaultTagText) {
      return h(Tag$1, {
        "attrs": {
          "type": "danger",
          "round": true
        },
        "class": bem$1b('tag')
      }, [props.defaultTagText]);
    }
  }
  function genContent() {
    var data = props.data;
    var Info = [h("div", {
      "class": bem$1b('name')
    }, [data.name + " " + data.tel, genTag()]), h("div", {
      "class": bem$1b('address')
    }, [data.address])];
    if (switchable && !disabled) {
      return h(Radio, {
        "attrs": {
          "name": data.id,
          "iconSize": 18
        }
      }, [Info]);
    }
    return Info;
  }
  return h("div", {
    "class": bem$1b({
      disabled: disabled
    }),
    "on": {
      "click": onClick
    }
  }, [h(Cell$1, _mergeJSXProps([{
    "attrs": {
      "border": false,
      "valueClass": bem$1b('value')
    },
    "scopedSlots": {
      default: genContent,
      'right-icon': genRightIcon
    }
  }, inherit(ctx)])), slots.bottom == null ? void 0 : slots.bottom(_extends$2({}, props.data, {
    disabled: disabled
  }))]);
}
AddressItem.props = {
  data: Object,
  disabled: Boolean,
  switchable: Boolean,
  defaultTagText: String
};
var AddressItem$1 = createComponent$1k(AddressItem);

var _createNamespace$1f = createNamespace('address-list'),
  createComponent$1j = _createNamespace$1f[0],
  bem$1a = _createNamespace$1f[1],
  t$n = _createNamespace$1f[2];
function AddressList(h, props, slots, ctx) {
  function genList(list, disabled) {
    if (!list) {
      return;
    }
    return list.map(function (item, index) {
      return h(AddressItem$1, {
        "attrs": {
          "data": item,
          "disabled": disabled,
          "switchable": props.switchable,
          "defaultTagText": props.defaultTagText
        },
        "key": item.id,
        "scopedSlots": {
          bottom: slots['item-bottom'],
          tag: slots.tag
        },
        "on": {
          "select": function select() {
            emit(ctx, disabled ? 'select-disabled' : 'select', item, index);
            if (!disabled) {
              emit(ctx, 'input', item.id);
            }
          },
          "edit": function edit() {
            emit(ctx, disabled ? 'edit-disabled' : 'edit', item, index);
          },
          "click": function click() {
            emit(ctx, 'click-item', item, index);
          }
        }
      });
    });
  }
  var List = genList(props.list);
  var DisabledList = genList(props.disabledList, true);
  return h("div", _mergeJSXProps([{
    "class": bem$1a()
  }, inherit(ctx)]), [slots.top == null ? void 0 : slots.top(), h(RadioGroup, {
    "attrs": {
      "value": props.value
    }
  }, [List]), props.disabledText && h("div", {
    "class": bem$1a('disabled-text')
  }, [props.disabledText]), DisabledList, slots.default == null ? void 0 : slots.default(), h("div", {
    "class": bem$1a('bottom')
  }, [h(Button$2, {
    "attrs": {
      "round": true,
      "block": true,
      "type": "danger",
      "text": props.addButtonText || t$n('add')
    },
    "class": bem$1a('add'),
    "on": {
      "click": function click() {
        emit(ctx, 'add');
      }
    }
  })])]);
}
AddressList.props = {
  list: Array,
  value: [Number, String],
  disabledList: Array,
  disabledText: String,
  addButtonText: String,
  defaultTagText: String,
  switchable: {
    type: Boolean,
    default: true
  }
};
var AddressList$1 = createComponent$1j(AddressList);

var _createNamespace$1e = createNamespace('badge'),
  createComponent$1i = _createNamespace$1e[0],
  bem$19 = _createNamespace$1e[1];
var Badge = createComponent$1i({
  props: {
    dot: Boolean,
    max: [Number, String],
    color: String,
    content: [Number, String],
    tag: {
      type: String,
      default: 'div'
    }
  },
  methods: {
    hasContent: function hasContent() {
      return !!(this.$scopedSlots.content || isDef(this.content) && this.content !== '');
    },
    renderContent: function renderContent() {
      var dot = this.dot,
        max = this.max,
        content = this.content;
      if (!dot && this.hasContent()) {
        if (this.$scopedSlots.content) {
          return this.$scopedSlots.content();
        }
        if (isDef(max) && isNumeric(content) && +content > max) {
          return max + "+";
        }
        return content;
      }
    },
    renderBadge: function renderBadge() {
      var h = this.$createElement;
      if (this.hasContent() || this.dot) {
        return h("div", {
          "class": bem$19({
            dot: this.dot,
            fixed: !!this.$scopedSlots.default
          }),
          "style": {
            background: this.color
          }
        }, [this.renderContent()]);
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    if (this.$scopedSlots.default) {
      var tag = this.tag;
      return h(tag, {
        "class": bem$19('wrapper')
      }, [this.$scopedSlots.default(), this.renderBadge()]);
    }
    return this.renderBadge();
  }
});

/**
 * requestAnimationFrame polyfill
 */
var prev = Date.now();
/* istanbul ignore next */

function fallback(fn) {
  var curr = Date.now();
  var ms = Math.max(0, 16 - (curr - prev));
  var id = setTimeout(fn, ms);
  prev = curr + ms;
  return id;
}
/* istanbul ignore next */

var root = isServer$1 ? global : window;
/* istanbul ignore next */

var iRaf = root.requestAnimationFrame || fallback;
/* istanbul ignore next */

var iCancel = root.cancelAnimationFrame || root.clearTimeout;
function raf(fn) {
  return iRaf.call(root, fn);
} // double raf for animation

function doubleRaf(fn) {
  raf(function () {
    raf(fn);
  });
}
function cancelRaf(id) {
  iCancel.call(root, id);
}

function isDate$1(val) {
  return Object.prototype.toString.call(val) === '[object Date]' && !isNaN$1(val.getTime());
}

var _createNamespace$1d = createNamespace('calendar'),
  createComponent$1h = _createNamespace$1d[0],
  bem$18 = _createNamespace$1d[1],
  t$m = _createNamespace$1d[2];
function formatMonthTitle(date) {
  return t$m('monthTitle', date.getFullYear(), date.getMonth() + 1);
}
function compareMonth(date1, date2) {
  var year1 = date1.getFullYear();
  var year2 = date2.getFullYear();
  var month1 = date1.getMonth();
  var month2 = date2.getMonth();
  if (year1 === year2) {
    return month1 === month2 ? 0 : month1 > month2 ? 1 : -1;
  }
  return year1 > year2 ? 1 : -1;
}
function compareDay(day1, day2) {
  var compareMonthResult = compareMonth(day1, day2);
  if (compareMonthResult === 0) {
    var date1 = day1.getDate();
    var date2 = day2.getDate();
    return date1 === date2 ? 0 : date1 > date2 ? 1 : -1;
  }
  return compareMonthResult;
}
function getDayByOffset(date, offset) {
  date = new Date(date);
  date.setDate(date.getDate() + offset);
  return date;
}
function getPrevDay(date) {
  return getDayByOffset(date, -1);
}
function getNextDay(date) {
  return getDayByOffset(date, 1);
}
function calcDateNum(date) {
  var day1 = date[0].getTime();
  var day2 = date[1].getTime();
  return (day2 - day1) / (1000 * 60 * 60 * 24) + 1;
}
function copyDate(dates) {
  return new Date(dates);
}
function copyDates(dates) {
  if (Array.isArray(dates)) {
    return dates.map(function (date) {
      if (date === null) {
        return date;
      }
      return copyDate(date);
    });
  }
  return copyDate(dates);
}

function times(n, iteratee) {
  if (n < 0) {
    return [];
  }
  var index = -1;
  var result = Array(n);
  while (++index < n) {
    result[index] = iteratee(index);
  }
  return result;
}
function getTrueValue(value) {
  if (!value) {
    return 0;
  }
  while (isNaN$1(parseInt(value, 10))) {
    if (value.length > 1) {
      value = value.slice(1);
    } else {
      return 0;
    }
  }
  return parseInt(value, 10);
}
function getMonthEndDay(year, month) {
  return 32 - new Date(year, month - 1, 32).getDate();
}

var _createNamespace$1c = createNamespace('calendar-month'),
  createComponent$1g = _createNamespace$1c[0];
var Month = createComponent$1g({
  props: {
    date: Date,
    type: String,
    color: String,
    minDate: Date,
    maxDate: Date,
    showMark: Boolean,
    rowHeight: [Number, String],
    formatter: Function,
    lazyRender: Boolean,
    currentDate: [Date, Array],
    allowSameDay: Boolean,
    showSubtitle: Boolean,
    showMonthTitle: Boolean,
    firstDayOfWeek: Number
  },
  data: function data() {
    return {
      visible: false
    };
  },
  computed: {
    title: function title() {
      return formatMonthTitle(this.date);
    },
    rowHeightWithUnit: function rowHeightWithUnit() {
      return addUnit(this.rowHeight);
    },
    offset: function offset() {
      var firstDayOfWeek = this.firstDayOfWeek;
      var realDay = this.date.getDay();
      if (!firstDayOfWeek) {
        return realDay;
      }
      return (realDay + 7 - this.firstDayOfWeek) % 7;
    },
    totalDay: function totalDay() {
      return getMonthEndDay(this.date.getFullYear(), this.date.getMonth() + 1);
    },
    shouldRender: function shouldRender() {
      return this.visible || !this.lazyRender;
    },
    placeholders: function placeholders() {
      var rows = [];
      var count = Math.ceil((this.totalDay + this.offset) / 7);
      for (var day = 1; day <= count; day++) {
        rows.push({
          type: 'placeholder'
        });
      }
      return rows;
    },
    days: function days() {
      var days = [];
      var year = this.date.getFullYear();
      var month = this.date.getMonth();
      for (var day = 1; day <= this.totalDay; day++) {
        var date = new Date(year, month, day);
        var type = this.getDayType(date);
        var config = {
          date: date,
          type: type,
          text: day,
          bottomInfo: this.getBottomInfo(type)
        };
        if (this.formatter) {
          config = this.formatter(config);
        }
        days.push(config);
      }
      return days;
    }
  },
  methods: {
    getHeight: function getHeight() {
      var _this$$el;
      return ((_this$$el = this.$el) == null ? void 0 : _this$$el.getBoundingClientRect().height) || 0;
    },
    scrollIntoView: function scrollIntoView(body) {
      var _this$$refs = this.$refs,
        days = _this$$refs.days,
        month = _this$$refs.month;
      var el = this.showSubtitle ? days : month;
      var scrollTop = el.getBoundingClientRect().top - body.getBoundingClientRect().top + body.scrollTop;
      setScrollTop(body, scrollTop);
    },
    getMultipleDayType: function getMultipleDayType(day) {
      var _this = this;
      var isSelected = function isSelected(date) {
        return _this.currentDate.some(function (item) {
          return compareDay(item, date) === 0;
        });
      };
      if (isSelected(day)) {
        var prevDay = getPrevDay(day);
        var nextDay = getNextDay(day);
        var prevSelected = isSelected(prevDay);
        var nextSelected = isSelected(nextDay);
        if (prevSelected && nextSelected) {
          return 'multiple-middle';
        }
        if (prevSelected) {
          return 'end';
        }
        return nextSelected ? 'start' : 'multiple-selected';
      }
      return '';
    },
    getRangeDayType: function getRangeDayType(day) {
      var _this$currentDate = this.currentDate,
        startDay = _this$currentDate[0],
        endDay = _this$currentDate[1];
      if (!startDay) {
        return '';
      }
      var compareToStart = compareDay(day, startDay);
      if (!endDay) {
        return compareToStart === 0 ? 'start' : '';
      }
      var compareToEnd = compareDay(day, endDay);
      if (compareToStart === 0 && compareToEnd === 0 && this.allowSameDay) {
        return 'start-end';
      }
      if (compareToStart === 0) {
        return 'start';
      }
      if (compareToEnd === 0) {
        return 'end';
      }
      if (compareToStart > 0 && compareToEnd < 0) {
        return 'middle';
      }
    },
    getDayType: function getDayType(day) {
      var type = this.type,
        minDate = this.minDate,
        maxDate = this.maxDate,
        currentDate = this.currentDate;
      if (compareDay(day, minDate) < 0 || compareDay(day, maxDate) > 0) {
        return 'disabled';
      }
      if (currentDate === null) {
        return;
      }
      if (type === 'single') {
        return compareDay(day, currentDate) === 0 ? 'selected' : '';
      }
      if (type === 'multiple') {
        return this.getMultipleDayType(day);
      }
      /* istanbul ignore else */

      if (type === 'range') {
        return this.getRangeDayType(day);
      }
    },
    getBottomInfo: function getBottomInfo(type) {
      if (this.type === 'range') {
        if (type === 'start' || type === 'end') {
          return t$m(type);
        }
        if (type === 'start-end') {
          return t$m('startEnd');
        }
      }
    },
    getDayStyle: function getDayStyle(type, index) {
      var style = {
        height: this.rowHeightWithUnit
      };
      if (type === 'placeholder') {
        style.width = '100%';
        return style;
      }
      if (index === 0) {
        style.marginLeft = 100 * this.offset / 7 + "%";
      }
      if (this.color) {
        if (type === 'start' || type === 'end' || type === 'start-end' || type === 'multiple-selected' || type === 'multiple-middle') {
          style.background = this.color;
        } else if (type === 'middle') {
          style.color = this.color;
        }
      }
      return style;
    },
    genTitle: function genTitle() {
      var h = this.$createElement;
      if (this.showMonthTitle) {
        return h("div", {
          "class": bem$18('month-title')
        }, [this.title]);
      }
    },
    genMark: function genMark() {
      var h = this.$createElement;
      if (this.showMark && this.shouldRender) {
        return h("div", {
          "class": bem$18('month-mark')
        }, [this.date.getMonth() + 1]);
      }
    },
    genDays: function genDays() {
      var h = this.$createElement;
      var days = this.shouldRender ? this.days : this.placeholders;
      return h("div", {
        "ref": "days",
        "attrs": {
          "role": "grid"
        },
        "class": bem$18('days')
      }, [this.genMark(), days.map(this.genDay)]);
    },
    genTopInfo: function genTopInfo(item) {
      var h = this.$createElement;
      var slot = this.$scopedSlots['top-info'];
      if (item.topInfo || slot) {
        return h("div", {
          "class": bem$18('top-info')
        }, [slot ? slot(item) : item.topInfo]);
      }
    },
    genBottomInfo: function genBottomInfo(item) {
      var h = this.$createElement;
      var slot = this.$scopedSlots['bottom-info'];
      if (item.bottomInfo || slot) {
        return h("div", {
          "class": bem$18('bottom-info')
        }, [slot ? slot(item) : item.bottomInfo]);
      }
    },
    genDay: function genDay(item, index) {
      var _this2 = this;
      var h = this.$createElement;
      var type = item.type;
      var style = this.getDayStyle(type, index);
      var disabled = type === 'disabled';
      var onClick = function onClick() {
        if (!disabled) {
          _this2.$emit('click', item);
        }
      };
      if (type === 'selected') {
        return h("div", {
          "attrs": {
            "role": "gridcell",
            "tabindex": -1
          },
          "style": style,
          "class": [bem$18('day'), item.className],
          "on": {
            "click": onClick
          }
        }, [h("div", {
          "class": bem$18('selected-day'),
          "style": {
            width: this.rowHeightWithUnit,
            height: this.rowHeightWithUnit,
            background: this.color
          }
        }, [this.genTopInfo(item), item.text, this.genBottomInfo(item)])]);
      }
      return h("div", {
        "attrs": {
          "role": "gridcell",
          "tabindex": disabled ? null : -1
        },
        "style": style,
        "class": [bem$18('day', type), item.className],
        "on": {
          "click": onClick
        }
      }, [this.genTopInfo(item), item.text, this.genBottomInfo(item)]);
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$18('month'),
      "ref": "month"
    }, [this.genTitle(), this.genDays()]);
  }
});

var _createNamespace$1b = createNamespace('calendar-header'),
  createComponent$1f = _createNamespace$1b[0];
var Header = createComponent$1f({
  props: {
    title: String,
    subtitle: String,
    showTitle: Boolean,
    showSubtitle: Boolean,
    firstDayOfWeek: Number
  },
  methods: {
    genTitle: function genTitle() {
      var h = this.$createElement;
      if (this.showTitle) {
        var title = this.slots('title') || this.title || t$m('title');
        return h("div", {
          "class": bem$18('header-title')
        }, [title]);
      }
    },
    genSubtitle: function genSubtitle() {
      var h = this.$createElement;
      if (this.showSubtitle) {
        return h("div", {
          "class": bem$18('header-subtitle')
        }, [this.subtitle]);
      }
    },
    genWeekDays: function genWeekDays() {
      var h = this.$createElement;
      var weekdays = t$m('weekdays');
      var firstDayOfWeek = this.firstDayOfWeek;
      var renderWeekDays = [].concat(weekdays.slice(firstDayOfWeek, 7), weekdays.slice(0, firstDayOfWeek));
      return h("div", {
        "class": bem$18('weekdays')
      }, [renderWeekDays.map(function (item) {
        return h("span", {
          "class": bem$18('weekday')
        }, [item]);
      })]);
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$18('header')
    }, [this.genTitle(), this.genSubtitle(), this.genWeekDays()]);
  }
});

// Utils
var Calendar = createComponent$1h({
  props: {
    title: String,
    color: String,
    value: Boolean,
    readonly: Boolean,
    formatter: Function,
    rowHeight: [Number, String],
    confirmText: String,
    rangePrompt: String,
    defaultDate: [Date, Array],
    getContainer: [String, Function],
    allowSameDay: Boolean,
    confirmDisabledText: String,
    type: {
      type: String,
      default: 'single'
    },
    round: {
      type: Boolean,
      default: true
    },
    position: {
      type: String,
      default: 'bottom'
    },
    poppable: {
      type: Boolean,
      default: true
    },
    maxRange: {
      type: [Number, String],
      default: null
    },
    lazyRender: {
      type: Boolean,
      default: true
    },
    showMark: {
      type: Boolean,
      default: true
    },
    showTitle: {
      type: Boolean,
      default: true
    },
    showConfirm: {
      type: Boolean,
      default: true
    },
    showSubtitle: {
      type: Boolean,
      default: true
    },
    closeOnPopstate: {
      type: Boolean,
      default: true
    },
    closeOnClickOverlay: {
      type: Boolean,
      default: true
    },
    safeAreaInsetBottom: {
      type: Boolean,
      default: true
    },
    minDate: {
      type: Date,
      validator: isDate$1,
      default: function _default() {
        return new Date();
      }
    },
    maxDate: {
      type: Date,
      validator: isDate$1,
      default: function _default() {
        var now = new Date();
        return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate());
      }
    },
    firstDayOfWeek: {
      type: [Number, String],
      default: 0,
      validator: function validator(val) {
        return val >= 0 && val <= 6;
      }
    }
  },
  inject: {
    vanPopup: {
      default: null
    }
  },
  data: function data() {
    return {
      subtitle: '',
      currentDate: this.getInitialDate()
    };
  },
  computed: {
    months: function months() {
      var months = [];
      var cursor = new Date(this.minDate);
      cursor.setDate(1);
      do {
        months.push(new Date(cursor));
        cursor.setMonth(cursor.getMonth() + 1);
      } while (compareMonth(cursor, this.maxDate) !== 1);
      return months;
    },
    buttonDisabled: function buttonDisabled() {
      var type = this.type,
        currentDate = this.currentDate;
      if (currentDate) {
        if (type === 'range') {
          return !currentDate[0] || !currentDate[1];
        }
        if (type === 'multiple') {
          return !currentDate.length;
        }
      }
      return !currentDate;
    },
    dayOffset: function dayOffset() {
      return this.firstDayOfWeek ? this.firstDayOfWeek % 7 : 0;
    }
  },
  watch: {
    value: 'init',
    type: function type() {
      this.reset();
    },
    defaultDate: function defaultDate(val) {
      this.currentDate = val;
      this.scrollIntoView();
    }
  },
  mounted: function mounted() {
    this.init(); // https://github.com/vant-ui/vant/issues/9845

    if (!this.poppable) {
      var _this$vanPopup;
      (_this$vanPopup = this.vanPopup) == null ? void 0 : _this$vanPopup.$on('opened', this.onScroll);
    }
  },
  /* istanbul ignore next */
  activated: function activated() {
    this.init();
  },
  methods: {
    // @exposed-api
    reset: function reset(date) {
      if (date === void 0) {
        date = this.getInitialDate();
      }
      this.currentDate = date;
      this.scrollIntoView();
    },
    init: function init() {
      var _this = this;
      if (this.poppable && !this.value) {
        return;
      }
      this.$nextTick(function () {
        // add Math.floor to avoid decimal height issues
        // https://github.com/vant-ui/vant/issues/5640
        _this.bodyHeight = Math.floor(_this.$refs.body.getBoundingClientRect().height);
        _this.onScroll();
        _this.scrollIntoView();
      });
    },
    // @exposed-api
    scrollToDate: function scrollToDate(targetDate) {
      var _this2 = this;
      raf(function () {
        var displayed = _this2.value || !_this2.poppable;
        /* istanbul ignore if */

        if (!targetDate || !displayed) {
          return;
        }
        _this2.months.some(function (month, index) {
          if (compareMonth(month, targetDate) === 0) {
            var _this2$$refs = _this2.$refs,
              body = _this2$$refs.body,
              months = _this2$$refs.months;
            months[index].scrollIntoView(body);
            return true;
          }
          return false;
        });
        _this2.onScroll();
      });
    },
    // scroll to current month
    scrollIntoView: function scrollIntoView() {
      var currentDate = this.currentDate;
      if (currentDate) {
        var targetDate = this.type === 'single' ? currentDate : currentDate[0];
        this.scrollToDate(targetDate);
      }
    },
    getInitialDate: function getInitialDate() {
      var type = this.type,
        minDate = this.minDate,
        maxDate = this.maxDate,
        defaultDate = this.defaultDate;
      if (defaultDate === null) {
        return defaultDate;
      }
      var defaultVal = new Date();
      if (compareDay(defaultVal, minDate) === -1) {
        defaultVal = minDate;
      } else if (compareDay(defaultVal, maxDate) === 1) {
        defaultVal = maxDate;
      }
      if (type === 'range') {
        var _ref = defaultDate || [],
          startDay = _ref[0],
          endDay = _ref[1];
        return [startDay || defaultVal, endDay || getNextDay(defaultVal)];
      }
      if (type === 'multiple') {
        return defaultDate || [defaultVal];
      }
      return defaultDate || defaultVal;
    },
    // calculate the position of the elements
    // and find the elements that needs to be rendered
    onScroll: function onScroll() {
      var _this$$refs = this.$refs,
        body = _this$$refs.body,
        months = _this$$refs.months;
      var top = getScrollTop(body);
      var bottom = top + this.bodyHeight;
      var heights = months.map(function (item) {
        return item.getHeight();
      });
      var heightSum = heights.reduce(function (a, b) {
        return a + b;
      }, 0); // iOS scroll bounce may exceed the range

      if (bottom > heightSum && top > 0) {
        return;
      }
      var height = 0;
      var currentMonth;
      var visibleRange = [-1, -1];
      for (var i = 0; i < months.length; i++) {
        var visible = height <= bottom && height + heights[i] >= top;
        if (visible) {
          visibleRange[1] = i;
          if (!currentMonth) {
            currentMonth = months[i];
            visibleRange[0] = i;
          }
          if (!months[i].showed) {
            months[i].showed = true;
            this.$emit('month-show', {
              date: months[i].date,
              title: months[i].title
            });
          }
        }
        height += heights[i];
      }
      months.forEach(function (month, index) {
        month.visible = index >= visibleRange[0] - 1 && index <= visibleRange[1] + 1;
      });
      /* istanbul ignore else */

      if (currentMonth) {
        this.subtitle = currentMonth.title;
      }
    },
    onClickDay: function onClickDay(item) {
      if (this.readonly) {
        return;
      }
      var date = item.date;
      var type = this.type,
        currentDate = this.currentDate;
      if (type === 'range') {
        if (!currentDate) {
          this.select([date, null]);
          return;
        }
        var startDay = currentDate[0],
          endDay = currentDate[1];
        if (startDay && !endDay) {
          var compareToStart = compareDay(date, startDay);
          if (compareToStart === 1) {
            this.select([startDay, date], true);
          } else if (compareToStart === -1) {
            this.select([date, null]);
          } else if (this.allowSameDay) {
            this.select([date, date], true);
          }
        } else {
          this.select([date, null]);
        }
      } else if (type === 'multiple') {
        if (!currentDate) {
          this.select([date]);
          return;
        }
        var selectedIndex;
        var selected = this.currentDate.some(function (dateItem, index) {
          var equal = compareDay(dateItem, date) === 0;
          if (equal) {
            selectedIndex = index;
          }
          return equal;
        });
        if (selected) {
          var _currentDate$splice = currentDate.splice(selectedIndex, 1),
            unselectedDate = _currentDate$splice[0];
          this.$emit('unselect', copyDate(unselectedDate));
        } else if (this.maxRange && currentDate.length >= this.maxRange) {
          Toast(this.rangePrompt || t$m('rangePrompt', this.maxRange));
        } else {
          this.select([].concat(currentDate, [date]));
        }
      } else {
        this.select(date, true);
      }
    },
    togglePopup: function togglePopup(val) {
      this.$emit('input', val);
    },
    select: function select(date, complete) {
      var _this3 = this;
      var emit = function emit(date) {
        _this3.currentDate = date;
        _this3.$emit('select', copyDates(_this3.currentDate));
      };
      if (complete && this.type === 'range') {
        var valid = this.checkRange(date);
        if (!valid) {
          // auto selected to max range if showConfirm
          if (this.showConfirm) {
            emit([date[0], getDayByOffset(date[0], this.maxRange - 1)]);
          } else {
            emit(date);
          }
          return;
        }
      }
      emit(date);
      if (complete && !this.showConfirm) {
        this.onConfirm();
      }
    },
    checkRange: function checkRange(date) {
      var maxRange = this.maxRange,
        rangePrompt = this.rangePrompt;
      if (maxRange && calcDateNum(date) > maxRange) {
        Toast(rangePrompt || t$m('rangePrompt', maxRange));
        return false;
      }
      return true;
    },
    onConfirm: function onConfirm() {
      this.$emit('confirm', copyDates(this.currentDate));
    },
    genMonth: function genMonth(date, index) {
      var h = this.$createElement;
      var showMonthTitle = index !== 0 || !this.showSubtitle;
      return h(Month, {
        "ref": "months",
        "refInFor": true,
        "attrs": {
          "date": date,
          "type": this.type,
          "color": this.color,
          "minDate": this.minDate,
          "maxDate": this.maxDate,
          "showMark": this.showMark,
          "formatter": this.formatter,
          "rowHeight": this.rowHeight,
          "lazyRender": this.lazyRender,
          "currentDate": this.currentDate,
          "showSubtitle": this.showSubtitle,
          "allowSameDay": this.allowSameDay,
          "showMonthTitle": showMonthTitle,
          "firstDayOfWeek": this.dayOffset
        },
        "scopedSlots": {
          'top-info': this.$scopedSlots['top-info'],
          'bottom-info': this.$scopedSlots['bottom-info']
        },
        "on": {
          "click": this.onClickDay
        }
      });
    },
    genFooterContent: function genFooterContent() {
      var h = this.$createElement;
      var slot = this.slots('footer');
      if (slot) {
        return slot;
      }
      if (this.showConfirm) {
        var text = this.buttonDisabled ? this.confirmDisabledText : this.confirmText;
        return h(Button$2, {
          "attrs": {
            "round": true,
            "block": true,
            "type": "danger",
            "color": this.color,
            "disabled": this.buttonDisabled,
            "nativeType": "button"
          },
          "class": bem$18('confirm'),
          "on": {
            "click": this.onConfirm
          }
        }, [text || t$m('confirm')]);
      }
    },
    genFooter: function genFooter() {
      var h = this.$createElement;
      return h("div", {
        "class": bem$18('footer', {
          unfit: !this.safeAreaInsetBottom
        })
      }, [this.genFooterContent()]);
    },
    genCalendar: function genCalendar() {
      var _this4 = this;
      var h = this.$createElement;
      return h("div", {
        "class": bem$18()
      }, [h(Header, {
        "attrs": {
          "title": this.title,
          "showTitle": this.showTitle,
          "subtitle": this.subtitle,
          "showSubtitle": this.showSubtitle,
          "firstDayOfWeek": this.dayOffset
        },
        "scopedSlots": {
          title: function title() {
            return _this4.slots('title');
          }
        }
      }), h("div", {
        "ref": "body",
        "class": bem$18('body'),
        "on": {
          "scroll": this.onScroll
        }
      }, [this.months.map(this.genMonth)]), this.genFooter()]);
    }
  },
  render: function render() {
    var _this5 = this;
    var h = arguments[0];
    if (this.poppable) {
      var _attrs;
      var createListener = function createListener(name) {
        return function () {
          return _this5.$emit(name);
        };
      };
      return h(Popup, {
        "attrs": (_attrs = {
          "round": true,
          "value": this.value
        }, _attrs["round"] = this.round, _attrs["position"] = this.position, _attrs["closeable"] = this.showTitle || this.showSubtitle, _attrs["getContainer"] = this.getContainer, _attrs["closeOnPopstate"] = this.closeOnPopstate, _attrs["closeOnClickOverlay"] = this.closeOnClickOverlay, _attrs),
        "class": bem$18('popup'),
        "on": {
          "input": this.togglePopup,
          "open": createListener('open'),
          "opened": createListener('opened'),
          "close": createListener('close'),
          "closed": createListener('closed')
        }
      }, [this.genCalendar()]);
    }
    return this.genCalendar();
  }
});

var _createNamespace$1a = createNamespace('image'),
  createComponent$1e = _createNamespace$1a[0],
  bem$17 = _createNamespace$1a[1];
var Image$1 = createComponent$1e({
  props: {
    src: String,
    fit: String,
    alt: String,
    round: Boolean,
    width: [Number, String],
    height: [Number, String],
    radius: [Number, String],
    lazyLoad: Boolean,
    iconPrefix: String,
    showError: {
      type: Boolean,
      default: true
    },
    showLoading: {
      type: Boolean,
      default: true
    },
    errorIcon: {
      type: String,
      default: 'photo-fail'
    },
    loadingIcon: {
      type: String,
      default: 'photo'
    }
  },
  data: function data() {
    return {
      loading: true,
      error: false
    };
  },
  watch: {
    src: function src() {
      this.loading = true;
      this.error = false;
    }
  },
  computed: {
    style: function style() {
      var style = {};
      if (isDef(this.width)) {
        style.width = addUnit(this.width);
      }
      if (isDef(this.height)) {
        style.height = addUnit(this.height);
      }
      if (isDef(this.radius)) {
        style.overflow = 'hidden';
        style.borderRadius = addUnit(this.radius);
      }
      return style;
    }
  },
  created: function created() {
    var $Lazyload = this.$Lazyload;
    if ($Lazyload && inBrowser$2) {
      $Lazyload.$on('loaded', this.onLazyLoaded);
      $Lazyload.$on('error', this.onLazyLoadError);
    }
  },
  beforeDestroy: function beforeDestroy() {
    var $Lazyload = this.$Lazyload;
    if ($Lazyload) {
      $Lazyload.$off('loaded', this.onLazyLoaded);
      $Lazyload.$off('error', this.onLazyLoadError);
    }
  },
  methods: {
    onLoad: function onLoad(event) {
      this.loading = false;
      this.$emit('load', event);
    },
    onLazyLoaded: function onLazyLoaded(_ref) {
      var el = _ref.el;
      if (el === this.$refs.image && this.loading) {
        this.onLoad();
      }
    },
    onLazyLoadError: function onLazyLoadError(_ref2) {
      var el = _ref2.el;
      if (el === this.$refs.image && !this.error) {
        this.onError();
      }
    },
    onError: function onError(event) {
      this.error = true;
      this.loading = false;
      this.$emit('error', event);
    },
    onClick: function onClick(event) {
      this.$emit('click', event);
    },
    genPlaceholder: function genPlaceholder() {
      var h = this.$createElement;
      if (this.loading && this.showLoading) {
        return h("div", {
          "class": bem$17('loading')
        }, [this.slots('loading') || h(Icon$3, {
          "attrs": {
            "name": this.loadingIcon,
            "classPrefix": this.iconPrefix
          },
          "class": bem$17('loading-icon')
        })]);
      }
      if (this.error && this.showError) {
        return h("div", {
          "class": bem$17('error')
        }, [this.slots('error') || h(Icon$3, {
          "attrs": {
            "name": this.errorIcon,
            "classPrefix": this.iconPrefix
          },
          "class": bem$17('error-icon')
        })]);
      }
    },
    genImage: function genImage() {
      var h = this.$createElement;
      var imgData = {
        class: bem$17('img'),
        attrs: {
          alt: this.alt
        },
        style: {
          objectFit: this.fit
        }
      };
      if (this.error) {
        return;
      }
      if (this.lazyLoad) {
        return h("img", _mergeJSXProps([{
          "ref": "image",
          "directives": [{
            name: "lazy",
            value: this.src
          }]
        }, imgData]));
      }
      return h("img", _mergeJSXProps([{
        "attrs": {
          "src": this.src
        },
        "on": {
          "load": this.onLoad,
          "error": this.onError
        }
      }, imgData]));
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$17({
        round: this.round
      }),
      "style": this.style,
      "on": {
        "click": this.onClick
      }
    }, [this.genImage(), this.genPlaceholder(), this.slots()]);
  }
});

var _createNamespace$19 = createNamespace('card'),
  createComponent$1d = _createNamespace$19[0],
  bem$16 = _createNamespace$19[1];
function Card(h, props, slots, ctx) {
  var _slots$priceTop;
  var thumb = props.thumb;
  var showNum = slots.num || isDef(props.num);
  var showPrice = slots.price || isDef(props.price);
  var showOriginPrice = slots['origin-price'] || isDef(props.originPrice);
  var showBottom = showNum || showPrice || showOriginPrice || slots.bottom;
  function onThumbClick(event) {
    emit(ctx, 'click-thumb', event);
  }
  function ThumbTag() {
    if (slots.tag || props.tag) {
      return h("div", {
        "class": bem$16('tag')
      }, [slots.tag ? slots.tag() : h(Tag$1, {
        "attrs": {
          "mark": true,
          "type": "danger"
        }
      }, [props.tag])]);
    }
  }
  function Thumb() {
    if (slots.thumb || thumb) {
      return h("a", {
        "attrs": {
          "href": props.thumbLink
        },
        "class": bem$16('thumb'),
        "on": {
          "click": onThumbClick
        }
      }, [slots.thumb ? slots.thumb() : h(Image$1, {
        "attrs": {
          "src": thumb,
          "width": "100%",
          "height": "100%",
          "fit": "cover",
          "lazy-load": props.lazyLoad
        }
      }), ThumbTag()]);
    }
  }
  function Title() {
    if (slots.title) {
      return slots.title();
    }
    if (props.title) {
      return h("div", {
        "class": [bem$16('title'), 'van-multi-ellipsis--l2']
      }, [props.title]);
    }
  }
  function Desc() {
    if (slots.desc) {
      return slots.desc();
    }
    if (props.desc) {
      return h("div", {
        "class": [bem$16('desc'), 'van-ellipsis']
      }, [props.desc]);
    }
  }
  function PriceContent() {
    var priceArr = props.price.toString().split('.');
    return h("div", [h("span", {
      "class": bem$16('price-currency')
    }, [props.currency]), h("span", {
      "class": bem$16('price-integer')
    }, [priceArr[0]]), ".", h("span", {
      "class": bem$16('price-decimal')
    }, [priceArr[1]])]);
  }
  function Price() {
    if (showPrice) {
      return h("div", {
        "class": bem$16('price')
      }, [slots.price ? slots.price() : PriceContent()]);
    }
  }
  function OriginPrice() {
    if (showOriginPrice) {
      var slot = slots['origin-price'];
      return h("div", {
        "class": bem$16('origin-price')
      }, [slot ? slot() : props.currency + " " + props.originPrice]);
    }
  }
  function Num() {
    if (showNum) {
      return h("div", {
        "class": bem$16('num')
      }, [slots.num ? slots.num() : "x" + props.num]);
    }
  }
  function Footer() {
    if (slots.footer) {
      return h("div", {
        "class": bem$16('footer')
      }, [slots.footer()]);
    }
  }
  return h("div", _mergeJSXProps([{
    "class": bem$16()
  }, inherit(ctx, true)]), [h("div", {
    "class": bem$16('header')
  }, [Thumb(), h("div", {
    "class": bem$16('content', {
      centered: props.centered
    })
  }, [h("div", [Title(), Desc(), slots.tags == null ? void 0 : slots.tags()]), showBottom && h("div", {
    "class": "van-card__bottom"
  }, [(_slots$priceTop = slots['price-top']) == null ? void 0 : _slots$priceTop.call(slots), Price(), OriginPrice(), Num(), slots.bottom == null ? void 0 : slots.bottom()])])]), Footer()]);
}
Card.props = {
  tag: String,
  desc: String,
  thumb: String,
  title: String,
  centered: Boolean,
  lazyLoad: Boolean,
  thumbLink: String,
  num: [Number, String],
  price: [Number, String],
  originPrice: [Number, String],
  currency: {
    type: String,
    default: '¥'
  }
};
var Card$1 = createComponent$1d(Card);

var _createNamespace$18 = createNamespace('tab'),
  createComponent$1c = _createNamespace$18[0],
  bem$15 = _createNamespace$18[1];
var Tab = createComponent$1c({
  mixins: [ChildrenMixin('vanTabs')],
  props: _extends$2({}, routeProps, {
    dot: Boolean,
    name: [Number, String],
    // @deprecated
    info: [Number, String],
    badge: [Number, String],
    title: String,
    titleStyle: null,
    titleClass: null,
    disabled: Boolean
  }),
  data: function data() {
    return {
      inited: false
    };
  },
  computed: {
    computedName: function computedName() {
      var _this$name;
      return (_this$name = this.name) != null ? _this$name : this.index;
    },
    isActive: function isActive() {
      var active = this.computedName === this.parent.currentName;
      if (active) {
        this.inited = true;
      }
      return active;
    }
  },
  watch: {
    title: function title() {
      this.parent.setLine();
      this.parent.scrollIntoView();
    },
    inited: function inited(val) {
      var _this = this;
      if (this.parent.lazyRender && val) {
        this.$nextTick(function () {
          _this.parent.$emit('rendered', _this.computedName, _this.title);
        });
      }
    }
  },
  render: function render(h) {
    var slots = this.slots,
      parent = this.parent,
      isActive = this.isActive;
    var slotContent = slots();
    if (!slotContent && !parent.animated) {
      return;
    }
    var show = parent.scrollspy || isActive;
    var shouldRender = this.inited || parent.scrollspy || !parent.lazyRender;
    var Content = shouldRender ? slotContent : h();
    if (parent.animated) {
      return h("div", {
        "attrs": {
          "role": "tabpanel",
          "aria-hidden": !isActive
        },
        "class": bem$15('pane-wrapper', {
          inactive: !isActive
        })
      }, [h("div", {
        "class": bem$15('pane')
      }, [Content])]);
    }
    return h("div", {
      "directives": [{
        name: "show",
        value: show
      }],
      "attrs": {
        "role": "tabpanel"
      },
      "class": bem$15('pane')
    }, [Content]);
  }
});

function scrollLeftTo(scroller, to, duration) {
  var count = 0;
  var from = scroller.scrollLeft;
  var frames = duration === 0 ? 1 : Math.round(duration * 1000 / 16);
  function animate() {
    scroller.scrollLeft += (to - from) / frames;
    if (++count < frames) {
      raf(animate);
    }
  }
  animate();
}
function scrollTopTo(scroller, to, duration, callback) {
  var current = getScrollTop(scroller);
  var isDown = current < to;
  var frames = duration === 0 ? 1 : Math.round(duration * 1000 / 16);
  var step = (to - current) / frames;
  function animate() {
    current += step;
    if (isDown && current > to || !isDown && current < to) {
      current = to;
    }
    setScrollTop(scroller, current);
    if (isDown && current < to || !isDown && current > to) {
      raf(animate);
    } else if (callback) {
      raf(callback);
    }
  }
  animate();
}

function isHidden(el) {
  var style = window.getComputedStyle(el);
  var hidden = style.display === 'none'; // offsetParent returns null in the following situations:
  // 1. The element or its parent element has the display property set to none.
  // 2. The element has the position property set to fixed

  var parentHidden = el.offsetParent === null && style.position !== 'fixed';
  return hidden || parentHidden;
}

function callInterceptor(options) {
  var interceptor = options.interceptor,
    args = options.args,
    done = options.done;
  if (interceptor) {
    var returnVal = interceptor.apply(void 0, args);
    if (isPromise$2(returnVal)) {
      returnVal.then(function (value) {
        if (value) {
          done();
        }
      }).catch(noop$5);
    } else if (returnVal) {
      done();
    }
  } else {
    done();
  }
}

var _createNamespace$17 = createNamespace('tab'),
  createComponent$1b = _createNamespace$17[0],
  bem$14 = _createNamespace$17[1];
var Title = createComponent$1b({
  props: {
    dot: Boolean,
    type: String,
    info: [Number, String],
    color: String,
    title: String,
    isActive: Boolean,
    disabled: Boolean,
    scrollable: Boolean,
    activeColor: String,
    inactiveColor: String
  },
  computed: {
    style: function style() {
      var style = {};
      var color = this.color,
        isActive = this.isActive;
      var isCard = this.type === 'card'; // card theme color

      if (color && isCard) {
        style.borderColor = color;
        if (!this.disabled) {
          if (isActive) {
            style.backgroundColor = color;
          } else {
            style.color = color;
          }
        }
      }
      var titleColor = isActive ? this.activeColor : this.inactiveColor;
      if (titleColor) {
        style.color = titleColor;
      }
      return style;
    }
  },
  methods: {
    onClick: function onClick() {
      this.$emit('click');
    },
    genText: function genText() {
      var h = this.$createElement;
      var Text = h("span", {
        "class": bem$14('text', {
          ellipsis: !this.scrollable
        })
      }, [this.slots() || this.title]);
      if (this.dot || isDef(this.info) && this.info !== '') {
        return h("span", {
          "class": bem$14('text-wrapper')
        }, [Text, h(Info$1, {
          "attrs": {
            "dot": this.dot,
            "info": this.info
          }
        })]);
      }
      return Text;
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "attrs": {
        "role": "tab",
        "aria-selected": this.isActive
      },
      "class": [bem$14({
        active: this.isActive,
        disabled: this.disabled
      })],
      "style": this.style,
      "on": {
        "click": this.onClick
      }
    }, [this.genText()]);
  }
});

var _createNamespace$16 = createNamespace('sticky'),
  createComponent$1a = _createNamespace$16[0],
  bem$13 = _createNamespace$16[1];
var Sticky = createComponent$1a({
  mixins: [BindEventMixin(function (bind, isBind) {
    if (!this.scroller) {
      this.scroller = getScroller(this.$el);
    }
    if (this.observer) {
      var method = isBind ? 'observe' : 'unobserve';
      this.observer[method](this.$el);
    }
    bind(this.scroller, 'scroll', this.onScroll, true);
    this.onScroll();
  })],
  props: {
    zIndex: [Number, String],
    container: null,
    offsetTop: {
      type: [Number, String],
      default: 0
    }
  },
  data: function data() {
    return {
      fixed: false,
      height: 0,
      transform: 0
    };
  },
  computed: {
    offsetTopPx: function offsetTopPx() {
      return unitToPx(this.offsetTop);
    },
    style: function style() {
      if (!this.fixed) {
        return;
      }
      var style = {};
      if (isDef(this.zIndex)) {
        style.zIndex = this.zIndex;
      }
      if (this.offsetTopPx && this.fixed) {
        style.top = this.offsetTopPx + "px";
      }
      if (this.transform) {
        style.transform = "translate3d(0, " + this.transform + "px, 0)";
      }
      return style;
    }
  },
  watch: {
    fixed: function fixed(isFixed) {
      this.$emit('change', isFixed);
    }
  },
  created: function created() {
    var _this = this;

    // compatibility: https://caniuse.com/#feat=intersectionobserver
    if (!isServer$1 && window.IntersectionObserver) {
      this.observer = new IntersectionObserver(function (entries) {
        // trigger scroll when visibility changed
        if (entries[0].intersectionRatio > 0) {
          _this.onScroll();
        }
      }, {
        root: document.body
      });
    }
  },
  methods: {
    onScroll: function onScroll() {
      var _this2 = this;
      if (isHidden(this.$el)) {
        return;
      }
      this.height = this.$el.offsetHeight;
      var container = this.container,
        offsetTopPx = this.offsetTopPx;
      var scrollTop = getScrollTop(window);
      var topToPageTop = getElementTop(this.$el);
      var emitScrollEvent = function emitScrollEvent() {
        _this2.$emit('scroll', {
          scrollTop: scrollTop,
          isFixed: _this2.fixed
        });
      }; // The sticky component should be kept inside the container element

      if (container) {
        var bottomToPageTop = topToPageTop + container.offsetHeight;
        if (scrollTop + offsetTopPx + this.height > bottomToPageTop) {
          var distanceToBottom = this.height + scrollTop - bottomToPageTop;
          if (distanceToBottom < this.height) {
            this.fixed = true;
            this.transform = -(distanceToBottom + offsetTopPx);
          } else {
            this.fixed = false;
          }
          emitScrollEvent();
          return;
        }
      }
      if (scrollTop + offsetTopPx > topToPageTop) {
        this.fixed = true;
        this.transform = 0;
      } else {
        this.fixed = false;
      }
      emitScrollEvent();
    }
  },
  render: function render() {
    var h = arguments[0];
    var fixed = this.fixed;
    var style = {
      height: fixed ? this.height + "px" : null
    };
    return h("div", {
      "style": style
    }, [h("div", {
      "class": bem$13({
        fixed: fixed
      }),
      "style": this.style
    }, [this.slots()])]);
  }
});

var _createNamespace$15 = createNamespace('tabs'),
  createComponent$19 = _createNamespace$15[0],
  bem$12 = _createNamespace$15[1];
var MIN_SWIPE_DISTANCE = 50;
var Content = createComponent$19({
  mixins: [TouchMixin],
  props: {
    count: Number,
    duration: [Number, String],
    animated: Boolean,
    swipeable: Boolean,
    currentIndex: Number
  },
  computed: {
    style: function style() {
      if (this.animated) {
        return {
          transform: "translate3d(" + -1 * this.currentIndex * 100 + "%, 0, 0)",
          transitionDuration: this.duration + "s"
        };
      }
    },
    listeners: function listeners() {
      if (this.swipeable) {
        return {
          touchstart: this.touchStart,
          touchmove: this.touchMove,
          touchend: this.onTouchEnd,
          touchcancel: this.onTouchEnd
        };
      }
    }
  },
  methods: {
    // watch swipe touch end
    onTouchEnd: function onTouchEnd() {
      var direction = this.direction,
        deltaX = this.deltaX,
        currentIndex = this.currentIndex;
      /* istanbul ignore else */

      if (direction === 'horizontal' && this.offsetX >= MIN_SWIPE_DISTANCE) {
        /* istanbul ignore else */
        if (deltaX > 0 && currentIndex !== 0) {
          this.$emit('change', currentIndex - 1);
        } else if (deltaX < 0 && currentIndex !== this.count - 1) {
          this.$emit('change', currentIndex + 1);
        }
      }
    },
    genChildren: function genChildren() {
      var h = this.$createElement;
      if (this.animated) {
        return h("div", {
          "class": bem$12('track'),
          "style": this.style
        }, [this.slots()]);
      }
      return this.slots();
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$12('content', {
        animated: this.animated
      }),
      "on": _extends$2({}, this.listeners)
    }, [this.genChildren()]);
  }
});

// Utils
var _createNamespace$14 = createNamespace('tabs'),
  createComponent$18 = _createNamespace$14[0],
  bem$11 = _createNamespace$14[1];
var Tabs = createComponent$18({
  mixins: [ParentMixin('vanTabs'), BindEventMixin(function (bind) {
    if (!this.scroller) {
      this.scroller = getScroller(this.$el);
    }
    bind(window, 'resize', this.resize, true);
    if (this.scrollspy) {
      bind(this.scroller, 'scroll', this.onScroll, true);
    }
  })],
  inject: {
    vanPopup: {
      default: null
    }
  },
  model: {
    prop: 'active'
  },
  props: {
    color: String,
    border: Boolean,
    sticky: Boolean,
    animated: Boolean,
    swipeable: Boolean,
    scrollspy: Boolean,
    background: String,
    lineWidth: [Number, String],
    lineHeight: [Number, String],
    beforeChange: Function,
    titleActiveColor: String,
    titleInactiveColor: String,
    type: {
      type: String,
      default: 'line'
    },
    active: {
      type: [Number, String],
      default: 0
    },
    ellipsis: {
      type: Boolean,
      default: true
    },
    duration: {
      type: [Number, String],
      default: 0.3
    },
    offsetTop: {
      type: [Number, String],
      default: 0
    },
    lazyRender: {
      type: Boolean,
      default: true
    },
    swipeThreshold: {
      type: [Number, String],
      default: 5
    }
  },
  data: function data() {
    return {
      position: '',
      currentIndex: null,
      lineStyle: {
        backgroundColor: this.color
      }
    };
  },
  computed: {
    // whether the nav is scrollable
    scrollable: function scrollable() {
      return this.children.length > this.swipeThreshold || !this.ellipsis;
    },
    navStyle: function navStyle() {
      return {
        borderColor: this.color,
        background: this.background
      };
    },
    currentName: function currentName() {
      var activeTab = this.children[this.currentIndex];
      if (activeTab) {
        return activeTab.computedName;
      }
    },
    offsetTopPx: function offsetTopPx() {
      return unitToPx(this.offsetTop);
    },
    scrollOffset: function scrollOffset() {
      if (this.sticky) {
        return this.offsetTopPx + this.tabHeight;
      }
      return 0;
    }
  },
  watch: {
    color: 'setLine',
    active: function active(name) {
      if (name !== this.currentName) {
        this.setCurrentIndexByName(name);
      }
    },
    children: function children() {
      var _this = this;
      this.setCurrentIndexByName(this.active);
      this.setLine();
      this.$nextTick(function () {
        _this.scrollIntoView(true);
      });
    },
    currentIndex: function currentIndex() {
      this.scrollIntoView();
      this.setLine(); // scroll to correct position

      if (this.stickyFixed && !this.scrollspy) {
        setRootScrollTop(Math.ceil(getElementTop(this.$el) - this.offsetTopPx));
      }
    },
    scrollspy: function scrollspy(val) {
      if (val) {
        on$2(this.scroller, 'scroll', this.onScroll, true);
      } else {
        off$2(this.scroller, 'scroll', this.onScroll);
      }
    }
  },
  mounted: function mounted() {
    var _this2 = this;
    this.init(); // https://github.com/vant-ui/vant/issues/7959

    if (this.vanPopup) {
      this.vanPopup.onReopen(function () {
        _this2.setLine();
      });
    }
  },
  activated: function activated() {
    this.init();
    this.setLine();
  },
  methods: {
    // @exposed-api
    resize: function resize() {
      this.setLine();
    },
    init: function init() {
      var _this3 = this;
      this.$nextTick(function () {
        _this3.inited = true;
        _this3.tabHeight = getVisibleHeight(_this3.$refs.wrap);
        _this3.scrollIntoView(true);
      });
    },
    // update nav bar style
    setLine: function setLine() {
      var _this4 = this;
      var shouldAnimate = this.inited;
      this.$nextTick(function () {
        var titles = _this4.$refs.titles;
        if (!titles || !titles[_this4.currentIndex] || _this4.type !== 'line' || isHidden(_this4.$el)) {
          return;
        }
        var title = titles[_this4.currentIndex].$el;
        var lineWidth = _this4.lineWidth,
          lineHeight = _this4.lineHeight;
        var left = title.offsetLeft + title.offsetWidth / 2;
        var lineStyle = {
          width: addUnit(lineWidth),
          backgroundColor: _this4.color,
          transform: "translateX(" + left + "px) translateX(-50%)"
        };
        if (shouldAnimate) {
          lineStyle.transitionDuration = _this4.duration + "s";
        }
        if (isDef(lineHeight)) {
          var height = addUnit(lineHeight);
          lineStyle.height = height;
          lineStyle.borderRadius = height;
        }
        _this4.lineStyle = lineStyle;
      });
    },
    // correct the index of active tab
    setCurrentIndexByName: function setCurrentIndexByName(name) {
      var matched = this.children.filter(function (tab) {
        return tab.computedName === name;
      });
      var defaultIndex = (this.children[0] || {}).index || 0;
      this.setCurrentIndex(matched.length ? matched[0].index : defaultIndex);
    },
    setCurrentIndex: function setCurrentIndex(currentIndex) {
      var newIndex = this.findAvailableTab(currentIndex);
      if (!isDef(newIndex)) {
        return;
      }
      var newTab = this.children[newIndex];
      var newName = newTab.computedName;
      var shouldEmitChange = this.currentIndex !== null;
      this.currentIndex = newIndex;
      if (newName !== this.active) {
        this.$emit('input', newName);
        if (shouldEmitChange) {
          this.$emit('change', newName, newTab.title);
        }
      }
    },
    findAvailableTab: function findAvailableTab(index) {
      var diff = index < this.currentIndex ? -1 : 1;
      while (index >= 0 && index < this.children.length) {
        if (!this.children[index].disabled) {
          return index;
        }
        index += diff;
      }
    },
    // emit event when clicked
    onClick: function onClick(item, index) {
      var _this5 = this;
      var _this$children$index = this.children[index],
        title = _this$children$index.title,
        disabled = _this$children$index.disabled,
        computedName = _this$children$index.computedName;
      if (disabled) {
        this.$emit('disabled', computedName, title);
      } else {
        callInterceptor({
          interceptor: this.beforeChange,
          args: [computedName],
          done: function done() {
            _this5.setCurrentIndex(index);
            _this5.scrollToCurrentContent();
          }
        });
        this.$emit('click', computedName, title);
        route(item.$router, item);
      }
    },
    // scroll active tab into view
    scrollIntoView: function scrollIntoView(immediate) {
      var titles = this.$refs.titles;
      if (!this.scrollable || !titles || !titles[this.currentIndex]) {
        return;
      }
      var nav = this.$refs.nav;
      var title = titles[this.currentIndex].$el;
      var to = title.offsetLeft - (nav.offsetWidth - title.offsetWidth) / 2;
      scrollLeftTo(nav, to, immediate ? 0 : +this.duration);
    },
    onSticktScroll: function onSticktScroll(params) {
      this.stickyFixed = params.isFixed;
      this.$emit('scroll', params);
    },
    // @exposed-api
    scrollTo: function scrollTo(name) {
      var _this6 = this;
      this.$nextTick(function () {
        _this6.setCurrentIndexByName(name);
        _this6.scrollToCurrentContent(true);
      });
    },
    scrollToCurrentContent: function scrollToCurrentContent(immediate) {
      var _this7 = this;
      if (immediate === void 0) {
        immediate = false;
      }
      if (this.scrollspy) {
        var target = this.children[this.currentIndex];
        var el = target == null ? void 0 : target.$el;
        if (el) {
          var to = getElementTop(el, this.scroller) - this.scrollOffset;
          this.lockScroll = true;
          scrollTopTo(this.scroller, to, immediate ? 0 : +this.duration, function () {
            _this7.lockScroll = false;
          });
        }
      }
    },
    onScroll: function onScroll() {
      if (this.scrollspy && !this.lockScroll) {
        var index = this.getCurrentIndexOnScroll();
        this.setCurrentIndex(index);
      }
    },
    getCurrentIndexOnScroll: function getCurrentIndexOnScroll() {
      var children = this.children;
      for (var index = 0; index < children.length; index++) {
        var top = getVisibleTop(children[index].$el);
        if (top > this.scrollOffset) {
          return index === 0 ? 0 : index - 1;
        }
      }
      return children.length - 1;
    }
  },
  render: function render() {
    var _this8 = this,
      _ref;
    var h = arguments[0];
    var type = this.type,
      animated = this.animated,
      scrollable = this.scrollable;
    var Nav = this.children.map(function (item, index) {
      var _item$badge;
      return h(Title, {
        "ref": "titles",
        "refInFor": true,
        "attrs": {
          "type": type,
          "dot": item.dot,
          "info": (_item$badge = item.badge) != null ? _item$badge : item.info,
          "title": item.title,
          "color": _this8.color,
          "isActive": index === _this8.currentIndex,
          "disabled": item.disabled,
          "scrollable": scrollable,
          "activeColor": _this8.titleActiveColor,
          "inactiveColor": _this8.titleInactiveColor
        },
        "style": item.titleStyle,
        "class": item.titleClass,
        "scopedSlots": {
          default: function _default() {
            return item.slots('title');
          }
        },
        "on": {
          "click": function click() {
            _this8.onClick(item, index);
          }
        }
      });
    });
    var Wrap = h("div", {
      "ref": "wrap",
      "class": [bem$11('wrap', {
        scrollable: scrollable
      }), (_ref = {}, _ref[BORDER_TOP_BOTTOM] = type === 'line' && this.border, _ref)]
    }, [h("div", {
      "ref": "nav",
      "attrs": {
        "role": "tablist"
      },
      "class": bem$11('nav', [type, {
        complete: this.scrollable
      }]),
      "style": this.navStyle
    }, [this.slots('nav-left'), Nav, type === 'line' && h("div", {
      "class": bem$11('line'),
      "style": this.lineStyle
    }), this.slots('nav-right')])]);
    return h("div", {
      "class": bem$11([type])
    }, [this.sticky ? h(Sticky, {
      "attrs": {
        "container": this.$el,
        "offsetTop": this.offsetTop
      },
      "on": {
        "scroll": this.onSticktScroll
      }
    }, [Wrap]) : Wrap, h(Content, {
      "attrs": {
        "count": this.children.length,
        "animated": animated,
        "duration": this.duration,
        "swipeable": this.swipeable,
        "currentIndex": this.currentIndex
      },
      "on": {
        "change": this.setCurrentIndex
      }
    }, [this.slots()])]);
  }
});

var _createNamespace$13 = createNamespace('cascader'),
  createComponent$17 = _createNamespace$13[0],
  bem$10 = _createNamespace$13[1],
  t$l = _createNamespace$13[2];
var Cascader = createComponent$17({
  props: {
    title: String,
    value: [Number, String],
    fieldNames: Object,
    placeholder: String,
    activeColor: String,
    options: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    closeable: {
      type: Boolean,
      default: true
    },
    showHeader: {
      type: Boolean,
      default: true
    }
  },
  data: function data() {
    return {
      tabs: [],
      activeTab: 0
    };
  },
  computed: {
    textKey: function textKey() {
      var _this$fieldNames;
      return ((_this$fieldNames = this.fieldNames) == null ? void 0 : _this$fieldNames.text) || 'text';
    },
    valueKey: function valueKey() {
      var _this$fieldNames2;
      return ((_this$fieldNames2 = this.fieldNames) == null ? void 0 : _this$fieldNames2.value) || 'value';
    },
    childrenKey: function childrenKey() {
      var _this$fieldNames3;
      return ((_this$fieldNames3 = this.fieldNames) == null ? void 0 : _this$fieldNames3.children) || 'children';
    }
  },
  watch: {
    options: {
      deep: true,
      handler: 'updateTabs'
    },
    value: function value(_value) {
      var _this = this;
      if (_value || _value === 0) {
        var values = this.tabs.map(function (tab) {
          var _tab$selectedOption;
          return (_tab$selectedOption = tab.selectedOption) == null ? void 0 : _tab$selectedOption[_this.valueKey];
        });
        if (values.indexOf(_value) !== -1) {
          return;
        }
      }
      this.updateTabs();
    }
  },
  created: function created() {
    this.updateTabs();
  },
  methods: {
    getSelectedOptionsByValue: function getSelectedOptionsByValue(options, value) {
      for (var i = 0; i < options.length; i++) {
        var option = options[i];
        if (option[this.valueKey] === value) {
          return [option];
        }
        if (option[this.childrenKey]) {
          var selectedOptions = this.getSelectedOptionsByValue(option[this.childrenKey], value);
          if (selectedOptions) {
            return [option].concat(selectedOptions);
          }
        }
      }
    },
    updateTabs: function updateTabs() {
      var _this2 = this;
      if (this.value || this.value === 0) {
        var selectedOptions = this.getSelectedOptionsByValue(this.options, this.value);
        if (selectedOptions) {
          var optionsCursor = this.options;
          this.tabs = selectedOptions.map(function (option) {
            var tab = {
              options: optionsCursor,
              selectedOption: option
            };
            var next = optionsCursor.filter(function (item) {
              return item[_this2.valueKey] === option[_this2.valueKey];
            });
            if (next.length) {
              optionsCursor = next[0][_this2.childrenKey];
            }
            return tab;
          });
          if (optionsCursor) {
            this.tabs.push({
              options: optionsCursor,
              selectedOption: null
            });
          }
          this.$nextTick(function () {
            _this2.activeTab = _this2.tabs.length - 1;
          });
          return;
        }
      }
      this.tabs = [{
        options: this.options,
        selectedOption: null
      }];
    },
    onSelect: function onSelect(option, tabIndex) {
      var _this3 = this;
      this.tabs[tabIndex].selectedOption = option;
      if (this.tabs.length > tabIndex + 1) {
        this.tabs = this.tabs.slice(0, tabIndex + 1);
      }
      if (option[this.childrenKey]) {
        var nextTab = {
          options: option[this.childrenKey],
          selectedOption: null
        };
        if (this.tabs[tabIndex + 1]) {
          this.$set(this.tabs, tabIndex + 1, nextTab);
        } else {
          this.tabs.push(nextTab);
        }
        this.$nextTick(function () {
          _this3.activeTab++;
        });
      }
      var selectedOptions = this.tabs.map(function (tab) {
        return tab.selectedOption;
      }).filter(function (item) {
        return !!item;
      });
      var eventParams = {
        value: option[this.valueKey],
        tabIndex: tabIndex,
        selectedOptions: selectedOptions
      };
      this.$emit('input', option[this.valueKey]);
      this.$emit('change', eventParams);
      if (!option[this.childrenKey]) {
        this.$emit('finish', eventParams);
      }
    },
    onClose: function onClose() {
      this.$emit('close');
    },
    renderHeader: function renderHeader() {
      var h = this.$createElement;
      if (this.showHeader) {
        return h("div", {
          "class": bem$10('header')
        }, [h("h2", {
          "class": bem$10('title')
        }, [this.slots('title') || this.title]), this.closeable ? h(Icon$3, {
          "attrs": {
            "name": "cross"
          },
          "class": bem$10('close-icon'),
          "on": {
            "click": this.onClose
          }
        }) : null]);
      }
    },
    renderOptions: function renderOptions(options, selectedOption, tabIndex) {
      var _this4 = this;
      var h = this.$createElement;
      var renderOption = function renderOption(option) {
        var isSelected = selectedOption && option[_this4.valueKey] === selectedOption[_this4.valueKey];
        var Text = _this4.slots('option', {
          option: option,
          selected: isSelected
        }) || h("span", [option[_this4.textKey]]);
        return h("li", {
          "class": bem$10('option', {
            selected: isSelected
          }),
          "style": {
            color: isSelected ? _this4.activeColor : null
          },
          "on": {
            "click": function click() {
              _this4.onSelect(option, tabIndex);
            }
          }
        }, [Text, isSelected ? h(Icon$3, {
          "attrs": {
            "name": "success"
          },
          "class": bem$10('selected-icon')
        }) : null]);
      };
      return h("ul", {
        "class": bem$10('options')
      }, [options.map(renderOption)]);
    },
    renderTab: function renderTab(item, tabIndex) {
      var h = this.$createElement;
      var options = item.options,
        selectedOption = item.selectedOption;
      var title = selectedOption ? selectedOption[this.textKey] : this.placeholder || t$l('select');
      return h(Tab, {
        "attrs": {
          "title": title,
          "titleClass": bem$10('tab', {
            unselected: !selectedOption
          })
        }
      }, [this.renderOptions(options, selectedOption, tabIndex)]);
    },
    renderTabs: function renderTabs() {
      var _this5 = this;
      var h = this.$createElement;
      return h(Tabs, {
        "attrs": {
          "animated": true,
          "swipeable": true,
          "swipeThreshold": 0,
          "color": this.activeColor
        },
        "class": bem$10('tabs'),
        "model": {
          value: _this5.activeTab,
          callback: function callback($$v) {
            _this5.activeTab = $$v;
          }
        }
      }, [this.tabs.map(this.renderTab)]);
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$10()
    }, [this.renderHeader(), this.renderTabs()]);
  }
});

var _createNamespace$12 = createNamespace('cell-group'),
  createComponent$16 = _createNamespace$12[0],
  bem$$ = _createNamespace$12[1];
function CellGroup(h, props, slots, ctx) {
  var _ref;
  var Group = h("div", _mergeJSXProps([{
    "class": [bem$$({
      inset: props.inset
    }), (_ref = {}, _ref[BORDER_TOP_BOTTOM] = props.border, _ref)]
  }, inherit(ctx, true)]), [slots.default == null ? void 0 : slots.default()]);
  if (props.title || slots.title) {
    return h("div", {
      "key": ctx.data.key
    }, [h("div", {
      "class": bem$$('title', {
        inset: props.inset
      })
    }, [slots.title ? slots.title() : props.title]), Group]);
  }
  return Group;
}
CellGroup.props = {
  title: String,
  inset: Boolean,
  border: {
    type: Boolean,
    default: true
  }
};
var CellGroup$1 = createComponent$16(CellGroup);

var _createNamespace$11 = createNamespace('checkbox'),
  createComponent$15 = _createNamespace$11[0],
  bem$_ = _createNamespace$11[1];
var Checkbox = createComponent$15({
  mixins: [CheckboxMixin({
    bem: bem$_,
    role: 'checkbox',
    parent: 'vanCheckbox'
  })],
  computed: {
    checked: {
      get: function get() {
        if (this.parent) {
          return this.parent.value.indexOf(this.name) !== -1;
        }
        return this.value;
      },
      set: function set(val) {
        if (this.parent) {
          this.setParentValue(val);
        } else {
          this.$emit('input', val);
        }
      }
    }
  },
  watch: {
    value: function value(val) {
      this.$emit('change', val);
    }
  },
  methods: {
    // @exposed-api
    toggle: function toggle(checked) {
      var _this = this;
      if (checked === void 0) {
        checked = !this.checked;
      }

      // When toggle method is called multiple times at the same time,
      // only the last call is valid.
      // This is a hack for usage inside Cell.
      clearTimeout(this.toggleTask);
      this.toggleTask = setTimeout(function () {
        _this.checked = checked;
      });
    },
    setParentValue: function setParentValue(val) {
      var parent = this.parent;
      var value = parent.value.slice();
      if (val) {
        if (parent.max && value.length >= parent.max) {
          return;
        }
        /* istanbul ignore else */

        if (value.indexOf(this.name) === -1) {
          value.push(this.name);
          parent.$emit('input', value);
        }
      } else {
        var index = value.indexOf(this.name);
        /* istanbul ignore else */

        if (index !== -1) {
          value.splice(index, 1);
          parent.$emit('input', value);
        }
      }
    }
  }
});

var _createNamespace$10 = createNamespace('checkbox-group'),
  createComponent$14 = _createNamespace$10[0],
  bem$Z = _createNamespace$10[1];
var CheckboxGroup = createComponent$14({
  mixins: [ParentMixin('vanCheckbox'), FieldMixin],
  props: {
    max: [Number, String],
    disabled: Boolean,
    direction: String,
    iconSize: [Number, String],
    checkedColor: String,
    value: {
      type: Array,
      default: function _default() {
        return [];
      }
    }
  },
  watch: {
    value: function value(val) {
      this.$emit('change', val);
    }
  },
  methods: {
    // @exposed-api
    toggleAll: function toggleAll(options) {
      if (options === void 0) {
        options = {};
      }
      if (typeof options === 'boolean') {
        options = {
          checked: options
        };
      }
      var _options = options,
        checked = _options.checked,
        skipDisabled = _options.skipDisabled;
      var children = this.children.filter(function (item) {
        if (item.disabled && skipDisabled) {
          return item.checked;
        }
        return checked != null ? checked : !item.checked;
      });
      var names = children.map(function (item) {
        return item.name;
      });
      this.$emit('input', names);
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$Z([this.direction])
    }, [this.slots()]);
  }
});

var _createNamespace$$ = createNamespace('circle'),
  createComponent$13 = _createNamespace$$[0],
  bem$Y = _createNamespace$$[1];
var PERIMETER = 3140;
var uid = 0;
function format$3(rate) {
  return Math.min(Math.max(rate, 0), 100);
}
function getPath(clockwise, viewBoxSize) {
  var sweepFlag = clockwise ? 1 : 0;
  return "M " + viewBoxSize / 2 + " " + viewBoxSize / 2 + " m 0, -500 a 500, 500 0 1, " + sweepFlag + " 0, 1000 a 500, 500 0 1, " + sweepFlag + " 0, -1000";
}
var Circle = createComponent$13({
  props: {
    text: String,
    size: [Number, String],
    color: [String, Object],
    layerColor: String,
    strokeLinecap: String,
    value: {
      type: Number,
      default: 0
    },
    speed: {
      type: [Number, String],
      default: 0
    },
    fill: {
      type: String,
      default: 'none'
    },
    rate: {
      type: [Number, String],
      default: 100
    },
    strokeWidth: {
      type: [Number, String],
      default: 40
    },
    clockwise: {
      type: Boolean,
      default: true
    }
  },
  beforeCreate: function beforeCreate() {
    this.uid = "van-circle-gradient-" + uid++;
  },
  computed: {
    style: function style() {
      var size = addUnit(this.size);
      return {
        width: size,
        height: size
      };
    },
    path: function path() {
      return getPath(this.clockwise, this.viewBoxSize);
    },
    viewBoxSize: function viewBoxSize() {
      return +this.strokeWidth + 1000;
    },
    layerStyle: function layerStyle() {
      return {
        fill: "" + this.fill,
        stroke: "" + this.layerColor,
        strokeWidth: this.strokeWidth + "px"
      };
    },
    hoverStyle: function hoverStyle() {
      var offset = PERIMETER * this.value / 100;
      return {
        stroke: "" + (this.gradient ? "url(#" + this.uid + ")" : this.color),
        strokeWidth: +this.strokeWidth + 1 + "px",
        strokeLinecap: this.strokeLinecap,
        strokeDasharray: offset + "px " + PERIMETER + "px"
      };
    },
    gradient: function gradient() {
      return isObject$2(this.color);
    },
    LinearGradient: function LinearGradient() {
      var _this = this;
      var h = this.$createElement;
      if (!this.gradient) {
        return;
      }
      var Stops = Object.keys(this.color).sort(function (a, b) {
        return parseFloat(a) - parseFloat(b);
      }).map(function (key, index) {
        return h("stop", {
          "key": index,
          "attrs": {
            "offset": key,
            "stop-color": _this.color[key]
          }
        });
      });
      return h("defs", [h("linearGradient", {
        "attrs": {
          "id": this.uid,
          "x1": "100%",
          "y1": "0%",
          "x2": "0%",
          "y2": "0%"
        }
      }, [Stops])]);
    }
  },
  watch: {
    rate: {
      handler: function handler(rate) {
        this.startTime = Date.now();
        this.startRate = this.value;
        this.endRate = format$3(rate);
        this.increase = this.endRate > this.startRate;
        this.duration = Math.abs((this.startRate - this.endRate) * 1000 / this.speed);
        if (this.speed) {
          cancelRaf(this.rafId);
          this.rafId = raf(this.animate);
        } else {
          this.$emit('input', this.endRate);
        }
      },
      immediate: true
    }
  },
  methods: {
    animate: function animate() {
      var now = Date.now();
      var progress = Math.min((now - this.startTime) / this.duration, 1);
      var rate = progress * (this.endRate - this.startRate) + this.startRate;
      this.$emit('input', format$3(parseFloat(rate.toFixed(1))));
      if (this.increase ? rate < this.endRate : rate > this.endRate) {
        this.rafId = raf(this.animate);
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$Y(),
      "style": this.style
    }, [h("svg", {
      "attrs": {
        "viewBox": "0 0 " + this.viewBoxSize + " " + this.viewBoxSize
      }
    }, [this.LinearGradient, h("path", {
      "class": bem$Y('layer'),
      "style": this.layerStyle,
      "attrs": {
        "d": this.path
      }
    }), h("path", {
      "attrs": {
        "d": this.path
      },
      "class": bem$Y('hover'),
      "style": this.hoverStyle
    })]), this.slots() || this.text && h("div", {
      "class": bem$Y('text')
    }, [this.text])]);
  }
});

var _createNamespace$_ = createNamespace('col'),
  createComponent$12 = _createNamespace$_[0],
  bem$X = _createNamespace$_[1];
var Col = createComponent$12({
  mixins: [ChildrenMixin('vanRow')],
  props: {
    span: [Number, String],
    offset: [Number, String],
    tag: {
      type: String,
      default: 'div'
    }
  },
  computed: {
    style: function style() {
      var index = this.index;
      var _ref = this.parent || {},
        spaces = _ref.spaces;
      if (spaces && spaces[index]) {
        var _spaces$index = spaces[index],
          left = _spaces$index.left,
          right = _spaces$index.right;
        return {
          paddingLeft: left ? left + "px" : null,
          paddingRight: right ? right + "px" : null
        };
      }
    }
  },
  methods: {
    onClick: function onClick(event) {
      this.$emit('click', event);
    }
  },
  render: function render() {
    var _bem;
    var h = arguments[0];
    var span = this.span,
      offset = this.offset;
    return h(this.tag, {
      "style": this.style,
      "class": bem$X((_bem = {}, _bem[span] = span, _bem["offset-" + offset] = offset, _bem)),
      "on": {
        "click": this.onClick
      }
    }, [this.slots()]);
  }
});

var _createNamespace$Z = createNamespace('collapse'),
  createComponent$11 = _createNamespace$Z[0],
  bem$W = _createNamespace$Z[1];
var Collapse = createComponent$11({
  mixins: [ParentMixin('vanCollapse')],
  props: {
    accordion: Boolean,
    value: [String, Number, Array],
    border: {
      type: Boolean,
      default: true
    }
  },
  methods: {
    switch: function _switch(name, expanded) {
      if (!this.accordion) {
        name = expanded ? this.value.concat(name) : this.value.filter(function (activeName) {
          return activeName !== name;
        });
      }
      this.$emit('change', name);
      this.$emit('input', name);
    }
  },
  render: function render() {
    var _ref;
    var h = arguments[0];
    return h("div", {
      "class": [bem$W(), (_ref = {}, _ref[BORDER_TOP_BOTTOM] = this.border, _ref)]
    }, [this.slots()]);
  }
});

var _createNamespace$Y = createNamespace('collapse-item'),
  createComponent$10 = _createNamespace$Y[0],
  bem$V = _createNamespace$Y[1];
var CELL_SLOTS = ['title', 'icon', 'right-icon'];
var CollapseItem = createComponent$10({
  mixins: [ChildrenMixin('vanCollapse')],
  props: _extends$2({}, cellProps, {
    name: [Number, String],
    disabled: Boolean,
    lazyRender: {
      type: Boolean,
      default: true
    },
    isLink: {
      type: Boolean,
      default: true
    }
  }),
  data: function data() {
    return {
      show: null,
      inited: null
    };
  },
  computed: {
    currentName: function currentName() {
      var _this$name;
      return (_this$name = this.name) != null ? _this$name : this.index;
    },
    expanded: function expanded() {
      var _this = this;
      if (!this.parent) {
        return null;
      }
      var _this$parent = this.parent,
        value = _this$parent.value,
        accordion = _this$parent.accordion;
      return accordion ? value === this.currentName : value.some(function (name) {
        return name === _this.currentName;
      });
    }
  },
  created: function created() {
    this.show = this.expanded;
    this.inited = this.expanded;
  },
  watch: {
    expanded: function expanded(_expanded, prev) {
      var _this2 = this;
      if (prev === null) {
        return;
      }
      if (_expanded) {
        this.show = true;
        this.inited = true;
      } // Use raf: flick when opened in safari
      // Use nextTick: closing animation failed when set `user-select: none`

      var nextTick = _expanded ? this.$nextTick : raf;
      nextTick(function () {
        var _this2$$refs = _this2.$refs,
          content = _this2$$refs.content,
          wrapper = _this2$$refs.wrapper;
        if (!content || !wrapper) {
          return;
        }
        var offsetHeight = content.offsetHeight;
        if (offsetHeight) {
          var contentHeight = offsetHeight + "px";
          wrapper.style.height = _expanded ? 0 : contentHeight; // use double raf to ensure animation can start

          doubleRaf(function () {
            wrapper.style.height = _expanded ? contentHeight : 0;
          });
        } else {
          _this2.onTransitionEnd();
        }
      });
    }
  },
  methods: {
    onClick: function onClick() {
      if (!this.disabled) {
        this.toggle();
      }
    },
    // @exposed-api
    toggle: function toggle(expanded) {
      if (expanded === void 0) {
        expanded = !this.expanded;
      }
      var parent = this.parent,
        currentName = this.currentName;
      var close = parent.accordion && currentName === parent.value;
      var name = close ? '' : currentName;
      this.parent.switch(name, expanded);
    },
    onTransitionEnd: function onTransitionEnd() {
      if (!this.expanded) {
        this.show = false;
      } else {
        this.$refs.wrapper.style.height = '';
      }
    },
    genTitle: function genTitle() {
      var _this3 = this;
      var h = this.$createElement;
      var border = this.border,
        disabled = this.disabled,
        expanded = this.expanded;
      var titleSlots = CELL_SLOTS.reduce(function (slots, name) {
        if (_this3.slots(name)) {
          slots[name] = function () {
            return _this3.slots(name);
          };
        }
        return slots;
      }, {});
      if (this.slots('value')) {
        titleSlots.default = function () {
          return _this3.slots('value');
        };
      }
      return h(Cell$1, {
        "attrs": {
          "role": "button",
          "tabindex": disabled ? -1 : 0,
          "aria-expanded": String(expanded)
        },
        "class": bem$V('title', {
          disabled: disabled,
          expanded: expanded,
          borderless: !border
        }),
        "on": {
          "click": this.onClick
        },
        "scopedSlots": titleSlots,
        "props": _extends$2({}, this.$props)
      });
    },
    genContent: function genContent() {
      var h = this.$createElement;
      if (this.inited || !this.lazyRender) {
        return h("div", {
          "directives": [{
            name: "show",
            value: this.show
          }],
          "ref": "wrapper",
          "class": bem$V('wrapper'),
          "on": {
            "transitionend": this.onTransitionEnd
          }
        }, [h("div", {
          "ref": "content",
          "class": bem$V('content')
        }, [this.slots()])]);
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": [bem$V({
        border: this.index && this.border
      })]
    }, [this.genTitle(), this.genContent()]);
  }
});

var _createNamespace$X = createNamespace('contact-card'),
  createComponent$$ = _createNamespace$X[0],
  bem$U = _createNamespace$X[1],
  t$k = _createNamespace$X[2];
function ContactCard(h, props, slots, ctx) {
  var type = props.type,
    editable = props.editable;
  function onClick(event) {
    if (editable) {
      emit(ctx, 'click', event);
    }
  }
  function Content() {
    if (type === 'add') {
      return props.addText || t$k('addText');
    }
    return [h("div", [t$k('name') + "\uFF1A" + props.name]), h("div", [t$k('tel') + "\uFF1A" + props.tel])];
  }
  return h(Cell$1, _mergeJSXProps([{
    "attrs": {
      "center": true,
      "border": false,
      "isLink": editable,
      "valueClass": bem$U('value'),
      "icon": type === 'edit' ? 'contact' : 'add-square'
    },
    "class": bem$U([type]),
    "on": {
      "click": onClick
    }
  }, inherit(ctx)]), [Content()]);
}
ContactCard.props = {
  tel: String,
  name: String,
  addText: String,
  editable: {
    type: Boolean,
    default: true
  },
  type: {
    type: String,
    default: 'add'
  }
};
var ContactCard$1 = createComponent$$(ContactCard);

var _createNamespace$W = createNamespace('contact-edit'),
  createComponent$_ = _createNamespace$W[0],
  bem$T = _createNamespace$W[1],
  t$j = _createNamespace$W[2];
var defaultContact = {
  tel: '',
  name: ''
};
var ContactEdit = createComponent$_({
  props: {
    isEdit: Boolean,
    isSaving: Boolean,
    isDeleting: Boolean,
    showSetDefault: Boolean,
    setDefaultLabel: String,
    contactInfo: {
      type: Object,
      default: function _default() {
        return _extends$2({}, defaultContact);
      }
    },
    telValidator: {
      type: Function,
      default: isMobile
    }
  },
  data: function data() {
    return {
      data: _extends$2({}, defaultContact, this.contactInfo),
      errorInfo: {
        name: '',
        tel: ''
      }
    };
  },
  watch: {
    contactInfo: function contactInfo(val) {
      this.data = _extends$2({}, defaultContact, val);
    }
  },
  methods: {
    onFocus: function onFocus(key) {
      this.errorInfo[key] = '';
    },
    getErrorMessageByKey: function getErrorMessageByKey(key) {
      var value = this.data[key].trim();
      switch (key) {
        case 'name':
          return value ? '' : t$j('nameInvalid');
        case 'tel':
          return this.telValidator(value) ? '' : t$j('telInvalid');
      }
    },
    onSave: function onSave() {
      var _this = this;
      var isValid = ['name', 'tel'].every(function (item) {
        var msg = _this.getErrorMessageByKey(item);
        if (msg) {
          _this.errorInfo[item] = msg;
        }
        return !msg;
      });
      if (isValid && !this.isSaving) {
        this.$emit('save', this.data);
      }
    },
    onDelete: function onDelete() {
      var _this2 = this;
      Dialog.confirm({
        title: t$j('confirmDelete')
      }).then(function () {
        _this2.$emit('delete', _this2.data);
      });
    }
  },
  render: function render() {
    var _this3 = this;
    var h = arguments[0];
    var data = this.data,
      errorInfo = this.errorInfo;
    var onFocus = function onFocus(name) {
      return function () {
        return _this3.onFocus(name);
      };
    };
    return h("div", {
      "class": bem$T()
    }, [h("div", {
      "class": bem$T('fields')
    }, [h(Field, {
      "attrs": {
        "clearable": true,
        "maxlength": "30",
        "label": t$j('name'),
        "placeholder": t$j('nameEmpty'),
        "errorMessage": errorInfo.name
      },
      "on": {
        "focus": onFocus('name')
      },
      "model": {
        value: data.name,
        callback: function callback($$v) {
          _this3.$set(data, "name", $$v);
        }
      }
    }), h(Field, {
      "attrs": {
        "clearable": true,
        "type": "tel",
        "label": t$j('tel'),
        "placeholder": t$j('telEmpty'),
        "errorMessage": errorInfo.tel
      },
      "on": {
        "focus": onFocus('tel')
      },
      "model": {
        value: data.tel,
        callback: function callback($$v) {
          _this3.$set(data, "tel", $$v);
        }
      }
    })]), this.showSetDefault && h(Cell$1, {
      "attrs": {
        "title": this.setDefaultLabel,
        "border": false
      },
      "class": bem$T('switch-cell')
    }, [h(Switch, {
      "attrs": {
        "size": 24
      },
      "slot": "right-icon",
      "on": {
        "change": function change(event) {
          _this3.$emit('change-default', event);
        }
      },
      "model": {
        value: data.isDefault,
        callback: function callback($$v) {
          _this3.$set(data, "isDefault", $$v);
        }
      }
    })]), h("div", {
      "class": bem$T('buttons')
    }, [h(Button$2, {
      "attrs": {
        "block": true,
        "round": true,
        "type": "danger",
        "text": t$j('save'),
        "loading": this.isSaving
      },
      "on": {
        "click": this.onSave
      }
    }), this.isEdit && h(Button$2, {
      "attrs": {
        "block": true,
        "round": true,
        "text": t$j('delete'),
        "loading": this.isDeleting
      },
      "on": {
        "click": this.onDelete
      }
    })])]);
  }
});

var _createNamespace$V = createNamespace('contact-list'),
  createComponent$Z = _createNamespace$V[0],
  bem$S = _createNamespace$V[1],
  t$i = _createNamespace$V[2];
function ContactList(h, props, slots, ctx) {
  var List = props.list && props.list.map(function (item, index) {
    function onClick() {
      emit(ctx, 'input', item.id);
      emit(ctx, 'select', item, index);
    }
    function RightIcon() {
      return h(Radio, {
        "attrs": {
          "name": item.id,
          "iconSize": 16,
          "checkedColor": RED
        },
        "on": {
          "click": onClick
        }
      });
    }
    function LeftIcon() {
      return h(Icon$3, {
        "attrs": {
          "name": "edit"
        },
        "class": bem$S('edit'),
        "on": {
          "click": function click(event) {
            event.stopPropagation();
            emit(ctx, 'edit', item, index);
          }
        }
      });
    }
    function Content() {
      var nodes = [item.name + "\uFF0C" + item.tel];
      if (item.isDefault && props.defaultTagText) {
        nodes.push(h(Tag$1, {
          "attrs": {
            "type": "danger",
            "round": true
          },
          "class": bem$S('item-tag')
        }, [props.defaultTagText]));
      }
      return nodes;
    }
    return h(Cell$1, {
      "key": item.id,
      "attrs": {
        "isLink": true,
        "center": true,
        "valueClass": bem$S('item-value')
      },
      "class": bem$S('item'),
      "scopedSlots": {
        icon: LeftIcon,
        default: Content,
        'right-icon': RightIcon
      },
      "on": {
        "click": onClick
      }
    });
  });
  return h("div", _mergeJSXProps([{
    "class": bem$S()
  }, inherit(ctx)]), [h(RadioGroup, {
    "attrs": {
      "value": props.value
    },
    "class": bem$S('group')
  }, [List]), h("div", {
    "class": bem$S('bottom')
  }, [h(Button$2, {
    "attrs": {
      "round": true,
      "block": true,
      "type": "danger",
      "text": props.addText || t$i('addText')
    },
    "class": bem$S('add'),
    "on": {
      "click": function click() {
        emit(ctx, 'add');
      }
    }
  })])]);
}
ContactList.props = {
  value: null,
  list: Array,
  addText: String,
  defaultTagText: String
};
var ContactList$1 = createComponent$Z(ContactList);

var SECOND = 1000;
var MINUTE = 60 * SECOND;
var HOUR = 60 * MINUTE;
var DAY = 24 * HOUR;
function parseTimeData(time) {
  var days = Math.floor(time / DAY);
  var hours = Math.floor(time % DAY / HOUR);
  var minutes = Math.floor(time % HOUR / MINUTE);
  var seconds = Math.floor(time % MINUTE / SECOND);
  var milliseconds = Math.floor(time % SECOND);
  return {
    days: days,
    hours: hours,
    minutes: minutes,
    seconds: seconds,
    milliseconds: milliseconds
  };
}
function parseFormat(format, timeData) {
  var days = timeData.days;
  var hours = timeData.hours,
    minutes = timeData.minutes,
    seconds = timeData.seconds,
    milliseconds = timeData.milliseconds;
  if (format.indexOf('DD') === -1) {
    hours += days * 24;
  } else {
    format = format.replace('DD', padZero(days));
  }
  if (format.indexOf('HH') === -1) {
    minutes += hours * 60;
  } else {
    format = format.replace('HH', padZero(hours));
  }
  if (format.indexOf('mm') === -1) {
    seconds += minutes * 60;
  } else {
    format = format.replace('mm', padZero(minutes));
  }
  if (format.indexOf('ss') === -1) {
    milliseconds += seconds * 1000;
  } else {
    format = format.replace('ss', padZero(seconds));
  }
  if (format.indexOf('S') !== -1) {
    var ms = padZero(milliseconds, 3);
    if (format.indexOf('SSS') !== -1) {
      format = format.replace('SSS', ms);
    } else if (format.indexOf('SS') !== -1) {
      format = format.replace('SS', ms.slice(0, 2));
    } else {
      format = format.replace('S', ms.charAt(0));
    }
  }
  return format;
}
function isSameSecond(time1, time2) {
  return Math.floor(time1 / 1000) === Math.floor(time2 / 1000);
}

var _createNamespace$U = createNamespace('count-down'),
  createComponent$Y = _createNamespace$U[0],
  bem$R = _createNamespace$U[1];
var CountDown = createComponent$Y({
  props: {
    millisecond: Boolean,
    time: {
      type: [Number, String],
      default: 0
    },
    format: {
      type: String,
      default: 'HH:mm:ss'
    },
    autoStart: {
      type: Boolean,
      default: true
    }
  },
  data: function data() {
    return {
      remain: 0
    };
  },
  computed: {
    timeData: function timeData() {
      return parseTimeData(this.remain);
    },
    formattedTime: function formattedTime() {
      return parseFormat(this.format, this.timeData);
    }
  },
  watch: {
    time: {
      immediate: true,
      handler: 'reset'
    }
  },
  activated: function activated() {
    if (this.keepAlivePaused) {
      this.counting = true;
      this.keepAlivePaused = false;
      this.tick();
    }
  },
  deactivated: function deactivated() {
    if (this.counting) {
      this.pause();
      this.keepAlivePaused = true;
    }
  },
  beforeDestroy: function beforeDestroy() {
    this.pause();
  },
  methods: {
    // @exposed-api
    start: function start() {
      if (this.counting) {
        return;
      }
      this.counting = true;
      this.endTime = Date.now() + this.remain;
      this.tick();
    },
    // @exposed-api
    pause: function pause() {
      this.counting = false;
      cancelRaf(this.rafId);
    },
    // @exposed-api
    reset: function reset() {
      this.pause();
      this.remain = +this.time;
      if (this.autoStart) {
        this.start();
      }
    },
    tick: function tick() {
      // should not start counting in server
      // see: https://github.com/vant-ui/vant/issues/7807
      if (!inBrowser$2) {
        return;
      }
      if (this.millisecond) {
        this.microTick();
      } else {
        this.macroTick();
      }
    },
    microTick: function microTick() {
      var _this = this;
      this.rafId = raf(function () {
        /* istanbul ignore if */
        // in case of call reset immediately after finish
        if (!_this.counting) {
          return;
        }
        _this.setRemain(_this.getRemain());
        if (_this.remain > 0) {
          _this.microTick();
        }
      });
    },
    macroTick: function macroTick() {
      var _this2 = this;
      this.rafId = raf(function () {
        /* istanbul ignore if */
        // in case of call reset immediately after finish
        if (!_this2.counting) {
          return;
        }
        var remain = _this2.getRemain();
        if (!isSameSecond(remain, _this2.remain) || remain === 0) {
          _this2.setRemain(remain);
        }
        if (_this2.remain > 0) {
          _this2.macroTick();
        }
      });
    },
    getRemain: function getRemain() {
      return Math.max(this.endTime - Date.now(), 0);
    },
    setRemain: function setRemain(remain) {
      this.remain = remain;
      this.$emit('change', this.timeData);
      if (remain === 0) {
        this.pause();
        this.$emit('finish');
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$R()
    }, [this.slots('default', this.timeData) || this.formattedTime]);
  }
});

var _createNamespace$T = createNamespace('coupon'),
  createComponent$X = _createNamespace$T[0],
  bem$Q = _createNamespace$T[1],
  t$h = _createNamespace$T[2];
function formatTimeStamp(timeStamp) {
  // compatible when the timestamp is seconds
  if (timeStamp < Math.pow(10, 12)) {
    return timeStamp * 1000;
  }
  return +timeStamp;
}
function getDate(timeStamp) {
  var date = new Date(formatTimeStamp(timeStamp));
  return date.getFullYear() + "." + padZero(date.getMonth() + 1) + "." + padZero(date.getDate());
}
function formatDiscount(discount) {
  return (discount / 10).toFixed(discount % 10 === 0 ? 0 : 1);
}
function formatAmount(amount) {
  return (amount / 100).toFixed(amount % 100 === 0 ? 0 : amount % 10 === 0 ? 1 : 2);
}
var Coupon = createComponent$X({
  props: {
    coupon: Object,
    chosen: Boolean,
    disabled: Boolean,
    currency: {
      type: String,
      default: '¥'
    }
  },
  computed: {
    validPeriod: function validPeriod() {
      var _this$coupon = this.coupon,
        startAt = _this$coupon.startAt,
        endAt = _this$coupon.endAt,
        customValidPeriod = _this$coupon.customValidPeriod;
      return customValidPeriod || getDate(startAt) + " - " + getDate(endAt);
    },
    faceAmount: function faceAmount() {
      var coupon = this.coupon;
      if (coupon.valueDesc) {
        return coupon.valueDesc + "<span>" + (coupon.unitDesc || '') + "</span>";
      }
      if (coupon.denominations) {
        var denominations = formatAmount(coupon.denominations);
        return "<span>" + this.currency + "</span> " + denominations;
      }
      if (coupon.discount) {
        return t$h('discount', formatDiscount(coupon.discount));
      }
      return '';
    },
    conditionMessage: function conditionMessage() {
      var condition = formatAmount(this.coupon.originCondition);
      return condition === '0' ? t$h('unlimited') : t$h('condition', condition);
    }
  },
  render: function render() {
    var h = arguments[0];
    var coupon = this.coupon,
      disabled = this.disabled;
    var description = disabled && coupon.reason || coupon.description;
    return h("div", {
      "class": bem$Q({
        disabled: disabled
      })
    }, [h("div", {
      "class": bem$Q('content')
    }, [h("div", {
      "class": bem$Q('head')
    }, [h("h2", {
      "class": bem$Q('amount'),
      "domProps": {
        "innerHTML": this.faceAmount
      }
    }), h("p", {
      "class": bem$Q('condition')
    }, [this.coupon.condition || this.conditionMessage])]), h("div", {
      "class": bem$Q('body')
    }, [h("p", {
      "class": bem$Q('name')
    }, [coupon.name]), h("p", {
      "class": bem$Q('valid')
    }, [this.validPeriod]), !this.disabled && h(Checkbox, {
      "attrs": {
        "size": 18,
        "value": this.chosen,
        "checkedColor": RED
      },
      "class": bem$Q('corner')
    })])]), description && h("p", {
      "class": bem$Q('description')
    }, [description])]);
  }
});

var _createNamespace$S = createNamespace('coupon-cell'),
  createComponent$W = _createNamespace$S[0],
  bem$P = _createNamespace$S[1],
  t$g = _createNamespace$S[2];
function formatValue(props) {
  var coupons = props.coupons,
    chosenCoupon = props.chosenCoupon,
    currency = props.currency;
  var coupon = coupons[+chosenCoupon];
  if (coupon) {
    var value = 0;
    if (isDef(coupon.value)) {
      value = coupon.value;
    } else if (isDef(coupon.denominations)) {
      value = coupon.denominations;
    }
    return "-" + currency + " " + (value / 100).toFixed(2);
  }
  return coupons.length === 0 ? t$g('tips') : t$g('count', coupons.length);
}
function CouponCell(h, props, slots, ctx) {
  var selected = props.coupons[+props.chosenCoupon];
  var value = formatValue(props);
  return h(Cell$1, _mergeJSXProps([{
    "class": bem$P(),
    "attrs": {
      "value": value,
      "title": props.title || t$g('title'),
      "border": props.border,
      "isLink": props.editable,
      "valueClass": bem$P('value', {
        selected: selected
      })
    }
  }, inherit(ctx, true)]));
}
CouponCell.model = {
  prop: 'chosenCoupon'
};
CouponCell.props = {
  title: String,
  coupons: {
    type: Array,
    default: function _default() {
      return [];
    }
  },
  currency: {
    type: String,
    default: '¥'
  },
  border: {
    type: Boolean,
    default: true
  },
  editable: {
    type: Boolean,
    default: true
  },
  chosenCoupon: {
    type: [Number, String],
    default: -1
  }
};
var CouponCell$1 = createComponent$W(CouponCell);

// Utils
var _createNamespace$R = createNamespace('coupon-list'),
  createComponent$V = _createNamespace$R[0],
  bem$O = _createNamespace$R[1],
  t$f = _createNamespace$R[2];
var EMPTY_IMAGE = 'https://img01.yzcdn.cn/vant/coupon-empty.png';
var CouponList = createComponent$V({
  model: {
    prop: 'code'
  },
  props: {
    code: String,
    closeButtonText: String,
    inputPlaceholder: String,
    enabledTitle: String,
    disabledTitle: String,
    exchangeButtonText: String,
    exchangeButtonLoading: Boolean,
    exchangeButtonDisabled: Boolean,
    exchangeMinLength: {
      type: Number,
      default: 1
    },
    chosenCoupon: {
      type: Number,
      default: -1
    },
    coupons: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    disabledCoupons: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    displayedCouponIndex: {
      type: Number,
      default: -1
    },
    showExchangeBar: {
      type: Boolean,
      default: true
    },
    showCloseButton: {
      type: Boolean,
      default: true
    },
    showCount: {
      type: Boolean,
      default: true
    },
    currency: {
      type: String,
      default: '¥'
    },
    emptyImage: {
      type: String,
      default: EMPTY_IMAGE
    }
  },
  data: function data() {
    return {
      tab: 0,
      winHeight: window.innerHeight,
      currentCode: this.code || ''
    };
  },
  computed: {
    buttonDisabled: function buttonDisabled() {
      return !this.exchangeButtonLoading && (this.exchangeButtonDisabled || !this.currentCode || this.currentCode.length < this.exchangeMinLength);
    },
    listStyle: function listStyle() {
      return {
        height: this.winHeight - (this.showExchangeBar ? 140 : 94) + 'px'
      };
    }
  },
  watch: {
    code: function code(_code) {
      this.currentCode = _code;
    },
    currentCode: function currentCode(code) {
      this.$emit('input', code);
    },
    displayedCouponIndex: 'scrollToShowCoupon'
  },
  mounted: function mounted() {
    this.scrollToShowCoupon(this.displayedCouponIndex);
  },
  methods: {
    onClickExchangeButton: function onClickExchangeButton() {
      this.$emit('exchange', this.currentCode); // auto clear currentCode when not use vModel

      if (!this.code) {
        this.currentCode = '';
      }
    },
    // scroll to show specific coupon
    scrollToShowCoupon: function scrollToShowCoupon(index) {
      var _this = this;
      if (index === -1) {
        return;
      }
      this.$nextTick(function () {
        var _this$$refs = _this.$refs,
          card = _this$$refs.card,
          list = _this$$refs.list;
        /* istanbul ignore next */

        if (list && card && card[index]) {
          list.scrollTop = card[index].$el.offsetTop - 100;
        }
      });
    },
    genEmpty: function genEmpty() {
      var h = this.$createElement;
      return h("div", {
        "class": bem$O('empty')
      }, [h("img", {
        "attrs": {
          "src": this.emptyImage
        }
      }), h("p", [t$f('empty')])]);
    },
    genExchangeButton: function genExchangeButton() {
      var h = this.$createElement;
      return h(Button$2, {
        "attrs": {
          "plain": true,
          "type": "danger",
          "text": this.exchangeButtonText || t$f('exchange'),
          "loading": this.exchangeButtonLoading,
          "disabled": this.buttonDisabled
        },
        "class": bem$O('exchange'),
        "on": {
          "click": this.onClickExchangeButton
        }
      });
    }
  },
  render: function render() {
    var _this2 = this;
    var h = arguments[0];
    var coupons = this.coupons,
      disabledCoupons = this.disabledCoupons;
    var count = this.showCount ? " (" + coupons.length + ")" : '';
    var title = (this.enabledTitle || t$f('enable')) + count;
    var disabledCount = this.showCount ? " (" + disabledCoupons.length + ")" : '';
    var disabledTitle = (this.disabledTitle || t$f('disabled')) + disabledCount;
    var ExchangeBar = this.showExchangeBar && h("div", {
      "class": bem$O('exchange-bar')
    }, [h(Field, {
      "attrs": {
        "clearable": true,
        "border": false,
        "placeholder": this.inputPlaceholder || t$f('placeholder'),
        "maxlength": "20"
      },
      "class": bem$O('field'),
      "model": {
        value: _this2.currentCode,
        callback: function callback($$v) {
          _this2.currentCode = $$v;
        }
      }
    }), this.genExchangeButton()]);
    var onChange = function onChange(index) {
      return function () {
        return _this2.$emit('change', index);
      };
    };
    var CouponTab = h(Tab, {
      "attrs": {
        "title": title
      }
    }, [h("div", {
      "class": bem$O('list', {
        'with-bottom': this.showCloseButton
      }),
      "style": this.listStyle
    }, [coupons.map(function (coupon, index) {
      return h(Coupon, {
        "ref": "card",
        "key": coupon.id,
        "attrs": {
          "coupon": coupon,
          "currency": _this2.currency,
          "chosen": index === _this2.chosenCoupon
        },
        "nativeOn": {
          "click": onChange(index)
        }
      });
    }), !coupons.length && this.genEmpty(), this.slots('list-footer')])]);
    var DisabledCouponTab = h(Tab, {
      "attrs": {
        "title": disabledTitle
      }
    }, [h("div", {
      "class": bem$O('list', {
        'with-bottom': this.showCloseButton
      }),
      "style": this.listStyle
    }, [disabledCoupons.map(function (coupon) {
      return h(Coupon, {
        "attrs": {
          "disabled": true,
          "coupon": coupon,
          "currency": _this2.currency
        },
        "key": coupon.id
      });
    }), !disabledCoupons.length && this.genEmpty(), this.slots('disabled-list-footer')])]);
    return h("div", {
      "class": bem$O()
    }, [ExchangeBar, h(Tabs, {
      "class": bem$O('tab'),
      "attrs": {
        "border": false
      },
      "model": {
        value: _this2.tab,
        callback: function callback($$v) {
          _this2.tab = $$v;
        }
      }
    }, [CouponTab, DisabledCouponTab]), h("div", {
      "class": bem$O('bottom')
    }, [h(Button$2, {
      "directives": [{
        name: "show",
        value: this.showCloseButton
      }],
      "attrs": {
        "round": true,
        "type": "danger",
        "block": true,
        "text": this.closeButtonText || t$f('close')
      },
      "class": bem$O('close'),
      "on": {
        "click": onChange(-1)
      }
    })])]);
  }
});

var sharedProps = _extends$2({}, pickerProps, {
  value: null,
  filter: Function,
  columnsOrder: Array,
  showToolbar: {
    type: Boolean,
    default: true
  },
  formatter: {
    type: Function,
    default: function _default(type, value) {
      return value;
    }
  }
});
var TimePickerMixin = {
  data: function data() {
    return {
      innerValue: this.formatValue(this.value)
    };
  },
  computed: {
    originColumns: function originColumns() {
      var _this = this;
      return this.ranges.map(function (_ref) {
        var type = _ref.type,
          rangeArr = _ref.range;
        var values = times(rangeArr[1] - rangeArr[0] + 1, function (index) {
          var value = padZero(rangeArr[0] + index);
          return value;
        });
        if (_this.filter) {
          values = _this.filter(type, values);
        }
        return {
          type: type,
          values: values
        };
      });
    },
    columns: function columns() {
      var _this2 = this;
      return this.originColumns.map(function (column) {
        return {
          values: column.values.map(function (value) {
            return _this2.formatter(column.type, value);
          })
        };
      });
    }
  },
  watch: {
    columns: 'updateColumnValue',
    innerValue: function innerValue(val, oldVal) {
      if (!oldVal) {
        this.$emit('input', null);
      } else {
        this.$emit('input', val);
      }
    }
  },
  mounted: function mounted() {
    var _this3 = this;
    this.updateColumnValue();
    this.$nextTick(function () {
      _this3.updateInnerValue();
    });
  },
  methods: {
    getPicker: function getPicker() {
      return this.$refs.picker;
    },
    // https://github.com/vant-ui/vant/issues/10013
    getProxiedPicker: function getProxiedPicker() {
      var _this4 = this;
      var picker = this.$refs.picker;
      if (picker) {
        var proxy = function proxy(fn) {
          return function () {
            picker[fn].apply(picker, arguments);
            _this4.updateInnerValue();
          };
        };
        return _extends$2({}, picker, {
          setValues: proxy('setValues'),
          setIndexes: proxy('setIndexes'),
          setColumnIndex: proxy('setColumnIndex'),
          setColumnValue: proxy('setColumnValue')
        });
      }
    },
    onConfirm: function onConfirm() {
      this.$emit('input', this.innerValue);
      this.$emit('confirm', this.innerValue);
    },
    onCancel: function onCancel() {
      this.$emit('cancel');
    }
  },
  render: function render() {
    var _this5 = this;
    var h = arguments[0];
    var props = {};
    Object.keys(pickerProps).forEach(function (key) {
      props[key] = _this5[key];
    });
    return h(Picker, {
      "ref": "picker",
      "attrs": {
        "columns": this.columns,
        "readonly": this.readonly
      },
      "scopedSlots": this.$scopedSlots,
      "on": {
        "change": this.onChange,
        "confirm": this.onConfirm,
        "cancel": this.onCancel
      },
      "props": _extends$2({}, props)
    });
  }
};

var _createNamespace$Q = createNamespace('time-picker'),
  createComponent$U = _createNamespace$Q[0];
var TimePicker = createComponent$U({
  mixins: [TimePickerMixin],
  props: _extends$2({}, sharedProps, {
    minHour: {
      type: [Number, String],
      default: 0
    },
    maxHour: {
      type: [Number, String],
      default: 23
    },
    minMinute: {
      type: [Number, String],
      default: 0
    },
    maxMinute: {
      type: [Number, String],
      default: 59
    }
  }),
  computed: {
    ranges: function ranges() {
      return [{
        type: 'hour',
        range: [+this.minHour, +this.maxHour]
      }, {
        type: 'minute',
        range: [+this.minMinute, +this.maxMinute]
      }];
    }
  },
  watch: {
    filter: 'updateInnerValue',
    minHour: function minHour() {
      var _this = this;
      this.$nextTick(function () {
        _this.updateInnerValue();
      });
    },
    maxHour: function maxHour(value) {
      var _this$innerValue$spli = this.innerValue.split(':'),
        hour = _this$innerValue$spli[0],
        minute = _this$innerValue$spli[1];
      if (hour >= value) {
        this.innerValue = this.formatValue(value + ":" + minute);
        this.updateColumnValue();
      } else {
        this.updateInnerValue();
      }
    },
    minMinute: 'updateInnerValue',
    maxMinute: function maxMinute(value) {
      var _this$innerValue$spli2 = this.innerValue.split(':'),
        hour = _this$innerValue$spli2[0],
        minute = _this$innerValue$spli2[1];
      if (minute >= value) {
        this.innerValue = this.formatValue(hour + ":" + value);
        this.updateColumnValue();
      } else {
        this.updateInnerValue();
      }
    },
    value: function value(val) {
      val = this.formatValue(val);
      if (val !== this.innerValue) {
        this.innerValue = val;
        this.updateColumnValue();
      }
    }
  },
  methods: {
    formatValue: function formatValue(value) {
      if (!value) {
        value = padZero(this.minHour) + ":" + padZero(this.minMinute);
      }
      var _value$split = value.split(':'),
        hour = _value$split[0],
        minute = _value$split[1];
      hour = padZero(range$1(hour, this.minHour, this.maxHour));
      minute = padZero(range$1(minute, this.minMinute, this.maxMinute));
      return hour + ":" + minute;
    },
    updateInnerValue: function updateInnerValue() {
      var _this$getPicker$getIn = this.getPicker().getIndexes(),
        hourIndex = _this$getPicker$getIn[0],
        minuteIndex = _this$getPicker$getIn[1];
      var _this$originColumns = this.originColumns,
        hourColumn = _this$originColumns[0],
        minuteColumn = _this$originColumns[1];
      var hour = hourColumn.values[hourIndex] || hourColumn.values[0];
      var minute = minuteColumn.values[minuteIndex] || minuteColumn.values[0];
      this.innerValue = this.formatValue(hour + ":" + minute);
      this.updateColumnValue();
    },
    onChange: function onChange(picker) {
      var _this2 = this;
      this.updateInnerValue();
      this.$nextTick(function () {
        _this2.$nextTick(function () {
          // https://github.com/vant-ui/vant/issues/9775
          _this2.updateInnerValue();
          _this2.$emit('change', picker);
        });
      });
    },
    updateColumnValue: function updateColumnValue() {
      var _this3 = this;
      var formatter = this.formatter;
      var pair = this.innerValue.split(':');
      var values = [formatter('hour', pair[0]), formatter('minute', pair[1])];
      this.$nextTick(function () {
        _this3.getPicker().setValues(values);
      });
    }
  }
});

function _isNativeReflectConstruct() {
  try {
    var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  } catch (t) {}
  return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
    return !!t;
  })();
}

function _setPrototypeOf(t, e) {
  return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
    return t.__proto__ = e, t;
  }, _setPrototypeOf(t, e);
}

function _construct(t, e, r) {
  if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
  var o = [null];
  o.push.apply(o, e);
  var p = new (t.bind.apply(t, o))();
  return r && _setPrototypeOf(p, r.prototype), p;
}

var currentYear = new Date().getFullYear();
var _createNamespace$P = createNamespace('date-picker'),
  createComponent$T = _createNamespace$P[0];
var DatePicker = createComponent$T({
  mixins: [TimePickerMixin],
  props: _extends$2({}, sharedProps, {
    type: {
      type: String,
      default: 'datetime'
    },
    minDate: {
      type: Date,
      default: function _default() {
        return new Date(currentYear - 10, 0, 1);
      },
      validator: isDate$1
    },
    maxDate: {
      type: Date,
      default: function _default() {
        return new Date(currentYear + 10, 11, 31);
      },
      validator: isDate$1
    }
  }),
  watch: {
    filter: 'updateInnerValue',
    minDate: function minDate() {
      var _this = this;
      this.$nextTick(function () {
        _this.updateInnerValue();
      });
    },
    maxDate: function maxDate(value) {
      if (this.innerValue.valueOf() >= value.valueOf()) {
        this.innerValue = value;
      } else {
        this.updateInnerValue();
      }
    },
    value: function value(val) {
      val = this.formatValue(val);
      if (val && val.valueOf() !== this.innerValue.valueOf()) {
        this.innerValue = val;
      }
    }
  },
  computed: {
    ranges: function ranges() {
      var _this$getBoundary = this.getBoundary('max', this.innerValue ? this.innerValue : this.minDate),
        maxYear = _this$getBoundary.maxYear,
        maxDate = _this$getBoundary.maxDate,
        maxMonth = _this$getBoundary.maxMonth,
        maxHour = _this$getBoundary.maxHour,
        maxMinute = _this$getBoundary.maxMinute;
      var _this$getBoundary2 = this.getBoundary('min', this.innerValue ? this.innerValue : this.minDate),
        minYear = _this$getBoundary2.minYear,
        minDate = _this$getBoundary2.minDate,
        minMonth = _this$getBoundary2.minMonth,
        minHour = _this$getBoundary2.minHour,
        minMinute = _this$getBoundary2.minMinute;
      var result = [{
        type: 'year',
        range: [minYear, maxYear]
      }, {
        type: 'month',
        range: [minMonth, maxMonth]
      }, {
        type: 'day',
        range: [minDate, maxDate]
      }, {
        type: 'hour',
        range: [minHour, maxHour]
      }, {
        type: 'minute',
        range: [minMinute, maxMinute]
      }];
      switch (this.type) {
        case 'date':
          result = result.slice(0, 3);
          break;
        case 'year-month':
          result = result.slice(0, 2);
          break;
        case 'month-day':
          result = result.slice(1, 3);
          break;
        case 'datehour':
          result = result.slice(0, 4);
          break;
      }
      if (this.columnsOrder) {
        var columnsOrder = this.columnsOrder.concat(result.map(function (column) {
          return column.type;
        }));
        result.sort(function (a, b) {
          return columnsOrder.indexOf(a.type) - columnsOrder.indexOf(b.type);
        });
      }
      return result;
    }
  },
  methods: {
    formatValue: function formatValue(value) {
      var _this2 = this;
      if (!isDate$1(value)) {
        return null;
      }
      var minDate = new Date(this.minDate);
      var maxDate = new Date(this.maxDate);
      var dateMethods = {
        year: 'getFullYear',
        month: 'getMonth',
        day: 'getDate',
        hour: 'getHours',
        minute: 'getMinutes'
      };
      if (this.originColumns) {
        var dateColumns = this.originColumns.map(function (_ref, index) {
          var type = _ref.type,
            values = _ref.values;
          var range = _this2.ranges[index].range;
          var minDateVal = minDate[dateMethods[type]]();
          var maxDateVal = maxDate[dateMethods[type]]();
          var min = type === 'month' ? +values[0] - 1 : +values[0];
          var max = type === 'month' ? +values[values.length - 1] - 1 : +values[values.length - 1];
          return {
            type: type,
            values: [minDateVal < range[0] ? Math.max(minDateVal, min) : min || minDateVal, maxDateVal > range[1] ? Math.min(maxDateVal, max) : max || maxDateVal]
          };
        });
        if (this.type === 'month-day') {
          var year = (this.innerValue || this.minDate).getFullYear();
          dateColumns.unshift({
            type: 'year',
            values: [year, year]
          });
        }
        var dates = Object.keys(dateMethods).map(function (type) {
          var _dateColumns$filter$;
          return (_dateColumns$filter$ = dateColumns.filter(function (item) {
            return item.type === type;
          })[0]) == null ? void 0 : _dateColumns$filter$.values;
        }).filter(function (item) {
          return item;
        });
        minDate = _construct(Date, dates.map(function (val) {
          return getTrueValue(val[0]);
        }));
        maxDate = _construct(Date, dates.map(function (val) {
          return getTrueValue(val[1]);
        }));
      }
      value = Math.max(value, minDate.getTime());
      value = Math.min(value, maxDate.getTime());
      return new Date(value);
    },
    getBoundary: function getBoundary(type, value) {
      var _ref2;
      var boundary = this[type + "Date"];
      var year = boundary.getFullYear();
      var month = 1;
      var date = 1;
      var hour = 0;
      var minute = 0;
      if (type === 'max') {
        month = 12;
        date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1);
        hour = 23;
        minute = 59;
      }
      if (value.getFullYear() === year) {
        month = boundary.getMonth() + 1;
        if (value.getMonth() + 1 === month) {
          date = boundary.getDate();
          if (value.getDate() === date) {
            hour = boundary.getHours();
            if (value.getHours() === hour) {
              minute = boundary.getMinutes();
            }
          }
        }
      }
      return _ref2 = {}, _ref2[type + "Year"] = year, _ref2[type + "Month"] = month, _ref2[type + "Date"] = date, _ref2[type + "Hour"] = hour, _ref2[type + "Minute"] = minute, _ref2;
    },
    updateInnerValue: function updateInnerValue() {
      var _this3 = this;
      var type = this.type;
      var indexes = this.getPicker().getIndexes();
      var getValue = function getValue(type) {
        var index = 0;
        _this3.originColumns.forEach(function (column, columnIndex) {
          if (type === column.type) {
            index = columnIndex;
          }
        });
        var values = _this3.originColumns[index].values;
        return getTrueValue(values[indexes[index]]);
      };
      var year;
      var month;
      var day;
      if (type === 'month-day') {
        year = (this.innerValue || this.minDate).getFullYear();
        month = getValue('month');
        day = getValue('day');
      } else {
        year = getValue('year');
        month = getValue('month');
        day = type === 'year-month' ? 1 : getValue('day');
      }
      var maxDay = getMonthEndDay(year, month);
      day = day > maxDay ? maxDay : day;
      var hour = 0;
      var minute = 0;
      if (type === 'datehour') {
        hour = getValue('hour');
      }
      if (type === 'datetime') {
        hour = getValue('hour');
        minute = getValue('minute');
      }
      var value = new Date(year, month - 1, day, hour, minute);
      this.innerValue = this.formatValue(value);
    },
    onChange: function onChange(picker) {
      var _this4 = this;
      this.updateInnerValue();
      this.$nextTick(function () {
        _this4.$nextTick(function () {
          // https://github.com/vant-ui/vant/issues/9775
          _this4.updateInnerValue();
          _this4.$emit('change', picker);
        });
      });
    },
    updateColumnValue: function updateColumnValue() {
      var _this5 = this;
      var value = this.innerValue ? this.innerValue : this.minDate;
      var formatter = this.formatter;
      var values = this.originColumns.map(function (column) {
        switch (column.type) {
          case 'year':
            return formatter('year', "" + value.getFullYear());
          case 'month':
            return formatter('month', padZero(value.getMonth() + 1));
          case 'day':
            return formatter('day', padZero(value.getDate()));
          case 'hour':
            return formatter('hour', padZero(value.getHours()));
          case 'minute':
            return formatter('minute', padZero(value.getMinutes()));
          default:
            // no default
            return null;
        }
      });
      this.$nextTick(function () {
        _this5.getPicker().setValues(values);
      });
    }
  }
});

var _createNamespace$O = createNamespace('datetime-picker'),
  createComponent$S = _createNamespace$O[0],
  bem$N = _createNamespace$O[1];
var DatetimePicker = createComponent$S({
  props: _extends$2({}, TimePicker.props, DatePicker.props),
  methods: {
    // @exposed-api
    getPicker: function getPicker() {
      return this.$refs.root.getProxiedPicker();
    }
  },
  render: function render() {
    var h = arguments[0];
    var Component = this.type === 'time' ? TimePicker : DatePicker;
    return h(Component, {
      "ref": "root",
      "class": bem$N(),
      "scopedSlots": this.$scopedSlots,
      "props": _extends$2({}, this.$props),
      "on": _extends$2({}, this.$listeners)
    });
  }
});

var _createNamespace$N = createNamespace('divider'),
  createComponent$R = _createNamespace$N[0],
  bem$M = _createNamespace$N[1];
function Divider(h, props, slots, ctx) {
  var _bem;
  return h("div", _mergeJSXProps([{
    "attrs": {
      "role": "separator"
    },
    "style": {
      borderColor: props.borderColor
    },
    "class": bem$M((_bem = {
      dashed: props.dashed,
      hairline: props.hairline
    }, _bem["content-" + props.contentPosition] = slots.default, _bem))
  }, inherit(ctx, true)]), [slots.default && slots.default()]);
}
Divider.props = {
  dashed: Boolean,
  hairline: {
    type: Boolean,
    default: true
  },
  contentPosition: {
    type: String,
    default: 'center'
  }
};
var Divider$1 = createComponent$R(Divider);

// Utils
var _createNamespace$M = createNamespace('dropdown-item'),
  createComponent$Q = _createNamespace$M[0],
  bem$L = _createNamespace$M[1];
var DropdownItem = createComponent$Q({
  mixins: [PortalMixin({
    ref: 'wrapper'
  }), ChildrenMixin('vanDropdownMenu')],
  props: {
    value: null,
    title: String,
    disabled: Boolean,
    titleClass: String,
    options: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    lazyRender: {
      type: Boolean,
      default: true
    }
  },
  data: function data() {
    return {
      transition: true,
      showPopup: false,
      showWrapper: false
    };
  },
  computed: {
    displayTitle: function displayTitle() {
      var _this = this;
      if (this.title) {
        return this.title;
      }
      var match = this.options.filter(function (option) {
        return option.value === _this.value;
      });
      return match.length ? match[0].text : '';
    }
  },
  watch: {
    showPopup: function showPopup(val) {
      this.bindScroll(val);
    }
  },
  beforeCreate: function beforeCreate() {
    var _this2 = this;
    var createEmitter = function createEmitter(eventName) {
      return function () {
        return _this2.$emit(eventName);
      };
    };
    this.onOpen = createEmitter('open');
    this.onClose = createEmitter('close');
    this.onOpened = createEmitter('opened');
  },
  methods: {
    // @exposed-api
    toggle: function toggle(show, options) {
      if (show === void 0) {
        show = !this.showPopup;
      }
      if (options === void 0) {
        options = {};
      }
      if (show === this.showPopup) {
        return;
      }
      this.transition = !options.immediate;
      this.showPopup = show;
      if (show) {
        this.parent.updateOffset();
        this.showWrapper = true;
      }
    },
    bindScroll: function bindScroll(bind) {
      var scroller = this.parent.scroller;
      var action = bind ? on$2 : off$2;
      action(scroller, 'scroll', this.onScroll, true);
    },
    onScroll: function onScroll() {
      this.parent.updateOffset();
    },
    onClickWrapper: function onClickWrapper(event) {
      // prevent being identified as clicking outside and closed when use get-contaienr
      if (this.getContainer) {
        event.stopPropagation();
      }
    }
  },
  render: function render() {
    var _this3 = this;
    var h = arguments[0];
    var _this$parent = this.parent,
      zIndex = _this$parent.zIndex,
      offset = _this$parent.offset,
      overlay = _this$parent.overlay,
      duration = _this$parent.duration,
      direction = _this$parent.direction,
      activeColor = _this$parent.activeColor,
      closeOnClickOverlay = _this$parent.closeOnClickOverlay;
    var Options = this.options.map(function (option) {
      var active = option.value === _this3.value;
      return h(Cell$1, {
        "attrs": {
          "clickable": true,
          "icon": option.icon,
          "title": option.text
        },
        "key": option.value,
        "class": bem$L('option', {
          active: active
        }),
        "style": {
          color: active ? activeColor : ''
        },
        "on": {
          "click": function click() {
            _this3.showPopup = false;
            if (option.value !== _this3.value) {
              _this3.$emit('input', option.value);
              _this3.$emit('change', option.value);
            }
          }
        }
      }, [active && h(Icon$3, {
        "class": bem$L('icon'),
        "attrs": {
          "color": activeColor,
          "name": "success"
        }
      })]);
    });
    var style = {
      zIndex: zIndex
    };
    if (direction === 'down') {
      style.top = offset + "px";
    } else {
      style.bottom = offset + "px";
    }
    return h("div", [h("div", {
      "directives": [{
        name: "show",
        value: this.showWrapper
      }],
      "ref": "wrapper",
      "style": style,
      "class": bem$L([direction]),
      "on": {
        "click": this.onClickWrapper
      }
    }, [h(Popup, {
      "attrs": {
        "overlay": overlay,
        "position": direction === 'down' ? 'top' : 'bottom',
        "duration": this.transition ? duration : 0,
        "lazyRender": this.lazyRender,
        "overlayStyle": {
          position: 'absolute'
        },
        "closeOnClickOverlay": closeOnClickOverlay
      },
      "class": bem$L('content'),
      "on": {
        "open": this.onOpen,
        "close": this.onClose,
        "opened": this.onOpened,
        "closed": function closed() {
          _this3.showWrapper = false;
          _this3.$emit('closed');
        }
      },
      "model": {
        value: _this3.showPopup,
        callback: function callback($$v) {
          _this3.showPopup = $$v;
        }
      }
    }, [Options, this.slots('default')])])]);
  }
});

/**
 * Listen to click outside event
 */
var ClickOutsideMixin = function ClickOutsideMixin(config) {
  return {
    props: {
      closeOnClickOutside: {
        type: Boolean,
        default: true
      }
    },
    data: function data() {
      var _this = this;
      var clickOutsideHandler = function clickOutsideHandler(event) {
        if (_this.closeOnClickOutside && !_this.$el.contains(event.target)) {
          _this[config.method]();
        }
      };
      return {
        clickOutsideHandler: clickOutsideHandler
      };
    },
    mounted: function mounted() {
      on$2(document, config.event, this.clickOutsideHandler);
    },
    beforeDestroy: function beforeDestroy() {
      off$2(document, config.event, this.clickOutsideHandler);
    }
  };
};

// Utils
var _createNamespace$L = createNamespace('dropdown-menu'),
  createComponent$P = _createNamespace$L[0],
  bem$K = _createNamespace$L[1];
var DropdownMenu = createComponent$P({
  mixins: [ParentMixin('vanDropdownMenu'), ClickOutsideMixin({
    event: 'click',
    method: 'onClickOutside'
  })],
  props: {
    zIndex: [Number, String],
    activeColor: String,
    overlay: {
      type: Boolean,
      default: true
    },
    duration: {
      type: [Number, String],
      default: 0.2
    },
    direction: {
      type: String,
      default: 'down'
    },
    closeOnClickOverlay: {
      type: Boolean,
      default: true
    }
  },
  data: function data() {
    return {
      offset: 0
    };
  },
  computed: {
    scroller: function scroller() {
      return getScroller(this.$el);
    },
    opened: function opened() {
      return this.children.some(function (item) {
        return item.showWrapper;
      });
    },
    barStyle: function barStyle() {
      if (this.opened && isDef(this.zIndex)) {
        return {
          zIndex: 1 + this.zIndex
        };
      }
    }
  },
  methods: {
    updateOffset: function updateOffset() {
      if (!this.$refs.bar) {
        return;
      }
      var rect = this.$refs.bar.getBoundingClientRect();
      if (this.direction === 'down') {
        this.offset = rect.bottom;
      } else {
        this.offset = window.innerHeight - rect.top;
      }
    },
    toggleItem: function toggleItem(active) {
      this.children.forEach(function (item, index) {
        if (index === active) {
          item.toggle();
        } else if (item.showPopup) {
          item.toggle(false, {
            immediate: true
          });
        }
      });
    },
    onClickOutside: function onClickOutside() {
      this.children.forEach(function (item) {
        item.toggle(false);
      });
    }
  },
  render: function render() {
    var _this = this;
    var h = arguments[0];
    var Titles = this.children.map(function (item, index) {
      return h("div", {
        "attrs": {
          "role": "button",
          "tabindex": item.disabled ? -1 : 0
        },
        "class": bem$K('item', {
          disabled: item.disabled
        }),
        "on": {
          "click": function click() {
            if (!item.disabled) {
              _this.toggleItem(index);
            }
          }
        }
      }, [h("span", {
        "class": [bem$K('title', {
          active: item.showPopup,
          down: item.showPopup === (_this.direction === 'down')
        }), item.titleClass],
        "style": {
          color: item.showPopup ? _this.activeColor : ''
        }
      }, [h("div", {
        "class": "van-ellipsis"
      }, [item.slots('title') || item.displayTitle])])]);
    });
    return h("div", {
      "class": bem$K()
    }, [h("div", {
      "ref": "bar",
      "style": this.barStyle,
      "class": bem$K('bar', {
        opened: this.opened
      })
    }, [Titles]), this.slots('default')]);
  }
});

var prefix = 'van-empty-network-';
var Network = {
  render: function render() {
    var h = arguments[0];
    var genStop = function genStop(color, offset, opacity) {
      return h("stop", {
        "attrs": {
          "stop-color": color,
          "offset": offset + "%",
          "stop-opacity": opacity
        }
      });
    };
    return h("svg", {
      "attrs": {
        "viewBox": "0 0 160 160",
        "xmlns": "http://www.w3.org/2000/svg"
      }
    }, [h("defs", [h("linearGradient", {
      "attrs": {
        "id": prefix + "1",
        "x1": "64.022%",
        "y1": "100%",
        "x2": "64.022%",
        "y2": "0%"
      }
    }, [genStop('#FFF', 0, 0.5), genStop('#F2F3F5', 100)]), h("linearGradient", {
      "attrs": {
        "id": prefix + "2",
        "x1": "50%",
        "y1": "0%",
        "x2": "50%",
        "y2": "84.459%"
      }
    }, [genStop('#EBEDF0', 0), genStop('#DCDEE0', 100, 0)]), h("linearGradient", {
      "attrs": {
        "id": prefix + "3",
        "x1": "100%",
        "y1": "0%",
        "x2": "100%",
        "y2": "100%"
      }
    }, [genStop('#EAEDF0', 0), genStop('#DCDEE0', 100)]), h("linearGradient", {
      "attrs": {
        "id": prefix + "4",
        "x1": "100%",
        "y1": "100%",
        "x2": "100%",
        "y2": "0%"
      }
    }, [genStop('#EAEDF0', 0), genStop('#DCDEE0', 100)]), h("linearGradient", {
      "attrs": {
        "id": prefix + "5",
        "x1": "0%",
        "y1": "43.982%",
        "x2": "100%",
        "y2": "54.703%"
      }
    }, [genStop('#EAEDF0', 0), genStop('#DCDEE0', 100)]), h("linearGradient", {
      "attrs": {
        "id": prefix + "6",
        "x1": "94.535%",
        "y1": "43.837%",
        "x2": "5.465%",
        "y2": "54.948%"
      }
    }, [genStop('#EAEDF0', 0), genStop('#DCDEE0', 100)]), h("radialGradient", {
      "attrs": {
        "id": prefix + "7",
        "cx": "50%",
        "cy": "0%",
        "fx": "50%",
        "fy": "0%",
        "r": "100%",
        "gradientTransform": "matrix(0 1 -.54835 0 .5 -.5)"
      }
    }, [genStop('#EBEDF0', 0), genStop('#FFF', 100, 0)])]), h("g", {
      "attrs": {
        "fill": "none",
        "fill-rule": "evenodd"
      }
    }, [h("g", {
      "attrs": {
        "opacity": ".8"
      }
    }, [h("path", {
      "attrs": {
        "d": "M0 124V46h20v20h14v58H0z",
        "fill": "url(#" + prefix + "1)",
        "transform": "matrix(-1 0 0 1 36 7)"
      }
    }), h("path", {
      "attrs": {
        "d": "M121 8h22.231v14H152v77.37h-31V8z",
        "fill": "url(#" + prefix + "1)",
        "transform": "translate(2 7)"
      }
    })]), h("path", {
      "attrs": {
        "fill": "url(#" + prefix + "7)",
        "d": "M0 139h160v21H0z"
      }
    }), h("path", {
      "attrs": {
        "d": "M37 18a7 7 0 013 13.326v26.742c0 1.23-.997 2.227-2.227 2.227h-1.546A2.227 2.227 0 0134 58.068V31.326A7 7 0 0137 18z",
        "fill": "url(#" + prefix + "2)",
        "fill-rule": "nonzero",
        "transform": "translate(43 36)"
      }
    }), h("g", {
      "attrs": {
        "opacity": ".6",
        "stroke-linecap": "round",
        "stroke-width": "7"
      }
    }, [h("path", {
      "attrs": {
        "d": "M20.875 11.136a18.868 18.868 0 00-5.284 13.121c0 5.094 2.012 9.718 5.284 13.12",
        "stroke": "url(#" + prefix + "3)",
        "transform": "translate(43 36)"
      }
    }), h("path", {
      "attrs": {
        "d": "M9.849 0C3.756 6.225 0 14.747 0 24.146c0 9.398 3.756 17.92 9.849 24.145",
        "stroke": "url(#" + prefix + "3)",
        "transform": "translate(43 36)"
      }
    }), h("path", {
      "attrs": {
        "d": "M57.625 11.136a18.868 18.868 0 00-5.284 13.121c0 5.094 2.012 9.718 5.284 13.12",
        "stroke": "url(#" + prefix + "4)",
        "transform": "rotate(-180 76.483 42.257)"
      }
    }), h("path", {
      "attrs": {
        "d": "M73.216 0c-6.093 6.225-9.849 14.747-9.849 24.146 0 9.398 3.756 17.92 9.849 24.145",
        "stroke": "url(#" + prefix + "4)",
        "transform": "rotate(-180 89.791 42.146)"
      }
    })]), h("g", {
      "attrs": {
        "transform": "translate(31 105)",
        "fill-rule": "nonzero"
      }
    }, [h("rect", {
      "attrs": {
        "fill": "url(#" + prefix + "5)",
        "width": "98",
        "height": "34",
        "rx": "2"
      }
    }), h("rect", {
      "attrs": {
        "fill": "#FFF",
        "x": "9",
        "y": "8",
        "width": "80",
        "height": "18",
        "rx": "1.114"
      }
    }), h("rect", {
      "attrs": {
        "fill": "url(#" + prefix + "6)",
        "x": "15",
        "y": "12",
        "width": "18",
        "height": "6",
        "rx": "1.114"
      }
    })])])]);
  }
};

var _createNamespace$K = createNamespace('empty'),
  createComponent$O = _createNamespace$K[0],
  bem$J = _createNamespace$K[1];
var PRESETS = ['error', 'search', 'default'];
var Empty = createComponent$O({
  props: {
    imageSize: [Number, String],
    description: String,
    image: {
      type: String,
      default: 'default'
    }
  },
  methods: {
    genImageContent: function genImageContent() {
      var h = this.$createElement;
      var slots = this.slots('image');
      if (slots) {
        return slots;
      }
      if (this.image === 'network') {
        return h(Network);
      }
      var image = this.image;
      if (PRESETS.indexOf(image) !== -1) {
        image = "https://img01.yzcdn.cn/vant/empty-image-" + image + ".png";
      }
      return h("img", {
        "attrs": {
          "src": image
        }
      });
    },
    genImage: function genImage() {
      var h = this.$createElement;
      var imageStyle = {
        width: addUnit(this.imageSize),
        height: addUnit(this.imageSize)
      };
      return h("div", {
        "class": bem$J('image'),
        "style": imageStyle
      }, [this.genImageContent()]);
    },
    genDescription: function genDescription() {
      var h = this.$createElement;
      var description = this.slots('description') || this.description;
      if (description) {
        return h("p", {
          "class": bem$J('description')
        }, [description]);
      }
    },
    genBottom: function genBottom() {
      var h = this.$createElement;
      var slot = this.slots();
      if (slot) {
        return h("div", {
          "class": bem$J('bottom')
        }, [slot]);
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$J()
    }, [this.genImage(), this.genDescription(), this.genBottom()]);
  }
});

var _createNamespace$J = createNamespace('form'),
  createComponent$N = _createNamespace$J[0],
  bem$I = _createNamespace$J[1];
var Form = createComponent$N({
  props: {
    colon: Boolean,
    disabled: Boolean,
    readonly: Boolean,
    labelWidth: [Number, String],
    labelAlign: String,
    inputAlign: String,
    scrollToError: Boolean,
    validateFirst: Boolean,
    errorMessageAlign: String,
    submitOnEnter: {
      type: Boolean,
      default: true
    },
    validateTrigger: {
      type: String,
      default: 'onBlur'
    },
    showError: {
      type: Boolean,
      default: true
    },
    showErrorMessage: {
      type: Boolean,
      default: true
    }
  },
  provide: function provide() {
    return {
      vanForm: this
    };
  },
  data: function data() {
    return {
      fields: []
    };
  },
  methods: {
    getFieldsByNames: function getFieldsByNames(names) {
      if (names) {
        return this.fields.filter(function (field) {
          return names.indexOf(field.name) !== -1;
        });
      }
      return this.fields;
    },
    validateSeq: function validateSeq(names) {
      var _this = this;
      return new Promise(function (resolve, reject) {
        var errors = [];
        var fields = _this.getFieldsByNames(names);
        fields.reduce(function (promise, field) {
          return promise.then(function () {
            if (!errors.length) {
              return field.validate().then(function (error) {
                if (error) {
                  errors.push(error);
                }
              });
            }
          });
        }, Promise.resolve()).then(function () {
          if (errors.length) {
            reject(errors);
          } else {
            resolve();
          }
        });
      });
    },
    validateFields: function validateFields(names) {
      var _this2 = this;
      return new Promise(function (resolve, reject) {
        var fields = _this2.getFieldsByNames(names);
        Promise.all(fields.map(function (item) {
          return item.validate();
        })).then(function (errors) {
          errors = errors.filter(function (item) {
            return item;
          });
          if (errors.length) {
            reject(errors);
          } else {
            resolve();
          }
        });
      });
    },
    // @exposed-api
    validate: function validate(name) {
      if (name && !Array.isArray(name)) {
        return this.validateField(name);
      }
      return this.validateFirst ? this.validateSeq(name) : this.validateFields(name);
    },
    validateField: function validateField(name) {
      var matched = this.fields.filter(function (item) {
        return item.name === name;
      });
      if (matched.length) {
        return new Promise(function (resolve, reject) {
          matched[0].validate().then(function (error) {
            if (error) {
              reject(error);
            } else {
              resolve();
            }
          });
        });
      }
      return Promise.reject();
    },
    // @exposed-api
    resetValidation: function resetValidation(name) {
      if (name && !Array.isArray(name)) {
        name = [name];
      }
      var fields = this.getFieldsByNames(name);
      fields.forEach(function (item) {
        item.resetValidation();
      });
    },
    // @exposed-api
    scrollToField: function scrollToField(name, options) {
      this.fields.some(function (item) {
        if (item.name === name) {
          item.$el.scrollIntoView(options);
          return true;
        }
        return false;
      });
    },
    addField: function addField(field) {
      this.fields.push(field);
      sortChildren(this.fields, this);
    },
    removeField: function removeField(field) {
      this.fields = this.fields.filter(function (item) {
        return item !== field;
      });
    },
    getValues: function getValues() {
      return this.fields.reduce(function (form, field) {
        form[field.name] = field.formValue;
        return form;
      }, {});
    },
    onSubmit: function onSubmit(event) {
      event.preventDefault();
      this.submit();
    },
    // @exposed-api
    submit: function submit() {
      var _this3 = this;
      var values = this.getValues();
      this.validate().then(function () {
        _this3.$emit('submit', values);
      }).catch(function (errors) {
        _this3.$emit('failed', {
          values: values,
          errors: errors
        });
        if (_this3.scrollToError) {
          _this3.scrollToField(errors[0].name);
        }
      });
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("form", {
      "class": bem$I(),
      "on": {
        "submit": this.onSubmit
      }
    }, [this.slots()]);
  }
});

var _createNamespace$I = createNamespace('goods-action-icon'),
  createComponent$M = _createNamespace$I[0],
  bem$H = _createNamespace$I[1];
var GoodsActionIcon = createComponent$M({
  mixins: [ChildrenMixin('vanGoodsAction')],
  props: _extends$2({}, routeProps, {
    dot: Boolean,
    text: String,
    icon: String,
    color: String,
    // @deprecated
    info: [Number, String],
    badge: [Number, String],
    iconClass: null
  }),
  methods: {
    onClick: function onClick(event) {
      this.$emit('click', event);
      route(this.$router, this);
    },
    genIcon: function genIcon() {
      var _this$badge;
      var h = this.$createElement;
      var slot = this.slots('icon');
      var info = (_this$badge = this.badge) != null ? _this$badge : this.info;
      if (slot) {
        return h("div", {
          "class": bem$H('icon')
        }, [slot, h(Info$1, {
          "attrs": {
            "dot": this.dot,
            "info": info
          }
        })]);
      }
      return h(Icon$3, {
        "class": [bem$H('icon'), this.iconClass],
        "attrs": {
          "tag": "div",
          "dot": this.dot,
          "name": this.icon,
          "badge": info,
          "color": this.color
        }
      });
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "attrs": {
        "role": "button",
        "tabindex": "0"
      },
      "class": bem$H(),
      "on": {
        "click": this.onClick
      }
    }, [this.genIcon(), this.slots() || this.text]);
  }
});

var _createNamespace$H = createNamespace('grid'),
  createComponent$L = _createNamespace$H[0],
  bem$G = _createNamespace$H[1];
var Grid = createComponent$L({
  mixins: [ParentMixin('vanGrid')],
  props: {
    square: Boolean,
    gutter: [Number, String],
    iconSize: [Number, String],
    direction: String,
    clickable: Boolean,
    columnNum: {
      type: [Number, String],
      default: 4
    },
    center: {
      type: Boolean,
      default: true
    },
    border: {
      type: Boolean,
      default: true
    }
  },
  computed: {
    style: function style() {
      var gutter = this.gutter;
      if (gutter) {
        return {
          paddingLeft: addUnit(gutter)
        };
      }
    }
  },
  render: function render() {
    var _ref;
    var h = arguments[0];
    return h("div", {
      "style": this.style,
      "class": [bem$G(), (_ref = {}, _ref[BORDER_TOP] = this.border && !this.gutter, _ref)]
    }, [this.slots()]);
  }
});

var _createNamespace$G = createNamespace('grid-item'),
  createComponent$K = _createNamespace$G[0],
  bem$F = _createNamespace$G[1];
var GridItem = createComponent$K({
  mixins: [ChildrenMixin('vanGrid')],
  props: _extends$2({}, routeProps, {
    dot: Boolean,
    text: String,
    icon: String,
    iconPrefix: String,
    // @deprecated
    info: [Number, String],
    badge: [Number, String]
  }),
  computed: {
    style: function style() {
      var _this$parent = this.parent,
        square = _this$parent.square,
        gutter = _this$parent.gutter,
        columnNum = _this$parent.columnNum;
      var percent = 100 / columnNum + "%";
      var style = {
        flexBasis: percent
      };
      if (square) {
        style.paddingTop = percent;
      } else if (gutter) {
        var gutterValue = addUnit(gutter);
        style.paddingRight = gutterValue;
        if (this.index >= columnNum) {
          style.marginTop = gutterValue;
        }
      }
      return style;
    },
    contentStyle: function contentStyle() {
      var _this$parent2 = this.parent,
        square = _this$parent2.square,
        gutter = _this$parent2.gutter;
      if (square && gutter) {
        var gutterValue = addUnit(gutter);
        return {
          right: gutterValue,
          bottom: gutterValue,
          height: 'auto'
        };
      }
    }
  },
  methods: {
    onClick: function onClick(event) {
      this.$emit('click', event);
      route(this.$router, this);
    },
    genIcon: function genIcon() {
      var _this$badge;
      var h = this.$createElement;
      var iconSlot = this.slots('icon');
      var info = (_this$badge = this.badge) != null ? _this$badge : this.info;
      if (iconSlot) {
        return h("div", {
          "class": bem$F('icon-wrapper')
        }, [iconSlot, h(Info$1, {
          "attrs": {
            "dot": this.dot,
            "info": info
          }
        })]);
      }
      if (this.icon) {
        return h(Icon$3, {
          "attrs": {
            "name": this.icon,
            "dot": this.dot,
            "badge": info,
            "size": this.parent.iconSize,
            "classPrefix": this.iconPrefix
          },
          "class": bem$F('icon')
        });
      }
    },
    getText: function getText() {
      var h = this.$createElement;
      var textSlot = this.slots('text');
      if (textSlot) {
        return textSlot;
      }
      if (this.text) {
        return h("span", {
          "class": bem$F('text')
        }, [this.text]);
      }
    },
    genContent: function genContent() {
      var slot = this.slots();
      if (slot) {
        return slot;
      }
      return [this.genIcon(), this.getText()];
    }
  },
  render: function render() {
    var _ref;
    var h = arguments[0];
    var _this$parent3 = this.parent,
      center = _this$parent3.center,
      border = _this$parent3.border,
      square = _this$parent3.square,
      gutter = _this$parent3.gutter,
      direction = _this$parent3.direction,
      clickable = _this$parent3.clickable;
    return h("div", {
      "class": [bem$F({
        square: square
      })],
      "style": this.style
    }, [h("div", {
      "style": this.contentStyle,
      "attrs": {
        "role": clickable ? 'button' : null,
        "tabindex": clickable ? 0 : null
      },
      "class": [bem$F('content', [direction, {
        center: center,
        square: square,
        clickable: clickable,
        surround: border && gutter
      }]), (_ref = {}, _ref[BORDER] = border, _ref)],
      "on": {
        "click": this.onClick
      }
    }, [this.genContent()])]);
  }
});

var _createNamespace$F = createNamespace('image-preview'),
  createComponent$J = _createNamespace$F[0],
  bem$E = _createNamespace$F[1];

// Utils
var _createNamespace$E = createNamespace('swipe'),
  createComponent$I = _createNamespace$E[0],
  bem$D = _createNamespace$E[1];
var Swipe = createComponent$I({
  mixins: [TouchMixin, ParentMixin('vanSwipe'), BindEventMixin(function (bind, isBind) {
    bind(window, 'resize', this.resize, true);
    bind(window, 'orientationchange', this.resize, true);
    bind(window, 'visibilitychange', this.onVisibilityChange);
    if (isBind) {
      this.initialize();
    } else {
      this.clear();
    }
  })],
  props: {
    width: [Number, String],
    height: [Number, String],
    autoplay: [Number, String],
    vertical: Boolean,
    lazyRender: Boolean,
    indicatorColor: String,
    loop: {
      type: Boolean,
      default: true
    },
    duration: {
      type: [Number, String],
      default: 500
    },
    touchable: {
      type: Boolean,
      default: true
    },
    initialSwipe: {
      type: [Number, String],
      default: 0
    },
    showIndicators: {
      type: Boolean,
      default: true
    },
    stopPropagation: {
      type: Boolean,
      default: true
    }
  },
  data: function data() {
    return {
      rect: null,
      offset: 0,
      active: 0,
      deltaX: 0,
      deltaY: 0,
      swiping: false,
      computedWidth: 0,
      computedHeight: 0
    };
  },
  watch: {
    children: function children() {
      this.initialize();
    },
    initialSwipe: function initialSwipe() {
      this.initialize();
    },
    autoplay: function autoplay(_autoplay) {
      if (_autoplay > 0) {
        this.autoPlay();
      } else {
        this.clear();
      }
    }
  },
  computed: {
    count: function count() {
      return this.children.length;
    },
    maxCount: function maxCount() {
      return Math.ceil(Math.abs(this.minOffset) / this.size);
    },
    delta: function delta() {
      return this.vertical ? this.deltaY : this.deltaX;
    },
    size: function size() {
      return this[this.vertical ? 'computedHeight' : 'computedWidth'];
    },
    trackSize: function trackSize() {
      return this.count * this.size;
    },
    activeIndicator: function activeIndicator() {
      return (this.active + this.count) % this.count;
    },
    isCorrectDirection: function isCorrectDirection() {
      var expect = this.vertical ? 'vertical' : 'horizontal';
      return this.direction === expect;
    },
    trackStyle: function trackStyle() {
      var style = {
        transitionDuration: (this.swiping ? 0 : this.duration) + "ms",
        transform: "translate" + (this.vertical ? 'Y' : 'X') + "(" + this.offset + "px)"
      };
      if (this.size) {
        var mainAxis = this.vertical ? 'height' : 'width';
        var crossAxis = this.vertical ? 'width' : 'height';
        style[mainAxis] = this.trackSize + "px";
        style[crossAxis] = this[crossAxis] ? this[crossAxis] + "px" : '';
      }
      return style;
    },
    indicatorStyle: function indicatorStyle() {
      return {
        backgroundColor: this.indicatorColor
      };
    },
    minOffset: function minOffset() {
      return (this.vertical ? this.rect.height : this.rect.width) - this.size * this.count;
    }
  },
  mounted: function mounted() {
    this.bindTouchEvent(this.$refs.track);
  },
  methods: {
    // initialize swipe position
    initialize: function initialize(active) {
      if (active === void 0) {
        active = +this.initialSwipe;
      }
      if (!this.$el || isHidden(this.$el)) {
        return;
      }
      clearTimeout(this.timer);
      var rect = {
        width: this.$el.offsetWidth,
        height: this.$el.offsetHeight
      };
      this.rect = rect;
      this.swiping = true;
      this.active = active;
      this.computedWidth = +this.width || rect.width;
      this.computedHeight = +this.height || rect.height;
      this.offset = this.getTargetOffset(active);
      this.children.forEach(function (swipe) {
        swipe.offset = 0;
      });
      this.autoPlay();
    },
    // @exposed-api
    resize: function resize() {
      this.initialize(this.activeIndicator);
    },
    onVisibilityChange: function onVisibilityChange() {
      if (document.hidden) {
        this.clear();
      } else {
        this.autoPlay();
      }
    },
    onTouchStart: function onTouchStart(event) {
      if (!this.touchable) return;
      this.clear();
      this.touchStartTime = Date.now();
      this.touchStart(event);
      this.correctPosition();
    },
    onTouchMove: function onTouchMove(event) {
      if (!this.touchable || !this.swiping) return;
      this.touchMove(event);
      if (this.isCorrectDirection) {
        preventDefault(event, this.stopPropagation);
        this.move({
          offset: this.delta
        });
      }
    },
    onTouchEnd: function onTouchEnd() {
      if (!this.touchable || !this.swiping) return;
      var size = this.size,
        delta = this.delta;
      var duration = Date.now() - this.touchStartTime;
      var speed = delta / duration;
      var shouldSwipe = Math.abs(speed) > 0.25 || Math.abs(delta) > size / 2;
      if (shouldSwipe && this.isCorrectDirection) {
        var offset = this.vertical ? this.offsetY : this.offsetX;
        var pace = 0;
        if (this.loop) {
          pace = offset > 0 ? delta > 0 ? -1 : 1 : 0;
        } else {
          pace = -Math[delta > 0 ? 'ceil' : 'floor'](delta / size);
        }
        this.move({
          pace: pace,
          emitChange: true
        });
      } else if (delta) {
        this.move({
          pace: 0
        });
      }
      this.swiping = false;
      this.autoPlay();
    },
    getTargetActive: function getTargetActive(pace) {
      var active = this.active,
        count = this.count,
        maxCount = this.maxCount;
      if (pace) {
        if (this.loop) {
          return range$1(active + pace, -1, count);
        }
        return range$1(active + pace, 0, maxCount);
      }
      return active;
    },
    getTargetOffset: function getTargetOffset(targetActive, offset) {
      if (offset === void 0) {
        offset = 0;
      }
      var currentPosition = targetActive * this.size;
      if (!this.loop) {
        currentPosition = Math.min(currentPosition, -this.minOffset);
      }
      var targetOffset = offset - currentPosition;
      if (!this.loop) {
        targetOffset = range$1(targetOffset, this.minOffset, 0);
      }
      return targetOffset;
    },
    move: function move(_ref) {
      var _ref$pace = _ref.pace,
        pace = _ref$pace === void 0 ? 0 : _ref$pace,
        _ref$offset = _ref.offset,
        offset = _ref$offset === void 0 ? 0 : _ref$offset,
        emitChange = _ref.emitChange;
      var loop = this.loop,
        count = this.count,
        active = this.active,
        children = this.children,
        trackSize = this.trackSize,
        minOffset = this.minOffset;
      if (count <= 1) {
        return;
      }
      var targetActive = this.getTargetActive(pace);
      var targetOffset = this.getTargetOffset(targetActive, offset); // auto move first and last swipe in loop mode

      if (loop) {
        if (children[0] && targetOffset !== minOffset) {
          var outRightBound = targetOffset < minOffset;
          children[0].offset = outRightBound ? trackSize : 0;
        }
        if (children[count - 1] && targetOffset !== 0) {
          var outLeftBound = targetOffset > 0;
          children[count - 1].offset = outLeftBound ? -trackSize : 0;
        }
      }
      this.active = targetActive;
      this.offset = targetOffset;
      if (emitChange && targetActive !== active) {
        this.$emit('change', this.activeIndicator);
      }
    },
    // @exposed-api
    prev: function prev() {
      var _this = this;
      this.correctPosition();
      this.resetTouchStatus();
      doubleRaf(function () {
        _this.swiping = false;
        _this.move({
          pace: -1,
          emitChange: true
        });
      });
    },
    // @exposed-api
    next: function next() {
      var _this2 = this;
      this.correctPosition();
      this.resetTouchStatus();
      doubleRaf(function () {
        _this2.swiping = false;
        _this2.move({
          pace: 1,
          emitChange: true
        });
      });
    },
    // @exposed-api
    swipeTo: function swipeTo(index, options) {
      var _this3 = this;
      if (options === void 0) {
        options = {};
      }
      this.correctPosition();
      this.resetTouchStatus();
      doubleRaf(function () {
        var targetIndex;
        if (_this3.loop && index === _this3.count) {
          targetIndex = _this3.active === 0 ? 0 : index;
        } else {
          targetIndex = index % _this3.count;
        }
        if (options.immediate) {
          doubleRaf(function () {
            _this3.swiping = false;
          });
        } else {
          _this3.swiping = false;
        }
        _this3.move({
          pace: targetIndex - _this3.active,
          emitChange: true
        });
      });
    },
    correctPosition: function correctPosition() {
      this.swiping = true;
      if (this.active <= -1) {
        this.move({
          pace: this.count
        });
      }
      if (this.active >= this.count) {
        this.move({
          pace: -this.count
        });
      }
    },
    clear: function clear() {
      clearTimeout(this.timer);
    },
    autoPlay: function autoPlay() {
      var _this4 = this;
      var autoplay = this.autoplay;
      if (autoplay > 0 && this.count > 1) {
        this.clear();
        this.timer = setTimeout(function () {
          _this4.next();
          _this4.autoPlay();
        }, autoplay);
      }
    },
    genIndicator: function genIndicator() {
      var _this5 = this;
      var h = this.$createElement;
      var count = this.count,
        activeIndicator = this.activeIndicator;
      var slot = this.slots('indicator');
      if (slot) {
        return slot;
      }
      if (this.showIndicators && count > 1) {
        return h("div", {
          "class": bem$D('indicators', {
            vertical: this.vertical
          })
        }, [Array.apply(void 0, Array(count)).map(function (empty, index) {
          return h("i", {
            "class": bem$D('indicator', {
              active: index === activeIndicator
            }),
            "style": index === activeIndicator ? _this5.indicatorStyle : null
          });
        })]);
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$D()
    }, [h("div", {
      "ref": "track",
      "style": this.trackStyle,
      "class": bem$D('track', {
        vertical: this.vertical
      })
    }, [this.slots()]), this.genIndicator()]);
  }
});

var _createNamespace$D = createNamespace('swipe-item'),
  createComponent$H = _createNamespace$D[0],
  bem$C = _createNamespace$D[1];
var SwipeItem = createComponent$H({
  mixins: [ChildrenMixin('vanSwipe')],
  data: function data() {
    return {
      offset: 0,
      inited: false,
      mounted: false
    };
  },
  mounted: function mounted() {
    var _this = this;
    this.$nextTick(function () {
      _this.mounted = true;
    });
  },
  computed: {
    style: function style() {
      var style = {};
      var _this$parent = this.parent,
        size = _this$parent.size,
        vertical = _this$parent.vertical;
      if (size) {
        style[vertical ? 'height' : 'width'] = size + "px";
      }
      if (this.offset) {
        style.transform = "translate" + (vertical ? 'Y' : 'X') + "(" + this.offset + "px)";
      }
      return style;
    },
    shouldRender: function shouldRender() {
      var index = this.index,
        inited = this.inited,
        parent = this.parent,
        mounted = this.mounted;
      if (!parent.lazyRender || inited) {
        return true;
      } // wait for all item to mount, so we can get the exact count

      if (!mounted) {
        return false;
      }
      var active = parent.activeIndicator;
      var maxActive = parent.count - 1;
      var prevActive = active === 0 && parent.loop ? maxActive : active - 1;
      var nextActive = active === maxActive && parent.loop ? 0 : active + 1;
      var shouldRender = index === active || index === prevActive || index === nextActive;
      if (shouldRender) {
        this.inited = true;
      }
      return shouldRender;
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$C(),
      "style": this.style,
      "on": _extends$2({}, this.$listeners)
    }, [this.shouldRender && this.slots()]);
  }
});

// Utils
function getDistance$1(touches) {
  return Math.sqrt(Math.pow(touches[0].clientX - touches[1].clientX, 2) + Math.pow(touches[0].clientY - touches[1].clientY, 2));
}
var ImagePreviewItem = {
  mixins: [TouchMixin],
  props: {
    src: String,
    show: Boolean,
    active: Number,
    minZoom: [Number, String],
    maxZoom: [Number, String],
    rootWidth: Number,
    rootHeight: Number
  },
  data: function data() {
    return {
      scale: 1,
      moveX: 0,
      moveY: 0,
      moving: false,
      zooming: false,
      imageRatio: 0,
      displayWidth: 0,
      displayHeight: 0
    };
  },
  computed: {
    vertical: function vertical() {
      var rootWidth = this.rootWidth,
        rootHeight = this.rootHeight;
      var rootRatio = rootHeight / rootWidth;
      return this.imageRatio > rootRatio;
    },
    imageStyle: function imageStyle() {
      var scale = this.scale;
      var style = {
        transitionDuration: this.zooming || this.moving ? '0s' : '.3s'
      };
      if (scale !== 1) {
        var offsetX = this.moveX / scale;
        var offsetY = this.moveY / scale;
        style.transform = "scale(" + scale + ", " + scale + ") translate(" + offsetX + "px, " + offsetY + "px)";
      }
      return style;
    },
    maxMoveX: function maxMoveX() {
      if (this.imageRatio) {
        var displayWidth = this.vertical ? this.rootHeight / this.imageRatio : this.rootWidth;
        return Math.max(0, (this.scale * displayWidth - this.rootWidth) / 2);
      }
      return 0;
    },
    maxMoveY: function maxMoveY() {
      if (this.imageRatio) {
        var displayHeight = this.vertical ? this.rootHeight : this.rootWidth * this.imageRatio;
        return Math.max(0, (this.scale * displayHeight - this.rootHeight) / 2);
      }
      return 0;
    }
  },
  watch: {
    active: 'resetScale',
    show: function show(val) {
      if (!val) {
        this.resetScale();
      }
    }
  },
  mounted: function mounted() {
    this.bindTouchEvent(this.$el);
  },
  methods: {
    resetScale: function resetScale() {
      this.setScale(1);
      this.moveX = 0;
      this.moveY = 0;
    },
    setScale: function setScale(scale) {
      scale = range$1(scale, +this.minZoom, +this.maxZoom);
      if (scale !== this.scale) {
        this.scale = scale;
        this.$emit('scale', {
          scale: this.scale,
          index: this.active
        });
      }
    },
    toggleScale: function toggleScale() {
      var scale = this.scale > 1 ? 1 : 2;
      this.setScale(scale);
      this.moveX = 0;
      this.moveY = 0;
    },
    onTouchStart: function onTouchStart(event) {
      var touches = event.touches;
      var _this$offsetX = this.offsetX,
        offsetX = _this$offsetX === void 0 ? 0 : _this$offsetX;
      this.touchStart(event);
      this.touchStartTime = new Date();
      this.fingerNum = touches.length;
      this.startMoveX = this.moveX;
      this.startMoveY = this.moveY;
      this.moving = this.fingerNum === 1 && this.scale !== 1;
      this.zooming = this.fingerNum === 2 && !offsetX;
      if (this.zooming) {
        this.startScale = this.scale;
        this.startDistance = getDistance$1(event.touches);
      }
    },
    onTouchMove: function onTouchMove(event) {
      var touches = event.touches;
      this.touchMove(event);
      if (this.moving || this.zooming) {
        preventDefault(event, true);
      }
      if (this.moving) {
        var moveX = this.deltaX + this.startMoveX;
        var moveY = this.deltaY + this.startMoveY;
        this.moveX = range$1(moveX, -this.maxMoveX, this.maxMoveX);
        this.moveY = range$1(moveY, -this.maxMoveY, this.maxMoveY);
      }
      if (this.zooming && touches.length === 2) {
        var distance = getDistance$1(touches);
        var scale = this.startScale * distance / this.startDistance;
        this.setScale(scale);
      }
    },
    onTouchEnd: function onTouchEnd(event) {
      var stopPropagation = false;
      /* istanbul ignore else */

      if (this.moving || this.zooming) {
        stopPropagation = true;
        if (this.moving && this.startMoveX === this.moveX && this.startMoveY === this.moveY) {
          stopPropagation = false;
        }
        if (!event.touches.length) {
          if (this.zooming) {
            this.moveX = range$1(this.moveX, -this.maxMoveX, this.maxMoveX);
            this.moveY = range$1(this.moveY, -this.maxMoveY, this.maxMoveY);
            this.zooming = false;
          }
          this.moving = false;
          this.startMoveX = 0;
          this.startMoveY = 0;
          this.startScale = 1;
          if (this.scale < 1) {
            this.resetScale();
          }
        }
      } // eliminate tap delay on safari

      preventDefault(event, stopPropagation);
      this.checkTap();
      this.resetTouchStatus();
    },
    checkTap: function checkTap() {
      var _this = this;
      if (this.fingerNum > 1) {
        return;
      }
      var _this$offsetX2 = this.offsetX,
        offsetX = _this$offsetX2 === void 0 ? 0 : _this$offsetX2,
        _this$offsetY = this.offsetY,
        offsetY = _this$offsetY === void 0 ? 0 : _this$offsetY;
      var deltaTime = new Date() - this.touchStartTime;
      var TAP_TIME = 250;
      var TAP_OFFSET = 5;
      if (offsetX < TAP_OFFSET && offsetY < TAP_OFFSET && deltaTime < TAP_TIME) {
        if (this.doubleTapTimer) {
          clearTimeout(this.doubleTapTimer);
          this.doubleTapTimer = null;
          this.toggleScale();
        } else {
          this.doubleTapTimer = setTimeout(function () {
            _this.$emit('close');
            _this.doubleTapTimer = null;
          }, TAP_TIME);
        }
      }
    },
    onLoad: function onLoad(event) {
      var _event$target = event.target,
        naturalWidth = _event$target.naturalWidth,
        naturalHeight = _event$target.naturalHeight;
      this.imageRatio = naturalHeight / naturalWidth;
    }
  },
  render: function render() {
    var h = arguments[0];
    var imageSlots = {
      loading: function loading() {
        return h(Loading$1, {
          "attrs": {
            "type": "spinner"
          }
        });
      }
    };
    return h(SwipeItem, {
      "class": bem$E('swipe-item')
    }, [h(Image$1, {
      "attrs": {
        "src": this.src,
        "fit": "contain"
      },
      "class": bem$E('image', {
        vertical: this.vertical
      }),
      "style": this.imageStyle,
      "scopedSlots": imageSlots,
      "on": {
        "load": this.onLoad
      }
    })]);
  }
};

// Utils
var VueImagePreview = createComponent$J({
  mixins: [TouchMixin, PopupMixin({
    skipToggleEvent: true
  }), BindEventMixin(function (bind) {
    bind(window, 'resize', this.resize, true);
    bind(window, 'orientationchange', this.resize, true);
  })],
  props: {
    className: null,
    closeable: Boolean,
    asyncClose: Boolean,
    overlayStyle: Object,
    showIndicators: Boolean,
    images: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    loop: {
      type: Boolean,
      default: true
    },
    overlay: {
      type: Boolean,
      default: true
    },
    minZoom: {
      type: [Number, String],
      default: 1 / 3
    },
    maxZoom: {
      type: [Number, String],
      default: 3
    },
    transition: {
      type: String,
      default: 'van-fade'
    },
    showIndex: {
      type: Boolean,
      default: true
    },
    swipeDuration: {
      type: [Number, String],
      default: 300
    },
    startPosition: {
      type: [Number, String],
      default: 0
    },
    overlayClass: {
      type: String,
      default: bem$E('overlay')
    },
    closeIcon: {
      type: String,
      default: 'clear'
    },
    closeOnPopstate: {
      type: Boolean,
      default: true
    },
    closeIconPosition: {
      type: String,
      default: 'top-right'
    }
  },
  data: function data() {
    return {
      active: 0,
      rootWidth: 0,
      rootHeight: 0,
      doubleClickTimer: null
    };
  },
  mounted: function mounted() {
    this.resize();
  },
  watch: {
    startPosition: 'setActive',
    value: function value(val) {
      var _this = this;
      if (val) {
        this.setActive(+this.startPosition);
        this.$nextTick(function () {
          _this.resize();
          _this.$refs.swipe.swipeTo(+_this.startPosition, {
            immediate: true
          });
        });
      } else {
        this.$emit('close', {
          index: this.active,
          url: this.images[this.active]
        });
      }
    }
  },
  methods: {
    resize: function resize() {
      if (this.$el && this.$el.getBoundingClientRect) {
        var rect = this.$el.getBoundingClientRect();
        this.rootWidth = rect.width;
        this.rootHeight = rect.height;
      }
    },
    emitClose: function emitClose() {
      if (!this.asyncClose) {
        this.$emit('input', false);
      }
    },
    emitScale: function emitScale(args) {
      this.$emit('scale', args);
    },
    setActive: function setActive(active) {
      if (active !== this.active) {
        this.active = active;
        this.$emit('change', active);
      }
    },
    genIndex: function genIndex() {
      var h = this.$createElement;
      if (this.showIndex) {
        return h("div", {
          "class": bem$E('index')
        }, [this.slots('index', {
          index: this.active
        }) || this.active + 1 + " / " + this.images.length]);
      }
    },
    genCover: function genCover() {
      var h = this.$createElement;
      var cover = this.slots('cover');
      if (cover) {
        return h("div", {
          "class": bem$E('cover')
        }, [cover]);
      }
    },
    genImages: function genImages() {
      var _this2 = this;
      var h = this.$createElement;
      return h(Swipe, {
        "ref": "swipe",
        "attrs": {
          "lazyRender": true,
          "loop": this.loop,
          "duration": this.swipeDuration,
          "initialSwipe": this.startPosition,
          "showIndicators": this.showIndicators,
          "indicatorColor": "white"
        },
        "class": bem$E('swipe'),
        "on": {
          "change": this.setActive
        }
      }, [this.images.map(function (image) {
        return h(ImagePreviewItem, {
          "attrs": {
            "src": image,
            "show": _this2.value,
            "active": _this2.active,
            "maxZoom": _this2.maxZoom,
            "minZoom": _this2.minZoom,
            "rootWidth": _this2.rootWidth,
            "rootHeight": _this2.rootHeight
          },
          "on": {
            "scale": _this2.emitScale,
            "close": _this2.emitClose
          }
        });
      })]);
    },
    genClose: function genClose() {
      var h = this.$createElement;
      if (this.closeable) {
        return h(Icon$3, {
          "attrs": {
            "role": "button",
            "name": this.closeIcon
          },
          "class": bem$E('close-icon', this.closeIconPosition),
          "on": {
            "click": this.emitClose
          }
        });
      }
    },
    onClosed: function onClosed() {
      this.$emit('closed');
    },
    // @exposed-api
    swipeTo: function swipeTo(index, options) {
      if (this.$refs.swipe) {
        this.$refs.swipe.swipeTo(index, options);
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("transition", {
      "attrs": {
        "name": this.transition
      },
      "on": {
        "afterLeave": this.onClosed
      }
    }, [this.shouldRender ? h("div", {
      "directives": [{
        name: "show",
        value: this.value
      }],
      "class": [bem$E(), this.className]
    }, [this.genClose(), this.genImages(), this.genIndex(), this.genCover()]) : null]);
  }
});

var instance$2;
var defaultConfig = {
  loop: true,
  value: true,
  images: [],
  maxZoom: 3,
  minZoom: 1 / 3,
  onClose: null,
  onChange: null,
  className: '',
  showIndex: true,
  closeable: false,
  closeIcon: 'clear',
  asyncClose: false,
  transition: 'van-fade',
  getContainer: 'body',
  overlayStyle: null,
  startPosition: 0,
  swipeDuration: 300,
  showIndicators: false,
  closeOnPopstate: true,
  closeIconPosition: 'top-right'
};
var initInstance = function initInstance() {
  instance$2 = new (Vue.extend(VueImagePreview))({
    el: document.createElement('div')
  });
  document.body.appendChild(instance$2.$el);
  instance$2.$on('change', function (index) {
    if (instance$2.onChange) {
      instance$2.onChange(index);
    }
  });
  instance$2.$on('scale', function (data) {
    if (instance$2.onScale) {
      instance$2.onScale(data);
    }
  });
};
var ImagePreview = function ImagePreview(images, startPosition) {
  if (startPosition === void 0) {
    startPosition = 0;
  }

  /* istanbul ignore if */
  if (isServer$1) {
    return;
  }
  if (!instance$2) {
    initInstance();
  }
  var options = Array.isArray(images) ? {
    images: images,
    startPosition: startPosition
  } : images;
  _extends$2(instance$2, defaultConfig, options);
  instance$2.$once('input', function (show) {
    instance$2.value = show;
  });
  instance$2.$once('closed', function () {
    instance$2.images = [];
  });
  if (options.onClose) {
    instance$2.$off('close');
    instance$2.$once('close', options.onClose);
  }
  return instance$2;
};
ImagePreview.Component = VueImagePreview;
ImagePreview.install = function () {
  Vue.use(VueImagePreview);
};
var ImagePreview$1 = ImagePreview;

var _createNamespace$C = createNamespace('index-anchor'),
  createComponent$G = _createNamespace$C[0],
  bem$B = _createNamespace$C[1];
var IndexAnchor = createComponent$G({
  mixins: [ChildrenMixin('vanIndexBar', {
    indexKey: 'childrenIndex'
  })],
  props: {
    index: [Number, String]
  },
  data: function data() {
    return {
      top: 0,
      left: null,
      rect: {
        top: 0,
        height: 0
      },
      width: null,
      active: false
    };
  },
  computed: {
    sticky: function sticky() {
      return this.active && this.parent.sticky;
    },
    anchorStyle: function anchorStyle() {
      if (this.sticky) {
        return {
          zIndex: "" + this.parent.zIndex,
          left: this.left ? this.left + "px" : null,
          width: this.width ? this.width + "px" : null,
          transform: "translate3d(0, " + this.top + "px, 0)",
          color: this.parent.highlightColor
        };
      }
    }
  },
  mounted: function mounted() {
    var rect = this.$el.getBoundingClientRect();
    this.rect.height = rect.height;
  },
  methods: {
    scrollIntoView: function scrollIntoView() {
      this.$el.scrollIntoView();
    },
    getRect: function getRect(scroller, scrollerRect) {
      var el = this.$el;
      var elRect = el.getBoundingClientRect();
      this.rect.height = elRect.height;
      if (scroller === window || scroller === document.body) {
        this.rect.top = elRect.top + getRootScrollTop();
      } else {
        this.rect.top = elRect.top + getScrollTop(scroller) - scrollerRect.top;
      }
      return this.rect;
    }
  },
  render: function render() {
    var _ref;
    var h = arguments[0];
    var sticky = this.sticky;
    return h("div", {
      "style": {
        height: sticky ? this.rect.height + "px" : null
      }
    }, [h("div", {
      "style": this.anchorStyle,
      "class": [bem$B({
        sticky: sticky
      }), (_ref = {}, _ref[BORDER_BOTTOM] = sticky, _ref)]
    }, [this.slots('default') || this.index])]);
  }
});

// Utils
function genAlphabet() {
  var indexList = [];
  var charCodeOfA = 'A'.charCodeAt(0);
  for (var i = 0; i < 26; i++) {
    indexList.push(String.fromCharCode(charCodeOfA + i));
  }
  return indexList;
}
var _createNamespace$B = createNamespace('index-bar'),
  createComponent$F = _createNamespace$B[0],
  bem$A = _createNamespace$B[1];
var IndexBar = createComponent$F({
  mixins: [TouchMixin, ParentMixin('vanIndexBar'), BindEventMixin(function (bind) {
    if (!this.scroller) {
      this.scroller = getScroller(this.$el);
    }
    bind(this.scroller, 'scroll', this.onScroll);
  })],
  props: {
    zIndex: [Number, String],
    highlightColor: String,
    sticky: {
      type: Boolean,
      default: true
    },
    stickyOffsetTop: {
      type: Number,
      default: 0
    },
    indexList: {
      type: Array,
      default: genAlphabet
    }
  },
  data: function data() {
    return {
      activeAnchorIndex: null
    };
  },
  computed: {
    sidebarStyle: function sidebarStyle() {
      if (isDef(this.zIndex)) {
        return {
          zIndex: this.zIndex + 1
        };
      }
    },
    highlightStyle: function highlightStyle() {
      var highlightColor = this.highlightColor;
      if (highlightColor) {
        return {
          color: highlightColor
        };
      }
    }
  },
  watch: {
    indexList: function indexList() {
      this.$nextTick(this.onScroll);
    },
    activeAnchorIndex: function activeAnchorIndex(value) {
      if (value) {
        this.$emit('change', value);
      }
    }
  },
  methods: {
    onScroll: function onScroll() {
      var _this = this;
      if (isHidden(this.$el)) {
        return;
      }
      var scrollTop = getScrollTop(this.scroller);
      var scrollerRect = this.getScrollerRect();
      var rects = this.children.map(function (item) {
        return item.getRect(_this.scroller, scrollerRect);
      });
      var active = this.getActiveAnchorIndex(scrollTop, rects);
      this.activeAnchorIndex = this.indexList[active];
      if (this.sticky) {
        this.children.forEach(function (item, index) {
          if (index === active || index === active - 1) {
            var rect = item.$el.getBoundingClientRect();
            item.left = rect.left;
            item.width = rect.width;
          } else {
            item.left = null;
            item.width = null;
          }
          if (index === active) {
            item.active = true;
            item.top = Math.max(_this.stickyOffsetTop, rects[index].top - scrollTop) + scrollerRect.top;
          } else if (index === active - 1) {
            var activeItemTop = rects[active].top - scrollTop;
            item.active = activeItemTop > 0;
            item.top = activeItemTop + scrollerRect.top - rects[index].height;
          } else {
            item.active = false;
          }
        });
      }
    },
    getScrollerRect: function getScrollerRect() {
      if (this.scroller.getBoundingClientRect) {
        return this.scroller.getBoundingClientRect();
      }
      return {
        top: 0,
        left: 0
      };
    },
    getActiveAnchorIndex: function getActiveAnchorIndex(scrollTop, rects) {
      for (var i = this.children.length - 1; i >= 0; i--) {
        var prevHeight = i > 0 ? rects[i - 1].height : 0;
        var reachTop = this.sticky ? prevHeight + this.stickyOffsetTop : 0;
        if (scrollTop + reachTop >= rects[i].top) {
          return i;
        }
      }
      return -1;
    },
    onClick: function onClick(event) {
      this.scrollToElement(event.target);
    },
    onTouchMove: function onTouchMove(event) {
      this.touchMove(event);
      if (this.direction === 'vertical') {
        preventDefault(event);
        var _event$touches$ = event.touches[0],
          clientX = _event$touches$.clientX,
          clientY = _event$touches$.clientY;
        var target = document.elementFromPoint(clientX, clientY);
        if (target) {
          var index = target.dataset.index;
          /* istanbul ignore else */

          if (this.touchActiveIndex !== index) {
            this.touchActiveIndex = index;
            this.scrollToElement(target);
          }
        }
      }
    },
    scrollTo: function scrollTo(index) {
      var match = this.children.filter(function (item) {
        return String(item.index) === index;
      });
      if (match[0]) {
        match[0].scrollIntoView();
        if (this.sticky && this.stickyOffsetTop) {
          setRootScrollTop(getRootScrollTop() - this.stickyOffsetTop);
        }
        this.$emit('select', match[0].index);
      }
    },
    scrollToElement: function scrollToElement(element) {
      var index = element.dataset.index;
      this.scrollTo(index);
    },
    onTouchEnd: function onTouchEnd() {
      this.active = null;
    }
  },
  render: function render() {
    var _this2 = this;
    var h = arguments[0];
    var Indexes = this.indexList.map(function (index) {
      var active = index === _this2.activeAnchorIndex;
      return h("span", {
        "class": bem$A('index', {
          active: active
        }),
        "style": active ? _this2.highlightStyle : null,
        "attrs": {
          "data-index": index
        }
      }, [index]);
    });
    return h("div", {
      "class": bem$A()
    }, [h("div", {
      "class": bem$A('sidebar'),
      "style": this.sidebarStyle,
      "on": {
        "click": this.onClick,
        "touchstart": this.touchStart,
        "touchmove": this.onTouchMove,
        "touchend": this.onTouchEnd,
        "touchcancel": this.onTouchEnd
      }
    }, [Indexes]), this.slots('default')]);
  }
});

// Utils
var _createNamespace$A = createNamespace('list'),
  createComponent$E = _createNamespace$A[0],
  bem$z = _createNamespace$A[1],
  t$e = _createNamespace$A[2];
var List = createComponent$E({
  mixins: [BindEventMixin(function (bind) {
    if (!this.scroller) {
      this.scroller = getScroller(this.$el);
    }
    bind(this.scroller, 'scroll', this.check);
  })],
  model: {
    prop: 'loading'
  },
  props: {
    error: Boolean,
    loading: Boolean,
    finished: Boolean,
    errorText: String,
    loadingText: String,
    finishedText: String,
    immediateCheck: {
      type: Boolean,
      default: true
    },
    offset: {
      type: [Number, String],
      default: 300
    },
    direction: {
      type: String,
      default: 'down'
    }
  },
  data: function data() {
    return {
      // use sync innerLoading state to avoid repeated loading in some edge cases
      innerLoading: this.loading
    };
  },
  updated: function updated() {
    this.innerLoading = this.loading;
  },
  mounted: function mounted() {
    if (this.immediateCheck) {
      this.check();
    }
  },
  watch: {
    loading: 'check',
    finished: 'check'
  },
  methods: {
    // @exposed-api
    check: function check() {
      var _this = this;
      this.$nextTick(function () {
        if (_this.innerLoading || _this.finished || _this.error) {
          return;
        }
        var el = _this.$el,
          scroller = _this.scroller,
          offset = _this.offset,
          direction = _this.direction;
        var scrollerRect;
        if (scroller.getBoundingClientRect) {
          scrollerRect = scroller.getBoundingClientRect();
        } else {
          scrollerRect = {
            top: 0,
            bottom: scroller.innerHeight
          };
        }
        var scrollerHeight = scrollerRect.bottom - scrollerRect.top;
        /* istanbul ignore next */

        if (!scrollerHeight || isHidden(el)) {
          return false;
        }
        var isReachEdge = false;
        var placeholderRect = _this.$refs.placeholder.getBoundingClientRect();
        if (direction === 'up') {
          isReachEdge = scrollerRect.top - placeholderRect.top <= offset;
        } else {
          isReachEdge = placeholderRect.bottom - scrollerRect.bottom <= offset;
        }
        if (isReachEdge) {
          _this.innerLoading = true;
          _this.$emit('input', true);
          _this.$emit('load');
        }
      });
    },
    clickErrorText: function clickErrorText() {
      this.$emit('update:error', false);
      this.check();
    },
    genLoading: function genLoading() {
      var h = this.$createElement;
      if (this.innerLoading && !this.finished) {
        return h("div", {
          "key": "loading",
          "class": bem$z('loading')
        }, [this.slots('loading') || h(Loading$1, {
          "attrs": {
            "size": "16"
          }
        }, [this.loadingText || t$e('loading')])]);
      }
    },
    genFinishedText: function genFinishedText() {
      var h = this.$createElement;
      if (this.finished) {
        var text = this.slots('finished') || this.finishedText;
        if (text) {
          return h("div", {
            "class": bem$z('finished-text')
          }, [text]);
        }
      }
    },
    genErrorText: function genErrorText() {
      var h = this.$createElement;
      if (this.error) {
        var text = this.slots('error') || this.errorText;
        if (text) {
          return h("div", {
            "on": {
              "click": this.clickErrorText
            },
            "class": bem$z('error-text')
          }, [text]);
        }
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    var Placeholder = h("div", {
      "ref": "placeholder",
      "key": "placeholder",
      "class": bem$z('placeholder')
    });
    return h("div", {
      "class": bem$z(),
      "attrs": {
        "role": "feed",
        "aria-busy": this.innerLoading
      }
    }, [this.direction === 'down' ? this.slots() : Placeholder, this.genLoading(), this.genFinishedText(), this.genErrorText(), this.direction === 'up' ? this.slots() : Placeholder]);
  }
});

// Utils
var _createNamespace$z = createNamespace('nav-bar'),
  createComponent$D = _createNamespace$z[0],
  bem$y = _createNamespace$z[1];
var NavBar = createComponent$D({
  props: {
    title: String,
    fixed: Boolean,
    zIndex: [Number, String],
    leftText: String,
    rightText: String,
    leftArrow: Boolean,
    placeholder: Boolean,
    safeAreaInsetTop: Boolean,
    border: {
      type: Boolean,
      default: true
    }
  },
  data: function data() {
    return {
      height: null
    };
  },
  mounted: function mounted() {
    var _this = this;
    if (this.placeholder && this.fixed) {
      var setHeight = function setHeight() {
        _this.height = _this.$refs.navBar.getBoundingClientRect().height;
      };
      setHeight(); // https://github.com/vant-ui/vant/issues/10131

      setTimeout(setHeight, 100);
    }
  },
  methods: {
    genLeft: function genLeft() {
      var h = this.$createElement;
      var leftSlot = this.slots('left');
      if (leftSlot) {
        return leftSlot;
      }
      return [this.leftArrow && h(Icon$3, {
        "class": bem$y('arrow'),
        "attrs": {
          "name": "arrow-left"
        }
      }), this.leftText && h("span", {
        "class": bem$y('text')
      }, [this.leftText])];
    },
    genRight: function genRight() {
      var h = this.$createElement;
      var rightSlot = this.slots('right');
      if (rightSlot) {
        return rightSlot;
      }
      if (this.rightText) {
        return h("span", {
          "class": bem$y('text')
        }, [this.rightText]);
      }
    },
    genNavBar: function genNavBar() {
      var _ref;
      var h = this.$createElement;
      return h("div", {
        "ref": "navBar",
        "style": {
          zIndex: this.zIndex
        },
        "class": [bem$y({
          fixed: this.fixed,
          'safe-area-inset-top': this.safeAreaInsetTop
        }), (_ref = {}, _ref[BORDER_BOTTOM] = this.border, _ref)]
      }, [h("div", {
        "class": bem$y('content')
      }, [this.hasLeft() && h("div", {
        "class": bem$y('left'),
        "on": {
          "click": this.onClickLeft
        }
      }, [this.genLeft()]), h("div", {
        "class": [bem$y('title'), 'van-ellipsis']
      }, [this.slots('title') || this.title]), this.hasRight() && h("div", {
        "class": bem$y('right'),
        "on": {
          "click": this.onClickRight
        }
      }, [this.genRight()])])]);
    },
    hasLeft: function hasLeft() {
      return this.leftArrow || this.leftText || this.slots('left');
    },
    hasRight: function hasRight() {
      return this.rightText || this.slots('right');
    },
    onClickLeft: function onClickLeft(event) {
      this.$emit('click-left', event);
    },
    onClickRight: function onClickRight(event) {
      this.$emit('click-right', event);
    }
  },
  render: function render() {
    var h = arguments[0];
    if (this.placeholder && this.fixed) {
      return h("div", {
        "class": bem$y('placeholder'),
        "style": {
          height: this.height + "px"
        }
      }, [this.genNavBar()]);
    }
    return this.genNavBar();
  }
});

var _createNamespace$y = createNamespace('notice-bar'),
  createComponent$C = _createNamespace$y[0],
  bem$x = _createNamespace$y[1];
var NoticeBar = createComponent$C({
  mixins: [BindEventMixin(function (bind) {
    // fix cache issues with forwards and back history in safari
    // see: https://guwii.com/cache-issues-with-forwards-and-back-history-in-safari/
    bind(window, 'pageshow', this.reset);
  })],
  inject: {
    vanPopup: {
      default: null
    }
  },
  props: {
    text: String,
    mode: String,
    color: String,
    leftIcon: String,
    wrapable: Boolean,
    background: String,
    scrollable: {
      type: Boolean,
      default: null
    },
    delay: {
      type: [Number, String],
      default: 1
    },
    speed: {
      type: [Number, String],
      default: 60
    }
  },
  data: function data() {
    return {
      show: true,
      offset: 0,
      duration: 0,
      wrapWidth: 0,
      contentWidth: 0
    };
  },
  watch: {
    scrollable: 'reset',
    text: {
      handler: 'reset',
      immediate: true
    }
  },
  created: function created() {
    // https://github.com/vant-ui/vant/issues/8634
    if (this.vanPopup) {
      this.vanPopup.onReopen(this.reset);
    }
  },
  activated: function activated() {
    this.reset();
  },
  methods: {
    onClickIcon: function onClickIcon(event) {
      if (this.mode === 'closeable') {
        this.show = false;
        this.$emit('close', event);
      }
    },
    onTransitionEnd: function onTransitionEnd() {
      var _this = this;
      this.offset = this.wrapWidth;
      this.duration = 0; // wait for Vue to render offset
      // using nextTick won't work in iOS14

      raf(function () {
        // use double raf to ensure animation can start
        doubleRaf(function () {
          _this.offset = -_this.contentWidth;
          _this.duration = (_this.contentWidth + _this.wrapWidth) / _this.speed;
          _this.$emit('replay');
        });
      });
    },
    // not an exposed-api, but may used by some users
    start: function start() {
      this.reset();
    },
    // @exposed-api
    reset: function reset() {
      var _this2 = this;
      var delay = isDef(this.delay) ? this.delay * 1000 : 0;
      this.offset = 0;
      this.duration = 0;
      this.wrapWidth = 0;
      this.contentWidth = 0;
      clearTimeout(this.startTimer);
      this.startTimer = setTimeout(function () {
        var _this2$$refs = _this2.$refs,
          wrap = _this2$$refs.wrap,
          content = _this2$$refs.content;
        if (!wrap || !content || _this2.scrollable === false) {
          return;
        }
        var wrapWidth = wrap.getBoundingClientRect().width;
        var contentWidth = content.getBoundingClientRect().width;
        if (_this2.scrollable || contentWidth > wrapWidth) {
          doubleRaf(function () {
            _this2.offset = -contentWidth;
            _this2.duration = contentWidth / _this2.speed;
            _this2.wrapWidth = wrapWidth;
            _this2.contentWidth = contentWidth;
          });
        }
      }, delay);
    }
  },
  render: function render() {
    var _this3 = this;
    var h = arguments[0];
    var slots = this.slots,
      mode = this.mode,
      leftIcon = this.leftIcon,
      onClickIcon = this.onClickIcon;
    var barStyle = {
      color: this.color,
      background: this.background
    };
    var contentStyle = {
      transform: this.offset ? "translateX(" + this.offset + "px)" : '',
      transitionDuration: this.duration + 's'
    };
    function LeftIcon() {
      var slot = slots('left-icon');
      if (slot) {
        return slot;
      }
      if (leftIcon) {
        return h(Icon$3, {
          "class": bem$x('left-icon'),
          "attrs": {
            "name": leftIcon
          }
        });
      }
    }
    function RightIcon() {
      var slot = slots('right-icon');
      if (slot) {
        return slot;
      }
      var iconName;
      if (mode === 'closeable') {
        iconName = 'cross';
      } else if (mode === 'link') {
        iconName = 'arrow';
      }
      if (iconName) {
        return h(Icon$3, {
          "class": bem$x('right-icon'),
          "attrs": {
            "name": iconName
          },
          "on": {
            "click": onClickIcon
          }
        });
      }
    }
    return h("div", {
      "attrs": {
        "role": "alert"
      },
      "directives": [{
        name: "show",
        value: this.show
      }],
      "class": bem$x({
        wrapable: this.wrapable
      }),
      "style": barStyle,
      "on": {
        "click": function click(event) {
          _this3.$emit('click', event);
        }
      }
    }, [LeftIcon(), h("div", {
      "ref": "wrap",
      "class": bem$x('wrap'),
      "attrs": {
        "role": "marquee"
      }
    }, [h("div", {
      "ref": "content",
      "class": [bem$x('content'), {
        'van-ellipsis': this.scrollable === false && !this.wrapable
      }],
      "style": contentStyle,
      "on": {
        "transitionend": this.onTransitionEnd
      }
    }, [this.slots() || this.text])]), RightIcon()]);
  }
});

var _createNamespace$x = createNamespace('notify'),
  createComponent$B = _createNamespace$x[0],
  bem$w = _createNamespace$x[1];
function Notify$1(h, props, slots, ctx) {
  var style = {
    color: props.color,
    background: props.background
  };
  return h(Popup, _mergeJSXProps([{
    "attrs": {
      "value": props.value,
      "position": "top",
      "overlay": false,
      "duration": 0.2,
      "lockScroll": false
    },
    "style": style,
    "class": [bem$w([props.type]), props.className]
  }, inherit(ctx, true)]), [(slots.default == null ? void 0 : slots.default()) || props.message]);
}
Notify$1.props = _extends$2({}, popupMixinProps, {
  color: String,
  message: [Number, String],
  duration: [Number, String],
  className: null,
  background: String,
  getContainer: [String, Function],
  type: {
    type: String,
    default: 'danger'
  }
});
var VanNotify = createComponent$B(Notify$1);

var timer;
var instance$1;
function parseOptions$2(message) {
  return isObject$2(message) ? message : {
    message: message
  };
}
function Notify(options) {
  /* istanbul ignore if */
  if (isServer$1) {
    return;
  }
  if (!instance$1) {
    instance$1 = mount(VanNotify, {
      on: {
        click: function click(event) {
          if (instance$1.onClick) {
            instance$1.onClick(event);
          }
        },
        close: function close() {
          if (instance$1.onClose) {
            instance$1.onClose();
          }
        },
        opened: function opened() {
          if (instance$1.onOpened) {
            instance$1.onOpened();
          }
        }
      }
    });
  }
  options = _extends$2({}, Notify.currentOptions, parseOptions$2(options));
  _extends$2(instance$1, options);
  clearTimeout(timer);
  if (options.duration && options.duration > 0) {
    timer = setTimeout(Notify.clear, options.duration);
  }
  return instance$1;
}
function defaultOptions() {
  return {
    type: 'danger',
    value: true,
    message: '',
    color: undefined,
    background: undefined,
    duration: 3000,
    className: '',
    onClose: null,
    onClick: null,
    onOpened: null
  };
}
Notify.clear = function () {
  if (instance$1) {
    instance$1.value = false;
  }
};
Notify.currentOptions = defaultOptions();
Notify.setDefaultOptions = function (options) {
  _extends$2(Notify.currentOptions, options);
};
Notify.resetDefaultOptions = function () {
  Notify.currentOptions = defaultOptions();
};
Notify.install = function () {
  Vue.use(VanNotify);
};
Notify.Component = VanNotify;
Vue.prototype.$notify = Notify;

var DeleteIcon = {
  render: function render() {
    var h = arguments[0];
    return h("svg", {
      "attrs": {
        "viewBox": "0 0 32 22",
        "xmlns": "http://www.w3.org/2000/svg"
      }
    }, [h("path", {
      "attrs": {
        "d": "M28.016 0A3.991 3.991 0 0132 3.987v14.026c0 2.2-1.787 3.987-3.98 3.987H10.382c-.509 0-.996-.206-1.374-.585L.89 13.09C.33 12.62 0 11.84 0 11.006c0-.86.325-1.62.887-2.08L9.01.585A1.936 1.936 0 0110.383 0zm0 1.947H10.368L2.24 10.28c-.224.226-.312.432-.312.73 0 .287.094.51.312.729l8.128 8.333h17.648a2.041 2.041 0 002.037-2.04V3.987c0-1.127-.915-2.04-2.037-2.04zM23.028 6a.96.96 0 01.678.292.95.95 0 01-.003 1.377l-3.342 3.348 3.326 3.333c.189.188.292.43.292.679 0 .248-.103.49-.292.679a.96.96 0 01-.678.292.959.959 0 01-.677-.292L18.99 12.36l-3.343 3.345a.96.96 0 01-.677.292.96.96 0 01-.678-.292.962.962 0 01-.292-.68c0-.248.104-.49.292-.679l3.342-3.348-3.342-3.348A.963.963 0 0114 6.971c0-.248.104-.49.292-.679A.96.96 0 0114.97 6a.96.96 0 01.677.292l3.358 3.348 3.345-3.348A.96.96 0 0123.028 6z",
        "fill": "currentColor"
      }
    })]);
  }
};

var CollapseIcon = {
  render: function render() {
    var h = arguments[0];
    return h("svg", {
      "attrs": {
        "viewBox": "0 0 30 24",
        "xmlns": "http://www.w3.org/2000/svg"
      }
    }, [h("path", {
      "attrs": {
        "d": "M25.877 12.843h-1.502c-.188 0-.188 0-.188.19v1.512c0 .188 0 .188.188.188h1.5c.187 0 .187 0 .187-.188v-1.511c0-.19 0-.191-.185-.191zM17.999 10.2c0 .188 0 .188.188.188h1.687c.188 0 .188 0 .188-.188V8.688c0-.187.004-.187-.186-.19h-1.69c-.187 0-.187 0-.187.19V10.2zm2.25-3.967h1.5c.188 0 .188 0 .188-.188v-1.7c0-.19 0-.19-.188-.19h-1.5c-.189 0-.189 0-.189.19v1.7c0 .188 0 .188.19.188zm2.063 4.157h3.563c.187 0 .187 0 .187-.189V4.346c0-.19.004-.19-.185-.19h-1.69c-.187 0-.187 0-.187.188v4.155h-1.688c-.187 0-.187 0-.187.189v1.514c0 .19 0 .19.187.19zM14.812 24l2.812-3.4H12l2.813 3.4zm-9-11.157H4.31c-.188 0-.188 0-.188.19v1.512c0 .188 0 .188.188.188h1.502c.187 0 .187 0 .187-.188v-1.511c0-.19.01-.191-.189-.191zm15.937 0H8.25c-.188 0-.188 0-.188.19v1.512c0 .188 0 .188.188.188h13.5c.188 0 .188 0 .188-.188v-1.511c0-.19 0-.191-.188-.191zm-11.438-2.454h1.5c.188 0 .188 0 .188-.188V8.688c0-.187 0-.187-.188-.189h-1.5c-.187 0-.187 0-.187.189V10.2c0 .188 0 .188.187.188zM27.94 0c.563 0 .917.21 1.313.567.518.466.748.757.748 1.51v14.92c0 .567-.188 1.134-.562 1.512-.376.378-.938.566-1.313.566H2.063c-.563 0-.938-.188-1.313-.566-.562-.378-.75-.945-.75-1.511V2.078C0 1.51.188.944.562.567.938.189 1.5 0 1.875 0zm-.062 2H2v14.92h25.877V2zM5.81 4.157c.19 0 .19 0 .19.189v1.762c-.003.126-.024.126-.188.126H4.249c-.126-.003-.126-.023-.126-.188v-1.7c-.187-.19 0-.19.188-.19zm10.5 2.077h1.503c.187 0 .187 0 .187-.188v-1.7c0-.19 0-.19-.187-.19h-1.502c-.188 0-.188.001-.188.19v1.7c0 .188 0 .188.188.188zM7.875 8.5c.187 0 .187.002.187.189V10.2c0 .188 0 .188-.187.188H4.249c-.126-.002-.126-.023-.126-.188V8.625c.003-.126.024-.126.188-.126zm7.875 0c.19.002.19.002.19.189v1.575c-.003.126-.024.126-.19.126h-1.563c-.126-.002-.126-.023-.126-.188V8.625c.002-.126.023-.126.189-.126zm-6-4.342c.187 0 .187 0 .187.189v1.7c0 .188 0 .188-.187.188H8.187c-.126-.003-.126-.023-.126-.188V4.283c.003-.126.024-.126.188-.126zm3.94 0c.185 0 .372 0 .372.189v1.762c-.002.126-.023.126-.187.126h-1.75C12 6.231 12 6.211 12 6.046v-1.7c0-.19.187-.19.187-.19z",
        "fill": "currentColor"
      }
    })]);
  }
};

var _createNamespace$w = createNamespace('key'),
  createComponent$A = _createNamespace$w[0],
  bem$v = _createNamespace$w[1];
var Key = createComponent$A({
  mixins: [TouchMixin],
  props: {
    type: String,
    text: [Number, String],
    color: String,
    wider: Boolean,
    large: Boolean,
    loading: Boolean
  },
  data: function data() {
    return {
      active: false
    };
  },
  mounted: function mounted() {
    this.bindTouchEvent(this.$el);
  },
  methods: {
    onTouchStart: function onTouchStart(event) {
      // compatible with Vue 2.6 event bubble bug
      event.stopPropagation();
      this.touchStart(event);
      this.active = true;
    },
    onTouchMove: function onTouchMove(event) {
      this.touchMove(event);
      if (this.direction) {
        this.active = false;
      }
    },
    onTouchEnd: function onTouchEnd(event) {
      if (this.active) {
        // eliminate tap delay on safari
        // see: https://github.com/vant-ui/vant/issues/6836
        if (!this.slots('default')) {
          event.preventDefault();
        }
        this.active = false;
        this.$emit('press', this.text, this.type);
      }
    },
    genContent: function genContent() {
      var h = this.$createElement;
      var isExtra = this.type === 'extra';
      var isDelete = this.type === 'delete';
      var text = this.slots('default') || this.text;
      if (this.loading) {
        return h(Loading$1, {
          "class": bem$v('loading-icon')
        });
      }
      if (isDelete) {
        return text || h(DeleteIcon, {
          "class": bem$v('delete-icon')
        });
      }
      if (isExtra) {
        return text || h(CollapseIcon, {
          "class": bem$v('collapse-icon')
        });
      }
      return text;
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$v('wrapper', {
        wider: this.wider
      })
    }, [h("div", {
      "attrs": {
        "role": "button",
        "tabindex": "0"
      },
      "class": bem$v([this.color, {
        large: this.large,
        active: this.active,
        delete: this.type === 'delete'
      }])
    }, [this.genContent()])]);
  }
});

var _createNamespace$v = createNamespace('number-keyboard'),
  createComponent$z = _createNamespace$v[0],
  bem$u = _createNamespace$v[1];
var NumberKeyboard = createComponent$z({
  mixins: [PortalMixin(), BindEventMixin(function (bind) {
    if (this.hideOnClickOutside) {
      bind(document.body, 'touchstart', this.onBlur);
    }
  })],
  model: {
    event: 'update:value'
  },
  props: {
    show: Boolean,
    title: String,
    zIndex: [Number, String],
    randomKeyOrder: Boolean,
    closeButtonText: String,
    deleteButtonText: String,
    closeButtonLoading: Boolean,
    theme: {
      type: String,
      default: 'default'
    },
    value: {
      type: String,
      default: ''
    },
    extraKey: {
      type: [String, Array],
      default: ''
    },
    maxlength: {
      type: [Number, String],
      default: Number.MAX_VALUE
    },
    transition: {
      type: Boolean,
      default: true
    },
    showDeleteKey: {
      type: Boolean,
      default: true
    },
    hideOnClickOutside: {
      type: Boolean,
      default: true
    },
    safeAreaInsetBottom: {
      type: Boolean,
      default: true
    }
  },
  watch: {
    show: function show(val) {
      if (!this.transition) {
        this.$emit(val ? 'show' : 'hide');
      }
    }
  },
  computed: {
    keys: function keys() {
      if (this.theme === 'custom') {
        return this.genCustomKeys();
      }
      return this.genDefaultKeys();
    }
  },
  methods: {
    genBasicKeys: function genBasicKeys() {
      var keys = [];
      for (var i = 1; i <= 9; i++) {
        keys.push({
          text: i
        });
      }
      if (this.randomKeyOrder) {
        keys.sort(function () {
          return Math.random() > 0.5 ? 1 : -1;
        });
      }
      return keys;
    },
    genDefaultKeys: function genDefaultKeys() {
      return [].concat(this.genBasicKeys(), [{
        text: this.extraKey,
        type: 'extra'
      }, {
        text: 0
      }, {
        text: this.showDeleteKey ? this.deleteButtonText : '',
        type: this.showDeleteKey ? 'delete' : ''
      }]);
    },
    genCustomKeys: function genCustomKeys() {
      var keys = this.genBasicKeys();
      var extraKey = this.extraKey;
      var extraKeys = Array.isArray(extraKey) ? extraKey : [extraKey];
      if (extraKeys.length === 1) {
        keys.push({
          text: 0,
          wider: true
        }, {
          text: extraKeys[0],
          type: 'extra'
        });
      } else if (extraKeys.length === 2) {
        keys.push({
          text: extraKeys[0],
          type: 'extra'
        }, {
          text: 0
        }, {
          text: extraKeys[1],
          type: 'extra'
        });
      }
      return keys;
    },
    onBlur: function onBlur() {
      this.show && this.$emit('blur');
    },
    onClose: function onClose() {
      this.$emit('close');
      this.onBlur();
    },
    onAnimationEnd: function onAnimationEnd() {
      this.$emit(this.show ? 'show' : 'hide');
    },
    onPress: function onPress(text, type) {
      if (text === '') {
        if (type === 'extra') {
          this.onBlur();
        }
        return;
      }
      var value = this.value;
      if (type === 'delete') {
        this.$emit('delete');
        this.$emit('update:value', value.slice(0, value.length - 1));
      } else if (type === 'close') {
        this.onClose();
      } else if (value.length < this.maxlength) {
        this.$emit('input', text);
        this.$emit('update:value', value + text);
      }
    },
    genTitle: function genTitle() {
      var h = this.$createElement;
      var title = this.title,
        theme = this.theme,
        closeButtonText = this.closeButtonText;
      var titleLeft = this.slots('title-left');
      var showClose = closeButtonText && theme === 'default';
      var showTitle = title || showClose || titleLeft;
      if (!showTitle) {
        return;
      }
      return h("div", {
        "class": bem$u('header')
      }, [titleLeft && h("span", {
        "class": bem$u('title-left')
      }, [titleLeft]), title && h("h2", {
        "class": bem$u('title')
      }, [title]), showClose && h("button", {
        "attrs": {
          "type": "button"
        },
        "class": bem$u('close'),
        "on": {
          "click": this.onClose
        }
      }, [closeButtonText])]);
    },
    genKeys: function genKeys() {
      var _this = this;
      var h = this.$createElement;
      return this.keys.map(function (key) {
        return h(Key, {
          "key": key.text,
          "attrs": {
            "text": key.text,
            "type": key.type,
            "wider": key.wider,
            "color": key.color
          },
          "on": {
            "press": _this.onPress
          }
        }, [key.type === 'delete' && _this.slots('delete'), key.type === 'extra' && _this.slots('extra-key')]);
      });
    },
    genSidebar: function genSidebar() {
      var h = this.$createElement;
      if (this.theme === 'custom') {
        return h("div", {
          "class": bem$u('sidebar')
        }, [this.showDeleteKey && h(Key, {
          "attrs": {
            "large": true,
            "text": this.deleteButtonText,
            "type": "delete"
          },
          "on": {
            "press": this.onPress
          }
        }, [this.slots('delete')]), h(Key, {
          "attrs": {
            "large": true,
            "text": this.closeButtonText,
            "type": "close",
            "color": "blue",
            "loading": this.closeButtonLoading
          },
          "on": {
            "press": this.onPress
          }
        })]);
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    var Title = this.genTitle();
    return h("transition", {
      "attrs": {
        "name": this.transition ? 'van-slide-up' : ''
      }
    }, [h("div", {
      "directives": [{
        name: "show",
        value: this.show
      }],
      "style": {
        zIndex: this.zIndex
      },
      "class": bem$u({
        unfit: !this.safeAreaInsetBottom,
        'with-title': Title
      }),
      "on": {
        "touchstart": stopPropagation,
        "animationend": this.onAnimationEnd,
        "webkitAnimationEnd": this.onAnimationEnd
      }
    }, [Title, h("div", {
      "class": bem$u('body')
    }, [h("div", {
      "class": bem$u('keys')
    }, [this.genKeys()]), this.genSidebar()])])]);
  }
});

var _createNamespace$u = createNamespace('pagination'),
  createComponent$y = _createNamespace$u[0],
  bem$t = _createNamespace$u[1],
  t$d = _createNamespace$u[2];
function makePage(number, text, active) {
  return {
    number: number,
    text: text,
    active: active
  };
}
var Pagination = createComponent$y({
  props: {
    prevText: String,
    nextText: String,
    forceEllipses: Boolean,
    mode: {
      type: String,
      default: 'multi'
    },
    value: {
      type: Number,
      default: 0
    },
    pageCount: {
      type: [Number, String],
      default: 0
    },
    totalItems: {
      type: [Number, String],
      default: 0
    },
    itemsPerPage: {
      type: [Number, String],
      default: 10
    },
    showPageSize: {
      type: [Number, String],
      default: 5
    }
  },
  computed: {
    count: function count() {
      var count = this.pageCount || Math.ceil(this.totalItems / this.itemsPerPage);
      return Math.max(1, count);
    },
    pages: function pages() {
      var pages = [];
      var pageCount = this.count;
      var showPageSize = +this.showPageSize;
      if (this.mode !== 'multi') {
        return pages;
      } // Default page limits

      var startPage = 1;
      var endPage = pageCount;
      var isMaxSized = showPageSize < pageCount; // recompute if showPageSize

      if (isMaxSized) {
        // Current page is displayed in the middle of the visible ones
        startPage = Math.max(this.value - Math.floor(showPageSize / 2), 1);
        endPage = startPage + showPageSize - 1; // Adjust if limit is exceeded

        if (endPage > pageCount) {
          endPage = pageCount;
          startPage = endPage - showPageSize + 1;
        }
      } // Add page number links

      for (var number = startPage; number <= endPage; number++) {
        var page = makePage(number, number, number === this.value);
        pages.push(page);
      } // Add links to move between page sets

      if (isMaxSized && showPageSize > 0 && this.forceEllipses) {
        if (startPage > 1) {
          var previousPageSet = makePage(startPage - 1, '...', false);
          pages.unshift(previousPageSet);
        }
        if (endPage < pageCount) {
          var nextPageSet = makePage(endPage + 1, '...', false);
          pages.push(nextPageSet);
        }
      }
      return pages;
    }
  },
  watch: {
    value: {
      handler: function handler(page) {
        this.select(page || this.value);
      },
      immediate: true
    }
  },
  methods: {
    select: function select(page, emitChange) {
      page = Math.min(this.count, Math.max(1, page));
      if (this.value !== page) {
        this.$emit('input', page);
        if (emitChange) {
          this.$emit('change', page);
        }
      }
    }
  },
  render: function render() {
    var _this = this,
      _this$slots,
      _this$slots3;
    var h = arguments[0];
    var value = this.value;
    var simple = this.mode !== 'multi';
    var onSelect = function onSelect(value) {
      return function () {
        _this.select(value, true);
      };
    };
    return h("ul", {
      "class": bem$t({
        simple: simple
      })
    }, [h("li", {
      "class": [bem$t('item', {
        disabled: value === 1
      }), bem$t('prev'), BORDER],
      "on": {
        "click": onSelect(value - 1)
      }
    }, [((_this$slots = this.slots('prev-text')) != null ? _this$slots : this.prevText) || t$d('prev')]), this.pages.map(function (page) {
      var _this$slots2;
      return h("li", {
        "class": [bem$t('item', {
          active: page.active
        }), bem$t('page'), BORDER],
        "on": {
          "click": onSelect(page.number)
        }
      }, [(_this$slots2 = _this.slots('page', page)) != null ? _this$slots2 : page.text]);
    }), simple && h("li", {
      "class": bem$t('page-desc')
    }, [this.slots('pageDesc') || value + "/" + this.count]), h("li", {
      "class": [bem$t('item', {
        disabled: value === this.count
      }), bem$t('next'), BORDER],
      "on": {
        "click": onSelect(value + 1)
      }
    }, [((_this$slots3 = this.slots('next-text')) != null ? _this$slots3 : this.nextText) || t$d('next')])]);
  }
});

var _createNamespace$t = createNamespace('panel'),
  createComponent$x = _createNamespace$t[0],
  bem$s = _createNamespace$t[1];
function Panel(h, props, slots, ctx) {
  var Content = function Content() {
    return [slots.header ? slots.header() : h(Cell$1, {
      "attrs": {
        "icon": props.icon,
        "label": props.desc,
        "title": props.title,
        "value": props.status,
        "valueClass": bem$s('header-value')
      },
      "class": bem$s('header')
    }), h("div", {
      "class": bem$s('content')
    }, [slots.default && slots.default()]), slots.footer && h("div", {
      "class": [bem$s('footer'), BORDER_TOP]
    }, [slots.footer()])];
  };
  return h(CellGroup$1, _mergeJSXProps([{
    "class": bem$s(),
    "scopedSlots": {
      default: Content
    }
  }, inherit(ctx, true)]));
}
Panel.props = {
  icon: String,
  desc: String,
  title: String,
  status: String
};
var Panel$1 = createComponent$x(Panel);

var _createNamespace$s = createNamespace('password-input'),
  createComponent$w = _createNamespace$s[0],
  bem$r = _createNamespace$s[1];
function PasswordInput(h, props, slots, ctx) {
  var _ref2;
  var mask = props.mask,
    value = props.value,
    length = props.length,
    gutter = props.gutter,
    focused = props.focused,
    errorInfo = props.errorInfo;
  var info = errorInfo || props.info;
  var Points = [];
  for (var i = 0; i < length; i++) {
    var _ref;
    var _char = value[i];
    var showBorder = i !== 0 && !gutter;
    var showCursor = focused && i === value.length;
    var style = void 0;
    if (i !== 0 && gutter) {
      style = {
        marginLeft: addUnit(gutter)
      };
    }
    Points.push(h("li", {
      "class": [(_ref = {}, _ref[BORDER_LEFT] = showBorder, _ref), bem$r('item', {
        focus: showCursor
      })],
      "style": style
    }, [mask ? h("i", {
      "style": {
        visibility: _char ? 'visible' : 'hidden'
      }
    }) : _char, showCursor && h("div", {
      "class": bem$r('cursor')
    })]));
  }
  return h("div", {
    "class": bem$r()
  }, [h("ul", _mergeJSXProps([{
    "class": [bem$r('security'), (_ref2 = {}, _ref2[BORDER_SURROUND] = !gutter, _ref2)],
    "on": {
      "touchstart": function touchstart(event) {
        event.stopPropagation();
        emit(ctx, 'focus', event);
      }
    }
  }, inherit(ctx, true)]), [Points]), info && h("div", {
    "class": bem$r(errorInfo ? 'error-info' : 'info')
  }, [info])]);
}
PasswordInput.props = {
  info: String,
  gutter: [Number, String],
  focused: Boolean,
  errorInfo: String,
  mask: {
    type: Boolean,
    default: true
  },
  value: {
    type: String,
    default: ''
  },
  length: {
    type: [Number, String],
    default: 6
  }
};
var PasswordInput$1 = createComponent$w(PasswordInput);

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getWindow.js
function getWindow$1(node) {
  if (node == null) {
    return window;
  }
  if (node.toString() !== "[object Window]") {
    var ownerDocument = node.ownerDocument;
    return ownerDocument ? ownerDocument.defaultView || window : window;
  }
  return node;
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js
function isElement$3(node) {
  var OwnElement = getWindow$1(node).Element;
  return node instanceof OwnElement || node instanceof Element;
}
function isHTMLElement$1(node) {
  var OwnElement = getWindow$1(node).HTMLElement;
  return node instanceof OwnElement || node instanceof HTMLElement;
}
function isShadowRoot$1(node) {
  if (typeof ShadowRoot === "undefined") {
    return false;
  }
  var OwnElement = getWindow$1(node).ShadowRoot;
  return node instanceof OwnElement || node instanceof ShadowRoot;
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/math.js
var round$2 = Math.round;

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/userAgent.js
function getUAString$1() {
  var uaData = navigator.userAgentData;
  if (uaData != null && uaData.brands) {
    return uaData.brands.map(function (item) {
      return item.brand + "/" + item.version;
    }).join(" ");
  }
  return navigator.userAgent;
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js
function isLayoutViewport$1() {
  return !/^((?!chrome|android).)*safari/i.test(getUAString$1());
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js
function getBoundingClientRect$2(element, includeScale, isFixedStrategy) {
  if (includeScale === void 0) {
    includeScale = false;
  }
  if (isFixedStrategy === void 0) {
    isFixedStrategy = false;
  }
  var clientRect = element.getBoundingClientRect();
  var scaleX = 1;
  var scaleY = 1;
  if (includeScale && isHTMLElement$1(element)) {
    scaleX = element.offsetWidth > 0 ? round$2(clientRect.width) / element.offsetWidth || 1 : 1;
    scaleY = element.offsetHeight > 0 ? round$2(clientRect.height) / element.offsetHeight || 1 : 1;
  }
  var _ref = isElement$3(element) ? getWindow$1(element) : window,
    visualViewport = _ref.visualViewport;
  var addVisualOffsets = !isLayoutViewport$1() && isFixedStrategy;
  var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
  var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
  var width = clientRect.width / scaleX;
  var height = clientRect.height / scaleY;
  return {
    width,
    height,
    top: y,
    right: x + width,
    bottom: y + height,
    left: x,
    x,
    y
  };
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js
function getWindowScroll$1(node) {
  var win = getWindow$1(node);
  var scrollLeft = win.pageXOffset;
  var scrollTop = win.pageYOffset;
  return {
    scrollLeft,
    scrollTop
  };
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js
function getHTMLElementScroll$1(element) {
  return {
    scrollLeft: element.scrollLeft,
    scrollTop: element.scrollTop
  };
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js
function getNodeScroll$1(node) {
  if (node === getWindow$1(node) || !isHTMLElement$1(node)) {
    return getWindowScroll$1(node);
  } else {
    return getHTMLElementScroll$1(node);
  }
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js
function getNodeName$1(element) {
  return element ? (element.nodeName || "").toLowerCase() : null;
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js
function getDocumentElement$1(element) {
  return ((isElement$3(element) ? element.ownerDocument : element.document) || window.document).documentElement;
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js
function getWindowScrollBarX$1(element) {
  return getBoundingClientRect$2(getDocumentElement$1(element)).left + getWindowScroll$1(element).scrollLeft;
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js
function getComputedStyle$2(element) {
  return getWindow$1(element).getComputedStyle(element);
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js
function isScrollParent$1(element) {
  var _getComputedStyle = getComputedStyle$2(element),
    overflow = _getComputedStyle.overflow,
    overflowX = _getComputedStyle.overflowX,
    overflowY = _getComputedStyle.overflowY;
  return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js
function isElementScaled$1(element) {
  var rect = element.getBoundingClientRect();
  var scaleX = round$2(rect.width) / element.offsetWidth || 1;
  var scaleY = round$2(rect.height) / element.offsetHeight || 1;
  return scaleX !== 1 || scaleY !== 1;
}
function getCompositeRect$1(elementOrVirtualElement, offsetParent, isFixed) {
  if (isFixed === void 0) {
    isFixed = false;
  }
  var isOffsetParentAnElement = isHTMLElement$1(offsetParent);
  var offsetParentIsScaled = isHTMLElement$1(offsetParent) && isElementScaled$1(offsetParent);
  var documentElement = getDocumentElement$1(offsetParent);
  var rect = getBoundingClientRect$2(elementOrVirtualElement, offsetParentIsScaled, isFixed);
  var scroll = {
    scrollLeft: 0,
    scrollTop: 0
  };
  var offsets = {
    x: 0,
    y: 0
  };
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
    if (getNodeName$1(offsetParent) !== "body" || isScrollParent$1(documentElement)) {
      scroll = getNodeScroll$1(offsetParent);
    }
    if (isHTMLElement$1(offsetParent)) {
      offsets = getBoundingClientRect$2(offsetParent, true);
      offsets.x += offsetParent.clientLeft;
      offsets.y += offsetParent.clientTop;
    } else if (documentElement) {
      offsets.x = getWindowScrollBarX$1(documentElement);
    }
  }
  return {
    x: rect.left + scroll.scrollLeft - offsets.x,
    y: rect.top + scroll.scrollTop - offsets.y,
    width: rect.width,
    height: rect.height
  };
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js
function getLayoutRect$1(element) {
  var clientRect = getBoundingClientRect$2(element);
  var width = element.offsetWidth;
  var height = element.offsetHeight;
  if (Math.abs(clientRect.width - width) <= 1) {
    width = clientRect.width;
  }
  if (Math.abs(clientRect.height - height) <= 1) {
    height = clientRect.height;
  }
  return {
    x: element.offsetLeft,
    y: element.offsetTop,
    width,
    height
  };
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js
function getParentNode$1(element) {
  if (getNodeName$1(element) === "html") {
    return element;
  }
  return element.assignedSlot || element.parentNode || (isShadowRoot$1(element) ? element.host : null) || getDocumentElement$1(element);
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js
function getScrollParent$1(node) {
  if (["html", "body", "#document"].indexOf(getNodeName$1(node)) >= 0) {
    return node.ownerDocument.body;
  }
  if (isHTMLElement$1(node) && isScrollParent$1(node)) {
    return node;
  }
  return getScrollParent$1(getParentNode$1(node));
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js
function listScrollParents$1(element, list) {
  var _element$ownerDocumen;
  if (list === void 0) {
    list = [];
  }
  var scrollParent = getScrollParent$1(element);
  var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
  var win = getWindow$1(scrollParent);
  var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent$1(scrollParent) ? scrollParent : []) : scrollParent;
  var updatedList = list.concat(target);
  return isBody ? updatedList : updatedList.concat(listScrollParents$1(getParentNode$1(target)));
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js
function isTableElement$1(element) {
  return ["table", "td", "th"].indexOf(getNodeName$1(element)) >= 0;
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js
function getTrueOffsetParent$1(element) {
  if (!isHTMLElement$1(element) || getComputedStyle$2(element).position === "fixed") {
    return null;
  }
  return element.offsetParent;
}
function getContainingBlock$1(element) {
  var isFirefox = /firefox/i.test(getUAString$1());
  var isIE = /Trident/i.test(getUAString$1());
  if (isIE && isHTMLElement$1(element)) {
    var elementCss = getComputedStyle$2(element);
    if (elementCss.position === "fixed") {
      return null;
    }
  }
  var currentNode = getParentNode$1(element);
  if (isShadowRoot$1(currentNode)) {
    currentNode = currentNode.host;
  }
  while (isHTMLElement$1(currentNode) && ["html", "body"].indexOf(getNodeName$1(currentNode)) < 0) {
    var css = getComputedStyle$2(currentNode);
    if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
      return currentNode;
    } else {
      currentNode = currentNode.parentNode;
    }
  }
  return null;
}
function getOffsetParent$1(element) {
  var window2 = getWindow$1(element);
  var offsetParent = getTrueOffsetParent$1(element);
  while (offsetParent && isTableElement$1(offsetParent) && getComputedStyle$2(offsetParent).position === "static") {
    offsetParent = getTrueOffsetParent$1(offsetParent);
  }
  if (offsetParent && (getNodeName$1(offsetParent) === "html" || getNodeName$1(offsetParent) === "body" && getComputedStyle$2(offsetParent).position === "static")) {
    return window2;
  }
  return offsetParent || getContainingBlock$1(element) || window2;
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/enums.js
var top$2 = "top";
var bottom$1 = "bottom";
var right$1 = "right";
var left$1 = "left";
var auto$1 = "auto";
var basePlacements$1 = [top$2, bottom$1, right$1, left$1];
var start$1 = "start";
var end$1 = "end";
var placements$1 = /* @__PURE__ */[].concat(basePlacements$1, [auto$1]).reduce(function (acc, placement) {
  return acc.concat([placement, placement + "-" + start$1, placement + "-" + end$1]);
}, []);
var beforeRead$1 = "beforeRead";
var read$1 = "read";
var afterRead$1 = "afterRead";
var beforeMain$1 = "beforeMain";
var main$1 = "main";
var afterMain$1 = "afterMain";
var beforeWrite$1 = "beforeWrite";
var write$1 = "write";
var afterWrite$1 = "afterWrite";
var modifierPhases$1 = [beforeRead$1, read$1, afterRead$1, beforeMain$1, main$1, afterMain$1, beforeWrite$1, write$1, afterWrite$1];

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/orderModifiers.js
function order$1(modifiers) {
  var map = /* @__PURE__ */new Map();
  var visited = /* @__PURE__ */new Set();
  var result = [];
  modifiers.forEach(function (modifier) {
    map.set(modifier.name, modifier);
  });
  function sort(modifier) {
    visited.add(modifier.name);
    var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
    requires.forEach(function (dep) {
      if (!visited.has(dep)) {
        var depModifier = map.get(dep);
        if (depModifier) {
          sort(depModifier);
        }
      }
    });
    result.push(modifier);
  }
  modifiers.forEach(function (modifier) {
    if (!visited.has(modifier.name)) {
      sort(modifier);
    }
  });
  return result;
}
function orderModifiers$1(modifiers) {
  var orderedModifiers = order$1(modifiers);
  return modifierPhases$1.reduce(function (acc, phase) {
    return acc.concat(orderedModifiers.filter(function (modifier) {
      return modifier.phase === phase;
    }));
  }, []);
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/debounce.js
function debounce$4(fn2) {
  var pending;
  return function () {
    if (!pending) {
      pending = new Promise(function (resolve) {
        Promise.resolve().then(function () {
          pending = void 0;
          resolve(fn2());
        });
      });
    }
    return pending;
  };
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/format.js
function format$2(str) {
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
    args[_key - 1] = arguments[_key];
  }
  return [].concat(args).reduce(function (p, c) {
    return p.replace(/%s/, c);
  }, str);
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/validateModifiers.js
var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
var VALID_PROPERTIES = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
function validateModifiers(modifiers) {
  modifiers.forEach(function (modifier) {
    [].concat(Object.keys(modifier), VALID_PROPERTIES).filter(function (value, index, self) {
      return self.indexOf(value) === index;
    }).forEach(function (key) {
      switch (key) {
        case "name":
          if (typeof modifier.name !== "string") {
            console.error(format$2(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', '"' + String(modifier.name) + '"'));
          }
          break;
        case "enabled":
          if (typeof modifier.enabled !== "boolean") {
            console.error(format$2(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', '"' + String(modifier.enabled) + '"'));
          }
          break;
        case "phase":
          if (modifierPhases$1.indexOf(modifier.phase) < 0) {
            console.error(format$2(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases$1.join(", "), '"' + String(modifier.phase) + '"'));
          }
          break;
        case "fn":
          if (typeof modifier.fn !== "function") {
            console.error(format$2(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', '"' + String(modifier.fn) + '"'));
          }
          break;
        case "effect":
          if (modifier.effect != null && typeof modifier.effect !== "function") {
            console.error(format$2(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', '"' + String(modifier.fn) + '"'));
          }
          break;
        case "requires":
          if (modifier.requires != null && !Array.isArray(modifier.requires)) {
            console.error(format$2(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', '"' + String(modifier.requires) + '"'));
          }
          break;
        case "requiresIfExists":
          if (!Array.isArray(modifier.requiresIfExists)) {
            console.error(format$2(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', '"' + String(modifier.requiresIfExists) + '"'));
          }
          break;
        case "options":
        case "data":
          break;
        default:
          console.error('PopperJS: an invalid property has been provided to the "' + modifier.name + '" modifier, valid properties are ' + VALID_PROPERTIES.map(function (s) {
            return '"' + s + '"';
          }).join(", ") + '; but "' + key + '" was provided.');
      }
      modifier.requires && modifier.requires.forEach(function (requirement) {
        if (modifiers.find(function (mod) {
          return mod.name === requirement;
        }) == null) {
          console.error(format$2(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
        }
      });
    });
  });
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/uniqueBy.js
function uniqueBy(arr, fn2) {
  var identifiers = /* @__PURE__ */new Set();
  return arr.filter(function (item) {
    var identifier = fn2(item);
    if (!identifiers.has(identifier)) {
      identifiers.add(identifier);
      return true;
    }
  });
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/getBasePlacement.js
function getBasePlacement$2(placement) {
  return placement.split("-")[0];
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/mergeByName.js
function mergeByName$1(modifiers) {
  var merged = modifiers.reduce(function (merged2, current) {
    var existing = merged2[current.name];
    merged2[current.name] = existing ? Object.assign({}, existing, current, {
      options: Object.assign({}, existing.options, current.options),
      data: Object.assign({}, existing.data, current.data)
    }) : current;
    return merged2;
  }, {});
  return Object.keys(merged).map(function (key) {
    return merged[key];
  });
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/getVariation.js
function getVariation$1(placement) {
  return placement.split("-")[1];
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js
function getMainAxisFromPlacement$1(placement) {
  return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/utils/computeOffsets.js
function computeOffsets$1(_ref) {
  var reference = _ref.reference,
    element = _ref.element,
    placement = _ref.placement;
  var basePlacement = placement ? getBasePlacement$2(placement) : null;
  var variation = placement ? getVariation$1(placement) : null;
  var commonX = reference.x + reference.width / 2 - element.width / 2;
  var commonY = reference.y + reference.height / 2 - element.height / 2;
  var offsets;
  switch (basePlacement) {
    case top$2:
      offsets = {
        x: commonX,
        y: reference.y - element.height
      };
      break;
    case bottom$1:
      offsets = {
        x: commonX,
        y: reference.y + reference.height
      };
      break;
    case right$1:
      offsets = {
        x: reference.x + reference.width,
        y: commonY
      };
      break;
    case left$1:
      offsets = {
        x: reference.x - element.width,
        y: commonY
      };
      break;
    default:
      offsets = {
        x: reference.x,
        y: reference.y
      };
  }
  var mainAxis = basePlacement ? getMainAxisFromPlacement$1(basePlacement) : null;
  if (mainAxis != null) {
    var len = mainAxis === "y" ? "height" : "width";
    switch (variation) {
      case start$1:
        offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
        break;
      case end$1:
        offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
        break;
    }
  }
  return offsets;
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/createPopper.js
var INVALID_ELEMENT_ERROR = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.";
var INFINITE_LOOP_ERROR = "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.";
var DEFAULT_OPTIONS$1 = {
  placement: "bottom",
  modifiers: [],
  strategy: "absolute"
};
function areValidElements$1() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }
  return !args.some(function (element) {
    return !(element && typeof element.getBoundingClientRect === "function");
  });
}
function popperGenerator$1(generatorOptions) {
  if (generatorOptions === void 0) {
    generatorOptions = {};
  }
  var _generatorOptions = generatorOptions,
    _generatorOptions$def = _generatorOptions.defaultModifiers,
    defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
    _generatorOptions$def2 = _generatorOptions.defaultOptions,
    defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS$1 : _generatorOptions$def2;
  return function createPopper2(reference, popper, options) {
    if (options === void 0) {
      options = defaultOptions;
    }
    var state = {
      placement: "bottom",
      orderedModifiers: [],
      options: Object.assign({}, DEFAULT_OPTIONS$1, defaultOptions),
      modifiersData: {},
      elements: {
        reference,
        popper
      },
      attributes: {},
      styles: {}
    };
    var effectCleanupFns = [];
    var isDestroyed = false;
    var instance = {
      state,
      setOptions: function setOptions(setOptionsAction) {
        var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
        cleanupModifierEffects();
        state.options = Object.assign({}, defaultOptions, state.options, options2);
        state.scrollParents = {
          reference: isElement$3(reference) ? listScrollParents$1(reference) : reference.contextElement ? listScrollParents$1(reference.contextElement) : [],
          popper: listScrollParents$1(popper)
        };
        var orderedModifiers = orderModifiers$1(mergeByName$1([].concat(defaultModifiers2, state.options.modifiers)));
        state.orderedModifiers = orderedModifiers.filter(function (m) {
          return m.enabled;
        });
        {
          var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {
            var name = _ref.name;
            return name;
          });
          validateModifiers(modifiers);
          if (getBasePlacement$2(state.options.placement) === auto$1) {
            var flipModifier = state.orderedModifiers.find(function (_ref2) {
              var name = _ref2.name;
              return name === "flip";
            });
            if (!flipModifier) {
              console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "));
            }
          }
          var _getComputedStyle = getComputedStyle$2(popper),
            marginTop = _getComputedStyle.marginTop,
            marginRight = _getComputedStyle.marginRight,
            marginBottom = _getComputedStyle.marginBottom,
            marginLeft = _getComputedStyle.marginLeft;
          if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {
            return parseFloat(margin);
          })) {
            console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" "));
          }
        }
        runModifierEffects();
        return instance.update();
      },
      forceUpdate: function forceUpdate() {
        if (isDestroyed) {
          return;
        }
        var _state$elements = state.elements,
          reference2 = _state$elements.reference,
          popper2 = _state$elements.popper;
        if (!areValidElements$1(reference2, popper2)) {
          {
            console.error(INVALID_ELEMENT_ERROR);
          }
          return;
        }
        state.rects = {
          reference: getCompositeRect$1(reference2, getOffsetParent$1(popper2), state.options.strategy === "fixed"),
          popper: getLayoutRect$1(popper2)
        };
        state.reset = false;
        state.placement = state.options.placement;
        state.orderedModifiers.forEach(function (modifier) {
          return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
        });
        var __debug_loops__ = 0;
        for (var index = 0; index < state.orderedModifiers.length; index++) {
          {
            __debug_loops__ += 1;
            if (__debug_loops__ > 100) {
              console.error(INFINITE_LOOP_ERROR);
              break;
            }
          }
          if (state.reset === true) {
            state.reset = false;
            index = -1;
            continue;
          }
          var _state$orderedModifie = state.orderedModifiers[index],
            fn2 = _state$orderedModifie.fn,
            _state$orderedModifie2 = _state$orderedModifie.options,
            _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
            name = _state$orderedModifie.name;
          if (typeof fn2 === "function") {
            state = fn2({
              state,
              options: _options,
              name,
              instance
            }) || state;
          }
        }
      },
      update: debounce$4(function () {
        return new Promise(function (resolve) {
          instance.forceUpdate();
          resolve(state);
        });
      }),
      destroy: function destroy() {
        cleanupModifierEffects();
        isDestroyed = true;
      }
    };
    if (!areValidElements$1(reference, popper)) {
      {
        console.error(INVALID_ELEMENT_ERROR);
      }
      return instance;
    }
    instance.setOptions(options).then(function (state2) {
      if (!isDestroyed && options.onFirstUpdate) {
        options.onFirstUpdate(state2);
      }
    });
    function runModifierEffects() {
      state.orderedModifiers.forEach(function (_ref3) {
        var name = _ref3.name,
          _ref3$options = _ref3.options,
          options2 = _ref3$options === void 0 ? {} : _ref3$options,
          effect3 = _ref3.effect;
        if (typeof effect3 === "function") {
          var cleanupFn = effect3({
            state,
            name,
            instance,
            options: options2
          });
          var noopFn = function noopFn2() {};
          effectCleanupFns.push(cleanupFn || noopFn);
        }
      });
    }
    function cleanupModifierEffects() {
      effectCleanupFns.forEach(function (fn2) {
        return fn2();
      });
      effectCleanupFns = [];
    }
    return instance;
  };
}

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/eventListeners.js
var passive$1 = {
  passive: true
};
function effect$3(_ref) {
  var state = _ref.state,
    instance = _ref.instance,
    options = _ref.options;
  var _options$scroll = options.scroll,
    scroll = _options$scroll === void 0 ? true : _options$scroll,
    _options$resize = options.resize,
    resize = _options$resize === void 0 ? true : _options$resize;
  var window2 = getWindow$1(state.elements.popper);
  var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
  if (scroll) {
    scrollParents.forEach(function (scrollParent) {
      scrollParent.addEventListener("scroll", instance.update, passive$1);
    });
  }
  if (resize) {
    window2.addEventListener("resize", instance.update, passive$1);
  }
  return function () {
    if (scroll) {
      scrollParents.forEach(function (scrollParent) {
        scrollParent.removeEventListener("scroll", instance.update, passive$1);
      });
    }
    if (resize) {
      window2.removeEventListener("resize", instance.update, passive$1);
    }
  };
}
var eventListeners_default = {
  name: "eventListeners",
  enabled: true,
  phase: "write",
  fn: function fn() {},
  effect: effect$3,
  data: {}
};

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js
function popperOffsets$2(_ref) {
  var state = _ref.state,
    name = _ref.name;
  state.modifiersData[name] = computeOffsets$1({
    reference: state.rects.reference,
    element: state.rects.popper,
    strategy: "absolute",
    placement: state.placement
  });
}
var popperOffsets_default = {
  name: "popperOffsets",
  enabled: true,
  phase: "read",
  fn: popperOffsets$2,
  data: {}
};

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/computeStyles.js
var unsetSides$1 = {
  top: "auto",
  right: "auto",
  bottom: "auto",
  left: "auto"
};
function roundOffsetsByDPR$1(_ref) {
  var x = _ref.x,
    y = _ref.y;
  var win = window;
  var dpr = win.devicePixelRatio || 1;
  return {
    x: round$2(x * dpr) / dpr || 0,
    y: round$2(y * dpr) / dpr || 0
  };
}
function mapToStyles$1(_ref2) {
  var _Object$assign2;
  var popper = _ref2.popper,
    popperRect = _ref2.popperRect,
    placement = _ref2.placement,
    variation = _ref2.variation,
    offsets = _ref2.offsets,
    position = _ref2.position,
    gpuAcceleration = _ref2.gpuAcceleration,
    adaptive = _ref2.adaptive,
    roundOffsets = _ref2.roundOffsets,
    isFixed = _ref2.isFixed;
  var _offsets$x = offsets.x,
    x = _offsets$x === void 0 ? 0 : _offsets$x,
    _offsets$y = offsets.y,
    y = _offsets$y === void 0 ? 0 : _offsets$y;
  var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
    x,
    y
  }) : {
    x,
    y
  };
  x = _ref3.x;
  y = _ref3.y;
  var hasX = offsets.hasOwnProperty("x");
  var hasY = offsets.hasOwnProperty("y");
  var sideX = left$1;
  var sideY = top$2;
  var win = window;
  if (adaptive) {
    var offsetParent = getOffsetParent$1(popper);
    var heightProp = "clientHeight";
    var widthProp = "clientWidth";
    if (offsetParent === getWindow$1(popper)) {
      offsetParent = getDocumentElement$1(popper);
      if (getComputedStyle$2(offsetParent).position !== "static" && position === "absolute") {
        heightProp = "scrollHeight";
        widthProp = "scrollWidth";
      }
    }
    offsetParent = offsetParent;
    if (placement === top$2 || (placement === left$1 || placement === right$1) && variation === end$1) {
      sideY = bottom$1;
      var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp];
      y -= offsetY - popperRect.height;
      y *= gpuAcceleration ? 1 : -1;
    }
    if (placement === left$1 || (placement === top$2 || placement === bottom$1) && variation === end$1) {
      sideX = right$1;
      var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp];
      x -= offsetX - popperRect.width;
      x *= gpuAcceleration ? 1 : -1;
    }
  }
  var commonStyles = Object.assign({
    position
  }, adaptive && unsetSides$1);
  var _ref4 = roundOffsets === true ? roundOffsetsByDPR$1({
    x,
    y
  }) : {
    x,
    y
  };
  x = _ref4.x;
  y = _ref4.y;
  if (gpuAcceleration) {
    var _Object$assign;
    return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
  }
  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
}
function computeStyles$2(_ref5) {
  var state = _ref5.state,
    options = _ref5.options;
  var _options$gpuAccelerat = options.gpuAcceleration,
    gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
    _options$adaptive = options.adaptive,
    adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
    _options$roundOffsets = options.roundOffsets,
    roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
  {
    var transitionProperty = getComputedStyle$2(state.elements.popper).transitionProperty || "";
    if (adaptive && ["transform", "top", "right", "bottom", "left"].some(function (property) {
      return transitionProperty.indexOf(property) >= 0;
    })) {
      console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', "\n\n", 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", "\n\n", "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" "));
    }
  }
  var commonStyles = {
    placement: getBasePlacement$2(state.placement),
    variation: getVariation$1(state.placement),
    popper: state.elements.popper,
    popperRect: state.rects.popper,
    gpuAcceleration,
    isFixed: state.options.strategy === "fixed"
  };
  if (state.modifiersData.popperOffsets != null) {
    state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles$1(Object.assign({}, commonStyles, {
      offsets: state.modifiersData.popperOffsets,
      position: state.options.strategy,
      adaptive,
      roundOffsets
    })));
  }
  if (state.modifiersData.arrow != null) {
    state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles$1(Object.assign({}, commonStyles, {
      offsets: state.modifiersData.arrow,
      position: "absolute",
      adaptive: false,
      roundOffsets
    })));
  }
  state.attributes.popper = Object.assign({}, state.attributes.popper, {
    "data-popper-placement": state.placement
  });
}
var computeStyles_default = {
  name: "computeStyles",
  enabled: true,
  phase: "beforeWrite",
  fn: computeStyles$2,
  data: {}
};

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/applyStyles.js
function applyStyles$2(_ref) {
  var state = _ref.state;
  Object.keys(state.elements).forEach(function (name) {
    var style = state.styles[name] || {};
    var attributes = state.attributes[name] || {};
    var element = state.elements[name];
    if (!isHTMLElement$1(element) || !getNodeName$1(element)) {
      return;
    }
    Object.assign(element.style, style);
    Object.keys(attributes).forEach(function (name2) {
      var value = attributes[name2];
      if (value === false) {
        element.removeAttribute(name2);
      } else {
        element.setAttribute(name2, value === true ? "" : value);
      }
    });
  });
}
function effect2(_ref2) {
  var state = _ref2.state;
  var initialStyles = {
    popper: {
      position: state.options.strategy,
      left: "0",
      top: "0",
      margin: "0"
    },
    arrow: {
      position: "absolute"
    },
    reference: {}
  };
  Object.assign(state.elements.popper.style, initialStyles.popper);
  state.styles = initialStyles;
  if (state.elements.arrow) {
    Object.assign(state.elements.arrow.style, initialStyles.arrow);
  }
  return function () {
    Object.keys(state.elements).forEach(function (name) {
      var element = state.elements[name];
      var attributes = state.attributes[name] || {};
      var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
      var style = styleProperties.reduce(function (style2, property) {
        style2[property] = "";
        return style2;
      }, {});
      if (!isHTMLElement$1(element) || !getNodeName$1(element)) {
        return;
      }
      Object.assign(element.style, style);
      Object.keys(attributes).forEach(function (attribute) {
        element.removeAttribute(attribute);
      });
    });
  };
}
var applyStyles_default = {
  name: "applyStyles",
  enabled: true,
  phase: "write",
  fn: applyStyles$2,
  effect: effect2,
  requires: ["computeStyles"]
};

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/popper-lite.js
var defaultModifiers$1 = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default];
var createPopper$1 = /* @__PURE__ */popperGenerator$1({
  defaultModifiers: defaultModifiers$1
});

// ../../node_modules/.pnpm/@popperjs+core@2.11.6/node_modules/@popperjs/core/lib/modifiers/offset.js
function distanceAndSkiddingToXY$1(placement, rects, offset2) {
  var basePlacement = getBasePlacement$2(placement);
  var invertDistance = [left$1, top$2].indexOf(basePlacement) >= 0 ? -1 : 1;
  var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
      placement
    })) : offset2,
    skidding = _ref[0],
    distance = _ref[1];
  skidding = skidding || 0;
  distance = (distance || 0) * invertDistance;
  return [left$1, right$1].indexOf(basePlacement) >= 0 ? {
    x: distance,
    y: skidding
  } : {
    x: skidding,
    y: distance
  };
}
function offset$3(_ref2) {
  var state = _ref2.state,
    options = _ref2.options,
    name = _ref2.name;
  var _options$offset = options.offset,
    offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
  var data = placements$1.reduce(function (acc, placement) {
    acc[placement] = distanceAndSkiddingToXY$1(placement, state.rects, offset2);
    return acc;
  }, {});
  var _data$state$placement = data[state.placement],
    x = _data$state$placement.x,
    y = _data$state$placement.y;
  if (state.modifiersData.popperOffsets != null) {
    state.modifiersData.popperOffsets.x += x;
    state.modifiersData.popperOffsets.y += y;
  }
  state.modifiersData[name] = data;
}
var offset_default = {
  name: "offset",
  enabled: true,
  phase: "main",
  requires: ["popperOffsets"],
  fn: offset$3
};

var _createNamespace$r = createNamespace('popover'),
  createComponent$v = _createNamespace$r[0],
  bem$q = _createNamespace$r[1];
var Popover = createComponent$v({
  mixins: [ClickOutsideMixin({
    event: 'touchstart',
    method: 'onClickOutside'
  })],
  props: {
    value: Boolean,
    trigger: String,
    overlay: Boolean,
    offset: {
      type: Array,
      default: function _default() {
        return [0, 8];
      }
    },
    theme: {
      type: String,
      default: 'light'
    },
    actions: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    placement: {
      type: String,
      default: 'bottom'
    },
    getContainer: {
      type: [String, Function],
      default: 'body'
    },
    closeOnClickAction: {
      type: Boolean,
      default: true
    }
  },
  watch: {
    value: 'updateLocation',
    placement: 'updateLocation'
  },
  mounted: function mounted() {
    this.updateLocation();
  },
  beforeDestroy: function beforeDestroy() {
    if (this.popper) {
      if (!isServer$1) {
        window.removeEventListener('animationend', this.updateLocation);
        window.removeEventListener('transitionend', this.updateLocation);
      }
      this.popper.destroy();
      this.popper = null;
    }
  },
  methods: {
    createPopper: function createPopper() {
      var popper = createPopper$1(this.$refs.wrapper, this.$refs.popover.$el, {
        placement: this.placement,
        modifiers: [{
          name: 'computeStyles',
          options: {
            adaptive: false,
            gpuAcceleration: false
          }
        }, _extends$2({}, offset_default, {
          options: {
            offset: this.offset
          }
        })]
      });
      if (!isServer$1) {
        window.addEventListener('animationend', this.updateLocation);
        window.addEventListener('transitionend', this.updateLocation);
      }
      return popper;
    },
    updateLocation: function updateLocation() {
      var _this = this;
      this.$nextTick(function () {
        if (!_this.value) {
          return;
        }
        if (!_this.popper) {
          _this.popper = _this.createPopper();
        } else {
          _this.popper.setOptions({
            placement: _this.placement
          });
        }
      });
    },
    renderAction: function renderAction(action, index) {
      var _this2 = this;
      var h = this.$createElement;
      var icon = action.icon,
        text = action.text,
        disabled = action.disabled,
        className = action.className;
      return h("div", {
        "attrs": {
          "role": "menuitem"
        },
        "class": [bem$q('action', {
          disabled: disabled,
          'with-icon': icon
        }), className],
        "on": {
          "click": function click() {
            return _this2.onClickAction(action, index);
          }
        }
      }, [icon && h(Icon$3, {
        "attrs": {
          "name": icon
        },
        "class": bem$q('action-icon')
      }), h("div", {
        "class": [bem$q('action-text'), BORDER_BOTTOM]
      }, [text])]);
    },
    onToggle: function onToggle(value) {
      this.$emit('input', value);
    },
    onClickWrapper: function onClickWrapper() {
      if (this.trigger === 'click') {
        this.onToggle(!this.value);
      }
    },
    onTouchstart: function onTouchstart(event) {
      event.stopPropagation();
      this.$emit('touchstart', event);
    },
    onClickAction: function onClickAction(action, index) {
      if (action.disabled) {
        return;
      }
      this.$emit('select', action, index);
      if (this.closeOnClickAction) {
        this.$emit('input', false);
      }
    },
    onClickOutside: function onClickOutside() {
      this.$emit('input', false);
    },
    onOpen: function onOpen() {
      this.$emit('open');
    },
    /* istanbul ignore next */
    onOpened: function onOpened() {
      this.$emit('opened');
    },
    onClose: function onClose() {
      this.$emit('close');
    },
    /* istanbul ignore next */
    onClosed: function onClosed() {
      this.$emit('closed');
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("span", {
      "ref": "wrapper",
      "class": bem$q('wrapper'),
      "on": {
        "click": this.onClickWrapper
      }
    }, [h(Popup, {
      "ref": "popover",
      "attrs": {
        "value": this.value,
        "overlay": this.overlay,
        "position": null,
        "transition": "van-popover-zoom",
        "lockScroll": false,
        "getContainer": this.getContainer
      },
      "class": bem$q([this.theme]),
      "on": {
        "open": this.onOpen,
        "close": this.onClose,
        "input": this.onToggle,
        "opened": this.onOpened,
        "closed": this.onClosed
      },
      "nativeOn": {
        "touchstart": this.onTouchstart
      }
    }, [h("div", {
      "class": bem$q('arrow')
    }), h("div", {
      "class": bem$q('content'),
      "attrs": {
        "role": "menu"
      }
    }, [this.slots('default') || this.actions.map(this.renderAction)])]), this.slots('reference')]);
  }
});

var _createNamespace$q = createNamespace('progress'),
  createComponent$u = _createNamespace$q[0],
  bem$p = _createNamespace$q[1];
var Progress = createComponent$u({
  mixins: [BindEventMixin(function (bind) {
    bind(window, 'resize', this.resize, true);
    bind(window, 'orientationchange', this.resize, true);
  })],
  props: {
    color: String,
    inactive: Boolean,
    pivotText: String,
    textColor: String,
    pivotColor: String,
    trackColor: String,
    strokeWidth: [Number, String],
    percentage: {
      type: [Number, String],
      required: true,
      validator: function validator(value) {
        return value >= 0 && value <= 100;
      }
    },
    showPivot: {
      type: Boolean,
      default: true
    }
  },
  data: function data() {
    return {
      pivotWidth: 0,
      progressWidth: 0
    };
  },
  mounted: function mounted() {
    this.resize();
  },
  watch: {
    showPivot: 'resize',
    pivotText: 'resize'
  },
  methods: {
    // @exposed-api
    resize: function resize() {
      var _this = this;
      this.$nextTick(function () {
        _this.progressWidth = _this.$el.offsetWidth;
        _this.pivotWidth = _this.$refs.pivot ? _this.$refs.pivot.offsetWidth : 0;
      });
    }
  },
  render: function render() {
    var h = arguments[0];
    var pivotText = this.pivotText,
      percentage = this.percentage;
    var text = pivotText != null ? pivotText : percentage + '%';
    var showPivot = this.showPivot && text;
    var background = this.inactive ? '#cacaca' : this.color;
    var pivotStyle = {
      color: this.textColor,
      left: (this.progressWidth - this.pivotWidth) * percentage / 100 + "px",
      background: this.pivotColor || background
    };
    var portionStyle = {
      background: background,
      width: this.progressWidth * percentage / 100 + 'px'
    };
    var wrapperStyle = {
      background: this.trackColor,
      height: addUnit(this.strokeWidth)
    };
    return h("div", {
      "class": bem$p(),
      "style": wrapperStyle
    }, [h("span", {
      "class": bem$p('portion'),
      "style": portionStyle
    }, [showPivot && h("span", {
      "ref": "pivot",
      "style": pivotStyle,
      "class": bem$p('pivot')
    }, [text])])]);
  }
});

// Utils
var _createNamespace$p = createNamespace('pull-refresh'),
  createComponent$t = _createNamespace$p[0],
  bem$o = _createNamespace$p[1],
  t$c = _createNamespace$p[2];
var DEFAULT_HEAD_HEIGHT = 50;
var TEXT_STATUS = ['pulling', 'loosing', 'success'];
var PullRefresh = createComponent$t({
  mixins: [TouchMixin],
  props: {
    disabled: Boolean,
    successText: String,
    pullingText: String,
    loosingText: String,
    loadingText: String,
    pullDistance: [Number, String],
    value: {
      type: Boolean,
      required: true
    },
    successDuration: {
      type: [Number, String],
      default: 500
    },
    animationDuration: {
      type: [Number, String],
      default: 300
    },
    headHeight: {
      type: [Number, String],
      default: DEFAULT_HEAD_HEIGHT
    }
  },
  data: function data() {
    return {
      status: 'normal',
      distance: 0,
      duration: 0
    };
  },
  computed: {
    touchable: function touchable() {
      return this.status !== 'loading' && this.status !== 'success' && !this.disabled;
    },
    headStyle: function headStyle() {
      if (this.headHeight !== DEFAULT_HEAD_HEIGHT) {
        return {
          height: this.headHeight + "px"
        };
      }
    }
  },
  watch: {
    value: function value(loading) {
      this.duration = this.animationDuration;
      if (loading) {
        this.setStatus(+this.headHeight, true);
      } else if (this.slots('success') || this.successText) {
        this.showSuccessTip();
      } else {
        this.setStatus(0, false);
      }
    }
  },
  mounted: function mounted() {
    this.bindTouchEvent(this.$refs.track);
    this.scrollEl = getScroller(this.$el);
  },
  methods: {
    checkPullStart: function checkPullStart(event) {
      this.ceiling = getScrollTop(this.scrollEl) === 0;
      if (this.ceiling) {
        this.duration = 0;
        this.touchStart(event);
      }
    },
    onTouchStart: function onTouchStart(event) {
      if (this.touchable) {
        this.checkPullStart(event);
      }
    },
    onTouchMove: function onTouchMove(event) {
      if (!this.touchable) {
        return;
      }
      if (!this.ceiling) {
        this.checkPullStart(event);
      }
      this.touchMove(event);
      if (this.ceiling && this.deltaY >= 0 && this.direction === 'vertical') {
        preventDefault(event);
        this.setStatus(this.ease(this.deltaY));
      }
    },
    onTouchEnd: function onTouchEnd() {
      var _this = this;
      if (this.touchable && this.ceiling && this.deltaY) {
        this.duration = this.animationDuration;
        if (this.status === 'loosing') {
          this.setStatus(+this.headHeight, true);
          this.$emit('input', true); // ensure value change can be watched

          this.$nextTick(function () {
            _this.$emit('refresh');
          });
        } else {
          this.setStatus(0);
        }
      }
    },
    ease: function ease(distance) {
      var pullDistance = +(this.pullDistance || this.headHeight);
      if (distance > pullDistance) {
        if (distance < pullDistance * 2) {
          distance = pullDistance + (distance - pullDistance) / 2;
        } else {
          distance = pullDistance * 1.5 + (distance - pullDistance * 2) / 4;
        }
      }
      return Math.round(distance);
    },
    setStatus: function setStatus(distance, isLoading) {
      var status;
      if (isLoading) {
        status = 'loading';
      } else if (distance === 0) {
        status = 'normal';
      } else {
        status = distance < (this.pullDistance || this.headHeight) ? 'pulling' : 'loosing';
      }
      this.distance = distance;
      if (status !== this.status) {
        this.status = status;
      }
    },
    genStatus: function genStatus() {
      var h = this.$createElement;
      var status = this.status,
        distance = this.distance;
      var slot = this.slots(status, {
        distance: distance
      });
      if (slot) {
        return slot;
      }
      var nodes = [];
      var text = this[status + "Text"] || t$c(status);
      if (TEXT_STATUS.indexOf(status) !== -1) {
        nodes.push(h("div", {
          "class": bem$o('text')
        }, [text]));
      }
      if (status === 'loading') {
        nodes.push(h(Loading$1, {
          "attrs": {
            "size": "16"
          }
        }, [text]));
      }
      return nodes;
    },
    showSuccessTip: function showSuccessTip() {
      var _this2 = this;
      this.status = 'success';
      setTimeout(function () {
        _this2.setStatus(0);
      }, this.successDuration);
    }
  },
  render: function render() {
    var h = arguments[0];
    var trackStyle = {
      transitionDuration: this.duration + "ms",
      transform: this.distance ? "translate3d(0," + this.distance + "px, 0)" : ''
    };
    return h("div", {
      "class": bem$o()
    }, [h("div", {
      "ref": "track",
      "class": bem$o('track'),
      "style": trackStyle
    }, [h("div", {
      "class": bem$o('head'),
      "style": this.headStyle
    }, [this.genStatus()]), this.slots()])]);
  }
});

// Utils
var _createNamespace$o = createNamespace('rate'),
  createComponent$s = _createNamespace$o[0],
  bem$n = _createNamespace$o[1];
function getRateStatus(value, index, allowHalf) {
  if (value >= index) {
    return 'full';
  }
  if (value + 0.5 >= index && allowHalf) {
    return 'half';
  }
  return 'void';
}
var Rate = createComponent$s({
  mixins: [TouchMixin, FieldMixin],
  props: {
    size: [Number, String],
    color: String,
    gutter: [Number, String],
    readonly: Boolean,
    disabled: Boolean,
    allowHalf: Boolean,
    voidColor: String,
    iconPrefix: String,
    disabledColor: String,
    value: {
      type: Number,
      default: 0
    },
    icon: {
      type: String,
      default: 'star'
    },
    voidIcon: {
      type: String,
      default: 'star-o'
    },
    count: {
      type: [Number, String],
      default: 5
    },
    touchable: {
      type: Boolean,
      default: true
    }
  },
  computed: {
    list: function list() {
      var list = [];
      for (var i = 1; i <= this.count; i++) {
        list.push(getRateStatus(this.value, i, this.allowHalf));
      }
      return list;
    },
    sizeWithUnit: function sizeWithUnit() {
      return addUnit(this.size);
    },
    gutterWithUnit: function gutterWithUnit() {
      return addUnit(this.gutter);
    }
  },
  mounted: function mounted() {
    this.bindTouchEvent(this.$el);
  },
  methods: {
    select: function select(index) {
      if (!this.disabled && !this.readonly && index !== this.value) {
        this.$emit('input', index);
        this.$emit('change', index);
      }
    },
    onTouchStart: function onTouchStart(event) {
      var _this = this;
      if (this.readonly || this.disabled || !this.touchable) {
        return;
      }
      this.touchStart(event);
      var rects = this.$refs.items.map(function (item) {
        return item.getBoundingClientRect();
      });
      var ranges = [];
      rects.forEach(function (rect, index) {
        if (_this.allowHalf) {
          ranges.push({
            score: index + 0.5,
            left: rect.left
          }, {
            score: index + 1,
            left: rect.left + rect.width / 2
          });
        } else {
          ranges.push({
            score: index + 1,
            left: rect.left
          });
        }
      });
      this.ranges = ranges;
    },
    onTouchMove: function onTouchMove(event) {
      if (this.readonly || this.disabled || !this.touchable) {
        return;
      }
      this.touchMove(event);
      if (this.direction === 'horizontal') {
        preventDefault(event);
        var clientX = event.touches[0].clientX;
        this.select(this.getScoreByPosition(clientX));
      }
    },
    getScoreByPosition: function getScoreByPosition(x) {
      for (var i = this.ranges.length - 1; i > 0; i--) {
        if (x > this.ranges[i].left) {
          return this.ranges[i].score;
        }
      }
      return this.allowHalf ? 0.5 : 1;
    },
    genStar: function genStar(status, index) {
      var _this2 = this;
      var h = this.$createElement;
      var icon = this.icon,
        color = this.color,
        count = this.count,
        voidIcon = this.voidIcon,
        disabled = this.disabled,
        voidColor = this.voidColor,
        disabledColor = this.disabledColor;
      var score = index + 1;
      var isFull = status === 'full';
      var isVoid = status === 'void';
      var style;
      if (this.gutterWithUnit && score !== +count) {
        style = {
          paddingRight: this.gutterWithUnit
        };
      }
      return h("div", {
        "ref": "items",
        "refInFor": true,
        "key": index,
        "attrs": {
          "role": "radio",
          "tabindex": "0",
          "aria-setsize": count,
          "aria-posinset": score,
          "aria-checked": String(!isVoid)
        },
        "style": style,
        "class": bem$n('item')
      }, [h(Icon$3, {
        "attrs": {
          "size": this.sizeWithUnit,
          "name": isFull ? icon : voidIcon,
          "color": disabled ? disabledColor : isFull ? color : voidColor,
          "classPrefix": this.iconPrefix,
          "data-score": score
        },
        "class": bem$n('icon', {
          disabled: disabled,
          full: isFull
        }),
        "on": {
          "click": function click() {
            _this2.select(score);
          }
        }
      }), this.allowHalf && h(Icon$3, {
        "attrs": {
          "size": this.sizeWithUnit,
          "name": isVoid ? voidIcon : icon,
          "color": disabled ? disabledColor : isVoid ? voidColor : color,
          "classPrefix": this.iconPrefix,
          "data-score": score - 0.5
        },
        "class": bem$n('icon', ['half', {
          disabled: disabled,
          full: !isVoid
        }]),
        "on": {
          "click": function click() {
            _this2.select(score - 0.5);
          }
        }
      })]);
    }
  },
  render: function render() {
    var _this3 = this;
    var h = arguments[0];
    return h("div", {
      "class": bem$n({
        readonly: this.readonly,
        disabled: this.disabled
      }),
      "attrs": {
        "tabindex": "0",
        "role": "radiogroup"
      }
    }, [this.list.map(function (status, index) {
      return _this3.genStar(status, index);
    })]);
  }
});

var _createNamespace$n = createNamespace('row'),
  createComponent$r = _createNamespace$n[0],
  bem$m = _createNamespace$n[1];
var Row$1 = createComponent$r({
  mixins: [ParentMixin('vanRow')],
  props: {
    type: String,
    align: String,
    justify: String,
    tag: {
      type: String,
      default: 'div'
    },
    gutter: {
      type: [Number, String],
      default: 0
    }
  },
  computed: {
    spaces: function spaces() {
      var gutter = Number(this.gutter);
      if (!gutter) {
        return;
      }
      var spaces = [];
      var groups = [[]];
      var totalSpan = 0;
      this.children.forEach(function (item, index) {
        totalSpan += Number(item.span);
        if (totalSpan > 24) {
          groups.push([index]);
          totalSpan -= 24;
        } else {
          groups[groups.length - 1].push(index);
        }
      });
      groups.forEach(function (group) {
        var averagePadding = gutter * (group.length - 1) / group.length;
        group.forEach(function (item, index) {
          if (index === 0) {
            spaces.push({
              right: averagePadding
            });
          } else {
            var left = gutter - spaces[item - 1].right;
            var right = averagePadding - left;
            spaces.push({
              left: left,
              right: right
            });
          }
        });
      });
      return spaces;
    }
  },
  methods: {
    onClick: function onClick(event) {
      this.$emit('click', event);
    }
  },
  render: function render() {
    var _bem;
    var h = arguments[0];
    var align = this.align,
      justify = this.justify;
    var flex = this.type === 'flex';
    return h(this.tag, {
      "class": bem$m((_bem = {
        flex: flex
      }, _bem["align-" + align] = flex && align, _bem["justify-" + justify] = flex && justify, _bem)),
      "on": {
        "click": this.onClick
      }
    }, [this.slots()]);
  }
});

var _createNamespace$m = createNamespace('search'),
  createComponent$q = _createNamespace$m[0],
  bem$l = _createNamespace$m[1],
  t$b = _createNamespace$m[2];
function Search(h, props, slots, ctx) {
  function Label() {
    if (slots.label || props.label) {
      return h("div", {
        "class": bem$l('label')
      }, [slots.label ? slots.label() : props.label]);
    }
  }
  function Action() {
    if (!props.showAction) {
      return;
    }
    function onCancel() {
      if (slots.action) {
        return;
      }
      emit(ctx, 'input', '');
      emit(ctx, 'cancel');
    }
    return h("div", {
      "class": bem$l('action'),
      "attrs": {
        "role": "button",
        "tabindex": "0"
      },
      "on": {
        "click": onCancel
      }
    }, [slots.action ? slots.action() : props.actionText || t$b('cancel')]);
  }
  var fieldData = {
    attrs: ctx.data.attrs,
    on: _extends$2({}, ctx.listeners, {
      keypress: function keypress(event) {
        // press enter
        if (event.keyCode === 13) {
          preventDefault(event);
          emit(ctx, 'search', props.value);
        }
        emit(ctx, 'keypress', event);
      }
    })
  };
  var inheritData = inherit(ctx);
  inheritData.attrs = undefined;
  return h("div", _mergeJSXProps([{
    "class": bem$l({
      'show-action': props.showAction
    }),
    "style": {
      background: props.background
    }
  }, inheritData]), [slots.left == null ? void 0 : slots.left(), h("div", {
    "class": bem$l('content', props.shape)
  }, [Label(), h(Field, _mergeJSXProps([{
    "attrs": {
      "type": "search",
      "border": false,
      "value": props.value,
      "leftIcon": props.leftIcon,
      "rightIcon": props.rightIcon,
      "clearable": props.clearable,
      "clearTrigger": props.clearTrigger
    },
    "scopedSlots": {
      'left-icon': slots['left-icon'],
      'right-icon': slots['right-icon']
    }
  }, fieldData]))]), Action()]);
}
Search.props = {
  value: String,
  label: String,
  rightIcon: String,
  actionText: String,
  background: String,
  showAction: Boolean,
  clearTrigger: String,
  shape: {
    type: String,
    default: 'square'
  },
  clearable: {
    type: Boolean,
    default: true
  },
  leftIcon: {
    type: String,
    default: 'search'
  }
};
var Search$1 = createComponent$q(Search);

var PRESET_ICONS = ['qq', 'link', 'weibo', 'wechat', 'poster', 'qrcode', 'weapp-qrcode', 'wechat-moments'];
var _createNamespace$l = createNamespace('share-sheet'),
  createComponent$p = _createNamespace$l[0],
  bem$k = _createNamespace$l[1],
  t$a = _createNamespace$l[2];
var ShareSheet = createComponent$p({
  props: _extends$2({}, popupMixinProps, {
    title: String,
    duration: String,
    cancelText: String,
    description: String,
    getContainer: [String, Function],
    options: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    overlay: {
      type: Boolean,
      default: true
    },
    closeOnPopstate: {
      type: Boolean,
      default: true
    },
    safeAreaInsetBottom: {
      type: Boolean,
      default: true
    },
    closeOnClickOverlay: {
      type: Boolean,
      default: true
    }
  }),
  methods: {
    onCancel: function onCancel() {
      this.toggle(false);
      this.$emit('cancel');
    },
    onSelect: function onSelect(option, index) {
      this.$emit('select', option, index);
    },
    toggle: function toggle(val) {
      this.$emit('input', val);
    },
    getIconURL: function getIconURL(icon) {
      if (PRESET_ICONS.indexOf(icon) !== -1) {
        return "https://img01.yzcdn.cn/vant/share-sheet-" + icon + ".png";
      }
      return icon;
    },
    genHeader: function genHeader() {
      var h = this.$createElement;
      var title = this.slots('title') || this.title;
      var description = this.slots('description') || this.description;
      if (!title && !description) {
        return;
      }
      return h("div", {
        "class": bem$k('header')
      }, [title && h("h2", {
        "class": bem$k('title')
      }, [title]), description && h("span", {
        "class": bem$k('description')
      }, [description])]);
    },
    genOptions: function genOptions(options, showBorder) {
      var _this = this;
      var h = this.$createElement;
      return h("div", {
        "class": bem$k('options', {
          border: showBorder
        })
      }, [options.map(function (option, index) {
        return h("div", {
          "attrs": {
            "role": "button",
            "tabindex": "0"
          },
          "class": [bem$k('option'), option.className],
          "on": {
            "click": function click() {
              _this.onSelect(option, index);
            }
          }
        }, [h("img", {
          "attrs": {
            "src": _this.getIconURL(option.icon)
          },
          "class": bem$k('icon')
        }), option.name && h("span", {
          "class": bem$k('name')
        }, [option.name]), option.description && h("span", {
          "class": bem$k('option-description')
        }, [option.description])]);
      })]);
    },
    genRows: function genRows() {
      var _this2 = this;
      var options = this.options;
      if (Array.isArray(options[0])) {
        return options.map(function (item, index) {
          return _this2.genOptions(item, index !== 0);
        });
      }
      return this.genOptions(options);
    },
    genCancelText: function genCancelText() {
      var _this$cancelText;
      var h = this.$createElement;
      var cancelText = (_this$cancelText = this.cancelText) != null ? _this$cancelText : t$a('cancel');
      if (cancelText) {
        return h("button", {
          "attrs": {
            "type": "button"
          },
          "class": bem$k('cancel'),
          "on": {
            "click": this.onCancel
          }
        }, [cancelText]);
      }
    },
    onClickOverlay: function onClickOverlay() {
      this.$emit('click-overlay');
    }
  },
  render: function render() {
    var h = arguments[0];
    return h(Popup, {
      "attrs": {
        "round": true,
        "value": this.value,
        "position": "bottom",
        "overlay": this.overlay,
        "duration": this.duration,
        "lazyRender": this.lazyRender,
        "lockScroll": this.lockScroll,
        "getContainer": this.getContainer,
        "closeOnPopstate": this.closeOnPopstate,
        "closeOnClickOverlay": this.closeOnClickOverlay,
        "safeAreaInsetBottom": this.safeAreaInsetBottom
      },
      "class": bem$k(),
      "on": {
        "input": this.toggle,
        "click-overlay": this.onClickOverlay
      }
    }, [this.genHeader(), this.genRows(), this.genCancelText()]);
  }
});

var _createNamespace$k = createNamespace('sidebar'),
  createComponent$o = _createNamespace$k[0],
  bem$j = _createNamespace$k[1];
var Sidebar = createComponent$o({
  mixins: [ParentMixin('vanSidebar')],
  model: {
    prop: 'activeKey'
  },
  props: {
    activeKey: {
      type: [Number, String],
      default: 0
    }
  },
  data: function data() {
    return {
      index: +this.activeKey
    };
  },
  watch: {
    activeKey: function activeKey() {
      this.setIndex(+this.activeKey);
    }
  },
  methods: {
    setIndex: function setIndex(index) {
      if (index !== this.index) {
        this.index = index;
        this.$emit('change', index);
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$j()
    }, [this.slots()]);
  }
});

var _createNamespace$j = createNamespace('sidebar-item'),
  createComponent$n = _createNamespace$j[0],
  bem$i = _createNamespace$j[1];
var SidebarItem = createComponent$n({
  mixins: [ChildrenMixin('vanSidebar')],
  props: _extends$2({}, routeProps, {
    dot: Boolean,
    // @deprecated
    info: [Number, String],
    badge: [Number, String],
    title: String,
    disabled: Boolean
  }),
  computed: {
    select: function select() {
      return this.index === +this.parent.activeKey;
    }
  },
  methods: {
    onClick: function onClick() {
      if (this.disabled) {
        return;
      }
      this.$emit('click', this.index);
      this.parent.$emit('input', this.index);
      this.parent.setIndex(this.index);
      route(this.$router, this);
    }
  },
  render: function render() {
    var _this$slots, _this$badge;
    var h = arguments[0];
    return h("a", {
      "class": bem$i({
        select: this.select,
        disabled: this.disabled
      }),
      "on": {
        "click": this.onClick
      }
    }, [h("div", {
      "class": bem$i('text')
    }, [(_this$slots = this.slots('title')) != null ? _this$slots : this.title, h(Info$1, {
      "attrs": {
        "dot": this.dot,
        "info": (_this$badge = this.badge) != null ? _this$badge : this.info
      },
      "class": bem$i('info')
    })])]);
  }
});

var _createNamespace$i = createNamespace('skeleton'),
  createComponent$m = _createNamespace$i[0],
  bem$h = _createNamespace$i[1];
var DEFAULT_ROW_WIDTH = '100%';
var DEFAULT_LAST_ROW_WIDTH = '60%';
function Skeleton(h, props, slots, ctx) {
  if (!props.loading) {
    return slots.default && slots.default();
  }
  function Title() {
    if (props.title) {
      return h("h3", {
        "class": bem$h('title'),
        "style": {
          width: addUnit(props.titleWidth)
        }
      });
    }
  }
  function Rows() {
    var Rows = [];
    var rowWidth = props.rowWidth;
    function getRowWidth(index) {
      if (rowWidth === DEFAULT_ROW_WIDTH && index === +props.row - 1) {
        return DEFAULT_LAST_ROW_WIDTH;
      }
      if (Array.isArray(rowWidth)) {
        return rowWidth[index];
      }
      return rowWidth;
    }
    for (var i = 0; i < props.row; i++) {
      Rows.push(h("div", {
        "class": bem$h('row'),
        "style": {
          width: addUnit(getRowWidth(i))
        }
      }));
    }
    return Rows;
  }
  function Avatar() {
    if (props.avatar) {
      var size = addUnit(props.avatarSize);
      return h("div", {
        "class": bem$h('avatar', props.avatarShape),
        "style": {
          width: size,
          height: size
        }
      });
    }
  }
  return h("div", _mergeJSXProps([{
    "class": bem$h({
      animate: props.animate,
      round: props.round
    })
  }, inherit(ctx)]), [Avatar(), h("div", {
    "class": bem$h('content')
  }, [Title(), Rows()])]);
}
Skeleton.props = {
  title: Boolean,
  round: Boolean,
  avatar: Boolean,
  titleWidth: [Number, String],
  avatarSize: [Number, String],
  row: {
    type: [Number, String],
    default: 0
  },
  loading: {
    type: Boolean,
    default: true
  },
  animate: {
    type: Boolean,
    default: true
  },
  avatarShape: {
    type: String,
    default: 'round'
  },
  rowWidth: {
    type: [Number, String, Array],
    default: DEFAULT_ROW_WIDTH
  }
};
var Skeleton$1 = createComponent$m(Skeleton);

/**
 * Sku only provide zh-CN lang by default
 */
var lang$1 = {
  'zh-CN': {
    vanSku: {
      select: '请选择',
      selected: '已选',
      selectSku: '请先选择商品规格',
      soldout: '库存不足',
      originPrice: '原价',
      minusTip: '至少选择一件',
      minusStartTip: function minusStartTip(start) {
        return start + "\u4EF6\u8D77\u552E";
      },
      unavailable: '商品已经无法购买啦',
      stock: '剩余',
      stockUnit: '件',
      quotaTip: function quotaTip(quota) {
        return "\u6BCF\u4EBA\u9650\u8D2D" + quota + "\u4EF6";
      },
      quotaUsedTip: function quotaUsedTip(quota, count) {
        return "\u6BCF\u4EBA\u9650\u8D2D" + quota + "\u4EF6\uFF0C\u4F60\u5DF2\u8D2D\u4E70" + count + "\u4EF6";
      }
    },
    vanSkuActions: {
      buy: '立即购买',
      addCart: '加入购物车'
    },
    vanSkuImgUploader: {
      oversize: function oversize(maxSize) {
        return "\u6700\u5927\u53EF\u4E0A\u4F20\u56FE\u7247\u4E3A" + maxSize + "MB\uFF0C\u8BF7\u5C1D\u8BD5\u538B\u7F29\u56FE\u7247\u5C3A\u5BF8";
      },
      fail: '上传失败',
      uploading: '上传中...'
    },
    vanSkuStepper: {
      quotaLimit: function quotaLimit(quota) {
        return "\u9650\u8D2D" + quota + "\u4EF6";
      },
      quotaStart: function quotaStart(start) {
        return start + "\u4EF6\u8D77\u552E";
      },
      comma: '，',
      num: '购买数量'
    },
    vanSkuMessages: {
      fill: '请填写',
      upload: '请上传',
      imageLabel: '仅限一张',
      invalid: {
        tel: '请填写正确的数字格式留言',
        mobile: '手机号长度为6-20位数字',
        email: '请填写正确的邮箱',
        id_no: '请填写正确的身份证号码'
      },
      placeholder: {
        id_no: '请填写身份证号',
        text: '请填写留言',
        tel: '请填写数字',
        email: '请填写邮箱',
        date: '请选择日期',
        time: '请选择时间',
        textarea: '请填写留言',
        mobile: '请填写手机号'
      }
    },
    vanSkuRow: {
      multiple: '可多选'
    },
    vanSkuDatetimeField: {
      title: {
        date: '选择年月日',
        time: '选择时间',
        datetime: '选择日期时间'
      },
      format: {
        year: '年',
        month: '月',
        day: '日',
        hour: '时',
        minute: '分'
      }
    }
  }
};

var LIMIT_TYPE = {
  QUOTA_LIMIT: 0,
  STOCK_LIMIT: 1
};
var UNSELECTED_SKU_VALUE_ID = '';
var constants = {
  LIMIT_TYPE: LIMIT_TYPE,
  UNSELECTED_SKU_VALUE_ID: UNSELECTED_SKU_VALUE_ID
};

/*
  normalize sku tree

  [
    {
      count: 2,
      k: "品种", // 规格名称 skuKeyName
      k_id: "1200", // skuKeyId
      k_s: "s1" // skuKeyStr
      v: [ // skuValues
        { // skuValue
          id: "1201", // skuValueId
          name: "萌" // 具体的规格值 skuValueName
        }, {
          id: "973",
          name: "帅"
        }
      ]
    },
    ...
  ]
                |
                v
  {
    s1: [{
      id: "1201",
      name: "萌"
    }, {
      id: "973",
      name: "帅"
    }],
    ...
  }
 */

var normalizeSkuTree = function normalizeSkuTree(skuTree) {
  var normalizedTree = {};
  skuTree.forEach(function (treeItem) {
    normalizedTree[treeItem.k_s] = treeItem.v;
  });
  return normalizedTree;
};
var normalizePropList = function normalizePropList(propList) {
  var normalizedProp = {};
  propList.forEach(function (item) {
    var itemObj = {};
    item.v.forEach(function (it) {
      itemObj[it.id] = it;
    });
    normalizedProp[item.k_id] = itemObj;
  });
  return normalizedProp;
}; // 判断是否所有的sku都已经选中

var isAllSelected = function isAllSelected(skuTree, selectedSku) {
  // 筛选selectedSku对象中key值不为空的值
  var selected = Object.keys(selectedSku).filter(function (skuKeyStr) {
    return selectedSku[skuKeyStr] !== UNSELECTED_SKU_VALUE_ID;
  });
  return skuTree.length === selected.length;
}; // 根据已选择的 sku 获取 skuComb

var getSkuComb = function getSkuComb(skuList, selectedSku) {
  var skuComb = skuList.filter(function (item) {
    return Object.keys(selectedSku).every(function (skuKeyStr) {
      return String(item[skuKeyStr]) === String(selectedSku[skuKeyStr]);
    });
  });
  return skuComb[0];
}; // 获取已选择的sku名称

var getSelectedSkuValues = function getSelectedSkuValues(skuTree, selectedSku) {
  var normalizedTree = normalizeSkuTree(skuTree);
  return Object.keys(selectedSku).reduce(function (selectedValues, skuKeyStr) {
    var skuValues = normalizedTree[skuKeyStr] || [];
    var skuValueId = selectedSku[skuKeyStr];
    if (skuValueId !== UNSELECTED_SKU_VALUE_ID && skuValues.length > 0) {
      var skuValue = skuValues.filter(function (value) {
        return value.id === skuValueId;
      })[0];
      skuValue && selectedValues.push(skuValue);
    }
    return selectedValues;
  }, []);
}; // 判断sku是否可选

var isSkuChoosable = function isSkuChoosable(skuList, selectedSku, skuToChoose) {
  var _extends2;
  var key = skuToChoose.key,
    valueId = skuToChoose.valueId; // 先假设sku已选中，拼入已选中sku对象中

  var matchedSku = _extends$2({}, selectedSku, (_extends2 = {}, _extends2[key] = valueId, _extends2)); // 再判断剩余sku是否全部不可选，若不可选则当前sku不可选中

  var skusToCheck = Object.keys(matchedSku).filter(function (skuKey) {
    return matchedSku[skuKey] !== UNSELECTED_SKU_VALUE_ID;
  });
  var filteredSku = skuList.filter(function (sku) {
    return skusToCheck.every(function (skuKey) {
      return String(matchedSku[skuKey]) === String(sku[skuKey]);
    });
  });
  var stock = filteredSku.reduce(function (total, sku) {
    total += sku.stock_num;
    return total;
  }, 0);
  return stock > 0;
};
var getSelectedPropValues = function getSelectedPropValues(propList, selectedProp) {
  var normalizeProp = normalizePropList(propList);
  return Object.keys(selectedProp).reduce(function (acc, cur) {
    selectedProp[cur].forEach(function (it) {
      acc.push(_extends$2({}, normalizeProp[cur][it]));
    });
    return acc;
  }, []);
};
var getSelectedProperties = function getSelectedProperties(propList, selectedProp) {
  var list = [];
  (propList || []).forEach(function (prop) {
    if (selectedProp[prop.k_id] && selectedProp[prop.k_id].length > 0) {
      var v = [];
      prop.v.forEach(function (it) {
        if (selectedProp[prop.k_id].indexOf(it.id) > -1) {
          v.push(_extends$2({}, it));
        }
      });
      list.push(_extends$2({}, prop, {
        v: v
      }));
    }
  });
  return list;
};
var skuHelper = {
  normalizeSkuTree: normalizeSkuTree,
  getSkuComb: getSkuComb,
  getSelectedSkuValues: getSelectedSkuValues,
  isAllSelected: isAllSelected,
  isSkuChoosable: isSkuChoosable,
  getSelectedPropValues: getSelectedPropValues,
  getSelectedProperties: getSelectedProperties
};

var _createNamespace$h = createNamespace('sku-header'),
  createComponent$l = _createNamespace$h[0],
  bem$g = _createNamespace$h[1];
function getSkuImgValue(sku, selectedSku) {
  var imgValue;
  sku.tree.some(function (item) {
    var id = selectedSku[item.k_s];
    if (id && item.v) {
      var matchedSku = item.v.filter(function (skuValue) {
        return skuValue.id === id;
      })[0] || {};
      var img = matchedSku.previewImgUrl || matchedSku.imgUrl || matchedSku.img_url;
      if (img) {
        imgValue = _extends$2({}, matchedSku, {
          ks: item.k_s,
          imgUrl: img
        });
        return true;
      }
    }
    return false;
  });
  return imgValue;
}
function SkuHeader$1(h, props, slots, ctx) {
  var _slots$skuHeaderIma;
  var sku = props.sku,
    goods = props.goods,
    skuEventBus = props.skuEventBus,
    selectedSku = props.selectedSku,
    _props$showHeaderImag = props.showHeaderImage,
    showHeaderImage = _props$showHeaderImag === void 0 ? true : _props$showHeaderImag;
  var selectedValue = getSkuImgValue(sku, selectedSku);
  var imgUrl = selectedValue ? selectedValue.imgUrl : goods.picture;
  var previewImage = function previewImage() {
    skuEventBus.$emit('sku:previewImage', selectedValue);
  };
  return h("div", _mergeJSXProps([{
    "class": [bem$g(), BORDER_BOTTOM]
  }, inherit(ctx)]), [showHeaderImage && h(Image$1, {
    "attrs": {
      "fit": "cover",
      "src": imgUrl
    },
    "class": bem$g('img-wrap'),
    "on": {
      "click": previewImage
    }
  }, [(_slots$skuHeaderIma = slots['sku-header-image-extra']) == null ? void 0 : _slots$skuHeaderIma.call(slots)]), h("div", {
    "class": bem$g('goods-info')
  }, [slots.default == null ? void 0 : slots.default()])]);
}
SkuHeader$1.props = {
  sku: Object,
  goods: Object,
  skuEventBus: Object,
  selectedSku: Object,
  showHeaderImage: Boolean
};
var SkuHeader$2 = createComponent$l(SkuHeader$1);

var _createNamespace$g = createNamespace('sku-header-item'),
  createComponent$k = _createNamespace$g[0],
  bem$f = _createNamespace$g[1];
function SkuHeader(h, props, slots, ctx) {
  return h("div", _mergeJSXProps([{
    "class": bem$f()
  }, inherit(ctx)]), [slots.default && slots.default()]);
}
var SkuHeaderItem = createComponent$k(SkuHeader);

// Utils
var _createNamespace$f = createNamespace('sku-row'),
  createComponent$j = _createNamespace$f[0],
  bem$e = _createNamespace$f[1],
  t$9 = _createNamespace$f[2];
var SkuRow = createComponent$j({
  mixins: [ParentMixin('vanSkuRows'), BindEventMixin(function (bind) {
    if (this.scrollable && this.$refs.scroller) {
      bind(this.$refs.scroller, 'scroll', this.onScroll);
    }
  })],
  props: {
    skuRow: Object
  },
  data: function data() {
    return {
      progress: 0
    };
  },
  computed: {
    scrollable: function scrollable() {
      return this.skuRow.largeImageMode && this.skuRow.v.length > 6;
    }
  },
  methods: {
    onScroll: function onScroll() {
      var _this$$refs = this.$refs,
        scroller = _this$$refs.scroller,
        row = _this$$refs.row;
      var distance = row.offsetWidth - scroller.offsetWidth;
      this.progress = scroller.scrollLeft / distance;
    },
    genTitle: function genTitle() {
      var h = this.$createElement;
      return h("div", {
        "class": bem$e('title')
      }, [this.skuRow.k, this.skuRow.is_multiple && h("span", {
        "class": bem$e('title-multiple')
      }, ["\uFF08", t$9('multiple'), "\uFF09"])]);
    },
    genIndicator: function genIndicator() {
      var h = this.$createElement;
      if (this.scrollable) {
        var style = {
          transform: "translate3d(" + this.progress * 20 + "px, 0, 0)"
        };
        return h("div", {
          "class": bem$e('indicator-wrapper')
        }, [h("div", {
          "class": bem$e('indicator')
        }, [h("div", {
          "class": bem$e('indicator-slider'),
          "style": style
        })])]);
      }
    },
    genContent: function genContent() {
      var h = this.$createElement;
      var nodes = this.slots();
      if (this.skuRow.largeImageMode) {
        var top = [];
        var bottom = [];
        nodes.forEach(function (node, index) {
          var group = Math.floor(index / 3) % 2 === 0 ? top : bottom;
          group.push(node);
        });
        return h("div", {
          "class": bem$e('scroller'),
          "ref": "scroller"
        }, [h("div", {
          "class": bem$e('row'),
          "ref": "row"
        }, [top]), bottom.length ? h("div", {
          "class": bem$e('row')
        }, [bottom]) : null]);
      }
      return nodes;
    },
    centerItem: function centerItem(selectSkuId) {
      if (!this.skuRow.largeImageMode || !selectSkuId) {
        return;
      }
      var _this$children = this.children,
        children = _this$children === void 0 ? [] : _this$children;
      var _this$$refs2 = this.$refs,
        scroller = _this$$refs2.scroller,
        row = _this$$refs2.row;
      var child = children.find(function (it) {
        return +it.skuValue.id === +selectSkuId;
      });
      if (scroller && row && child && child.$el) {
        var target = child.$el;
        var to = target.offsetLeft - (scroller.offsetWidth - target.offsetWidth) / 2;
        scroller.scrollLeft = to;
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": [bem$e(), BORDER_BOTTOM]
    }, [this.genTitle(), this.genContent(), this.genIndicator()]);
  }
});

var _createNamespace$e = createNamespace('sku-row-item'),
  createComponent$i = _createNamespace$e[0];
var SkuRowItem = createComponent$i({
  mixins: [ChildrenMixin('vanSkuRows')],
  props: {
    lazyLoad: Boolean,
    skuValue: Object,
    skuKeyStr: String,
    skuEventBus: Object,
    selectedSku: Object,
    largeImageMode: Boolean,
    disableSoldoutSku: Boolean,
    skuList: {
      type: Array,
      default: function _default() {
        return [];
      }
    }
  },
  computed: {
    imgUrl: function imgUrl() {
      var url = this.skuValue.imgUrl || this.skuValue.img_url;
      return this.largeImageMode ? url || 'https://img01.yzcdn.cn/upload_files/2020/06/24/FmKWDg0bN9rMcTp9ne8MXiQWGtLn.png' : url;
    },
    choosable: function choosable() {
      if (!this.disableSoldoutSku) {
        return true;
      }
      return isSkuChoosable(this.skuList, this.selectedSku, {
        key: this.skuKeyStr,
        valueId: this.skuValue.id
      });
    }
  },
  methods: {
    onSelect: function onSelect() {
      if (this.choosable) {
        this.skuEventBus.$emit('sku:select', _extends$2({}, this.skuValue, {
          skuKeyStr: this.skuKeyStr
        }));
      }
    },
    onPreviewImg: function onPreviewImg(event) {
      event.stopPropagation();
      var skuValue = this.skuValue,
        skuKeyStr = this.skuKeyStr;
      this.skuEventBus.$emit('sku:previewImage', _extends$2({}, skuValue, {
        ks: skuKeyStr,
        imgUrl: skuValue.imgUrl || skuValue.img_url
      }));
    },
    genImage: function genImage(classPrefix) {
      var h = this.$createElement;
      if (this.imgUrl) {
        return h(Image$1, {
          "attrs": {
            "fit": "cover",
            "src": this.imgUrl,
            "lazyLoad": this.lazyLoad
          },
          "class": classPrefix + "-img"
        });
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    var choosed = this.skuValue.id === this.selectedSku[this.skuKeyStr];
    var classPrefix = this.largeImageMode ? bem$e('image-item') : bem$e('item');
    return h("span", {
      "class": [classPrefix, choosed ? classPrefix + "--active" : '', !this.choosable ? classPrefix + "--disabled" : ''],
      "on": {
        "click": this.onSelect
      }
    }, [this.genImage(classPrefix), h("div", {
      "class": classPrefix + "-name"
    }, [this.largeImageMode ? h("span", {
      "class": {
        'van-multi-ellipsis--l2': this.largeImageMode
      }
    }, [this.skuValue.name]) : this.skuValue.name]), this.largeImageMode && h(Icon$3, {
      "attrs": {
        "name": "enlarge"
      },
      "class": classPrefix + "-img-icon",
      "on": {
        "click": this.onPreviewImg
      }
    })]);
  }
});

var _createNamespace$d = createNamespace('sku-row-prop-item'),
  createComponent$h = _createNamespace$d[0];
var SkuRowPropItem = createComponent$h({
  props: {
    skuValue: Object,
    skuKeyStr: String,
    skuEventBus: Object,
    selectedProp: Object,
    multiple: Boolean,
    disabled: Boolean
  },
  computed: {
    choosed: function choosed() {
      var selectedProp = this.selectedProp,
        skuKeyStr = this.skuKeyStr,
        skuValue = this.skuValue;
      if (selectedProp && selectedProp[skuKeyStr]) {
        return selectedProp[skuKeyStr].indexOf(skuValue.id) > -1;
      }
      return false;
    }
  },
  methods: {
    onSelect: function onSelect() {
      if (this.disabled) return;
      this.skuEventBus.$emit('sku:propSelect', _extends$2({}, this.skuValue, {
        skuKeyStr: this.skuKeyStr,
        multiple: this.multiple
      }));
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("span", {
      "class": ['van-sku-row__item', {
        'van-sku-row__item--active': this.choosed
      }, {
        'van-sku-row__item--disabled': this.disabled
      }],
      "on": {
        "click": this.onSelect
      }
    }, [h("span", {
      "class": "van-sku-row__item-name"
    }, [this.skuValue.name])]);
  }
});

var _createNamespace$c = createNamespace('stepper'),
  createComponent$g = _createNamespace$c[0],
  bem$d = _createNamespace$c[1];
var LONG_PRESS_START_TIME = 600;
var LONG_PRESS_INTERVAL = 200;
function equal(value1, value2) {
  return String(value1) === String(value2);
}
var Stepper = createComponent$g({
  mixins: [FieldMixin],
  props: {
    value: null,
    theme: String,
    integer: Boolean,
    disabled: Boolean,
    allowEmpty: Boolean,
    inputWidth: [Number, String],
    buttonSize: [Number, String],
    asyncChange: Boolean,
    placeholder: String,
    disablePlus: Boolean,
    disableMinus: Boolean,
    disableInput: Boolean,
    decimalLength: [Number, String],
    name: {
      type: [Number, String],
      default: ''
    },
    min: {
      type: [Number, String],
      default: 1
    },
    max: {
      type: [Number, String],
      default: Infinity
    },
    step: {
      type: [Number, String],
      default: 1
    },
    defaultValue: {
      type: [Number, String],
      default: 1
    },
    showPlus: {
      type: Boolean,
      default: true
    },
    showMinus: {
      type: Boolean,
      default: true
    },
    showInput: {
      type: Boolean,
      default: true
    },
    longPress: {
      type: Boolean,
      default: true
    }
  },
  data: function data() {
    var _this$value;
    var defaultValue = (_this$value = this.value) != null ? _this$value : this.defaultValue;
    var value = this.format(defaultValue);
    if (!equal(value, this.value)) {
      this.$emit('input', value);
    }
    return {
      currentValue: value
    };
  },
  computed: {
    minusDisabled: function minusDisabled() {
      return this.disabled || this.disableMinus || this.currentValue <= +this.min;
    },
    plusDisabled: function plusDisabled() {
      return this.disabled || this.disablePlus || this.currentValue >= +this.max;
    },
    inputStyle: function inputStyle() {
      var style = {};
      if (this.inputWidth) {
        style.width = addUnit(this.inputWidth);
      }
      if (this.buttonSize) {
        style.height = addUnit(this.buttonSize);
      }
      return style;
    },
    buttonStyle: function buttonStyle() {
      if (this.buttonSize) {
        var size = addUnit(this.buttonSize);
        return {
          width: size,
          height: size
        };
      }
    }
  },
  watch: {
    max: 'check',
    min: 'check',
    integer: 'check',
    decimalLength: 'check',
    value: function value(val) {
      if (!equal(val, this.currentValue)) {
        this.currentValue = this.format(val);
      }
    },
    currentValue: function currentValue(val) {
      this.$emit('input', val);
      this.$emit('change', val, {
        name: this.name
      });
    }
  },
  methods: {
    check: function check() {
      var val = this.format(this.currentValue);
      if (!equal(val, this.currentValue)) {
        this.currentValue = val;
      }
    },
    // formatNumber illegal characters
    formatNumber: function formatNumber$1(value) {
      return formatNumber(String(value), !this.integer);
    },
    format: function format(value) {
      if (this.allowEmpty && value === '') {
        return value;
      }
      value = this.formatNumber(value); // format range

      value = value === '' ? 0 : +value;
      value = isNaN$1(value) ? this.min : value;
      value = Math.max(Math.min(this.max, value), this.min); // format decimal

      if (isDef(this.decimalLength)) {
        value = value.toFixed(this.decimalLength);
      }
      return value;
    },
    onInput: function onInput(event) {
      var value = event.target.value;
      var formatted = this.formatNumber(value); // limit max decimal length

      if (isDef(this.decimalLength) && formatted.indexOf('.') !== -1) {
        var pair = formatted.split('.');
        formatted = pair[0] + "." + pair[1].slice(0, this.decimalLength);
      }
      if (!equal(value, formatted)) {
        event.target.value = formatted;
      } // prefer number type

      if (formatted === String(+formatted)) {
        formatted = +formatted;
      }
      this.emitChange(formatted);
    },
    emitChange: function emitChange(value) {
      if (this.asyncChange) {
        this.$emit('input', value);
        this.$emit('change', value, {
          name: this.name
        });
      } else {
        this.currentValue = value;
      }
    },
    onChange: function onChange() {
      var type = this.type;
      if (this[type + "Disabled"]) {
        this.$emit('overlimit', type);
        return;
      }
      var diff = type === 'minus' ? -this.step : +this.step;
      var value = this.format(addNumber(+this.currentValue, diff));
      this.emitChange(value);
      this.$emit(type);
    },
    onFocus: function onFocus(event) {
      // readonly not work in legacy mobile safari
      if (this.disableInput && this.$refs.input) {
        this.$refs.input.blur();
      } else {
        this.$emit('focus', event);
      }
    },
    onBlur: function onBlur(event) {
      var value = this.format(event.target.value);
      event.target.value = value;
      this.emitChange(value);
      this.$emit('blur', event);
      resetScroll();
    },
    longPressStep: function longPressStep() {
      var _this = this;
      this.longPressTimer = setTimeout(function () {
        _this.onChange();
        _this.longPressStep(_this.type);
      }, LONG_PRESS_INTERVAL);
    },
    onTouchStart: function onTouchStart() {
      var _this2 = this;
      if (!this.longPress) {
        return;
      }
      clearTimeout(this.longPressTimer);
      this.isLongPress = false;
      this.longPressTimer = setTimeout(function () {
        _this2.isLongPress = true;
        _this2.onChange();
        _this2.longPressStep();
      }, LONG_PRESS_START_TIME);
    },
    onTouchEnd: function onTouchEnd(event) {
      if (!this.longPress) {
        return;
      }
      clearTimeout(this.longPressTimer);
      if (this.isLongPress) {
        preventDefault(event);
      }
    },
    onMousedown: function onMousedown(event) {
      // fix mobile safari page scroll down issue
      // see: https://github.com/vant-ui/vant/issues/7690
      if (this.disableInput) {
        event.preventDefault();
      }
    }
  },
  render: function render() {
    var _this3 = this;
    var h = arguments[0];
    var createListeners = function createListeners(type) {
      return {
        on: {
          click: function click(e) {
            // disable double tap scrolling on mobile safari
            e.preventDefault();
            _this3.type = type;
            _this3.onChange();
          },
          touchstart: function touchstart() {
            _this3.type = type;
            _this3.onTouchStart();
          },
          touchend: _this3.onTouchEnd,
          touchcancel: _this3.onTouchEnd
        }
      };
    };
    return h("div", {
      "class": bem$d([this.theme])
    }, [h("button", _mergeJSXProps([{
      "directives": [{
        name: "show",
        value: this.showMinus
      }],
      "attrs": {
        "type": "button"
      },
      "style": this.buttonStyle,
      "class": bem$d('minus', {
        disabled: this.minusDisabled
      })
    }, createListeners('minus')])), h("input", {
      "directives": [{
        name: "show",
        value: this.showInput
      }],
      "ref": "input",
      "attrs": {
        "type": this.integer ? 'tel' : 'text',
        "role": "spinbutton",
        "disabled": this.disabled,
        "readonly": this.disableInput,
        "inputmode": this.integer ? 'numeric' : 'decimal',
        "placeholder": this.placeholder,
        "aria-valuemax": this.max,
        "aria-valuemin": this.min,
        "aria-valuenow": this.currentValue
      },
      "class": bem$d('input'),
      "domProps": {
        "value": this.currentValue
      },
      "style": this.inputStyle,
      "on": {
        "input": this.onInput,
        "focus": this.onFocus,
        "blur": this.onBlur,
        "mousedown": this.onMousedown
      }
    }), h("button", _mergeJSXProps([{
      "directives": [{
        name: "show",
        value: this.showPlus
      }],
      "attrs": {
        "type": "button"
      },
      "style": this.buttonStyle,
      "class": bem$d('plus', {
        disabled: this.plusDisabled
      })
    }, createListeners('plus')]))]);
  }
});

var namespace$3 = createNamespace('sku-stepper');
var createComponent$f = namespace$3[0];
var t$8 = namespace$3[2];
var QUOTA_LIMIT$1 = LIMIT_TYPE.QUOTA_LIMIT,
  STOCK_LIMIT = LIMIT_TYPE.STOCK_LIMIT;
var SkuStepper = createComponent$f({
  props: {
    stock: Number,
    skuEventBus: Object,
    skuStockNum: Number,
    selectedNum: Number,
    stepperTitle: String,
    disableStepperInput: Boolean,
    customStepperConfig: Object,
    hideQuotaText: Boolean,
    quota: {
      type: Number,
      default: 0
    },
    quotaUsed: {
      type: Number,
      default: 0
    },
    startSaleNum: {
      type: Number,
      default: 1
    }
  },
  data: function data() {
    return {
      currentNum: this.selectedNum,
      // 购买限制类型: 限购/库存
      limitType: STOCK_LIMIT
    };
  },
  watch: {
    currentNum: function currentNum(num) {
      var intValue = parseInt(num, 10);
      if (intValue >= this.stepperMinLimit && intValue <= this.stepperLimit) {
        this.skuEventBus.$emit('sku:numChange', intValue);
      }
    },
    stepperLimit: function stepperLimit(limit) {
      if (limit < this.currentNum && this.stepperMinLimit <= limit) {
        this.currentNum = limit;
      }
      this.checkState(this.stepperMinLimit, limit);
    },
    stepperMinLimit: function stepperMinLimit(start) {
      if (start > this.currentNum || start > this.stepperLimit) {
        this.currentNum = start;
      }
      this.checkState(start, this.stepperLimit);
    }
  },
  computed: {
    stepperLimit: function stepperLimit() {
      var quotaLimit = this.quota - this.quotaUsed;
      var limit; // 无限购时直接取库存，有限购时取限购数和库存数中小的那个

      if (this.quota > 0 && quotaLimit <= this.stock) {
        // 修正负的limit
        limit = quotaLimit < 0 ? 0 : quotaLimit;
        this.limitType = QUOTA_LIMIT$1;
      } else {
        limit = this.stock;
        this.limitType = STOCK_LIMIT;
      }
      return limit;
    },
    stepperMinLimit: function stepperMinLimit() {
      return this.startSaleNum < 1 ? 1 : this.startSaleNum;
    },
    quotaText: function quotaText() {
      var _this$customStepperCo = this.customStepperConfig,
        quotaText = _this$customStepperCo.quotaText,
        hideQuotaText = _this$customStepperCo.hideQuotaText;
      if (hideQuotaText) return '';
      var text = '';
      if (quotaText) {
        text = quotaText;
      } else {
        var textArr = [];
        if (this.startSaleNum > 1) {
          textArr.push(t$8('quotaStart', this.startSaleNum));
        }
        if (this.quota > 0) {
          textArr.push(t$8('quotaLimit', this.quota));
        }
        text = textArr.join(t$8('comma'));
      }
      return text;
    }
  },
  created: function created() {
    this.checkState(this.stepperMinLimit, this.stepperLimit);
  },
  methods: {
    setCurrentNum: function setCurrentNum(num) {
      this.currentNum = num;
      this.checkState(this.stepperMinLimit, this.stepperLimit);
    },
    onOverLimit: function onOverLimit(action) {
      this.skuEventBus.$emit('sku:overLimit', {
        action: action,
        limitType: this.limitType,
        quota: this.quota,
        quotaUsed: this.quotaUsed,
        startSaleNum: this.startSaleNum
      });
    },
    onChange: function onChange(currentValue) {
      var intValue = parseInt(currentValue, 10);
      var handleStepperChange = this.customStepperConfig.handleStepperChange;
      handleStepperChange && handleStepperChange(intValue);
      this.$emit('change', intValue);
    },
    checkState: function checkState(min, max) {
      // 如果选择小于起售，则强制变为起售
      if (this.currentNum < min || min > max) {
        this.currentNum = min;
      } else if (this.currentNum > max) {
        // 当前选择数量大于最大可选时，需要重置已选数量
        this.currentNum = max;
      }
      this.skuEventBus.$emit('sku:stepperState', {
        valid: min <= max,
        min: min,
        max: max,
        limitType: this.limitType,
        quota: this.quota,
        quotaUsed: this.quotaUsed,
        startSaleNum: this.startSaleNum
      });
    }
  },
  render: function render() {
    var _this = this;
    var h = arguments[0];
    return h("div", {
      "class": "van-sku-stepper-stock"
    }, [h("div", {
      "class": "van-sku__stepper-title"
    }, [this.stepperTitle || t$8('num')]), h(Stepper, {
      "attrs": {
        "integer": true,
        "min": this.stepperMinLimit,
        "max": this.stepperLimit,
        "disableInput": this.disableStepperInput
      },
      "class": "van-sku__stepper",
      "on": {
        "overlimit": this.onOverLimit,
        "change": this.onChange
      },
      "model": {
        value: _this.currentNum,
        callback: function callback($$v) {
          _this.currentNum = $$v;
        }
      }
    }), !this.hideQuotaText && this.quotaText && h("span", {
      "class": "van-sku__stepper-quota"
    }, ["(", this.quotaText, ")"])]);
  }
});

/* eslint-disable */
function isEmail(value) {
  var reg = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/;
  return reg.test(value.trim());
}

function toArray$1(item) {
  if (Array.isArray(item)) {
    return item;
  }
  return [item];
}
function readFile(file, resultType) {
  return new Promise(function (resolve) {
    if (resultType === 'file') {
      resolve(null);
      return;
    }
    var reader = new FileReader();
    reader.onload = function (event) {
      resolve(event.target.result);
    };
    if (resultType === 'dataUrl') {
      reader.readAsDataURL(file);
    } else if (resultType === 'text') {
      reader.readAsText(file);
    }
  });
}
function isOversize(files, maxSize) {
  return toArray$1(files).some(function (file) {
    if (file) {
      if (isFunction$2(maxSize)) {
        return maxSize(file);
      }
      return file.size > maxSize;
    }
    return false;
  });
}
var IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
function isImageUrl(url) {
  return IMAGE_REGEXP.test(url);
}
function isImageFile(item) {
  // some special urls cannot be recognized
  // user can add `isImage` flag to mark it as an image url
  if (item.isImage) {
    return true;
  }
  if (item.file && item.file.type) {
    return item.file.type.indexOf('image') === 0;
  }
  if (item.url) {
    return isImageUrl(item.url);
  }
  if (item.content) {
    return item.content.indexOf('data:image') === 0;
  }
  return false;
}

var _createNamespace$b = createNamespace('uploader'),
  createComponent$e = _createNamespace$b[0],
  bem$c = _createNamespace$b[1];
var Uploader = createComponent$e({
  inheritAttrs: false,
  mixins: [FieldMixin],
  model: {
    prop: 'fileList'
  },
  props: {
    disabled: Boolean,
    readonly: Boolean,
    lazyLoad: Boolean,
    uploadText: String,
    afterRead: Function,
    beforeRead: Function,
    beforeDelete: Function,
    previewSize: [Number, String],
    previewOptions: Object,
    name: {
      type: [Number, String],
      default: ''
    },
    accept: {
      type: String,
      default: 'image/*'
    },
    fileList: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    maxSize: {
      type: [Number, String, Function],
      default: Number.MAX_VALUE
    },
    maxCount: {
      type: [Number, String],
      default: Number.MAX_VALUE
    },
    deletable: {
      type: Boolean,
      default: true
    },
    showUpload: {
      type: Boolean,
      default: true
    },
    previewImage: {
      type: Boolean,
      default: true
    },
    previewFullImage: {
      type: Boolean,
      default: true
    },
    imageFit: {
      type: String,
      default: 'cover'
    },
    resultType: {
      type: String,
      default: 'dataUrl'
    },
    uploadIcon: {
      type: String,
      default: 'photograph'
    }
  },
  computed: {
    previewSizeWithUnit: function previewSizeWithUnit() {
      return addUnit(this.previewSize);
    },
    // for form
    value: function value() {
      return this.fileList;
    }
  },
  created: function created() {
    this.urls = [];
  },
  beforeDestroy: function beforeDestroy() {
    this.urls.forEach(function (url) {
      return URL.revokeObjectURL(url);
    });
  },
  methods: {
    getDetail: function getDetail(index) {
      if (index === void 0) {
        index = this.fileList.length;
      }
      return {
        name: this.name,
        index: index
      };
    },
    onChange: function onChange(event) {
      var _this = this;
      var files = event.target.files;
      if (this.disabled || !files.length) {
        return;
      }
      files = files.length === 1 ? files[0] : [].slice.call(files);
      if (this.beforeRead) {
        var response = this.beforeRead(files, this.getDetail());
        if (!response) {
          this.resetInput();
          return;
        }
        if (isPromise$2(response)) {
          response.then(function (data) {
            if (data) {
              _this.readFile(data);
            } else {
              _this.readFile(files);
            }
          }).catch(this.resetInput);
          return;
        }
      }
      this.readFile(files);
    },
    readFile: function readFile$1(files) {
      var _this2 = this;
      var oversize = isOversize(files, this.maxSize);
      if (Array.isArray(files)) {
        var maxCount = this.maxCount - this.fileList.length;
        if (files.length > maxCount) {
          files = files.slice(0, maxCount);
        }
        Promise.all(files.map(function (file) {
          return readFile(file, _this2.resultType);
        })).then(function (contents) {
          var fileList = files.map(function (file, index) {
            var result = {
              file: file,
              status: '',
              message: ''
            };
            if (contents[index]) {
              result.content = contents[index];
            }
            return result;
          });
          _this2.onAfterRead(fileList, oversize);
        });
      } else {
        readFile(files, this.resultType).then(function (content) {
          var result = {
            file: files,
            status: '',
            message: ''
          };
          if (content) {
            result.content = content;
          }
          _this2.onAfterRead(result, oversize);
        });
      }
    },
    onAfterRead: function onAfterRead(files, oversize) {
      var _this3 = this;
      this.resetInput();
      var validFiles = files;
      if (oversize) {
        var oversizeFiles = files;
        if (Array.isArray(files)) {
          oversizeFiles = [];
          validFiles = [];
          files.forEach(function (item) {
            if (item.file) {
              if (isOversize(item.file, _this3.maxSize)) {
                oversizeFiles.push(item);
              } else {
                validFiles.push(item);
              }
            }
          });
        } else {
          validFiles = null;
        }
        this.$emit('oversize', oversizeFiles, this.getDetail());
      }
      var isValidFiles = Array.isArray(validFiles) ? Boolean(validFiles.length) : Boolean(validFiles);
      if (isValidFiles) {
        this.$emit('input', [].concat(this.fileList, toArray$1(validFiles)));
        if (this.afterRead) {
          this.afterRead(validFiles, this.getDetail());
        }
      }
    },
    onDelete: function onDelete(file, index) {
      var _file$beforeDelete,
        _this4 = this;
      var beforeDelete = (_file$beforeDelete = file.beforeDelete) != null ? _file$beforeDelete : this.beforeDelete;
      if (beforeDelete) {
        var response = beforeDelete(file, this.getDetail(index));
        if (!response) {
          return;
        }
        if (isPromise$2(response)) {
          response.then(function () {
            _this4.deleteFile(file, index);
          }).catch(noop$5);
          return;
        }
      }
      this.deleteFile(file, index);
    },
    deleteFile: function deleteFile(file, index) {
      var fileList = this.fileList.slice(0);
      fileList.splice(index, 1);
      this.$emit('input', fileList);
      this.$emit('delete', file, this.getDetail(index));
    },
    resetInput: function resetInput() {
      /* istanbul ignore else */
      if (this.$refs.input) {
        this.$refs.input.value = '';
      }
    },
    onClickUpload: function onClickUpload(event) {
      this.$emit('click-upload', event);
    },
    onPreviewImage: function onPreviewImage(item) {
      var _this5 = this;
      if (!this.previewFullImage) {
        return;
      }
      var imageFiles = this.fileList.filter(function (item) {
        return isImageFile(item);
      });
      var imageContents = imageFiles.map(function (item) {
        if (item.file && !item.url && item.status !== 'failed') {
          item.url = URL.createObjectURL(item.file);
          _this5.urls.push(item.url);
        }
        return item.url;
      });
      this.imagePreview = ImagePreview$1(_extends$2({
        images: imageContents,
        startPosition: imageFiles.indexOf(item),
        onClose: function onClose() {
          _this5.$emit('close-preview');
        }
      }, this.previewOptions));
    },
    // @exposed-api
    closeImagePreview: function closeImagePreview() {
      if (this.imagePreview) {
        this.imagePreview.close();
      }
    },
    // @exposed-api
    chooseFile: function chooseFile() {
      if (this.disabled) {
        return;
      }
      /* istanbul ignore else */

      if (this.$refs.input) {
        this.$refs.input.click();
      }
    },
    genPreviewMask: function genPreviewMask(item) {
      var h = this.$createElement;
      var status = item.status,
        message = item.message;
      if (status === 'uploading' || status === 'failed') {
        var MaskIcon = status === 'failed' ? h(Icon$3, {
          "attrs": {
            "name": "close"
          },
          "class": bem$c('mask-icon')
        }) : h(Loading$1, {
          "class": bem$c('loading')
        });
        var showMessage = isDef(message) && message !== '';
        return h("div", {
          "class": bem$c('mask')
        }, [MaskIcon, showMessage && h("div", {
          "class": bem$c('mask-message')
        }, [message])]);
      }
    },
    genPreviewItem: function genPreviewItem(item, index) {
      var _item$deletable,
        _this6 = this,
        _item$previewSize,
        _item$imageFit;
      var h = this.$createElement;
      var deleteAble = (_item$deletable = item.deletable) != null ? _item$deletable : this.deletable;
      var showDelete = item.status !== 'uploading' && deleteAble;
      var DeleteIcon = showDelete && h("div", {
        "class": bem$c('preview-delete'),
        "on": {
          "click": function click(event) {
            event.stopPropagation();
            _this6.onDelete(item, index);
          }
        }
      }, [h(Icon$3, {
        "attrs": {
          "name": "cross"
        },
        "class": bem$c('preview-delete-icon')
      })]);
      var PreviewCoverContent = this.slots('preview-cover', _extends$2({
        index: index
      }, item));
      var PreviewCover = PreviewCoverContent && h("div", {
        "class": bem$c('preview-cover')
      }, [PreviewCoverContent]);
      var previewSize = (_item$previewSize = item.previewSize) != null ? _item$previewSize : this.previewSize;
      var imageFit = (_item$imageFit = item.imageFit) != null ? _item$imageFit : this.imageFit;
      var Preview = isImageFile(item) ? h(Image$1, {
        "attrs": {
          "fit": imageFit,
          "src": item.content || item.url,
          "width": previewSize,
          "height": previewSize,
          "lazyLoad": this.lazyLoad
        },
        "class": bem$c('preview-image'),
        "on": {
          "click": function click() {
            _this6.onPreviewImage(item);
          }
        }
      }, [PreviewCover]) : h("div", {
        "class": bem$c('file'),
        "style": {
          width: this.previewSizeWithUnit,
          height: this.previewSizeWithUnit
        }
      }, [h(Icon$3, {
        "class": bem$c('file-icon'),
        "attrs": {
          "name": "description"
        }
      }), h("div", {
        "class": [bem$c('file-name'), 'van-ellipsis']
      }, [item.file ? item.file.name : item.url]), PreviewCover]);
      return h("div", {
        "class": bem$c('preview'),
        "on": {
          "click": function click() {
            _this6.$emit('click-preview', item, _this6.getDetail(index));
          }
        }
      }, [Preview, this.genPreviewMask(item), DeleteIcon]);
    },
    genPreviewList: function genPreviewList() {
      if (this.previewImage) {
        return this.fileList.map(this.genPreviewItem);
      }
    },
    genUpload: function genUpload() {
      var h = this.$createElement;
      if (this.fileList.length >= this.maxCount) {
        return;
      }
      var slot = this.slots();
      var Input = this.readonly ? null : h("input", {
        "attrs": _extends$2({}, this.$attrs, {
          "type": "file",
          "accept": this.accept,
          "disabled": this.disabled
        }),
        "ref": "input",
        "class": bem$c('input'),
        "on": {
          "change": this.onChange
        }
      });
      if (slot) {
        return h("div", {
          "class": bem$c('input-wrapper'),
          "key": "input-wrapper",
          "on": {
            "click": this.onClickUpload
          }
        }, [slot, Input]);
      }
      var style;
      if (this.previewSize) {
        var size = this.previewSizeWithUnit;
        style = {
          width: size,
          height: size
        };
      }
      return h("div", {
        "directives": [{
          name: "show",
          value: this.showUpload
        }],
        "class": bem$c('upload', {
          readonly: this.readonly
        }),
        "style": style,
        "on": {
          "click": this.onClickUpload
        }
      }, [h(Icon$3, {
        "attrs": {
          "name": this.uploadIcon
        },
        "class": bem$c('upload-icon')
      }), this.uploadText && h("span", {
        "class": bem$c('upload-text')
      }, [this.uploadText]), Input]);
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$c()
    }, [h("div", {
      "class": bem$c('wrapper', {
        disabled: this.disabled
      })
    }, [this.genPreviewList(), this.genUpload()])]);
  }
});

// Utils
var namespace$2 = createNamespace('sku-img-uploader');
var createComponent$d = namespace$2[0];
var t$7 = namespace$2[2];
var SkuImgUploader = createComponent$d({
  props: {
    value: String,
    uploadImg: Function,
    customUpload: Function,
    maxSize: {
      type: Number,
      default: 6
    }
  },
  data: function data() {
    return {
      fileList: []
    };
  },
  watch: {
    value: function value(val) {
      if (val) {
        this.fileList = [{
          url: val,
          isImage: true
        }];
      } else {
        this.fileList = [];
      }
    }
  },
  methods: {
    afterReadFile: function afterReadFile(file) {
      var _this = this;
      file.status = 'uploading';
      file.message = t$7('uploading');
      this.uploadImg(file.file, file.content).then(function (img) {
        file.status = 'done';
        _this.$emit('input', img);
      }).catch(function () {
        file.status = 'failed';
        file.message = t$7('fail');
      });
    },
    onOversize: function onOversize() {
      this.$toast(t$7('oversize', this.maxSize));
    },
    onDelete: function onDelete() {
      this.$emit('input', '');
    },
    onClickUpload: function onClickUpload() {
      var _this2 = this;
      if (this.customUpload) {
        this.customUpload().then(function (url) {
          _this2.fileList.push({
            url: url
          });
          _this2.$emit('input', url);
        });
      }
    }
  },
  render: function render() {
    var _this3 = this;
    var h = arguments[0];
    return h(Uploader, {
      "attrs": {
        "maxCount": 1,
        "readonly": !!this.customUpload,
        "maxSize": this.maxSize * 1024 * 1024,
        "afterRead": this.afterReadFile
      },
      "on": {
        "oversize": this.onOversize,
        "delete": this.onDelete,
        "click-upload": this.onClickUpload
      },
      "model": {
        value: _this3.fileList,
        callback: function callback($$v) {
          _this3.fileList = $$v;
        }
      }
    });
  }
});

// 只处理 YYYY-MM-DD 或者 YYYY-MM-DD HH:MM 格式

function stringToDate(timeString) {
  if (!timeString) {
    return null;
  }
  return new Date(timeString.replace(/-/g, '/'));
} // Date 转字符串
// type: date or datetime

function dateToString(date, type) {
  if (type === void 0) {
    type = 'date';
  }
  if (!date) {
    return '';
  }
  var year = date.getFullYear();
  var month = date.getMonth() + 1;
  var day = date.getDate();
  var timeString = year + "-" + padZero(month) + "-" + padZero(day);
  if (type === 'datetime') {
    var hours = date.getHours();
    var minute = date.getMinutes();
    timeString += " " + padZero(hours) + ":" + padZero(minute);
  }
  return timeString;
}

// Utils
var namespace$1 = createNamespace('sku-datetime-field');
var createComponent$c = namespace$1[0];
var t$6 = namespace$1[2];
var SkuDateTimeField = createComponent$c({
  props: {
    value: String,
    label: String,
    required: Boolean,
    placeholder: String,
    type: {
      type: String,
      default: 'date'
    }
  },
  data: function data() {
    return {
      showDatePicker: false,
      currentDate: this.type === 'time' ? '' : new Date(),
      minDate: new Date(new Date().getFullYear() - 60, 0, 1)
    };
  },
  watch: {
    value: function value(val) {
      switch (this.type) {
        case 'time':
          this.currentDate = val;
          break;
        case 'date':
        case 'datetime':
          this.currentDate = stringToDate(val) || new Date();
          break;
      }
    }
  },
  computed: {
    title: function title() {
      return t$6("title." + this.type);
    }
  },
  methods: {
    onClick: function onClick() {
      this.showDatePicker = true;
    },
    onConfirm: function onConfirm(val) {
      var data = val;
      if (this.type !== 'time') {
        data = dateToString(val, this.type);
      }
      this.$emit('input', data);
      this.showDatePicker = false;
    },
    onCancel: function onCancel() {
      this.showDatePicker = false;
    },
    formatter: function formatter(type, val) {
      var word = t$6("format." + type);
      return "" + val + word;
    }
  },
  render: function render() {
    var _this = this;
    var h = arguments[0];
    return h(Field, {
      "attrs": {
        "readonly": true,
        "is-link": true,
        "center": true,
        "value": this.value,
        "label": this.label,
        "required": this.required,
        "placeholder": this.placeholder
      },
      "on": {
        "click": this.onClick
      }
    }, [h(Popup, {
      "attrs": {
        "round": true,
        "position": "bottom",
        "getContainer": "body"
      },
      "slot": "extra",
      "model": {
        value: _this.showDatePicker,
        callback: function callback($$v) {
          _this.showDatePicker = $$v;
        }
      }
    }, [h(DatetimePicker, {
      "attrs": {
        "type": this.type,
        "title": this.title,
        "value": this.currentDate,
        "minDate": this.minDate,
        "formatter": this.formatter
      },
      "on": {
        "cancel": this.onCancel,
        "confirm": this.onConfirm
      }
    })])]);
  }
});

// Utils
var _createNamespace$a = createNamespace('sku-messages'),
  createComponent$b = _createNamespace$a[0],
  bem$b = _createNamespace$a[1],
  t$5 = _createNamespace$a[2];
var SkuMessages = createComponent$b({
  props: {
    messageConfig: Object,
    goodsId: [Number, String],
    messages: {
      type: Array,
      default: function _default() {
        return [];
      }
    }
  },
  data: function data() {
    return {
      messageValues: this.resetMessageValues(this.messages)
    };
  },
  watch: {
    messages: function messages(val) {
      this.messageValues = this.resetMessageValues(val);
    }
  },
  methods: {
    resetMessageValues: function resetMessageValues(messages) {
      var messageConfig = this.messageConfig;
      var _messageConfig$initia = messageConfig.initialMessages,
        initialMessages = _messageConfig$initia === void 0 ? {} : _messageConfig$initia;
      return (messages || []).map(function (message) {
        return {
          value: initialMessages[message.name] || ''
        };
      });
    },
    getType: function getType(message) {
      if (+message.multiple === 1) {
        return 'textarea';
      }
      if (message.type === 'id_no') {
        return 'text';
      }
      return message.datetime > 0 ? 'datetime' : message.type;
    },
    getMessages: function getMessages() {
      var messages = {};
      this.messageValues.forEach(function (item, index) {
        messages["message_" + index] = item.value;
      });
      return messages;
    },
    getCartMessages: function getCartMessages() {
      var _this = this;
      var messages = {};
      this.messageValues.forEach(function (item, index) {
        var message = _this.messages[index];
        messages[message.name] = item.value;
      });
      return messages;
    },
    getPlaceholder: function getPlaceholder(message) {
      var type = +message.multiple === 1 ? 'textarea' : message.type;
      var map = this.messageConfig.placeholderMap || {};
      return message.placeholder || map[type] || t$5("placeholder." + type);
    },
    validateMessages: function validateMessages() {
      var values = this.messageValues;
      for (var i = 0; i < values.length; i++) {
        var value = values[i].value;
        var message = this.messages[i];
        if (value === '') {
          // 必填字段的校验
          if (String(message.required) === '1') {
            var textType = t$5(message.type === 'image' ? 'upload' : 'fill');
            return textType + message.name;
          }
        } else {
          if (message.type === 'tel' && !isNumeric(value)) {
            return t$5('invalid.tel');
          }
          if (message.type === 'mobile' && !/^\d{6,20}$/.test(value)) {
            return t$5('invalid.mobile');
          }
          if (message.type === 'email' && !isEmail(value)) {
            return t$5('invalid.email');
          }
          if (message.type === 'id_no' && (value.length < 15 || value.length > 18)) {
            return t$5('invalid.id_no');
          }
        }
      }
    },
    /**
     * The phone number copied from IOS mobile phone address book
     * will add spaces and invisible Unicode characters
     * which cannot pass the /^\d+$/ verification
     * so keep numbers and dots
     */
    getFormatter: function getFormatter(message) {
      return function formatter(value) {
        if (message.type === 'mobile' || message.type === 'tel') {
          return value.replace(/[^\d.]/g, '');
        }
        return value;
      };
    },
    getExtraDesc: function getExtraDesc(message) {
      var h = this.$createElement;
      var extraDesc = message.extraDesc;
      if (extraDesc) {
        return h("div", {
          "class": bem$b('extra-message')
        }, [extraDesc]);
      }
    },
    genMessage: function genMessage(message, index) {
      var _this2 = this;
      var h = this.$createElement;
      if (message.type === 'image') {
        return h(Cell$1, {
          "key": this.goodsId + "-" + index,
          "attrs": {
            "title": message.name,
            "required": String(message.required) === '1',
            "valueClass": bem$b('image-cell-value')
          },
          "class": bem$b('image-cell')
        }, [h(SkuImgUploader, {
          "attrs": {
            "maxSize": this.messageConfig.uploadMaxSize,
            "uploadImg": this.messageConfig.uploadImg,
            "customUpload": this.messageConfig.customUpload
          },
          "model": {
            value: _this2.messageValues[index].value,
            callback: function callback($$v) {
              _this2.$set(_this2.messageValues[index], "value", $$v);
            }
          }
        }), h("div", {
          "class": bem$b('image-cell-label')
        }, [t$5('imageLabel')])]);
      } // 时间和日期使用的vant选择器

      var isDateOrTime = ['date', 'time'].indexOf(message.type) > -1;
      if (isDateOrTime) {
        return h(SkuDateTimeField, {
          "attrs": {
            "label": message.name,
            "required": String(message.required) === '1',
            "placeholder": this.getPlaceholder(message),
            "type": this.getType(message)
          },
          "key": this.goodsId + "-" + index,
          "model": {
            value: _this2.messageValues[index].value,
            callback: function callback($$v) {
              _this2.$set(_this2.messageValues[index], "value", $$v);
            }
          }
        });
      }
      return h("div", {
        "class": bem$b('cell-block')
      }, [h(Field, {
        "attrs": {
          "maxlength": "200",
          "center": !message.multiple,
          "label": message.name,
          "required": String(message.required) === '1',
          "placeholder": this.getPlaceholder(message),
          "type": this.getType(message),
          "formatter": this.getFormatter(message),
          "border": false
        },
        "key": this.goodsId + "-" + index,
        "model": {
          value: _this2.messageValues[index].value,
          callback: function callback($$v) {
            _this2.$set(_this2.messageValues[index], "value", $$v);
          }
        }
      }), this.getExtraDesc(message)]);
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$b()
    }, [this.messages.map(this.genMessage)]);
  }
});

var _createNamespace$9 = createNamespace('sku-actions'),
  createComponent$a = _createNamespace$9[0],
  bem$a = _createNamespace$9[1],
  t$4 = _createNamespace$9[2];
function SkuActions(h, props, slots, ctx) {
  var createEmitter = function createEmitter(name) {
    return function () {
      props.skuEventBus.$emit(name);
    };
  };
  return h("div", _mergeJSXProps([{
    "class": bem$a()
  }, inherit(ctx)]), [props.showAddCartBtn && h(Button$2, {
    "attrs": {
      "size": "large",
      "type": "warning",
      "text": props.addCartText || t$4('addCart')
    },
    "on": {
      "click": createEmitter('sku:addCart')
    }
  }), h(Button$2, {
    "attrs": {
      "size": "large",
      "type": "danger",
      "text": props.buyText || t$4('buy')
    },
    "on": {
      "click": createEmitter('sku:buy')
    }
  })]);
}
SkuActions.props = {
  buyText: String,
  addCartText: String,
  skuEventBus: Object,
  showAddCartBtn: Boolean
};
var SkuActions$1 = createComponent$a(SkuActions);

var namespace = createNamespace('sku');
var createComponent$9 = namespace[0],
  bem$9 = namespace[1],
  t$3 = namespace[2];
var QUOTA_LIMIT = LIMIT_TYPE.QUOTA_LIMIT;
var Sku = createComponent$9({
  props: {
    sku: Object,
    goods: Object,
    value: Boolean,
    buyText: String,
    goodsId: [Number, String],
    priceTag: String,
    lazyLoad: Boolean,
    hideStock: Boolean,
    properties: Array,
    addCartText: String,
    stepperTitle: String,
    getContainer: [String, Function],
    hideQuotaText: Boolean,
    hideSelectedText: Boolean,
    resetStepperOnHide: Boolean,
    customSkuValidator: Function,
    disableStepperInput: Boolean,
    resetSelectedSkuOnHide: Boolean,
    quota: {
      type: Number,
      default: 0
    },
    quotaUsed: {
      type: Number,
      default: 0
    },
    startSaleNum: {
      type: Number,
      default: 1
    },
    initialSku: {
      type: Object,
      default: function _default() {
        return {};
      }
    },
    stockThreshold: {
      type: Number,
      default: 50
    },
    showSoldoutSku: {
      type: Boolean,
      default: true
    },
    showAddCartBtn: {
      type: Boolean,
      default: true
    },
    disableSoldoutSku: {
      type: Boolean,
      default: true
    },
    customStepperConfig: {
      type: Object,
      default: function _default() {
        return {};
      }
    },
    showHeaderImage: {
      type: Boolean,
      default: true
    },
    previewOnClickImage: {
      type: Boolean,
      default: true
    },
    safeAreaInsetBottom: {
      type: Boolean,
      default: true
    },
    closeOnClickOverlay: {
      type: Boolean,
      default: true
    },
    bodyOffsetTop: {
      type: Number,
      default: 200
    },
    messageConfig: {
      type: Object,
      default: function _default() {
        return {
          initialMessages: {},
          placeholderMap: {},
          uploadImg: function uploadImg() {
            return Promise.resolve();
          },
          uploadMaxSize: 5
        };
      }
    }
  },
  data: function data() {
    return {
      selectedSku: {},
      selectedProp: {},
      selectedNum: 1,
      show: this.value
    };
  },
  watch: {
    show: function show(val) {
      this.$emit('input', val);
      if (!val) {
        this.$emit('sku-close', {
          selectedSkuValues: this.selectedSkuValues,
          selectedNum: this.selectedNum,
          selectedSkuComb: this.selectedSkuComb
        });
        if (this.resetStepperOnHide) {
          this.resetStepper();
        }
        if (this.resetSelectedSkuOnHide) {
          this.resetSelectedSku();
        }
      }
    },
    value: function value(val) {
      this.show = val;
    },
    skuTree: 'resetSelectedSku',
    initialSku: function initialSku() {
      this.resetStepper();
      this.resetSelectedSku();
    }
  },
  computed: {
    skuGroupClass: function skuGroupClass() {
      return ['van-sku-group-container', {
        'van-sku-group-container--hide-soldout': !this.showSoldoutSku
      }];
    },
    bodyStyle: function bodyStyle() {
      if (this.$isServer) {
        return;
      }
      var maxHeight = window.innerHeight - this.bodyOffsetTop;
      return {
        maxHeight: maxHeight + 'px'
      };
    },
    isSkuCombSelected: function isSkuCombSelected() {
      var _this = this;

      // SKU 未选完
      if (this.hasSku && !isAllSelected(this.skuTree, this.selectedSku)) {
        return false;
      } // 属性未全选

      return !this.propList.filter(function (i) {
        return i.is_necessary !== false;
      }).some(function (i) {
        return (_this.selectedProp[i.k_id] || []).length === 0;
      });
    },
    isSkuEmpty: function isSkuEmpty() {
      return Object.keys(this.sku).length === 0;
    },
    hasSku: function hasSku() {
      return !this.sku.none_sku;
    },
    hasSkuOrAttr: function hasSkuOrAttr() {
      return this.hasSku || this.propList.length > 0;
    },
    selectedSkuComb: function selectedSkuComb() {
      var skuComb = null;
      if (this.isSkuCombSelected) {
        if (this.hasSku) {
          skuComb = getSkuComb(this.skuList, this.selectedSku);
        } else {
          skuComb = {
            id: this.sku.collection_id,
            price: Math.round(this.sku.price * 100),
            stock_num: this.sku.stock_num
          };
        }
        if (skuComb) {
          skuComb.properties = getSelectedProperties(this.propList, this.selectedProp);
          skuComb.property_price = this.selectedPropValues.reduce(function (acc, cur) {
            return acc + (cur.price || 0);
          }, 0);
        }
      }
      return skuComb;
    },
    selectedSkuValues: function selectedSkuValues() {
      return getSelectedSkuValues(this.skuTree, this.selectedSku);
    },
    selectedPropValues: function selectedPropValues() {
      return getSelectedPropValues(this.propList, this.selectedProp);
    },
    price: function price() {
      if (this.selectedSkuComb) {
        return ((this.selectedSkuComb.price + this.selectedSkuComb.property_price) / 100).toFixed(2);
      } // sku.price是一个格式化好的价格区间

      return this.sku.price;
    },
    originPrice: function originPrice() {
      if (this.selectedSkuComb && this.selectedSkuComb.origin_price) {
        return ((this.selectedSkuComb.origin_price + this.selectedSkuComb.property_price) / 100).toFixed(2);
      }
      return this.sku.origin_price;
    },
    skuTree: function skuTree() {
      return this.sku.tree || [];
    },
    skuList: function skuList() {
      return this.sku.list || [];
    },
    propList: function propList() {
      return this.properties || [];
    },
    imageList: function imageList() {
      var imageList = [this.goods.picture];
      if (this.skuTree.length > 0) {
        this.skuTree.forEach(function (treeItem) {
          if (!treeItem.v) {
            return;
          }
          treeItem.v.forEach(function (vItem) {
            var imgUrl = vItem.previewImgUrl || vItem.imgUrl || vItem.img_url;
            if (imgUrl && imageList.indexOf(imgUrl) === -1) {
              imageList.push(imgUrl);
            }
          });
        });
      }
      return imageList;
    },
    stock: function stock() {
      var stockNum = this.customStepperConfig.stockNum;
      if (stockNum !== undefined) {
        return stockNum;
      }
      if (this.selectedSkuComb) {
        return this.selectedSkuComb.stock_num;
      }
      return this.sku.stock_num;
    },
    stockText: function stockText() {
      var h = this.$createElement;
      var stockFormatter = this.customStepperConfig.stockFormatter;
      if (stockFormatter) {
        return stockFormatter(this.stock);
      }
      return [t$3('stock') + " ", h("span", {
        "class": bem$9('stock-num', {
          highlight: this.stock < this.stockThreshold
        })
      }, [this.stock]), " " + t$3('stockUnit')];
    },
    selectedText: function selectedText() {
      var _this2 = this;
      if (this.selectedSkuComb) {
        var values = this.selectedSkuValues.concat(this.selectedPropValues);
        return t$3('selected') + " " + values.map(function (item) {
          return item.name;
        }).join(' ');
      }
      var unselectedSku = this.skuTree.filter(function (item) {
        return _this2.selectedSku[item.k_s] === UNSELECTED_SKU_VALUE_ID;
      }).map(function (item) {
        return item.k;
      });
      var unselectedProp = this.propList.filter(function (item) {
        return (_this2.selectedProp[item.k_id] || []).length < 1;
      }).map(function (item) {
        return item.k;
      });
      return t$3('select') + " " + unselectedSku.concat(unselectedProp).join(' ');
    }
  },
  created: function created() {
    var skuEventBus = new Vue();
    this.skuEventBus = skuEventBus;
    skuEventBus.$on('sku:select', this.onSelect);
    skuEventBus.$on('sku:propSelect', this.onPropSelect);
    skuEventBus.$on('sku:numChange', this.onNumChange);
    skuEventBus.$on('sku:previewImage', this.onPreviewImage);
    skuEventBus.$on('sku:overLimit', this.onOverLimit);
    skuEventBus.$on('sku:stepperState', this.onStepperState);
    skuEventBus.$on('sku:addCart', this.onAddCart);
    skuEventBus.$on('sku:buy', this.onBuy);
    this.resetStepper();
    this.resetSelectedSku(); // 组件初始化后的钩子，抛出skuEventBus

    this.$emit('after-sku-create', skuEventBus);
  },
  methods: {
    resetStepper: function resetStepper() {
      var skuStepper = this.$refs.skuStepper;
      var selectedNum = this.initialSku.selectedNum;
      var num = selectedNum != null ? selectedNum : this.startSaleNum; // 用来缓存不合法的情况

      this.stepperError = null;
      if (skuStepper) {
        skuStepper.setCurrentNum(num);
      } else {
        // 当首次加载（skuStepper 为空）时，传入数量如果不合法，可能会存在问题
        this.selectedNum = num;
      }
    },
    // @exposed-api
    resetSelectedSku: function resetSelectedSku() {
      var _this3 = this;
      this.selectedSku = {}; // 重置 selectedSku

      this.skuTree.forEach(function (item) {
        _this3.selectedSku[item.k_s] = UNSELECTED_SKU_VALUE_ID;
      });
      this.skuTree.forEach(function (item) {
        var key = item.k_s; // 规格值只有1个时，优先判断

        var valueId = item.v.length === 1 ? item.v[0].id : _this3.initialSku[key];
        if (valueId && isSkuChoosable(_this3.skuList, _this3.selectedSku, {
          key: key,
          valueId: valueId
        })) {
          _this3.selectedSku[key] = valueId;
        }
      });
      var skuValues = this.selectedSkuValues;
      if (skuValues.length > 0) {
        this.$nextTick(function () {
          _this3.$emit('sku-selected', {
            skuValue: skuValues[skuValues.length - 1],
            selectedSku: _this3.selectedSku,
            selectedSkuComb: _this3.selectedSkuComb
          });
        });
      } // 重置商品属性

      this.selectedProp = {};
      var _this$initialSku$sele = this.initialSku.selectedProp,
        selectedProp = _this$initialSku$sele === void 0 ? {} : _this$initialSku$sele; // 选中外部传入信息

      this.propList.forEach(function (item) {
        if (selectedProp[item.k_id]) {
          _this3.selectedProp[item.k_id] = selectedProp[item.k_id];
        }
      });
      if (isEmpty$2(this.selectedProp)) {
        this.propList.forEach(function (item) {
          var _item$v;

          // 没有加价的属性，默认选中第一个
          if ((item == null ? void 0 : (_item$v = item.v) == null ? void 0 : _item$v.length) > 0) {
            var v = item.v,
              k_id = item.k_id;
            var isHasConfigPrice = v.some(function (i) {
              return +i.price !== 0;
            }); // 没有加价属性

            if (!isHasConfigPrice) {
              // 找到第一个不被禁用的属性
              // 历史如果没有 text_status 字段的，就相当于沿用直接原来的逻辑取第一个属性
              var firstEnableProp = v.find(function (prop) {
                return prop.text_status !== 0;
              });
              if (firstEnableProp) {
                _this3.selectedProp[k_id] = [firstEnableProp.id];
              }
            }
          }
        });
      }
      var propValues = this.selectedPropValues;
      if (propValues.length > 0) {
        this.$emit('sku-prop-selected', {
          propValue: propValues[propValues.length - 1],
          selectedProp: this.selectedProp,
          selectedSkuComb: this.selectedSkuComb
        });
      } // 抛出重置事件

      this.$emit('sku-reset', {
        selectedSku: this.selectedSku,
        selectedProp: this.selectedProp,
        selectedSkuComb: this.selectedSkuComb
      });
      this.centerInitialSku();
    },
    getSkuMessages: function getSkuMessages() {
      return this.$refs.skuMessages ? this.$refs.skuMessages.getMessages() : {};
    },
    getSkuCartMessages: function getSkuCartMessages() {
      return this.$refs.skuMessages ? this.$refs.skuMessages.getCartMessages() : {};
    },
    validateSkuMessages: function validateSkuMessages() {
      return this.$refs.skuMessages ? this.$refs.skuMessages.validateMessages() : '';
    },
    validateSku: function validateSku() {
      if (this.selectedNum === 0) {
        return t$3('unavailable');
      }
      if (this.isSkuCombSelected) {
        return this.validateSkuMessages();
      } // 自定义sku校验

      if (this.customSkuValidator) {
        var err = this.customSkuValidator(this);
        if (err) return err;
      }
      return t$3('selectSku');
    },
    onSelect: function onSelect(skuValue) {
      var _extends2, _extends3;

      // 点击已选中的sku时则取消选中
      this.selectedSku = this.selectedSku[skuValue.skuKeyStr] === skuValue.id ? _extends$2({}, this.selectedSku, (_extends2 = {}, _extends2[skuValue.skuKeyStr] = UNSELECTED_SKU_VALUE_ID, _extends2)) : _extends$2({}, this.selectedSku, (_extends3 = {}, _extends3[skuValue.skuKeyStr] = skuValue.id, _extends3));
      this.$emit('sku-selected', {
        skuValue: skuValue,
        selectedSku: this.selectedSku,
        selectedSkuComb: this.selectedSkuComb
      });
    },
    onPropSelect: function onPropSelect(propValue) {
      var _extends4;
      var arr = this.selectedProp[propValue.skuKeyStr] || [];
      var pos = arr.indexOf(propValue.id);
      if (pos > -1) {
        arr.splice(pos, 1);
      } else if (propValue.multiple) {
        arr.push(propValue.id);
      } else {
        arr.splice(0, 1, propValue.id);
      }
      this.selectedProp = _extends$2({}, this.selectedProp, (_extends4 = {}, _extends4[propValue.skuKeyStr] = arr, _extends4));
      this.$emit('sku-prop-selected', {
        propValue: propValue,
        selectedProp: this.selectedProp,
        selectedSkuComb: this.selectedSkuComb
      });
    },
    onNumChange: function onNumChange(num) {
      this.selectedNum = num;
    },
    onPreviewImage: function onPreviewImage(selectedValue) {
      var _this4 = this;
      var imageList = this.imageList;
      var index = 0;
      var indexImage = imageList[0];
      if (selectedValue && selectedValue.imgUrl) {
        this.imageList.some(function (image, pos) {
          if (image === selectedValue.imgUrl) {
            index = pos;
            return true;
          }
          return false;
        });
        indexImage = selectedValue.imgUrl;
      }
      var params = _extends$2({}, selectedValue, {
        index: index,
        imageList: this.imageList,
        indexImage: indexImage
      });
      this.$emit('open-preview', params);
      if (!this.previewOnClickImage) {
        return;
      }
      ImagePreview$1({
        images: this.imageList,
        startPosition: index,
        onClose: function onClose() {
          _this4.$emit('close-preview', params);
        }
      });
    },
    onOverLimit: function onOverLimit(data) {
      var action = data.action,
        limitType = data.limitType,
        quota = data.quota,
        quotaUsed = data.quotaUsed;
      var handleOverLimit = this.customStepperConfig.handleOverLimit;
      if (handleOverLimit) {
        handleOverLimit(data);
        return;
      }
      if (action === 'minus') {
        if (this.startSaleNum > 1) {
          Toast(t$3('minusStartTip', this.startSaleNum));
        } else {
          Toast(t$3('minusTip'));
        }
      } else if (action === 'plus') {
        if (limitType === QUOTA_LIMIT) {
          if (quotaUsed > 0) {
            Toast(t$3('quotaUsedTip', quota, quotaUsed));
          } else {
            Toast(t$3('quotaTip', quota));
          }
        } else {
          Toast(t$3('soldout'));
        }
      }
    },
    onStepperState: function onStepperState(data) {
      this.stepperError = data.valid ? null : _extends$2({}, data, {
        action: 'plus'
      });
    },
    onAddCart: function onAddCart() {
      this.onBuyOrAddCart('add-cart');
    },
    onBuy: function onBuy() {
      this.onBuyOrAddCart('buy-clicked');
    },
    onBuyOrAddCart: function onBuyOrAddCart(type) {
      // sku 不符合购买条件
      if (this.stepperError) {
        return this.onOverLimit(this.stepperError);
      }
      var error = this.validateSku();
      if (error) {
        Toast(error);
      } else {
        this.$emit(type, this.getSkuData());
      }
    },
    // @exposed-api
    getSkuData: function getSkuData() {
      return {
        goodsId: this.goodsId,
        messages: this.getSkuMessages(),
        selectedNum: this.selectedNum,
        cartMessages: this.getSkuCartMessages(),
        selectedSkuComb: this.selectedSkuComb
      };
    },
    // 当 popup 完全打开后执行
    onOpened: function onOpened() {
      this.centerInitialSku();
    },
    centerInitialSku: function centerInitialSku() {
      var _this5 = this;
      (this.$refs.skuRows || []).forEach(function (it) {
        var _ref = it.skuRow || {},
          k_s = _ref.k_s;
        it.centerItem(_this5.initialSku[k_s]);
      });
    }
  },
  render: function render() {
    var _this6 = this;
    var h = arguments[0];
    if (this.isSkuEmpty) {
      return;
    }
    var sku = this.sku,
      skuList = this.skuList,
      goods = this.goods,
      price = this.price,
      lazyLoad = this.lazyLoad,
      originPrice = this.originPrice,
      skuEventBus = this.skuEventBus,
      selectedSku = this.selectedSku,
      selectedProp = this.selectedProp,
      selectedNum = this.selectedNum,
      stepperTitle = this.stepperTitle,
      selectedSkuComb = this.selectedSkuComb,
      showHeaderImage = this.showHeaderImage,
      disableSoldoutSku = this.disableSoldoutSku;
    var slotsProps = {
      price: price,
      originPrice: originPrice,
      selectedNum: selectedNum,
      skuEventBus: skuEventBus,
      selectedSku: selectedSku,
      selectedSkuComb: selectedSkuComb
    };
    var slots = function slots(name) {
      return _this6.slots(name, slotsProps);
    };
    var Header = slots('sku-header') || h(SkuHeader$2, {
      "attrs": {
        "sku": sku,
        "goods": goods,
        "skuEventBus": skuEventBus,
        "selectedSku": selectedSku,
        "showHeaderImage": showHeaderImage
      }
    }, [h("template", {
      "slot": "sku-header-image-extra"
    }, [slots('sku-header-image-extra')]), slots('sku-header-price') || h("div", {
      "class": "van-sku__goods-price"
    }, [h("span", {
      "class": "van-sku__price-symbol"
    }, ["\uFFE5"]), h("span", {
      "class": "van-sku__price-num"
    }, [price]), this.priceTag && h("span", {
      "class": "van-sku__price-tag"
    }, [this.priceTag])]), slots('sku-header-origin-price') || originPrice && h(SkuHeaderItem, [t$3('originPrice'), " \uFFE5", originPrice]), !this.hideStock && h(SkuHeaderItem, [h("span", {
      "class": "van-sku__stock"
    }, [this.stockText])]), this.hasSkuOrAttr && !this.hideSelectedText && h(SkuHeaderItem, [this.selectedText]), slots('sku-header-extra')]);
    var Group = slots('sku-group') || this.hasSkuOrAttr && h("div", {
      "class": this.skuGroupClass
    }, [this.skuTree.map(function (skuTreeItem) {
      return h(SkuRow, {
        "attrs": {
          "skuRow": skuTreeItem
        },
        "ref": "skuRows",
        "refInFor": true
      }, [skuTreeItem.v.map(function (skuValue) {
        return h(SkuRowItem, {
          "attrs": {
            "skuList": skuList,
            "lazyLoad": lazyLoad,
            "skuValue": skuValue,
            "skuKeyStr": skuTreeItem.k_s,
            "selectedSku": selectedSku,
            "skuEventBus": skuEventBus,
            "disableSoldoutSku": disableSoldoutSku,
            "largeImageMode": skuTreeItem.largeImageMode
          }
        });
      })]);
    }), this.propList.map(function (skuTreeItem) {
      return h(SkuRow, {
        "attrs": {
          "skuRow": skuTreeItem
        }
      }, [skuTreeItem.v.map(function (skuValue) {
        return h(SkuRowPropItem, {
          "attrs": {
            "skuValue": skuValue,
            "skuKeyStr": skuTreeItem.k_id + '',
            "selectedProp": selectedProp,
            "skuEventBus": skuEventBus,
            "multiple": skuTreeItem.is_multiple,
            "disabled": skuValue.text_status === 0
          }
        });
      })]);
    })]);
    var Stepper = slots('sku-stepper') || h(SkuStepper, {
      "ref": "skuStepper",
      "attrs": {
        "stock": this.stock,
        "quota": this.quota,
        "quotaUsed": this.quotaUsed,
        "startSaleNum": this.startSaleNum,
        "skuEventBus": skuEventBus,
        "selectedNum": selectedNum,
        "stepperTitle": stepperTitle,
        "skuStockNum": sku.stock_num,
        "disableStepperInput": this.disableStepperInput,
        "customStepperConfig": this.customStepperConfig,
        "hideQuotaText": this.hideQuotaText
      },
      "on": {
        "change": function change(event) {
          _this6.$emit('stepper-change', event);
        }
      }
    });
    var Messages = slots('sku-messages') || h(SkuMessages, {
      "ref": "skuMessages",
      "attrs": {
        "goodsId": this.goodsId,
        "messageConfig": this.messageConfig,
        "messages": sku.messages
      }
    });
    var Actions = slots('sku-actions') || h(SkuActions$1, {
      "attrs": {
        "buyText": this.buyText,
        "skuEventBus": skuEventBus,
        "addCartText": this.addCartText,
        "showAddCartBtn": this.showAddCartBtn
      }
    });
    return h(Popup, {
      "attrs": {
        "round": true,
        "closeable": true,
        "position": "bottom",
        "getContainer": this.getContainer,
        "closeOnClickOverlay": this.closeOnClickOverlay,
        "safeAreaInsetBottom": this.safeAreaInsetBottom
      },
      "class": "van-sku-container",
      "on": {
        "opened": this.onOpened
      },
      "model": {
        value: _this6.show,
        callback: function callback($$v) {
          _this6.show = $$v;
        }
      }
    }, [Header, h("div", {
      "class": "van-sku-body",
      "style": this.bodyStyle
    }, [slots('sku-body-top'), Group, slots('extra-sku-group'), Stepper, slots('before-sku-messages'), Messages, slots('after-sku-messages')]), slots('sku-actions-top'), Actions]);
  }
});

// Utils
Locale$1.add(lang$1);
Sku.SkuActions = SkuActions$1;
Sku.SkuHeader = SkuHeader$2;
Sku.SkuHeaderItem = SkuHeaderItem;
Sku.SkuMessages = SkuMessages;
Sku.SkuStepper = SkuStepper;
Sku.SkuRow = SkuRow;
Sku.SkuRowItem = SkuRowItem;
Sku.SkuRowPropItem = SkuRowPropItem;
Sku.skuHelper = skuHelper;
Sku.skuConstants = constants;

var _createNamespace$8 = createNamespace('slider'),
  createComponent$8 = _createNamespace$8[0],
  bem$8 = _createNamespace$8[1];
var isSameValue = function isSameValue(newValue, oldValue) {
  return JSON.stringify(newValue) === JSON.stringify(oldValue);
};
var Slider$1 = createComponent$8({
  mixins: [TouchMixin, FieldMixin],
  props: {
    disabled: Boolean,
    vertical: Boolean,
    range: Boolean,
    barHeight: [Number, String],
    buttonSize: [Number, String],
    activeColor: String,
    inactiveColor: String,
    min: {
      type: [Number, String],
      default: 0
    },
    max: {
      type: [Number, String],
      default: 100
    },
    step: {
      type: [Number, String],
      default: 1
    },
    value: {
      type: [Number, Array],
      default: 0
    }
  },
  data: function data() {
    return {
      dragStatus: ''
    };
  },
  computed: {
    scope: function scope() {
      return this.max - this.min;
    },
    buttonStyle: function buttonStyle() {
      if (this.buttonSize) {
        var size = addUnit(this.buttonSize);
        return {
          width: size,
          height: size
        };
      }
    }
  },
  created: function created() {
    // format initial value
    this.updateValue(this.value);
  },
  mounted: function mounted() {
    if (this.range) {
      this.bindTouchEvent(this.$refs.wrapper0);
      this.bindTouchEvent(this.$refs.wrapper1);
    } else {
      this.bindTouchEvent(this.$refs.wrapper);
    }
  },
  methods: {
    onTouchStart: function onTouchStart(event) {
      if (this.disabled) {
        return;
      }
      this.touchStart(event);
      this.currentValue = this.value;
      if (this.range) {
        this.startValue = this.value.map(this.format);
      } else {
        this.startValue = this.format(this.value);
      }
      this.dragStatus = 'start';
    },
    onTouchMove: function onTouchMove(event) {
      if (this.disabled) {
        return;
      }
      if (this.dragStatus === 'start') {
        this.$emit('drag-start');
      }
      preventDefault(event, true);
      this.touchMove(event);
      this.dragStatus = 'draging';
      var rect = this.$el.getBoundingClientRect();
      var delta = this.vertical ? this.deltaY : this.deltaX;
      var total = this.vertical ? rect.height : rect.width;
      var diff = delta / total * this.scope;
      if (this.range) {
        this.currentValue[this.index] = this.startValue[this.index] + diff;
      } else {
        this.currentValue = this.startValue + diff;
      }
      this.updateValue(this.currentValue);
    },
    onTouchEnd: function onTouchEnd() {
      if (this.disabled) {
        return;
      }
      if (this.dragStatus === 'draging') {
        this.updateValue(this.currentValue, true);
        this.$emit('drag-end');
      }
      this.dragStatus = '';
    },
    onClick: function onClick(event) {
      event.stopPropagation();
      if (this.disabled) return;
      var rect = this.$el.getBoundingClientRect();
      var delta = this.vertical ? event.clientY - rect.top : event.clientX - rect.left;
      var total = this.vertical ? rect.height : rect.width;
      var value = +this.min + delta / total * this.scope;
      if (this.range) {
        var _this$value = this.value,
          left = _this$value[0],
          right = _this$value[1];
        var middle = (left + right) / 2;
        if (value <= middle) {
          left = value;
        } else {
          right = value;
        }
        value = [left, right];
      }
      this.startValue = this.value;
      this.updateValue(value, true);
    },
    // 处理两个滑块重叠之后的情况
    handleOverlap: function handleOverlap(value) {
      if (value[0] > value[1]) {
        value = deepClone(value);
        return value.reverse();
      }
      return value;
    },
    updateValue: function updateValue(value, end) {
      if (this.range) {
        value = this.handleOverlap(value).map(this.format);
      } else {
        value = this.format(value);
      }
      if (!isSameValue(value, this.value)) {
        this.$emit('input', value);
      }
      if (end && !isSameValue(value, this.startValue)) {
        this.$emit('change', value);
      }
    },
    format: function format(value) {
      var min = +this.min;
      var max = +this.max;
      var step = +this.step;
      value = range$1(value, min, max);
      var diff = Math.round((value - min) / step) * step;
      return addNumber(min, diff);
    }
  },
  render: function render() {
    var _wrapperStyle,
      _this = this,
      _barStyle;
    var h = arguments[0];
    var vertical = this.vertical;
    var mainAxis = vertical ? 'height' : 'width';
    var crossAxis = vertical ? 'width' : 'height';
    var wrapperStyle = (_wrapperStyle = {
      background: this.inactiveColor
    }, _wrapperStyle[crossAxis] = addUnit(this.barHeight), _wrapperStyle); // 计算选中条的长度百分比

    var calcMainAxis = function calcMainAxis() {
      var value = _this.value,
        min = _this.min,
        range = _this.range,
        scope = _this.scope;
      if (range) {
        return (value[1] - value[0]) * 100 / scope + "%";
      }
      return (value - min) * 100 / scope + "%";
    }; // 计算选中条的开始位置的偏移量

    var calcOffset = function calcOffset() {
      var value = _this.value,
        min = _this.min,
        range = _this.range,
        scope = _this.scope;
      if (range) {
        return (value[0] - min) * 100 / scope + "%";
      }
      return null;
    };
    var barStyle = (_barStyle = {}, _barStyle[mainAxis] = calcMainAxis(), _barStyle.left = this.vertical ? null : calcOffset(), _barStyle.top = this.vertical ? calcOffset() : null, _barStyle.background = this.activeColor, _barStyle);
    if (this.dragStatus) {
      barStyle.transition = 'none';
    }
    var renderButton = function renderButton(i) {
      var map = ['left', 'right'];
      var isNumber = typeof i === 'number';
      var current = isNumber ? _this.value[i] : _this.value;
      var getClassName = function getClassName() {
        if (isNumber) {
          return "button-wrapper-" + map[i];
        }
        return "button-wrapper";
      };
      var getRefName = function getRefName() {
        if (isNumber) {
          return "wrapper" + i;
        }
        return "wrapper";
      };
      var renderButtonContent = function renderButtonContent() {
        if (isNumber) {
          var slot = _this.slots(i === 0 ? 'left-button' : 'right-button', {
            value: current
          });
          if (slot) {
            return slot;
          }
        }
        if (_this.slots('button')) {
          return _this.slots('button');
        }
        return h("div", {
          "class": bem$8('button'),
          "style": _this.buttonStyle
        });
      };
      return h("div", {
        "ref": getRefName(),
        "attrs": {
          "role": "slider",
          "tabindex": _this.disabled ? -1 : 0,
          "aria-valuemin": _this.min,
          "aria-valuenow": _this.value,
          "aria-valuemax": _this.max,
          "aria-orientation": _this.vertical ? 'vertical' : 'horizontal'
        },
        "class": bem$8(getClassName()),
        "on": {
          "touchstart": function touchstart() {
            if (isNumber) {
              // 保存当前按钮的索引
              _this.index = i;
            }
          },
          "click": function click(e) {
            return e.stopPropagation();
          }
        }
      }, [renderButtonContent()]);
    };
    return h("div", {
      "style": wrapperStyle,
      "class": bem$8({
        disabled: this.disabled,
        vertical: vertical
      }),
      "on": {
        "click": this.onClick
      }
    }, [h("div", {
      "class": bem$8('bar'),
      "style": barStyle
    }, [this.range ? [renderButton(0), renderButton(1)] : renderButton()])]);
  }
});

var _createNamespace$7 = createNamespace('step'),
  createComponent$7 = _createNamespace$7[0],
  bem$7 = _createNamespace$7[1];
var Step = createComponent$7({
  mixins: [ChildrenMixin('vanSteps')],
  computed: {
    status: function status() {
      if (this.index < this.parent.active) {
        return 'finish';
      }
      if (this.index === +this.parent.active) {
        return 'process';
      }
    },
    active: function active() {
      return this.status === 'process';
    },
    lineStyle: function lineStyle() {
      var _this$parent = this.parent,
        activeColor = _this$parent.activeColor,
        inactiveColor = _this$parent.inactiveColor,
        center = _this$parent.center,
        direction = _this$parent.direction;
      var style = {
        background: this.status === 'finish' ? activeColor : inactiveColor
      };
      if (center && direction === 'vertical') {
        style.top = '50%';
      }
      return style;
    },
    circleContainerStyle: function circleContainerStyle() {
      if (this.parent.center && this.parent.direction === 'vertical') {
        return {
          top: '50%'
        };
      }
    },
    titleStyle: function titleStyle() {
      if (this.active) {
        return {
          color: this.parent.activeColor
        };
      }
      if (!this.status) {
        return {
          color: this.parent.inactiveColor
        };
      }
    }
  },
  methods: {
    genCircle: function genCircle() {
      var h = this.$createElement;
      var _this$parent2 = this.parent,
        activeIcon = _this$parent2.activeIcon,
        iconPrefix = _this$parent2.iconPrefix,
        activeColor = _this$parent2.activeColor,
        finishIcon = _this$parent2.finishIcon,
        inactiveIcon = _this$parent2.inactiveIcon;
      if (this.active) {
        return this.slots('active-icon') || h(Icon$3, {
          "class": bem$7('icon', 'active'),
          "attrs": {
            "name": activeIcon,
            "color": activeColor,
            "classPrefix": iconPrefix
          }
        });
      }
      var finishIconSlot = this.slots('finish-icon');
      if (this.status === 'finish' && (finishIcon || finishIconSlot)) {
        return finishIconSlot || h(Icon$3, {
          "class": bem$7('icon', 'finish'),
          "attrs": {
            "name": finishIcon,
            "color": activeColor,
            "classPrefix": iconPrefix
          }
        });
      }
      var inactiveIconSlot = this.slots('inactive-icon');
      if (inactiveIcon || inactiveIconSlot) {
        return inactiveIconSlot || h(Icon$3, {
          "class": bem$7('icon'),
          "attrs": {
            "name": inactiveIcon,
            "classPrefix": iconPrefix
          }
        });
      }
      return h("i", {
        "class": bem$7('circle'),
        "style": this.lineStyle
      });
    },
    onClickStep: function onClickStep() {
      this.parent.$emit('click-step', this.index);
    }
  },
  render: function render() {
    var _ref;
    var h = arguments[0];
    var status = this.status,
      active = this.active;
    var direction = this.parent.direction;
    return h("div", {
      "class": [BORDER, bem$7([direction, (_ref = {}, _ref[status] = status, _ref)])]
    }, [h("div", {
      "class": bem$7('title', {
        active: active
      }),
      "style": this.titleStyle,
      "on": {
        "click": this.onClickStep
      }
    }, [this.slots()]), h("div", {
      "class": bem$7('circle-container'),
      "on": {
        "click": this.onClickStep
      },
      "style": this.circleContainerStyle
    }, [this.genCircle()]), h("div", {
      "class": bem$7('line'),
      "style": this.lineStyle
    })]);
  }
});

var _createNamespace$6 = createNamespace('steps'),
  createComponent$6 = _createNamespace$6[0],
  bem$6 = _createNamespace$6[1];
var Steps = createComponent$6({
  mixins: [ParentMixin('vanSteps')],
  props: {
    center: Boolean,
    iconPrefix: String,
    finishIcon: String,
    activeColor: String,
    inactiveIcon: String,
    inactiveColor: String,
    active: {
      type: [Number, String],
      default: 0
    },
    direction: {
      type: String,
      default: 'horizontal'
    },
    activeIcon: {
      type: String,
      default: 'checked'
    }
  },
  render: function render() {
    var h = arguments[0];
    return h("div", {
      "class": bem$6([this.direction])
    }, [h("div", {
      "class": bem$6('items')
    }, [this.slots()])]);
  }
});

var _createNamespace$5 = createNamespace('submit-bar'),
  createComponent$5 = _createNamespace$5[0],
  bem$5 = _createNamespace$5[1],
  t$2 = _createNamespace$5[2];
function SubmitBar(h, props, slots, ctx) {
  var tip = props.tip,
    price = props.price,
    tipIcon = props.tipIcon;
  function Text() {
    if (typeof price === 'number') {
      var priceArr = (price / 100).toFixed(props.decimalLength).split('.');
      var decimalStr = props.decimalLength ? "." + priceArr[1] : '';
      return h("div", {
        "style": {
          textAlign: props.textAlign ? props.textAlign : ''
        },
        "class": bem$5('text')
      }, [h("span", [props.label || t$2('label')]), h("span", {
        "class": bem$5('price')
      }, [props.currency, h("span", {
        "class": bem$5('price', 'integer')
      }, [priceArr[0]]), decimalStr]), props.suffixLabel && h("span", {
        "class": bem$5('suffix-label')
      }, [props.suffixLabel])]);
    }
  }
  function Tip() {
    if (slots.tip || tip) {
      return h("div", {
        "class": bem$5('tip')
      }, [tipIcon && h(Icon$3, {
        "class": bem$5('tip-icon'),
        "attrs": {
          "name": tipIcon
        }
      }), tip && h("span", {
        "class": bem$5('tip-text')
      }, [tip]), slots.tip && slots.tip()]);
    }
  }
  return h("div", _mergeJSXProps([{
    "class": bem$5({
      unfit: !props.safeAreaInsetBottom
    })
  }, inherit(ctx)]), [slots.top && slots.top(), Tip(), h("div", {
    "class": bem$5('bar')
  }, [slots.default && slots.default(), Text(), slots.button ? slots.button() : h(Button$2, {
    "attrs": {
      "round": true,
      "type": props.buttonType,
      "text": props.loading ? '' : props.buttonText,
      "color": props.buttonColor,
      "loading": props.loading,
      "disabled": props.disabled
    },
    "class": bem$5('button', props.buttonType),
    "on": {
      "click": function click() {
        emit(ctx, 'submit');
      }
    }
  })])]);
}
SubmitBar.props = {
  tip: String,
  label: String,
  price: Number,
  tipIcon: String,
  loading: Boolean,
  disabled: Boolean,
  textAlign: String,
  buttonText: String,
  buttonColor: String,
  suffixLabel: String,
  safeAreaInsetBottom: {
    type: Boolean,
    default: true
  },
  decimalLength: {
    type: [Number, String],
    default: 2
  },
  currency: {
    type: String,
    default: '¥'
  },
  buttonType: {
    type: String,
    default: 'danger'
  }
};
var SubmitBar$1 = createComponent$5(SubmitBar);

// Utils
var _createNamespace$4 = createNamespace('swipe-cell'),
  createComponent$4 = _createNamespace$4[0],
  bem$4 = _createNamespace$4[1];
var THRESHOLD = 0.15;
var SwipeCell = createComponent$4({
  mixins: [TouchMixin, ClickOutsideMixin({
    event: 'touchstart',
    method: 'onClick'
  })],
  props: {
    // @deprecated
    // should be removed in next major version, use beforeClose instead
    onClose: Function,
    disabled: Boolean,
    leftWidth: [Number, String],
    rightWidth: [Number, String],
    beforeClose: Function,
    stopPropagation: Boolean,
    name: {
      type: [Number, String],
      default: ''
    }
  },
  data: function data() {
    return {
      offset: 0,
      dragging: false
    };
  },
  computed: {
    computedLeftWidth: function computedLeftWidth() {
      return +this.leftWidth || this.getWidthByRef('left');
    },
    computedRightWidth: function computedRightWidth() {
      return +this.rightWidth || this.getWidthByRef('right');
    }
  },
  mounted: function mounted() {
    this.bindTouchEvent(this.$el);
  },
  methods: {
    getWidthByRef: function getWidthByRef(ref) {
      if (this.$refs[ref]) {
        var rect = this.$refs[ref].getBoundingClientRect();
        return rect.width;
      }
      return 0;
    },
    // @exposed-api
    open: function open(position) {
      var offset = position === 'left' ? this.computedLeftWidth : -this.computedRightWidth;
      this.opened = true;
      this.offset = offset;
      this.$emit('open', {
        position: position,
        name: this.name,
        // @deprecated
        // should be removed in next major version
        detail: this.name
      });
    },
    // @exposed-api
    close: function close(position) {
      this.offset = 0;
      if (this.opened) {
        this.opened = false;
        this.$emit('close', {
          position: position,
          name: this.name
        });
      }
    },
    onTouchStart: function onTouchStart(event) {
      if (this.disabled) {
        return;
      }
      this.startOffset = this.offset;
      this.touchStart(event);
    },
    onTouchMove: function onTouchMove(event) {
      if (this.disabled) {
        return;
      }
      this.touchMove(event);
      if (this.direction === 'horizontal') {
        this.dragging = true;
        this.lockClick = true;
        var isPrevent = !this.opened || this.deltaX * this.startOffset < 0;
        if (isPrevent) {
          preventDefault(event, this.stopPropagation);
        }
        this.offset = range$1(this.deltaX + this.startOffset, -this.computedRightWidth, this.computedLeftWidth);
      }
    },
    onTouchEnd: function onTouchEnd() {
      var _this = this;
      if (this.disabled) {
        return;
      }
      if (this.dragging) {
        this.toggle(this.offset > 0 ? 'left' : 'right');
        this.dragging = false; // compatible with desktop scenario

        setTimeout(function () {
          _this.lockClick = false;
        }, 0);
      }
    },
    toggle: function toggle(direction) {
      var offset = Math.abs(this.offset);
      var threshold = this.opened ? 1 - THRESHOLD : THRESHOLD;
      var computedLeftWidth = this.computedLeftWidth,
        computedRightWidth = this.computedRightWidth;
      if (computedRightWidth && direction === 'right' && offset > computedRightWidth * threshold) {
        this.open('right');
      } else if (computedLeftWidth && direction === 'left' && offset > computedLeftWidth * threshold) {
        this.open('left');
      } else {
        this.close();
      }
    },
    onClick: function onClick(position) {
      if (position === void 0) {
        position = 'outside';
      }
      this.$emit('click', position);
      if (this.opened && !this.lockClick) {
        if (this.beforeClose) {
          this.beforeClose({
            position: position,
            name: this.name,
            instance: this
          });
        } else if (this.onClose) {
          this.onClose(position, this, {
            name: this.name
          });
        } else {
          this.close(position);
        }
      }
    },
    getClickHandler: function getClickHandler(position, stop) {
      var _this2 = this;
      return function (event) {
        if (stop) {
          event.stopPropagation();
        }
        _this2.onClick(position);
      };
    },
    genLeftPart: function genLeftPart() {
      var h = this.$createElement;
      var content = this.slots('left');
      if (content) {
        return h("div", {
          "ref": "left",
          "class": bem$4('left'),
          "on": {
            "click": this.getClickHandler('left', true)
          }
        }, [content]);
      }
    },
    genRightPart: function genRightPart() {
      var h = this.$createElement;
      var content = this.slots('right');
      if (content) {
        return h("div", {
          "ref": "right",
          "class": bem$4('right'),
          "on": {
            "click": this.getClickHandler('right', true)
          }
        }, [content]);
      }
    }
  },
  render: function render() {
    var h = arguments[0];
    var wrapperStyle = {
      transform: "translate3d(" + this.offset + "px, 0, 0)",
      transitionDuration: this.dragging ? '0s' : '.6s'
    };
    return h("div", {
      "class": bem$4(),
      "on": {
        "click": this.getClickHandler('cell')
      }
    }, [h("div", {
      "class": bem$4('wrapper'),
      "style": wrapperStyle
    }, [this.genLeftPart(), this.slots(), this.genRightPart()])]);
  }
});

var _createNamespace$3 = createNamespace('switch-cell'),
  createComponent$3 = _createNamespace$3[0],
  bem$3 = _createNamespace$3[1];
function SwitchCell(h, props, slots, ctx) {
  return h(Cell$1, _mergeJSXProps([{
    "attrs": {
      "center": true,
      "size": props.cellSize,
      "title": props.title,
      "border": props.border
    },
    "class": bem$3([props.cellSize])
  }, inherit(ctx)]), [h(Switch, {
    "props": _extends$2({}, props),
    "on": _extends$2({}, ctx.listeners)
  })]);
}
SwitchCell.props = _extends$2({}, switchProps, {
  title: String,
  cellSize: String,
  border: {
    type: Boolean,
    default: true
  },
  size: {
    type: String,
    default: '24px'
  }
});
var SwitchCell$1 = createComponent$3(SwitchCell);

var _createNamespace$2 = createNamespace('tabbar'),
  createComponent$2 = _createNamespace$2[0],
  bem$2 = _createNamespace$2[1];
var Tabbar = createComponent$2({
  mixins: [ParentMixin('vanTabbar')],
  props: {
    route: Boolean,
    zIndex: [Number, String],
    placeholder: Boolean,
    activeColor: String,
    beforeChange: Function,
    inactiveColor: String,
    value: {
      type: [Number, String],
      default: 0
    },
    border: {
      type: Boolean,
      default: true
    },
    fixed: {
      type: Boolean,
      default: true
    },
    safeAreaInsetBottom: {
      type: Boolean,
      default: null
    }
  },
  data: function data() {
    return {
      height: null
    };
  },
  computed: {
    fit: function fit() {
      if (this.safeAreaInsetBottom !== null) {
        return this.safeAreaInsetBottom;
      } // enable safe-area-inset-bottom by default when fixed

      return this.fixed;
    }
  },
  watch: {
    value: 'setActiveItem',
    children: 'setActiveItem'
  },
  mounted: function mounted() {
    var _this = this;
    if (this.placeholder && this.fixed) {
      var setHeight = function setHeight() {
        _this.height = _this.$refs.tabbar.getBoundingClientRect().height;
      };
      setHeight(); // https://github.com/vant-ui/vant/issues/10131

      setTimeout(setHeight, 100);
    }
  },
  methods: {
    setActiveItem: function setActiveItem() {
      var _this2 = this;
      this.children.forEach(function (item, index) {
        item.nameMatched = item.name === _this2.value || index === _this2.value;
      });
    },
    triggerChange: function triggerChange(active, afterChange) {
      var _this3 = this;
      callInterceptor({
        interceptor: this.beforeChange,
        args: [active],
        done: function done() {
          _this3.$emit('input', active);
          _this3.$emit('change', active);
          afterChange();
        }
      });
    },
    genTabbar: function genTabbar() {
      var _ref;
      var h = this.$createElement;
      return h("div", {
        "ref": "tabbar",
        "style": {
          zIndex: this.zIndex
        },
        "class": [(_ref = {}, _ref[BORDER_TOP_BOTTOM] = this.border, _ref), bem$2({
          unfit: !this.fit,
          fixed: this.fixed
        })]
      }, [this.slots()]);
    }
  },
  render: function render() {
    var h = arguments[0];
    if (this.placeholder && this.fixed) {
      return h("div", {
        "class": bem$2('placeholder'),
        "style": {
          height: this.height + "px"
        }
      }, [this.genTabbar()]);
    }
    return this.genTabbar();
  }
});

var _createNamespace$1 = createNamespace('tabbar-item'),
  createComponent$1 = _createNamespace$1[0],
  bem$1 = _createNamespace$1[1];
var TabbarItem = createComponent$1({
  mixins: [ChildrenMixin('vanTabbar')],
  props: _extends$2({}, routeProps, {
    dot: Boolean,
    icon: String,
    name: [Number, String],
    // @deprecated
    info: [Number, String],
    badge: [Number, String],
    iconPrefix: String
  }),
  data: function data() {
    return {
      nameMatched: false
    };
  },
  computed: {
    active: function active() {
      var routeMode = this.parent.route;
      if (routeMode && '$route' in this) {
        var to = this.to,
          $route = this.$route;
        var config = isObject$2(to) ? to : {
          path: to
        };
        return !!$route.matched.find(function (r) {
          // vue-router 3.x $route.matched[0].path is empty in / and its children paths
          var path = r.path === '' ? '/' : r.path;
          var pathMatched = config.path === path;
          var nameMatched = isDef(config.name) && config.name === r.name;
          return pathMatched || nameMatched;
        });
      }
      return this.nameMatched;
    }
  },
  methods: {
    onClick: function onClick(event) {
      var _this = this;
      if (!this.active) {
        this.parent.triggerChange(this.name || this.index, function () {
          route(_this.$router, _this);
        });
      }
      this.$emit('click', event);
    },
    genIcon: function genIcon() {
      var h = this.$createElement;
      var slot = this.slots('icon', {
        active: this.active
      });
      if (slot) {
        return slot;
      }
      if (this.icon) {
        return h(Icon$3, {
          "attrs": {
            "name": this.icon,
            "classPrefix": this.iconPrefix
          }
        });
      }
    }
  },
  render: function render() {
    var _this$badge;
    var h = arguments[0];
    var active = this.active;
    var color = this.parent[active ? 'activeColor' : 'inactiveColor'];
    return h("div", {
      "class": bem$1({
        active: active
      }),
      "style": {
        color: color
      },
      "on": {
        "click": this.onClick
      }
    }, [h("div", {
      "class": bem$1('icon')
    }, [this.genIcon(), h(Info$1, {
      "attrs": {
        "dot": this.dot,
        "info": (_this$badge = this.badge) != null ? _this$badge : this.info
      }
    })]), h("div", {
      "class": bem$1('text')
    }, [this.slots('default', {
      active: active
    })])]);
  }
});

var _createNamespace = createNamespace('tree-select'),
  createComponent = _createNamespace[0],
  bem = _createNamespace[1];
function TreeSelect(h, props, slots, ctx) {
  var items = props.items,
    height = props.height,
    activeId = props.activeId,
    selectedIcon = props.selectedIcon,
    mainActiveIndex = props.mainActiveIndex;
  var selectedItem = items[+mainActiveIndex] || {};
  var subItems = selectedItem.children || [];
  var isMultiple = Array.isArray(activeId);
  function isActiveItem(id) {
    return isMultiple ? activeId.indexOf(id) !== -1 : activeId === id;
  }
  var Navs = items.map(function (item) {
    var _item$badge;
    return h(SidebarItem, {
      "attrs": {
        "dot": item.dot,
        "info": (_item$badge = item.badge) != null ? _item$badge : item.info,
        "title": item.text,
        "disabled": item.disabled
      },
      "class": [bem('nav-item'), item.className]
    });
  });
  function Content() {
    if (slots.content) {
      return slots.content();
    }
    return subItems.map(function (item) {
      return h("div", {
        "key": item.id,
        "class": ['van-ellipsis', bem('item', {
          active: isActiveItem(item.id),
          disabled: item.disabled
        })],
        "on": {
          "click": function click() {
            if (!item.disabled) {
              var newActiveId = item.id;
              if (isMultiple) {
                newActiveId = activeId.slice();
                var index = newActiveId.indexOf(item.id);
                if (index !== -1) {
                  newActiveId.splice(index, 1);
                } else if (newActiveId.length < props.max) {
                  newActiveId.push(item.id);
                }
              }
              emit(ctx, 'update:active-id', newActiveId);
              emit(ctx, 'click-item', item); // compatible with legacy usage, should be removed in next major version

              emit(ctx, 'itemclick', item);
            }
          }
        }
      }, [item.text, isActiveItem(item.id) && h(Icon$3, {
        "attrs": {
          "name": selectedIcon
        },
        "class": bem('selected')
      })]);
    });
  }
  return h("div", _mergeJSXProps([{
    "class": bem(),
    "style": {
      height: addUnit(height)
    }
  }, inherit(ctx)]), [h(Sidebar, {
    "class": bem('nav'),
    "attrs": {
      "activeKey": mainActiveIndex
    },
    "on": {
      "change": function change(index) {
        emit(ctx, 'update:main-active-index', index);
        emit(ctx, 'click-nav', index); // compatible with legacy usage, should be removed in next major version

        emit(ctx, 'navclick', index);
      }
    }
  }, [Navs]), h("div", {
    "class": bem('content')
  }, [Content()])]);
}
TreeSelect.props = {
  max: {
    type: [Number, String],
    default: Infinity
  },
  items: {
    type: Array,
    default: function _default() {
      return [];
    }
  },
  height: {
    type: [Number, String],
    default: 300
  },
  activeId: {
    type: [Number, String, Array],
    default: 0
  },
  selectedIcon: {
    type: String,
    default: 'success'
  },
  mainActiveIndex: {
    type: [Number, String],
    default: 0
  }
};
var TreeSelect$1 = createComponent(TreeSelect);

function install$2(Vue) {
  var components = [ActionSheet$1, AddressEdit, AddressList$1, Area, Badge, Button$2, Calendar, Card$1, Cascader, Cell$1, CellGroup$1, Checkbox, CheckboxGroup, Circle, Col, Collapse, CollapseItem, ContactCard$1, ContactEdit, ContactList$1, CountDown, Coupon, CouponCell$1, CouponList, DatetimePicker, Dialog, Divider$1, DropdownItem, DropdownMenu, Empty, Field, Form, GoodsAction, GoodsActionButton, GoodsActionIcon, Grid, GridItem, Icon$3, Image$1, ImagePreview$1, IndexAnchor, IndexBar, Info$1, List, Loading$1, Locale$1, NavBar, NoticeBar, Notify, NumberKeyboard, Overlay$1, Pagination, Panel$1, PasswordInput$1, Picker, Popover, Popup, Progress, PullRefresh, Radio, RadioGroup, Rate, Row$1, Search$1, ShareSheet, Sidebar, SidebarItem, Skeleton$1, Sku, Slider$1, Step, Stepper, Steps, Sticky, SubmitBar$1, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell$1, Tab, Tabbar, TabbarItem, Tabs, Tag$1, Toast, TreeSelect$1, Uploader];
  components.forEach(function (item) {
    if (item.install) {
      Vue.use(item);
    } else if (item.name) {
      Vue.component(item.name, item);
    }
  });
}
if (typeof window !== 'undefined' && window.Vue) {
  install$2(window.Vue);
}

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

var script$4X = {
  //预览教材目录
  name: 'PreviewCatalogRender',
  props: {
    textBookId: String,
    catalogList: Array,
    checkedId: {
      type: String,
      default: ''
    },
    pageType: {
      type: String,
      default: 'h5'
    },
    isShow: {
      type: Boolean,
      default: false
    },
    title: String
  },
  data() {
    return {
      scrollTop: 0,
      defaultProps: {
        children: 'children',
        label: 'label'
      },
      selectId: ''
    };
  },
  watch: {
    checkedId: {
      handler(newValue) {
        console.log('=============================newValue=======', newValue);
        if (this.$refs.tree) {
          this.$refs.tree.setCurrentKey(newValue);
        }
      },
      immediate: true,
      deep: true
    },
    isShow: {
      handler(newValue) {
        console.log(newValue);
        let dom = document.getElementById('preview-tree');
        if (dom) {
          dom.animate({
            scrollTop: this.scrollTop
          }, 200);
        }
      },
      immediate: true
    }
  },
  created() {},
  methods: {
    nodeClick(data) {
      console.log(data);
      this.$emit('onNodeClick', {
        id: data.id,
        label: data.label
      });
      this.selectId = data.id;
    }
  }
};

function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
  if (typeof shadowMode !== 'boolean') {
    createInjectorSSR = createInjector;
    createInjector = shadowMode;
    shadowMode = false;
  }
  // Vue.extend constructor export interop.
  const options = typeof script === 'function' ? script.options : script;
  // render functions
  if (template && template.render) {
    options.render = template.render;
    options.staticRenderFns = template.staticRenderFns;
    options._compiled = true;
    // functional template
    if (isFunctionalTemplate) {
      options.functional = true;
    }
  }
  // scopedId
  if (scopeId) {
    options._scopeId = scopeId;
  }
  let hook;
  if (moduleIdentifier) {
    // server build
    hook = function (context) {
      // 2.3 injection
      context = context ||
      // cached call
      this.$vnode && this.$vnode.ssrContext ||
      // stateful
      this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__;
      }
      // inject component styles
      if (style) {
        style.call(this, createInjectorSSR(context));
      }
      // register component module identifier for async chunk inference
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier);
      }
    };
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook;
  } else if (style) {
    hook = shadowMode ? function (context) {
      style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
    } : function (context) {
      style.call(this, createInjector(context));
    };
  }
  if (hook) {
    if (options.functional) {
      // register for functional component in vue file
      const originalRender = options.render;
      options.render = function renderWithStyleInjection(h, context) {
        hook.call(context);
        return originalRender(h, context);
      };
    } else {
      // inject component registration as beforeCreate hook
      const existing = options.beforeCreate;
      options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
    }
  }
  return script;
}

/* script */
const __vue_script__$4X = script$4X;
/* template */
var __vue_render__$4X = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    [
      _vm.pageType !== "pc"
        ? _c("div", { staticClass: "preview-container-title" }, [
            _c("span", { staticClass: "container-text" }, [
              _vm._v(_vm._s(_vm.title)),
            ]),
          ])
        : _vm._e(),
      _vm._v(" "),
      _c("el-tree", {
        ref: "tree",
        class: "preview-tree-box-" + _vm.pageType,
        staticStyle: { "margin-top": "50px" },
        attrs: {
          id: "preview-tree",
          draggable: true,
          "default-expand-all": true,
          "highlight-current": "",
          data: _vm.catalogList,
          "node-key": "id",
          props: _vm.defaultProps,
          "expand-on-click-node": false,
        },
        on: { "node-click": _vm.nodeClick },
      }),
    ],
    1
  )
};
var __vue_staticRenderFns__$4X = [];
__vue_render__$4X._withStripped = true;

  /* style */
  const __vue_inject_styles__$4X = undefined;
  /* scoped */
  const __vue_scope_id__$4X = "data-v-7da5c6fc";
  /* module identifier */
  const __vue_module_identifier__$4X = undefined;
  /* functional template */
  const __vue_is_functional_template__$4X = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4X = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4X, staticRenderFns: __vue_staticRenderFns__$4X },
    __vue_inject_styles__$4X,
    __vue_script__$4X,
    __vue_scope_id__$4X,
    __vue_is_functional_template__$4X,
    __vue_module_identifier__$4X,
    false,
    undefined,
    undefined,
    undefined
  );

var jquery = createCommonjsModule(function (module) {
/*!
 * jQuery JavaScript Library v3.7.1
 * https://jquery.com/
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license
 * https://jquery.org/license
 *
 * Date: 2023-08-28T13:37Z
 */
(function (global, factory) {

  {
    // For CommonJS and CommonJS-like environments where a proper `window`
    // is present, execute the factory and get jQuery.
    // For environments that do not have a `window` with a `document`
    // (such as Node.js), expose a factory as module.exports.
    // This accentuates the need for the creation of a real `window`.
    // e.g. var jQuery = require("jquery")(window);
    // See ticket trac-14549 for more info.
    module.exports = global.document ? factory(global, true) : function (w) {
      if (!w.document) {
        throw new Error("jQuery requires a window with a document");
      }
      return factory(w);
    };
  }

  // Pass this if window is not defined yet
})(typeof window !== "undefined" ? window : commonjsGlobal, function (window, noGlobal) {

  var arr = [];
  var getProto = Object.getPrototypeOf;
  var slice = arr.slice;
  var flat = arr.flat ? function (array) {
    return arr.flat.call(array);
  } : function (array) {
    return arr.concat.apply([], array);
  };
  var push = arr.push;
  var indexOf = arr.indexOf;
  var class2type = {};
  var toString = class2type.toString;
  var hasOwn = class2type.hasOwnProperty;
  var fnToString = hasOwn.toString;
  var ObjectFunctionString = fnToString.call(Object);
  var support = {};
  var isFunction = function isFunction(obj) {
    // Support: Chrome <=57, Firefox <=52
    // In some browsers, typeof returns "function" for HTML <object> elements
    // (i.e., `typeof document.createElement( "object" ) === "function"`).
    // We don't want to classify *any* DOM node as a function.
    // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5
    // Plus for old WebKit, typeof returns "function" for HTML collections
    // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)
    return typeof obj === "function" && typeof obj.nodeType !== "number" && typeof obj.item !== "function";
  };
  var isWindow = function isWindow(obj) {
    return obj != null && obj === obj.window;
  };
  var document = window.document;
  var preservedScriptAttributes = {
    type: true,
    src: true,
    nonce: true,
    noModule: true
  };
  function DOMEval(code, node, doc) {
    doc = doc || document;
    var i,
      val,
      script = doc.createElement("script");
    script.text = code;
    if (node) {
      for (i in preservedScriptAttributes) {
        // Support: Firefox 64+, Edge 18+
        // Some browsers don't support the "nonce" property on scripts.
        // On the other hand, just using `getAttribute` is not enough as
        // the `nonce` attribute is reset to an empty string whenever it
        // becomes browsing-context connected.
        // See https://github.com/whatwg/html/issues/2369
        // See https://html.spec.whatwg.org/#nonce-attributes
        // The `node.getAttribute` check was added for the sake of
        // `jQuery.globalEval` so that it can fake a nonce-containing node
        // via an object.
        val = node[i] || node.getAttribute && node.getAttribute(i);
        if (val) {
          script.setAttribute(i, val);
        }
      }
    }
    doc.head.appendChild(script).parentNode.removeChild(script);
  }
  function toType(obj) {
    if (obj == null) {
      return obj + "";
    }

    // Support: Android <=2.3 only (functionish RegExp)
    return typeof obj === "object" || typeof obj === "function" ? class2type[toString.call(obj)] || "object" : typeof obj;
  }
  /* global Symbol */
  // Defining this global in .eslintrc.json would create a danger of using the global
  // unguarded in another place, it seems safer to define global only for this module

  var version = "3.7.1",
    rhtmlSuffix = /HTML$/i,
    // Define a local copy of jQuery
    jQuery = function (selector, context) {
      // The jQuery object is actually just the init constructor 'enhanced'
      // Need init if jQuery is called (just allow error to be thrown if not included)
      return new jQuery.fn.init(selector, context);
    };
  jQuery.fn = jQuery.prototype = {
    // The current version of jQuery being used
    jquery: version,
    constructor: jQuery,
    // The default length of a jQuery object is 0
    length: 0,
    toArray: function () {
      return slice.call(this);
    },
    // Get the Nth element in the matched element set OR
    // Get the whole matched element set as a clean array
    get: function (num) {
      // Return all the elements in a clean array
      if (num == null) {
        return slice.call(this);
      }

      // Return just the one element from the set
      return num < 0 ? this[num + this.length] : this[num];
    },
    // Take an array of elements and push it onto the stack
    // (returning the new matched element set)
    pushStack: function (elems) {
      // Build a new jQuery matched element set
      var ret = jQuery.merge(this.constructor(), elems);

      // Add the old object onto the stack (as a reference)
      ret.prevObject = this;

      // Return the newly-formed element set
      return ret;
    },
    // Execute a callback for every element in the matched set.
    each: function (callback) {
      return jQuery.each(this, callback);
    },
    map: function (callback) {
      return this.pushStack(jQuery.map(this, function (elem, i) {
        return callback.call(elem, i, elem);
      }));
    },
    slice: function () {
      return this.pushStack(slice.apply(this, arguments));
    },
    first: function () {
      return this.eq(0);
    },
    last: function () {
      return this.eq(-1);
    },
    even: function () {
      return this.pushStack(jQuery.grep(this, function (_elem, i) {
        return (i + 1) % 2;
      }));
    },
    odd: function () {
      return this.pushStack(jQuery.grep(this, function (_elem, i) {
        return i % 2;
      }));
    },
    eq: function (i) {
      var len = this.length,
        j = +i + (i < 0 ? len : 0);
      return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
    },
    end: function () {
      return this.prevObject || this.constructor();
    },
    // For internal use only.
    // Behaves like an Array's method, not like a jQuery method.
    push: push,
    sort: arr.sort,
    splice: arr.splice
  };
  jQuery.extend = jQuery.fn.extend = function () {
    var options,
      name,
      src,
      copy,
      copyIsArray,
      clone,
      target = arguments[0] || {},
      i = 1,
      length = arguments.length,
      deep = false;

    // Handle a deep copy situation
    if (typeof target === "boolean") {
      deep = target;

      // Skip the boolean and the target
      target = arguments[i] || {};
      i++;
    }

    // Handle case when target is a string or something (possible in deep copy)
    if (typeof target !== "object" && !isFunction(target)) {
      target = {};
    }

    // Extend jQuery itself if only one argument is passed
    if (i === length) {
      target = this;
      i--;
    }
    for (; i < length; i++) {
      // Only deal with non-null/undefined values
      if ((options = arguments[i]) != null) {
        // Extend the base object
        for (name in options) {
          copy = options[name];

          // Prevent Object.prototype pollution
          // Prevent never-ending loop
          if (name === "__proto__" || target === copy) {
            continue;
          }

          // Recurse if we're merging plain objects or arrays
          if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {
            src = target[name];

            // Ensure proper type for the source value
            if (copyIsArray && !Array.isArray(src)) {
              clone = [];
            } else if (!copyIsArray && !jQuery.isPlainObject(src)) {
              clone = {};
            } else {
              clone = src;
            }
            copyIsArray = false;

            // Never move original objects, clone them
            target[name] = jQuery.extend(deep, clone, copy);

            // Don't bring in undefined values
          } else if (copy !== undefined) {
            target[name] = copy;
          }
        }
      }
    }

    // Return the modified object
    return target;
  };
  jQuery.extend({
    // Unique for each copy of jQuery on the page
    expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""),
    // Assume jQuery is ready without the ready module
    isReady: true,
    error: function (msg) {
      throw new Error(msg);
    },
    noop: function () {},
    isPlainObject: function (obj) {
      var proto, Ctor;

      // Detect obvious negatives
      // Use toString instead of jQuery.type to catch host objects
      if (!obj || toString.call(obj) !== "[object Object]") {
        return false;
      }
      proto = getProto(obj);

      // Objects with no prototype (e.g., `Object.create( null )`) are plain
      if (!proto) {
        return true;
      }

      // Objects with prototype are plain iff they were constructed by a global Object function
      Ctor = hasOwn.call(proto, "constructor") && proto.constructor;
      return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString;
    },
    isEmptyObject: function (obj) {
      var name;
      for (name in obj) {
        return false;
      }
      return true;
    },
    // Evaluates a script in a provided context; falls back to the global one
    // if not specified.
    globalEval: function (code, options, doc) {
      DOMEval(code, {
        nonce: options && options.nonce
      }, doc);
    },
    each: function (obj, callback) {
      var length,
        i = 0;
      if (isArrayLike(obj)) {
        length = obj.length;
        for (; i < length; i++) {
          if (callback.call(obj[i], i, obj[i]) === false) {
            break;
          }
        }
      } else {
        for (i in obj) {
          if (callback.call(obj[i], i, obj[i]) === false) {
            break;
          }
        }
      }
      return obj;
    },
    // Retrieve the text value of an array of DOM nodes
    text: function (elem) {
      var node,
        ret = "",
        i = 0,
        nodeType = elem.nodeType;
      if (!nodeType) {
        // If no nodeType, this is expected to be an array
        while (node = elem[i++]) {
          // Do not traverse comment nodes
          ret += jQuery.text(node);
        }
      }
      if (nodeType === 1 || nodeType === 11) {
        return elem.textContent;
      }
      if (nodeType === 9) {
        return elem.documentElement.textContent;
      }
      if (nodeType === 3 || nodeType === 4) {
        return elem.nodeValue;
      }

      // Do not include comment or processing instruction nodes

      return ret;
    },
    // results is for internal usage only
    makeArray: function (arr, results) {
      var ret = results || [];
      if (arr != null) {
        if (isArrayLike(Object(arr))) {
          jQuery.merge(ret, typeof arr === "string" ? [arr] : arr);
        } else {
          push.call(ret, arr);
        }
      }
      return ret;
    },
    inArray: function (elem, arr, i) {
      return arr == null ? -1 : indexOf.call(arr, elem, i);
    },
    isXMLDoc: function (elem) {
      var namespace = elem && elem.namespaceURI,
        docElem = elem && (elem.ownerDocument || elem).documentElement;

      // Assume HTML when documentElement doesn't yet exist, such as inside
      // document fragments.
      return !rhtmlSuffix.test(namespace || docElem && docElem.nodeName || "HTML");
    },
    // Support: Android <=4.0 only, PhantomJS 1 only
    // push.apply(_, arraylike) throws on ancient WebKit
    merge: function (first, second) {
      var len = +second.length,
        j = 0,
        i = first.length;
      for (; j < len; j++) {
        first[i++] = second[j];
      }
      first.length = i;
      return first;
    },
    grep: function (elems, callback, invert) {
      var callbackInverse,
        matches = [],
        i = 0,
        length = elems.length,
        callbackExpect = !invert;

      // Go through the array, only saving the items
      // that pass the validator function
      for (; i < length; i++) {
        callbackInverse = !callback(elems[i], i);
        if (callbackInverse !== callbackExpect) {
          matches.push(elems[i]);
        }
      }
      return matches;
    },
    // arg is for internal usage only
    map: function (elems, callback, arg) {
      var length,
        value,
        i = 0,
        ret = [];

      // Go through the array, translating each of the items to their new values
      if (isArrayLike(elems)) {
        length = elems.length;
        for (; i < length; i++) {
          value = callback(elems[i], i, arg);
          if (value != null) {
            ret.push(value);
          }
        }

        // Go through every key on the object,
      } else {
        for (i in elems) {
          value = callback(elems[i], i, arg);
          if (value != null) {
            ret.push(value);
          }
        }
      }

      // Flatten any nested arrays
      return flat(ret);
    },
    // A global GUID counter for objects
    guid: 1,
    // jQuery.support is not used in Core but other projects attach their
    // properties to it so it needs to exist.
    support: support
  });
  if (typeof Symbol === "function") {
    jQuery.fn[Symbol.iterator] = arr[Symbol.iterator];
  }

  // Populate the class2type map
  jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function (_i, name) {
    class2type["[object " + name + "]"] = name.toLowerCase();
  });
  function isArrayLike(obj) {
    // Support: real iOS 8.2 only (not reproducible in simulator)
    // `in` check used to prevent JIT error (gh-2145)
    // hasOwn isn't used here due to false negatives
    // regarding Nodelist length in IE
    var length = !!obj && "length" in obj && obj.length,
      type = toType(obj);
    if (isFunction(obj) || isWindow(obj)) {
      return false;
    }
    return type === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj;
  }
  function nodeName(elem, name) {
    return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  }
  var pop = arr.pop;
  var sort = arr.sort;
  var splice = arr.splice;
  var whitespace = "[\\x20\\t\\r\\n\\f]";
  var rtrimCSS = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g");

  // Note: an element does not contain itself
  jQuery.contains = function (a, b) {
    var bup = b && b.parentNode;
    return a === bup || !!(bup && bup.nodeType === 1 && (
    // Support: IE 9 - 11+
    // IE doesn't have `contains` on SVG.
    a.contains ? a.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
  };

  // CSS string/identifier serialization
  // https://drafts.csswg.org/cssom/#common-serializing-idioms
  var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
  function fcssescape(ch, asCodePoint) {
    if (asCodePoint) {
      // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
      if (ch === "\0") {
        return "\uFFFD";
      }

      // Control characters and (dependent upon position) numbers get escaped as code points
      return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " ";
    }

    // Other potentially-special ASCII characters get backslash-escaped
    return "\\" + ch;
  }
  jQuery.escapeSelector = function (sel) {
    return (sel + "").replace(rcssescape, fcssescape);
  };
  var preferredDoc = document,
    pushNative = push;
  (function () {
    var i,
      Expr,
      outermostContext,
      sortInput,
      hasDuplicate,
      push = pushNative,
      // Local document vars
      document,
      documentElement,
      documentIsHTML,
      rbuggyQSA,
      matches,
      // Instance-specific data
      expando = jQuery.expando,
      dirruns = 0,
      done = 0,
      classCache = createCache(),
      tokenCache = createCache(),
      compilerCache = createCache(),
      nonnativeSelectorCache = createCache(),
      sortOrder = function (a, b) {
        if (a === b) {
          hasDuplicate = true;
        }
        return 0;
      },
      booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" + "loop|multiple|open|readonly|required|scoped",
      // Regular expressions

      // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
      identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
      // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors
      attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
      // Operator (capture 2)
      "*([*^$|!~]?=)" + whitespace +
      // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
      "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]",
      pseudos = ":(" + identifier + ")(?:\\((" +
      // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
      // 1. quoted (capture 3; capture 4 or capture 5)
      "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
      // 2. simple (capture 6)
      "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
      // 3. anything else (capture 2)
      ".*" + ")\\)|)",
      // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
      rwhitespace = new RegExp(whitespace + "+", "g"),
      rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"),
      rleadingCombinator = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"),
      rdescend = new RegExp(whitespace + "|>"),
      rpseudo = new RegExp(pseudos),
      ridentifier = new RegExp("^" + identifier + "$"),
      matchExpr = {
        ID: new RegExp("^#(" + identifier + ")"),
        CLASS: new RegExp("^\\.(" + identifier + ")"),
        TAG: new RegExp("^(" + identifier + "|[*])"),
        ATTR: new RegExp("^" + attributes),
        PSEUDO: new RegExp("^" + pseudos),
        CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i"),
        bool: new RegExp("^(?:" + booleans + ")$", "i"),
        // For use in libraries implementing .is()
        // We use this for POS matching in `select`
        needsContext: new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
      },
      rinputs = /^(?:input|select|textarea|button)$/i,
      rheader = /^h\d$/i,
      // Easily-parseable/retrievable ID or TAG or CLASS selectors
      rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
      rsibling = /[+~]/,
      // CSS escapes
      // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters
      runescape = new RegExp("\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g"),
      funescape = function (escape, nonHex) {
        var high = "0x" + escape.slice(1) - 0x10000;
        if (nonHex) {
          // Strip the backslash prefix from a non-hex escape sequence
          return nonHex;
        }

        // Replace a hexadecimal escape sequence with the encoded Unicode code point
        // Support: IE <=11+
        // For values outside the Basic Multilingual Plane (BMP), manually construct a
        // surrogate pair
        return high < 0 ? String.fromCharCode(high + 0x10000) : String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00);
      },
      // Used for iframes; see `setDocument`.
      // Support: IE 9 - 11+, Edge 12 - 18+
      // Removing the function wrapper causes a "Permission Denied"
      // error in IE/Edge.
      unloadHandler = function () {
        setDocument();
      },
      inDisabledFieldset = addCombinator(function (elem) {
        return elem.disabled === true && nodeName(elem, "fieldset");
      }, {
        dir: "parentNode",
        next: "legend"
      });

    // Support: IE <=9 only
    // Accessing document.activeElement can throw unexpectedly
    // https://bugs.jquery.com/ticket/13393
    function safeActiveElement() {
      try {
        return document.activeElement;
      } catch (err) {}
    }

    // Optimize for push.apply( _, NodeList )
    try {
      push.apply(arr = slice.call(preferredDoc.childNodes), preferredDoc.childNodes);

      // Support: Android <=4.0
      // Detect silently failing push.apply
      // eslint-disable-next-line no-unused-expressions
      arr[preferredDoc.childNodes.length].nodeType;
    } catch (e) {
      push = {
        apply: function (target, els) {
          pushNative.apply(target, slice.call(els));
        },
        call: function (target) {
          pushNative.apply(target, slice.call(arguments, 1));
        }
      };
    }
    function find(selector, context, results, seed) {
      var m,
        i,
        elem,
        nid,
        match,
        groups,
        newSelector,
        newContext = context && context.ownerDocument,
        // nodeType defaults to 9, since context defaults to document
        nodeType = context ? context.nodeType : 9;
      results = results || [];

      // Return early from calls with invalid selector or context
      if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
        return results;
      }

      // Try to shortcut find operations (as opposed to filters) in HTML documents
      if (!seed) {
        setDocument(context);
        context = context || document;
        if (documentIsHTML) {
          // If the selector is sufficiently simple, try using a "get*By*" DOM method
          // (excepting DocumentFragment context, where the methods don't exist)
          if (nodeType !== 11 && (match = rquickExpr.exec(selector))) {
            // ID selector
            if (m = match[1]) {
              // Document context
              if (nodeType === 9) {
                if (elem = context.getElementById(m)) {
                  // Support: IE 9 only
                  // getElementById can match elements by name instead of ID
                  if (elem.id === m) {
                    push.call(results, elem);
                    return results;
                  }
                } else {
                  return results;
                }

                // Element context
              } else {
                // Support: IE 9 only
                // getElementById can match elements by name instead of ID
                if (newContext && (elem = newContext.getElementById(m)) && find.contains(context, elem) && elem.id === m) {
                  push.call(results, elem);
                  return results;
                }
              }

              // Type selector
            } else if (match[2]) {
              push.apply(results, context.getElementsByTagName(selector));
              return results;

              // Class selector
            } else if ((m = match[3]) && context.getElementsByClassName) {
              push.apply(results, context.getElementsByClassName(m));
              return results;
            }
          }

          // Take advantage of querySelectorAll
          if (!nonnativeSelectorCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
            newSelector = selector;
            newContext = context;

            // qSA considers elements outside a scoping root when evaluating child or
            // descendant combinators, which is not what we want.
            // In such cases, we work around the behavior by prefixing every selector in the
            // list with an ID selector referencing the scope context.
            // The technique has to be used as well when a leading combinator is used
            // as such selectors are not recognized by querySelectorAll.
            // Thanks to Andrew Dupont for this technique.
            if (nodeType === 1 && (rdescend.test(selector) || rleadingCombinator.test(selector))) {
              // Expand context for sibling selectors
              newContext = rsibling.test(selector) && testContext(context.parentNode) || context;

              // We can use :scope instead of the ID hack if the browser
              // supports it & if we're not changing the context.
              // Support: IE 11+, Edge 17 - 18+
              // IE/Edge sometimes throw a "Permission denied" error when
              // strict-comparing two documents; shallow comparisons work.
              // eslint-disable-next-line eqeqeq
              if (newContext != context || !support.scope) {
                // Capture the context ID, setting it first if necessary
                if (nid = context.getAttribute("id")) {
                  nid = jQuery.escapeSelector(nid);
                } else {
                  context.setAttribute("id", nid = expando);
                }
              }

              // Prefix every selector in the list
              groups = tokenize(selector);
              i = groups.length;
              while (i--) {
                groups[i] = (nid ? "#" + nid : ":scope") + " " + toSelector(groups[i]);
              }
              newSelector = groups.join(",");
            }
            try {
              push.apply(results, newContext.querySelectorAll(newSelector));
              return results;
            } catch (qsaError) {
              nonnativeSelectorCache(selector, true);
            } finally {
              if (nid === expando) {
                context.removeAttribute("id");
              }
            }
          }
        }
      }

      // All others
      return select(selector.replace(rtrimCSS, "$1"), context, results, seed);
    }

    /**
     * Create key-value caches of limited size
     * @returns {function(string, object)} Returns the Object data after storing it on itself with
     *	property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
     *	deleting the oldest entry
     */
    function createCache() {
      var keys = [];
      function cache(key, value) {
        // Use (key + " ") to avoid collision with native prototype properties
        // (see https://github.com/jquery/sizzle/issues/157)
        if (keys.push(key + " ") > Expr.cacheLength) {
          // Only keep the most recent entries
          delete cache[keys.shift()];
        }
        return cache[key + " "] = value;
      }
      return cache;
    }

    /**
     * Mark a function for special use by jQuery selector module
     * @param {Function} fn The function to mark
     */
    function markFunction(fn) {
      fn[expando] = true;
      return fn;
    }

    /**
     * Support testing using an element
     * @param {Function} fn Passed the created element and returns a boolean result
     */
    function assert(fn) {
      var el = document.createElement("fieldset");
      try {
        return !!fn(el);
      } catch (e) {
        return false;
      } finally {
        // Remove from its parent by default
        if (el.parentNode) {
          el.parentNode.removeChild(el);
        }

        // release memory in IE
        el = null;
      }
    }

    /**
     * Returns a function to use in pseudos for input types
     * @param {String} type
     */
    function createInputPseudo(type) {
      return function (elem) {
        return nodeName(elem, "input") && elem.type === type;
      };
    }

    /**
     * Returns a function to use in pseudos for buttons
     * @param {String} type
     */
    function createButtonPseudo(type) {
      return function (elem) {
        return (nodeName(elem, "input") || nodeName(elem, "button")) && elem.type === type;
      };
    }

    /**
     * Returns a function to use in pseudos for :enabled/:disabled
     * @param {Boolean} disabled true for :disabled; false for :enabled
     */
    function createDisabledPseudo(disabled) {
      // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
      return function (elem) {
        // Only certain elements can match :enabled or :disabled
        // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
        // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
        if ("form" in elem) {
          // Check for inherited disabledness on relevant non-disabled elements:
          // * listed form-associated elements in a disabled fieldset
          //   https://html.spec.whatwg.org/multipage/forms.html#category-listed
          //   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
          // * option elements in a disabled optgroup
          //   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
          // All such elements have a "form" property.
          if (elem.parentNode && elem.disabled === false) {
            // Option elements defer to a parent optgroup if present
            if ("label" in elem) {
              if ("label" in elem.parentNode) {
                return elem.parentNode.disabled === disabled;
              } else {
                return elem.disabled === disabled;
              }
            }

            // Support: IE 6 - 11+
            // Use the isDisabled shortcut property to check for disabled fieldset ancestors
            return elem.isDisabled === disabled ||
            // Where there is no isDisabled, check manually
            elem.isDisabled !== !disabled && inDisabledFieldset(elem) === disabled;
          }
          return elem.disabled === disabled;

          // Try to winnow out elements that can't be disabled before trusting the disabled property.
          // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
          // even exist on them, let alone have a boolean value.
        } else if ("label" in elem) {
          return elem.disabled === disabled;
        }

        // Remaining elements are neither :enabled nor :disabled
        return false;
      };
    }

    /**
     * Returns a function to use in pseudos for positionals
     * @param {Function} fn
     */
    function createPositionalPseudo(fn) {
      return markFunction(function (argument) {
        argument = +argument;
        return markFunction(function (seed, matches) {
          var j,
            matchIndexes = fn([], seed.length, argument),
            i = matchIndexes.length;

          // Match elements found at the specified indexes
          while (i--) {
            if (seed[j = matchIndexes[i]]) {
              seed[j] = !(matches[j] = seed[j]);
            }
          }
        });
      });
    }

    /**
     * Checks a node for validity as a jQuery selector context
     * @param {Element|Object=} context
     * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
     */
    function testContext(context) {
      return context && typeof context.getElementsByTagName !== "undefined" && context;
    }

    /**
     * Sets document-related variables once based on the current document
     * @param {Element|Object} [node] An element or document object to use to set the document
     * @returns {Object} Returns the current document
     */
    function setDocument(node) {
      var subWindow,
        doc = node ? node.ownerDocument || node : preferredDoc;

      // Return early if doc is invalid or already selected
      // Support: IE 11+, Edge 17 - 18+
      // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
      // two documents; shallow comparisons work.
      // eslint-disable-next-line eqeqeq
      if (doc == document || doc.nodeType !== 9 || !doc.documentElement) {
        return document;
      }

      // Update global variables
      document = doc;
      documentElement = document.documentElement;
      documentIsHTML = !jQuery.isXMLDoc(document);

      // Support: iOS 7 only, IE 9 - 11+
      // Older browsers didn't support unprefixed `matches`.
      matches = documentElement.matches || documentElement.webkitMatchesSelector || documentElement.msMatchesSelector;

      // Support: IE 9 - 11+, Edge 12 - 18+
      // Accessing iframe documents after unload throws "permission denied" errors
      // (see trac-13936).
      // Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`,
      // all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well.
      if (documentElement.msMatchesSelector &&
      // Support: IE 11+, Edge 17 - 18+
      // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
      // two documents; shallow comparisons work.
      // eslint-disable-next-line eqeqeq
      preferredDoc != document && (subWindow = document.defaultView) && subWindow.top !== subWindow) {
        // Support: IE 9 - 11+, Edge 12 - 18+
        subWindow.addEventListener("unload", unloadHandler);
      }

      // Support: IE <10
      // Check if getElementById returns elements by name
      // The broken getElementById methods don't pick up programmatically-set names,
      // so use a roundabout getElementsByName test
      support.getById = assert(function (el) {
        documentElement.appendChild(el).id = jQuery.expando;
        return !document.getElementsByName || !document.getElementsByName(jQuery.expando).length;
      });

      // Support: IE 9 only
      // Check to see if it's possible to do matchesSelector
      // on a disconnected node.
      support.disconnectedMatch = assert(function (el) {
        return matches.call(el, "*");
      });

      // Support: IE 9 - 11+, Edge 12 - 18+
      // IE/Edge don't support the :scope pseudo-class.
      support.scope = assert(function () {
        return document.querySelectorAll(":scope");
      });

      // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only
      // Make sure the `:has()` argument is parsed unforgivingly.
      // We include `*` in the test to detect buggy implementations that are
      // _selectively_ forgiving (specifically when the list includes at least
      // one valid selector).
      // Note that we treat complete lack of support for `:has()` as if it were
      // spec-compliant support, which is fine because use of `:has()` in such
      // environments will fail in the qSA path and fall back to jQuery traversal
      // anyway.
      support.cssHas = assert(function () {
        try {
          document.querySelector(":has(*,:jqfake)");
          return false;
        } catch (e) {
          return true;
        }
      });

      // ID filter and find
      if (support.getById) {
        Expr.filter.ID = function (id) {
          var attrId = id.replace(runescape, funescape);
          return function (elem) {
            return elem.getAttribute("id") === attrId;
          };
        };
        Expr.find.ID = function (id, context) {
          if (typeof context.getElementById !== "undefined" && documentIsHTML) {
            var elem = context.getElementById(id);
            return elem ? [elem] : [];
          }
        };
      } else {
        Expr.filter.ID = function (id) {
          var attrId = id.replace(runescape, funescape);
          return function (elem) {
            var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
            return node && node.value === attrId;
          };
        };

        // Support: IE 6 - 7 only
        // getElementById is not reliable as a find shortcut
        Expr.find.ID = function (id, context) {
          if (typeof context.getElementById !== "undefined" && documentIsHTML) {
            var node,
              i,
              elems,
              elem = context.getElementById(id);
            if (elem) {
              // Verify the id attribute
              node = elem.getAttributeNode("id");
              if (node && node.value === id) {
                return [elem];
              }

              // Fall back on getElementsByName
              elems = context.getElementsByName(id);
              i = 0;
              while (elem = elems[i++]) {
                node = elem.getAttributeNode("id");
                if (node && node.value === id) {
                  return [elem];
                }
              }
            }
            return [];
          }
        };
      }

      // Tag
      Expr.find.TAG = function (tag, context) {
        if (typeof context.getElementsByTagName !== "undefined") {
          return context.getElementsByTagName(tag);

          // DocumentFragment nodes don't have gEBTN
        } else {
          return context.querySelectorAll(tag);
        }
      };

      // Class
      Expr.find.CLASS = function (className, context) {
        if (typeof context.getElementsByClassName !== "undefined" && documentIsHTML) {
          return context.getElementsByClassName(className);
        }
      };

      /* QSA/matchesSelector
      ---------------------------------------------------------------------- */

      // QSA and matchesSelector support

      rbuggyQSA = [];

      // Build QSA regex
      // Regex strategy adopted from Diego Perini
      assert(function (el) {
        var input;
        documentElement.appendChild(el).innerHTML = "<a id='" + expando + "' href='' disabled='disabled'></a>" + "<select id='" + expando + "-\r\\' disabled='disabled'>" + "<option selected=''></option></select>";

        // Support: iOS <=7 - 8 only
        // Boolean attributes and "value" are not treated correctly in some XML documents
        if (!el.querySelectorAll("[selected]").length) {
          rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
        }

        // Support: iOS <=7 - 8 only
        if (!el.querySelectorAll("[id~=" + expando + "-]").length) {
          rbuggyQSA.push("~=");
        }

        // Support: iOS 8 only
        // https://bugs.webkit.org/show_bug.cgi?id=136851
        // In-page `selector#id sibling-combinator selector` fails
        if (!el.querySelectorAll("a#" + expando + "+*").length) {
          rbuggyQSA.push(".#.+[+~]");
        }

        // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+
        // In some of the document kinds, these selectors wouldn't work natively.
        // This is probably OK but for backwards compatibility we want to maintain
        // handling them through jQuery traversal in jQuery 3.x.
        if (!el.querySelectorAll(":checked").length) {
          rbuggyQSA.push(":checked");
        }

        // Support: Windows 8 Native Apps
        // The type and name attributes are restricted during .innerHTML assignment
        input = document.createElement("input");
        input.setAttribute("type", "hidden");
        el.appendChild(input).setAttribute("name", "D");

        // Support: IE 9 - 11+
        // IE's :disabled selector does not pick up the children of disabled fieldsets
        // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+
        // In some of the document kinds, these selectors wouldn't work natively.
        // This is probably OK but for backwards compatibility we want to maintain
        // handling them through jQuery traversal in jQuery 3.x.
        documentElement.appendChild(el).disabled = true;
        if (el.querySelectorAll(":disabled").length !== 2) {
          rbuggyQSA.push(":enabled", ":disabled");
        }

        // Support: IE 11+, Edge 15 - 18+
        // IE 11/Edge don't find elements on a `[name='']` query in some cases.
        // Adding a temporary attribute to the document before the selection works
        // around the issue.
        // Interestingly, IE 10 & older don't seem to have the issue.
        input = document.createElement("input");
        input.setAttribute("name", "");
        el.appendChild(input);
        if (!el.querySelectorAll("[name='']").length) {
          rbuggyQSA.push("\\[" + whitespace + "*name" + whitespace + "*=" + whitespace + "*(?:''|\"\")");
        }
      });
      if (!support.cssHas) {
        // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
        // Our regular `try-catch` mechanism fails to detect natively-unsupported
        // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`)
        // in browsers that parse the `:has()` argument as a forgiving selector list.
        // https://drafts.csswg.org/selectors/#relational now requires the argument
        // to be parsed unforgivingly, but browsers have not yet fully adjusted.
        rbuggyQSA.push(":has");
      }
      rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));

      /* Sorting
      ---------------------------------------------------------------------- */

      // Document order sorting
      sortOrder = function (a, b) {
        // Flag for duplicate removal
        if (a === b) {
          hasDuplicate = true;
          return 0;
        }

        // Sort on method existence if only one input has compareDocumentPosition
        var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
        if (compare) {
          return compare;
        }

        // Calculate position if both inputs belong to the same document
        // Support: IE 11+, Edge 17 - 18+
        // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
        // two documents; shallow comparisons work.
        // eslint-disable-next-line eqeqeq
        compare = (a.ownerDocument || a) == (b.ownerDocument || b) ? a.compareDocumentPosition(b) :
        // Otherwise we know they are disconnected
        1;

        // Disconnected nodes
        if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {
          // Choose the first element that is related to our preferred document
          // Support: IE 11+, Edge 17 - 18+
          // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
          // two documents; shallow comparisons work.
          // eslint-disable-next-line eqeqeq
          if (a === document || a.ownerDocument == preferredDoc && find.contains(preferredDoc, a)) {
            return -1;
          }

          // Support: IE 11+, Edge 17 - 18+
          // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
          // two documents; shallow comparisons work.
          // eslint-disable-next-line eqeqeq
          if (b === document || b.ownerDocument == preferredDoc && find.contains(preferredDoc, b)) {
            return 1;
          }

          // Maintain original order
          return sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0;
        }
        return compare & 4 ? -1 : 1;
      };
      return document;
    }
    find.matches = function (expr, elements) {
      return find(expr, null, null, elements);
    };
    find.matchesSelector = function (elem, expr) {
      setDocument(elem);
      if (documentIsHTML && !nonnativeSelectorCache[expr + " "] && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
        try {
          var ret = matches.call(elem, expr);

          // IE 9's matchesSelector returns false on disconnected nodes
          if (ret || support.disconnectedMatch ||
          // As well, disconnected nodes are said to be in a document
          // fragment in IE 9
          elem.document && elem.document.nodeType !== 11) {
            return ret;
          }
        } catch (e) {
          nonnativeSelectorCache(expr, true);
        }
      }
      return find(expr, document, null, [elem]).length > 0;
    };
    find.contains = function (context, elem) {
      // Set document vars if needed
      // Support: IE 11+, Edge 17 - 18+
      // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
      // two documents; shallow comparisons work.
      // eslint-disable-next-line eqeqeq
      if ((context.ownerDocument || context) != document) {
        setDocument(context);
      }
      return jQuery.contains(context, elem);
    };
    find.attr = function (elem, name) {
      // Set document vars if needed
      // Support: IE 11+, Edge 17 - 18+
      // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
      // two documents; shallow comparisons work.
      // eslint-disable-next-line eqeqeq
      if ((elem.ownerDocument || elem) != document) {
        setDocument(elem);
      }
      var fn = Expr.attrHandle[name.toLowerCase()],
        // Don't get fooled by Object.prototype properties (see trac-13807)
        val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : undefined;
      if (val !== undefined) {
        return val;
      }
      return elem.getAttribute(name);
    };
    find.error = function (msg) {
      throw new Error("Syntax error, unrecognized expression: " + msg);
    };

    /**
     * Document sorting and removing duplicates
     * @param {ArrayLike} results
     */
    jQuery.uniqueSort = function (results) {
      var elem,
        duplicates = [],
        j = 0,
        i = 0;

      // Unless we *know* we can detect duplicates, assume their presence
      //
      // Support: Android <=4.0+
      // Testing for detecting duplicates is unpredictable so instead assume we can't
      // depend on duplicate detection in all browsers without a stable sort.
      hasDuplicate = !support.sortStable;
      sortInput = !support.sortStable && slice.call(results, 0);
      sort.call(results, sortOrder);
      if (hasDuplicate) {
        while (elem = results[i++]) {
          if (elem === results[i]) {
            j = duplicates.push(i);
          }
        }
        while (j--) {
          splice.call(results, duplicates[j], 1);
        }
      }

      // Clear input after sorting to release objects
      // See https://github.com/jquery/sizzle/pull/225
      sortInput = null;
      return results;
    };
    jQuery.fn.uniqueSort = function () {
      return this.pushStack(jQuery.uniqueSort(slice.apply(this)));
    };
    Expr = jQuery.expr = {
      // Can be adjusted by the user
      cacheLength: 50,
      createPseudo: markFunction,
      match: matchExpr,
      attrHandle: {},
      find: {},
      relative: {
        ">": {
          dir: "parentNode",
          first: true
        },
        " ": {
          dir: "parentNode"
        },
        "+": {
          dir: "previousSibling",
          first: true
        },
        "~": {
          dir: "previousSibling"
        }
      },
      preFilter: {
        ATTR: function (match) {
          match[1] = match[1].replace(runescape, funescape);

          // Move the given value to match[3] whether quoted or unquoted
          match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape);
          if (match[2] === "~=") {
            match[3] = " " + match[3] + " ";
          }
          return match.slice(0, 4);
        },
        CHILD: function (match) {
          /* matches from matchExpr["CHILD"]
          	1 type (only|nth|...)
          	2 what (child|of-type)
          	3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
          	4 xn-component of xn+y argument ([+-]?\d*n|)
          	5 sign of xn-component
          	6 x of xn-component
          	7 sign of y-component
          	8 y of y-component
          */
          match[1] = match[1].toLowerCase();
          if (match[1].slice(0, 3) === "nth") {
            // nth-* requires argument
            if (!match[3]) {
              find.error(match[0]);
            }

            // numeric x and y parameters for Expr.filter.CHILD
            // remember that false/true cast respectively to 0/1
            match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
            match[5] = +(match[7] + match[8] || match[3] === "odd");

            // other types prohibit arguments
          } else if (match[3]) {
            find.error(match[0]);
          }
          return match;
        },
        PSEUDO: function (match) {
          var excess,
            unquoted = !match[6] && match[2];
          if (matchExpr.CHILD.test(match[0])) {
            return null;
          }

          // Accept quoted arguments as-is
          if (match[3]) {
            match[2] = match[4] || match[5] || "";

            // Strip excess characters from unquoted arguments
          } else if (unquoted && rpseudo.test(unquoted) && (
          // Get excess from tokenize (recursively)
          excess = tokenize(unquoted, true)) && (
          // advance to the next closing parenthesis
          excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
            // excess is a negative index
            match[0] = match[0].slice(0, excess);
            match[2] = unquoted.slice(0, excess);
          }

          // Return only captures needed by the pseudo filter method (type and argument)
          return match.slice(0, 3);
        }
      },
      filter: {
        TAG: function (nodeNameSelector) {
          var expectedNodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
          return nodeNameSelector === "*" ? function () {
            return true;
          } : function (elem) {
            return nodeName(elem, expectedNodeName);
          };
        },
        CLASS: function (className) {
          var pattern = classCache[className + " "];
          return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function (elem) {
            return pattern.test(typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "");
          });
        },
        ATTR: function (name, operator, check) {
          return function (elem) {
            var result = find.attr(elem, name);
            if (result == null) {
              return operator === "!=";
            }
            if (!operator) {
              return true;
            }
            result += "";
            if (operator === "=") {
              return result === check;
            }
            if (operator === "!=") {
              return result !== check;
            }
            if (operator === "^=") {
              return check && result.indexOf(check) === 0;
            }
            if (operator === "*=") {
              return check && result.indexOf(check) > -1;
            }
            if (operator === "$=") {
              return check && result.slice(-check.length) === check;
            }
            if (operator === "~=") {
              return (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1;
            }
            if (operator === "|=") {
              return result === check || result.slice(0, check.length + 1) === check + "-";
            }
            return false;
          };
        },
        CHILD: function (type, what, _argument, first, last) {
          var simple = type.slice(0, 3) !== "nth",
            forward = type.slice(-4) !== "last",
            ofType = what === "of-type";
          return first === 1 && last === 0 ?
          // Shortcut for :nth-*(n)
          function (elem) {
            return !!elem.parentNode;
          } : function (elem, _context, xml) {
            var cache,
              outerCache,
              node,
              nodeIndex,
              start,
              dir = simple !== forward ? "nextSibling" : "previousSibling",
              parent = elem.parentNode,
              name = ofType && elem.nodeName.toLowerCase(),
              useCache = !xml && !ofType,
              diff = false;
            if (parent) {
              // :(first|last|only)-(child|of-type)
              if (simple) {
                while (dir) {
                  node = elem;
                  while (node = node[dir]) {
                    if (ofType ? nodeName(node, name) : node.nodeType === 1) {
                      return false;
                    }
                  }

                  // Reverse direction for :only-* (if we haven't yet done so)
                  start = dir = type === "only" && !start && "nextSibling";
                }
                return true;
              }
              start = [forward ? parent.firstChild : parent.lastChild];

              // non-xml :nth-child(...) stores cache data on `parent`
              if (forward && useCache) {
                // Seek `elem` from a previously-cached index
                outerCache = parent[expando] || (parent[expando] = {});
                cache = outerCache[type] || [];
                nodeIndex = cache[0] === dirruns && cache[1];
                diff = nodeIndex && cache[2];
                node = nodeIndex && parent.childNodes[nodeIndex];
                while (node = ++nodeIndex && node && node[dir] || (
                // Fallback to seeking `elem` from the start
                diff = nodeIndex = 0) || start.pop()) {
                  // When found, cache indexes on `parent` and break
                  if (node.nodeType === 1 && ++diff && node === elem) {
                    outerCache[type] = [dirruns, nodeIndex, diff];
                    break;
                  }
                }
              } else {
                // Use previously-cached element index if available
                if (useCache) {
                  outerCache = elem[expando] || (elem[expando] = {});
                  cache = outerCache[type] || [];
                  nodeIndex = cache[0] === dirruns && cache[1];
                  diff = nodeIndex;
                }

                // xml :nth-child(...)
                // or :nth-last-child(...) or :nth(-last)?-of-type(...)
                if (diff === false) {
                  // Use the same loop as above to seek `elem` from the start
                  while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {
                    if ((ofType ? nodeName(node, name) : node.nodeType === 1) && ++diff) {
                      // Cache the index of each encountered element
                      if (useCache) {
                        outerCache = node[expando] || (node[expando] = {});
                        outerCache[type] = [dirruns, diff];
                      }
                      if (node === elem) {
                        break;
                      }
                    }
                  }
                }
              }

              // Incorporate the offset, then check against cycle size
              diff -= last;
              return diff === first || diff % first === 0 && diff / first >= 0;
            }
          };
        },
        PSEUDO: function (pseudo, argument) {
          // pseudo-class names are case-insensitive
          // https://www.w3.org/TR/selectors/#pseudo-classes
          // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
          // Remember that setFilters inherits from pseudos
          var args,
            fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || find.error("unsupported pseudo: " + pseudo);

          // The user may use createPseudo to indicate that
          // arguments are needed to create the filter function
          // just as jQuery does
          if (fn[expando]) {
            return fn(argument);
          }

          // But maintain support for old signatures
          if (fn.length > 1) {
            args = [pseudo, pseudo, "", argument];
            return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function (seed, matches) {
              var idx,
                matched = fn(seed, argument),
                i = matched.length;
              while (i--) {
                idx = indexOf.call(seed, matched[i]);
                seed[idx] = !(matches[idx] = matched[i]);
              }
            }) : function (elem) {
              return fn(elem, 0, args);
            };
          }
          return fn;
        }
      },
      pseudos: {
        // Potentially complex pseudos
        not: markFunction(function (selector) {
          // Trim the selector passed to compile
          // to avoid treating leading and trailing
          // spaces as combinators
          var input = [],
            results = [],
            matcher = compile(selector.replace(rtrimCSS, "$1"));
          return matcher[expando] ? markFunction(function (seed, matches, _context, xml) {
            var elem,
              unmatched = matcher(seed, null, xml, []),
              i = seed.length;

            // Match elements unmatched by `matcher`
            while (i--) {
              if (elem = unmatched[i]) {
                seed[i] = !(matches[i] = elem);
              }
            }
          }) : function (elem, _context, xml) {
            input[0] = elem;
            matcher(input, null, xml, results);

            // Don't keep the element
            // (see https://github.com/jquery/sizzle/issues/299)
            input[0] = null;
            return !results.pop();
          };
        }),
        has: markFunction(function (selector) {
          return function (elem) {
            return find(selector, elem).length > 0;
          };
        }),
        contains: markFunction(function (text) {
          text = text.replace(runescape, funescape);
          return function (elem) {
            return (elem.textContent || jQuery.text(elem)).indexOf(text) > -1;
          };
        }),
        // "Whether an element is represented by a :lang() selector
        // is based solely on the element's language value
        // being equal to the identifier C,
        // or beginning with the identifier C immediately followed by "-".
        // The matching of C against the element's language value is performed case-insensitively.
        // The identifier C does not have to be a valid language name."
        // https://www.w3.org/TR/selectors/#lang-pseudo
        lang: markFunction(function (lang) {
          // lang value must be a valid identifier
          if (!ridentifier.test(lang || "")) {
            find.error("unsupported lang: " + lang);
          }
          lang = lang.replace(runescape, funescape).toLowerCase();
          return function (elem) {
            var elemLang;
            do {
              if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) {
                elemLang = elemLang.toLowerCase();
                return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
              }
            } while ((elem = elem.parentNode) && elem.nodeType === 1);
            return false;
          };
        }),
        // Miscellaneous
        target: function (elem) {
          var hash = window.location && window.location.hash;
          return hash && hash.slice(1) === elem.id;
        },
        root: function (elem) {
          return elem === documentElement;
        },
        focus: function (elem) {
          return elem === safeActiveElement() && document.hasFocus() && !!(elem.type || elem.href || ~elem.tabIndex);
        },
        // Boolean properties
        enabled: createDisabledPseudo(false),
        disabled: createDisabledPseudo(true),
        checked: function (elem) {
          // In CSS3, :checked should return both checked and selected elements
          // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
          return nodeName(elem, "input") && !!elem.checked || nodeName(elem, "option") && !!elem.selected;
        },
        selected: function (elem) {
          // Support: IE <=11+
          // Accessing the selectedIndex property
          // forces the browser to treat the default option as
          // selected when in an optgroup.
          if (elem.parentNode) {
            // eslint-disable-next-line no-unused-expressions
            elem.parentNode.selectedIndex;
          }
          return elem.selected === true;
        },
        // Contents
        empty: function (elem) {
          // https://www.w3.org/TR/selectors/#empty-pseudo
          // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
          //   but not by others (comment: 8; processing instruction: 7; etc.)
          // nodeType < 6 works because attributes (2) do not appear as children
          for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
            if (elem.nodeType < 6) {
              return false;
            }
          }
          return true;
        },
        parent: function (elem) {
          return !Expr.pseudos.empty(elem);
        },
        // Element/input types
        header: function (elem) {
          return rheader.test(elem.nodeName);
        },
        input: function (elem) {
          return rinputs.test(elem.nodeName);
        },
        button: function (elem) {
          return nodeName(elem, "input") && elem.type === "button" || nodeName(elem, "button");
        },
        text: function (elem) {
          var attr;
          return nodeName(elem, "input") && elem.type === "text" && (
          // Support: IE <10 only
          // New HTML5 attribute values (e.g., "search") appear
          // with elem.type === "text"
          (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text");
        },
        // Position-in-collection
        first: createPositionalPseudo(function () {
          return [0];
        }),
        last: createPositionalPseudo(function (_matchIndexes, length) {
          return [length - 1];
        }),
        eq: createPositionalPseudo(function (_matchIndexes, length, argument) {
          return [argument < 0 ? argument + length : argument];
        }),
        even: createPositionalPseudo(function (matchIndexes, length) {
          var i = 0;
          for (; i < length; i += 2) {
            matchIndexes.push(i);
          }
          return matchIndexes;
        }),
        odd: createPositionalPseudo(function (matchIndexes, length) {
          var i = 1;
          for (; i < length; i += 2) {
            matchIndexes.push(i);
          }
          return matchIndexes;
        }),
        lt: createPositionalPseudo(function (matchIndexes, length, argument) {
          var i;
          if (argument < 0) {
            i = argument + length;
          } else if (argument > length) {
            i = length;
          } else {
            i = argument;
          }
          for (; --i >= 0;) {
            matchIndexes.push(i);
          }
          return matchIndexes;
        }),
        gt: createPositionalPseudo(function (matchIndexes, length, argument) {
          var i = argument < 0 ? argument + length : argument;
          for (; ++i < length;) {
            matchIndexes.push(i);
          }
          return matchIndexes;
        })
      }
    };
    Expr.pseudos.nth = Expr.pseudos.eq;

    // Add button/input type pseudos
    for (i in {
      radio: true,
      checkbox: true,
      file: true,
      password: true,
      image: true
    }) {
      Expr.pseudos[i] = createInputPseudo(i);
    }
    for (i in {
      submit: true,
      reset: true
    }) {
      Expr.pseudos[i] = createButtonPseudo(i);
    }

    // Easy API for creating new setFilters
    function setFilters() {}
    setFilters.prototype = Expr.filters = Expr.pseudos;
    Expr.setFilters = new setFilters();
    function tokenize(selector, parseOnly) {
      var matched,
        match,
        tokens,
        type,
        soFar,
        groups,
        preFilters,
        cached = tokenCache[selector + " "];
      if (cached) {
        return parseOnly ? 0 : cached.slice(0);
      }
      soFar = selector;
      groups = [];
      preFilters = Expr.preFilter;
      while (soFar) {
        // Comma and first run
        if (!matched || (match = rcomma.exec(soFar))) {
          if (match) {
            // Don't consume trailing commas as valid
            soFar = soFar.slice(match[0].length) || soFar;
          }
          groups.push(tokens = []);
        }
        matched = false;

        // Combinators
        if (match = rleadingCombinator.exec(soFar)) {
          matched = match.shift();
          tokens.push({
            value: matched,
            // Cast descendant combinators to space
            type: match[0].replace(rtrimCSS, " ")
          });
          soFar = soFar.slice(matched.length);
        }

        // Filters
        for (type in Expr.filter) {
          if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {
            matched = match.shift();
            tokens.push({
              value: matched,
              type: type,
              matches: match
            });
            soFar = soFar.slice(matched.length);
          }
        }
        if (!matched) {
          break;
        }
      }

      // Return the length of the invalid excess
      // if we're just parsing
      // Otherwise, throw an error or return tokens
      if (parseOnly) {
        return soFar.length;
      }
      return soFar ? find.error(selector) :
      // Cache the tokens
      tokenCache(selector, groups).slice(0);
    }
    function toSelector(tokens) {
      var i = 0,
        len = tokens.length,
        selector = "";
      for (; i < len; i++) {
        selector += tokens[i].value;
      }
      return selector;
    }
    function addCombinator(matcher, combinator, base) {
      var dir = combinator.dir,
        skip = combinator.next,
        key = skip || dir,
        checkNonElements = base && key === "parentNode",
        doneName = done++;
      return combinator.first ?
      // Check against closest ancestor/preceding element
      function (elem, context, xml) {
        while (elem = elem[dir]) {
          if (elem.nodeType === 1 || checkNonElements) {
            return matcher(elem, context, xml);
          }
        }
        return false;
      } :
      // Check against all ancestor/preceding elements
      function (elem, context, xml) {
        var oldCache,
          outerCache,
          newCache = [dirruns, doneName];

        // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
        if (xml) {
          while (elem = elem[dir]) {
            if (elem.nodeType === 1 || checkNonElements) {
              if (matcher(elem, context, xml)) {
                return true;
              }
            }
          }
        } else {
          while (elem = elem[dir]) {
            if (elem.nodeType === 1 || checkNonElements) {
              outerCache = elem[expando] || (elem[expando] = {});
              if (skip && nodeName(elem, skip)) {
                elem = elem[dir] || elem;
              } else if ((oldCache = outerCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
                // Assign to newCache so results back-propagate to previous elements
                return newCache[2] = oldCache[2];
              } else {
                // Reuse newcache so results back-propagate to previous elements
                outerCache[key] = newCache;

                // A match means we're done; a fail means we have to keep checking
                if (newCache[2] = matcher(elem, context, xml)) {
                  return true;
                }
              }
            }
          }
        }
        return false;
      };
    }
    function elementMatcher(matchers) {
      return matchers.length > 1 ? function (elem, context, xml) {
        var i = matchers.length;
        while (i--) {
          if (!matchers[i](elem, context, xml)) {
            return false;
          }
        }
        return true;
      } : matchers[0];
    }
    function multipleContexts(selector, contexts, results) {
      var i = 0,
        len = contexts.length;
      for (; i < len; i++) {
        find(selector, contexts[i], results);
      }
      return results;
    }
    function condense(unmatched, map, filter, context, xml) {
      var elem,
        newUnmatched = [],
        i = 0,
        len = unmatched.length,
        mapped = map != null;
      for (; i < len; i++) {
        if (elem = unmatched[i]) {
          if (!filter || filter(elem, context, xml)) {
            newUnmatched.push(elem);
            if (mapped) {
              map.push(i);
            }
          }
        }
      }
      return newUnmatched;
    }
    function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
      if (postFilter && !postFilter[expando]) {
        postFilter = setMatcher(postFilter);
      }
      if (postFinder && !postFinder[expando]) {
        postFinder = setMatcher(postFinder, postSelector);
      }
      return markFunction(function (seed, results, context, xml) {
        var temp,
          i,
          elem,
          matcherOut,
          preMap = [],
          postMap = [],
          preexisting = results.length,
          // Get initial elements from seed or context
          elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []),
          // Prefilter to get matcher input, preserving a map for seed-results synchronization
          matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems;
        if (matcher) {
          // If we have a postFinder, or filtered seed, or non-seed postFilter
          // or preexisting results,
          matcherOut = postFinder || (seed ? preFilter : preexisting || postFilter) ?
          // ...intermediate processing is necessary
          [] :
          // ...otherwise use results directly
          results;

          // Find primary matches
          matcher(matcherIn, matcherOut, context, xml);
        } else {
          matcherOut = matcherIn;
        }

        // Apply postFilter
        if (postFilter) {
          temp = condense(matcherOut, postMap);
          postFilter(temp, [], context, xml);

          // Un-match failing elements by moving them back to matcherIn
          i = temp.length;
          while (i--) {
            if (elem = temp[i]) {
              matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);
            }
          }
        }
        if (seed) {
          if (postFinder || preFilter) {
            if (postFinder) {
              // Get the final matcherOut by condensing this intermediate into postFinder contexts
              temp = [];
              i = matcherOut.length;
              while (i--) {
                if (elem = matcherOut[i]) {
                  // Restore matcherIn since elem is not yet a final match
                  temp.push(matcherIn[i] = elem);
                }
              }
              postFinder(null, matcherOut = [], temp, xml);
            }

            // Move matched elements from seed to results to keep them synchronized
            i = matcherOut.length;
            while (i--) {
              if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i]) > -1) {
                seed[temp] = !(results[temp] = elem);
              }
            }
          }

          // Add elements to results, through postFinder if defined
        } else {
          matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut);
          if (postFinder) {
            postFinder(null, results, matcherOut, xml);
          } else {
            push.apply(results, matcherOut);
          }
        }
      });
    }
    function matcherFromTokens(tokens) {
      var checkContext,
        matcher,
        j,
        len = tokens.length,
        leadingRelative = Expr.relative[tokens[0].type],
        implicitRelative = leadingRelative || Expr.relative[" "],
        i = leadingRelative ? 1 : 0,
        // The foundational matcher ensures that elements are reachable from top-level context(s)
        matchContext = addCombinator(function (elem) {
          return elem === checkContext;
        }, implicitRelative, true),
        matchAnyContext = addCombinator(function (elem) {
          return indexOf.call(checkContext, elem) > -1;
        }, implicitRelative, true),
        matchers = [function (elem, context, xml) {
          // Support: IE 11+, Edge 17 - 18+
          // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
          // two documents; shallow comparisons work.
          // eslint-disable-next-line eqeqeq
          var ret = !leadingRelative && (xml || context != outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));

          // Avoid hanging onto element
          // (see https://github.com/jquery/sizzle/issues/299)
          checkContext = null;
          return ret;
        }];
      for (; i < len; i++) {
        if (matcher = Expr.relative[tokens[i].type]) {
          matchers = [addCombinator(elementMatcher(matchers), matcher)];
        } else {
          matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches);

          // Return special upon seeing a positional matcher
          if (matcher[expando]) {
            // Find the next relative operator (if any) for proper handling
            j = ++i;
            for (; j < len; j++) {
              if (Expr.relative[tokens[j].type]) {
                break;
              }
            }
            return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector(
            // If the preceding token was a descendant combinator, insert an implicit any-element `*`
            tokens.slice(0, i - 1).concat({
              value: tokens[i - 2].type === " " ? "*" : ""
            })).replace(rtrimCSS, "$1"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens));
          }
          matchers.push(matcher);
        }
      }
      return elementMatcher(matchers);
    }
    function matcherFromGroupMatchers(elementMatchers, setMatchers) {
      var bySet = setMatchers.length > 0,
        byElement = elementMatchers.length > 0,
        superMatcher = function (seed, context, xml, results, outermost) {
          var elem,
            j,
            matcher,
            matchedCount = 0,
            i = "0",
            unmatched = seed && [],
            setMatched = [],
            contextBackup = outermostContext,
            // We must always have either seed elements or outermost context
            elems = seed || byElement && Expr.find.TAG("*", outermost),
            // Use integer dirruns iff this is the outermost matcher
            dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1,
            len = elems.length;
          if (outermost) {
            // Support: IE 11+, Edge 17 - 18+
            // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
            // two documents; shallow comparisons work.
            // eslint-disable-next-line eqeqeq
            outermostContext = context == document || context || outermost;
          }

          // Add elements passing elementMatchers directly to results
          // Support: iOS <=7 - 9 only
          // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching
          // elements by id. (see trac-14142)
          for (; i !== len && (elem = elems[i]) != null; i++) {
            if (byElement && elem) {
              j = 0;

              // Support: IE 11+, Edge 17 - 18+
              // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
              // two documents; shallow comparisons work.
              // eslint-disable-next-line eqeqeq
              if (!context && elem.ownerDocument != document) {
                setDocument(elem);
                xml = !documentIsHTML;
              }
              while (matcher = elementMatchers[j++]) {
                if (matcher(elem, context || document, xml)) {
                  push.call(results, elem);
                  break;
                }
              }
              if (outermost) {
                dirruns = dirrunsUnique;
              }
            }

            // Track unmatched elements for set filters
            if (bySet) {
              // They will have gone through all possible matchers
              if (elem = !matcher && elem) {
                matchedCount--;
              }

              // Lengthen the array for every element, matched or not
              if (seed) {
                unmatched.push(elem);
              }
            }
          }

          // `i` is now the count of elements visited above, and adding it to `matchedCount`
          // makes the latter nonnegative.
          matchedCount += i;

          // Apply set filters to unmatched elements
          // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
          // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
          // no element matchers and no seed.
          // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
          // case, which will result in a "00" `matchedCount` that differs from `i` but is also
          // numerically zero.
          if (bySet && i !== matchedCount) {
            j = 0;
            while (matcher = setMatchers[j++]) {
              matcher(unmatched, setMatched, context, xml);
            }
            if (seed) {
              // Reintegrate element matches to eliminate the need for sorting
              if (matchedCount > 0) {
                while (i--) {
                  if (!(unmatched[i] || setMatched[i])) {
                    setMatched[i] = pop.call(results);
                  }
                }
              }

              // Discard index placeholder values to get only actual matches
              setMatched = condense(setMatched);
            }

            // Add matches to results
            push.apply(results, setMatched);

            // Seedless set matches succeeding multiple successful matchers stipulate sorting
            if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
              jQuery.uniqueSort(results);
            }
          }

          // Override manipulation of globals by nested matchers
          if (outermost) {
            dirruns = dirrunsUnique;
            outermostContext = contextBackup;
          }
          return unmatched;
        };
      return bySet ? markFunction(superMatcher) : superMatcher;
    }
    function compile(selector, match /* Internal Use Only */) {
      var i,
        setMatchers = [],
        elementMatchers = [],
        cached = compilerCache[selector + " "];
      if (!cached) {
        // Generate a function of recursive functions that can be used to check each element
        if (!match) {
          match = tokenize(selector);
        }
        i = match.length;
        while (i--) {
          cached = matcherFromTokens(match[i]);
          if (cached[expando]) {
            setMatchers.push(cached);
          } else {
            elementMatchers.push(cached);
          }
        }

        // Cache the compiled function
        cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));

        // Save selector and tokenization
        cached.selector = selector;
      }
      return cached;
    }

    /**
     * A low-level selection function that works with jQuery's compiled
     *  selector functions
     * @param {String|Function} selector A selector or a pre-compiled
     *  selector function built with jQuery selector compile
     * @param {Element} context
     * @param {Array} [results]
     * @param {Array} [seed] A set of elements to match against
     */
    function select(selector, context, results, seed) {
      var i,
        tokens,
        token,
        type,
        find,
        compiled = typeof selector === "function" && selector,
        match = !seed && tokenize(selector = compiled.selector || selector);
      results = results || [];

      // Try to minimize operations if there is only one selector in the list and no seed
      // (the latter of which guarantees us context)
      if (match.length === 1) {
        // Reduce context if the leading compound selector is an ID
        tokens = match[0] = match[0].slice(0);
        if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {
          context = (Expr.find.ID(token.matches[0].replace(runescape, funescape), context) || [])[0];
          if (!context) {
            return results;

            // Precompiled matchers will still verify ancestry, so step up a level
          } else if (compiled) {
            context = context.parentNode;
          }
          selector = selector.slice(tokens.shift().value.length);
        }

        // Fetch a seed set for right-to-left matching
        i = matchExpr.needsContext.test(selector) ? 0 : tokens.length;
        while (i--) {
          token = tokens[i];

          // Abort if we hit a combinator
          if (Expr.relative[type = token.type]) {
            break;
          }
          if (find = Expr.find[type]) {
            // Search, expanding context for leading sibling combinators
            if (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(context.parentNode) || context)) {
              // If seed is empty or no tokens remain, we can return early
              tokens.splice(i, 1);
              selector = seed.length && toSelector(tokens);
              if (!selector) {
                push.apply(results, seed);
                return results;
              }
              break;
            }
          }
        }
      }

      // Compile and execute a filtering function if one is not provided
      // Provide `match` to avoid retokenization if we modified the selector above
      (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, !context || rsibling.test(selector) && testContext(context.parentNode) || context);
      return results;
    }

    // One-time assignments

    // Support: Android <=4.0 - 4.1+
    // Sort stability
    support.sortStable = expando.split("").sort(sortOrder).join("") === expando;

    // Initialize against the default document
    setDocument();

    // Support: Android <=4.0 - 4.1+
    // Detached nodes confoundingly follow *each other*
    support.sortDetached = assert(function (el) {
      // Should return 1, but returns 4 (following)
      return el.compareDocumentPosition(document.createElement("fieldset")) & 1;
    });
    jQuery.find = find;

    // Deprecated
    jQuery.expr[":"] = jQuery.expr.pseudos;
    jQuery.unique = jQuery.uniqueSort;

    // These have always been private, but they used to be documented as part of
    // Sizzle so let's maintain them for now for backwards compatibility purposes.
    find.compile = compile;
    find.select = select;
    find.setDocument = setDocument;
    find.tokenize = tokenize;
    find.escape = jQuery.escapeSelector;
    find.getText = jQuery.text;
    find.isXML = jQuery.isXMLDoc;
    find.selectors = jQuery.expr;
    find.support = jQuery.support;
    find.uniqueSort = jQuery.uniqueSort;

    /* eslint-enable */
  })();
  var dir = function (elem, dir, until) {
    var matched = [],
      truncate = until !== undefined;
    while ((elem = elem[dir]) && elem.nodeType !== 9) {
      if (elem.nodeType === 1) {
        if (truncate && jQuery(elem).is(until)) {
          break;
        }
        matched.push(elem);
      }
    }
    return matched;
  };
  var siblings = function (n, elem) {
    var matched = [];
    for (; n; n = n.nextSibling) {
      if (n.nodeType === 1 && n !== elem) {
        matched.push(n);
      }
    }
    return matched;
  };
  var rneedsContext = jQuery.expr.match.needsContext;
  var rsingleTag = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;

  // Implement the identical functionality for filter and not
  function winnow(elements, qualifier, not) {
    if (isFunction(qualifier)) {
      return jQuery.grep(elements, function (elem, i) {
        return !!qualifier.call(elem, i, elem) !== not;
      });
    }

    // Single element
    if (qualifier.nodeType) {
      return jQuery.grep(elements, function (elem) {
        return elem === qualifier !== not;
      });
    }

    // Arraylike of elements (jQuery, arguments, Array)
    if (typeof qualifier !== "string") {
      return jQuery.grep(elements, function (elem) {
        return indexOf.call(qualifier, elem) > -1 !== not;
      });
    }

    // Filtered directly for both simple and complex selectors
    return jQuery.filter(qualifier, elements, not);
  }
  jQuery.filter = function (expr, elems, not) {
    var elem = elems[0];
    if (not) {
      expr = ":not(" + expr + ")";
    }
    if (elems.length === 1 && elem.nodeType === 1) {
      return jQuery.find.matchesSelector(elem, expr) ? [elem] : [];
    }
    return jQuery.find.matches(expr, jQuery.grep(elems, function (elem) {
      return elem.nodeType === 1;
    }));
  };
  jQuery.fn.extend({
    find: function (selector) {
      var i,
        ret,
        len = this.length,
        self = this;
      if (typeof selector !== "string") {
        return this.pushStack(jQuery(selector).filter(function () {
          for (i = 0; i < len; i++) {
            if (jQuery.contains(self[i], this)) {
              return true;
            }
          }
        }));
      }
      ret = this.pushStack([]);
      for (i = 0; i < len; i++) {
        jQuery.find(selector, self[i], ret);
      }
      return len > 1 ? jQuery.uniqueSort(ret) : ret;
    },
    filter: function (selector) {
      return this.pushStack(winnow(this, selector || [], false));
    },
    not: function (selector) {
      return this.pushStack(winnow(this, selector || [], true));
    },
    is: function (selector) {
      return !!winnow(this,
      // If this is a positional/relative selector, check membership in the returned set
      // so $("p:first").is("p:last") won't return true for a doc with two "p".
      typeof selector === "string" && rneedsContext.test(selector) ? jQuery(selector) : selector || [], false).length;
    }
  });

  // Initialize a jQuery object

  // A central reference to the root jQuery(document)
  var rootjQuery,
    // A simple way to check for HTML strings
    // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
    // Strict HTML recognition (trac-11290: must start with <)
    // Shortcut simple #id case for speed
    rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
    init = jQuery.fn.init = function (selector, context, root) {
      var match, elem;

      // HANDLE: $(""), $(null), $(undefined), $(false)
      if (!selector) {
        return this;
      }

      // Method init() accepts an alternate rootjQuery
      // so migrate can support jQuery.sub (gh-2101)
      root = root || rootjQuery;

      // Handle HTML strings
      if (typeof selector === "string") {
        if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) {
          // Assume that strings that start and end with <> are HTML and skip the regex check
          match = [null, selector, null];
        } else {
          match = rquickExpr.exec(selector);
        }

        // Match html or make sure no context is specified for #id
        if (match && (match[1] || !context)) {
          // HANDLE: $(html) -> $(array)
          if (match[1]) {
            context = context instanceof jQuery ? context[0] : context;

            // Option to run scripts is true for back-compat
            // Intentionally let the error be thrown if parseHTML is not present
            jQuery.merge(this, jQuery.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : document, true));

            // HANDLE: $(html, props)
            if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
              for (match in context) {
                // Properties of context are called as methods if possible
                if (isFunction(this[match])) {
                  this[match](context[match]);

                  // ...and otherwise set as attributes
                } else {
                  this.attr(match, context[match]);
                }
              }
            }
            return this;

            // HANDLE: $(#id)
          } else {
            elem = document.getElementById(match[2]);
            if (elem) {
              // Inject the element directly into the jQuery object
              this[0] = elem;
              this.length = 1;
            }
            return this;
          }

          // HANDLE: $(expr, $(...))
        } else if (!context || context.jquery) {
          return (context || root).find(selector);

          // HANDLE: $(expr, context)
          // (which is just equivalent to: $(context).find(expr)
        } else {
          return this.constructor(context).find(selector);
        }

        // HANDLE: $(DOMElement)
      } else if (selector.nodeType) {
        this[0] = selector;
        this.length = 1;
        return this;

        // HANDLE: $(function)
        // Shortcut for document ready
      } else if (isFunction(selector)) {
        return root.ready !== undefined ? root.ready(selector) :
        // Execute immediately if ready is not present
        selector(jQuery);
      }
      return jQuery.makeArray(selector, this);
    };

  // Give the init function the jQuery prototype for later instantiation
  init.prototype = jQuery.fn;

  // Initialize central reference
  rootjQuery = jQuery(document);
  var rparentsprev = /^(?:parents|prev(?:Until|All))/,
    // Methods guaranteed to produce a unique set when starting from a unique set
    guaranteedUnique = {
      children: true,
      contents: true,
      next: true,
      prev: true
    };
  jQuery.fn.extend({
    has: function (target) {
      var targets = jQuery(target, this),
        l = targets.length;
      return this.filter(function () {
        var i = 0;
        for (; i < l; i++) {
          if (jQuery.contains(this, targets[i])) {
            return true;
          }
        }
      });
    },
    closest: function (selectors, context) {
      var cur,
        i = 0,
        l = this.length,
        matched = [],
        targets = typeof selectors !== "string" && jQuery(selectors);

      // Positional selectors never match, since there's no _selection_ context
      if (!rneedsContext.test(selectors)) {
        for (; i < l; i++) {
          for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {
            // Always skip document fragments
            if (cur.nodeType < 11 && (targets ? targets.index(cur) > -1 :
            // Don't pass non-elements to jQuery#find
            cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors))) {
              matched.push(cur);
              break;
            }
          }
        }
      }
      return this.pushStack(matched.length > 1 ? jQuery.uniqueSort(matched) : matched);
    },
    // Determine the position of an element within the set
    index: function (elem) {
      // No argument, return index in parent
      if (!elem) {
        return this[0] && this[0].parentNode ? this.first().prevAll().length : -1;
      }

      // Index in selector
      if (typeof elem === "string") {
        return indexOf.call(jQuery(elem), this[0]);
      }

      // Locate the position of the desired element
      return indexOf.call(this,
      // If it receives a jQuery object, the first element is used
      elem.jquery ? elem[0] : elem);
    },
    add: function (selector, context) {
      return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(), jQuery(selector, context))));
    },
    addBack: function (selector) {
      return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));
    }
  });
  function sibling(cur, dir) {
    while ((cur = cur[dir]) && cur.nodeType !== 1) {}
    return cur;
  }
  jQuery.each({
    parent: function (elem) {
      var parent = elem.parentNode;
      return parent && parent.nodeType !== 11 ? parent : null;
    },
    parents: function (elem) {
      return dir(elem, "parentNode");
    },
    parentsUntil: function (elem, _i, until) {
      return dir(elem, "parentNode", until);
    },
    next: function (elem) {
      return sibling(elem, "nextSibling");
    },
    prev: function (elem) {
      return sibling(elem, "previousSibling");
    },
    nextAll: function (elem) {
      return dir(elem, "nextSibling");
    },
    prevAll: function (elem) {
      return dir(elem, "previousSibling");
    },
    nextUntil: function (elem, _i, until) {
      return dir(elem, "nextSibling", until);
    },
    prevUntil: function (elem, _i, until) {
      return dir(elem, "previousSibling", until);
    },
    siblings: function (elem) {
      return siblings((elem.parentNode || {}).firstChild, elem);
    },
    children: function (elem) {
      return siblings(elem.firstChild);
    },
    contents: function (elem) {
      if (elem.contentDocument != null &&
      // Support: IE 11+
      // <object> elements with no `data` attribute has an object
      // `contentDocument` with a `null` prototype.
      getProto(elem.contentDocument)) {
        return elem.contentDocument;
      }

      // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
      // Treat the template element as a regular one in browsers that
      // don't support it.
      if (nodeName(elem, "template")) {
        elem = elem.content || elem;
      }
      return jQuery.merge([], elem.childNodes);
    }
  }, function (name, fn) {
    jQuery.fn[name] = function (until, selector) {
      var matched = jQuery.map(this, fn, until);
      if (name.slice(-5) !== "Until") {
        selector = until;
      }
      if (selector && typeof selector === "string") {
        matched = jQuery.filter(selector, matched);
      }
      if (this.length > 1) {
        // Remove duplicates
        if (!guaranteedUnique[name]) {
          jQuery.uniqueSort(matched);
        }

        // Reverse order for parents* and prev-derivatives
        if (rparentsprev.test(name)) {
          matched.reverse();
        }
      }
      return this.pushStack(matched);
    };
  });
  var rnothtmlwhite = /[^\x20\t\r\n\f]+/g;

  // Convert String-formatted options into Object-formatted ones
  function createOptions(options) {
    var object = {};
    jQuery.each(options.match(rnothtmlwhite) || [], function (_, flag) {
      object[flag] = true;
    });
    return object;
  }

  /*
   * Create a callback list using the following parameters:
   *
   *	options: an optional list of space-separated options that will change how
   *			the callback list behaves or a more traditional option object
   *
   * By default a callback list will act like an event callback list and can be
   * "fired" multiple times.
   *
   * Possible options:
   *
   *	once:			will ensure the callback list can only be fired once (like a Deferred)
   *
   *	memory:			will keep track of previous values and will call any callback added
   *					after the list has been fired right away with the latest "memorized"
   *					values (like a Deferred)
   *
   *	unique:			will ensure a callback can only be added once (no duplicate in the list)
   *
   *	stopOnFalse:	interrupt callings when a callback returns false
   *
   */
  jQuery.Callbacks = function (options) {
    // Convert options from String-formatted to Object-formatted if needed
    // (we check in cache first)
    options = typeof options === "string" ? createOptions(options) : jQuery.extend({}, options);
    var
      // Flag to know if list is currently firing
      firing,
      // Last fire value for non-forgettable lists
      memory,
      // Flag to know if list was already fired
      fired,
      // Flag to prevent firing
      locked,
      // Actual callback list
      list = [],
      // Queue of execution data for repeatable lists
      queue = [],
      // Index of currently firing callback (modified by add/remove as needed)
      firingIndex = -1,
      // Fire callbacks
      fire = function () {
        // Enforce single-firing
        locked = locked || options.once;

        // Execute callbacks for all pending executions,
        // respecting firingIndex overrides and runtime changes
        fired = firing = true;
        for (; queue.length; firingIndex = -1) {
          memory = queue.shift();
          while (++firingIndex < list.length) {
            // Run callback and check for early termination
            if (list[firingIndex].apply(memory[0], memory[1]) === false && options.stopOnFalse) {
              // Jump to end and forget the data so .add doesn't re-fire
              firingIndex = list.length;
              memory = false;
            }
          }
        }

        // Forget the data if we're done with it
        if (!options.memory) {
          memory = false;
        }
        firing = false;

        // Clean up if we're done firing for good
        if (locked) {
          // Keep an empty list if we have data for future add calls
          if (memory) {
            list = [];

            // Otherwise, this object is spent
          } else {
            list = "";
          }
        }
      },
      // Actual Callbacks object
      self = {
        // Add a callback or a collection of callbacks to the list
        add: function () {
          if (list) {
            // If we have memory from a past run, we should fire after adding
            if (memory && !firing) {
              firingIndex = list.length - 1;
              queue.push(memory);
            }
            (function add(args) {
              jQuery.each(args, function (_, arg) {
                if (isFunction(arg)) {
                  if (!options.unique || !self.has(arg)) {
                    list.push(arg);
                  }
                } else if (arg && arg.length && toType(arg) !== "string") {
                  // Inspect recursively
                  add(arg);
                }
              });
            })(arguments);
            if (memory && !firing) {
              fire();
            }
          }
          return this;
        },
        // Remove a callback from the list
        remove: function () {
          jQuery.each(arguments, function (_, arg) {
            var index;
            while ((index = jQuery.inArray(arg, list, index)) > -1) {
              list.splice(index, 1);

              // Handle firing indexes
              if (index <= firingIndex) {
                firingIndex--;
              }
            }
          });
          return this;
        },
        // Check if a given callback is in the list.
        // If no argument is given, return whether or not list has callbacks attached.
        has: function (fn) {
          return fn ? jQuery.inArray(fn, list) > -1 : list.length > 0;
        },
        // Remove all callbacks from the list
        empty: function () {
          if (list) {
            list = [];
          }
          return this;
        },
        // Disable .fire and .add
        // Abort any current/pending executions
        // Clear all callbacks and values
        disable: function () {
          locked = queue = [];
          list = memory = "";
          return this;
        },
        disabled: function () {
          return !list;
        },
        // Disable .fire
        // Also disable .add unless we have memory (since it would have no effect)
        // Abort any pending executions
        lock: function () {
          locked = queue = [];
          if (!memory && !firing) {
            list = memory = "";
          }
          return this;
        },
        locked: function () {
          return !!locked;
        },
        // Call all callbacks with the given context and arguments
        fireWith: function (context, args) {
          if (!locked) {
            args = args || [];
            args = [context, args.slice ? args.slice() : args];
            queue.push(args);
            if (!firing) {
              fire();
            }
          }
          return this;
        },
        // Call all the callbacks with the given arguments
        fire: function () {
          self.fireWith(this, arguments);
          return this;
        },
        // To know if the callbacks have already been called at least once
        fired: function () {
          return !!fired;
        }
      };
    return self;
  };
  function Identity(v) {
    return v;
  }
  function Thrower(ex) {
    throw ex;
  }
  function adoptValue(value, resolve, reject, noValue) {
    var method;
    try {
      // Check for promise aspect first to privilege synchronous behavior
      if (value && isFunction(method = value.promise)) {
        method.call(value).done(resolve).fail(reject);

        // Other thenables
      } else if (value && isFunction(method = value.then)) {
        method.call(value, resolve, reject);

        // Other non-thenables
      } else {
        // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
        // * false: [ value ].slice( 0 ) => resolve( value )
        // * true: [ value ].slice( 1 ) => resolve()
        resolve.apply(undefined, [value].slice(noValue));
      }

      // For Promises/A+, convert exceptions into rejections
      // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
      // Deferred#then to conditionally suppress rejection.
    } catch (value) {
      // Support: Android 4.0 only
      // Strict mode functions invoked without .call/.apply get global-object context
      reject.apply(undefined, [value]);
    }
  }
  jQuery.extend({
    Deferred: function (func) {
      var tuples = [
        // action, add listener, callbacks,
        // ... .then handlers, argument index, [final state]
        ["notify", "progress", jQuery.Callbacks("memory"), jQuery.Callbacks("memory"), 2], ["resolve", "done", jQuery.Callbacks("once memory"), jQuery.Callbacks("once memory"), 0, "resolved"], ["reject", "fail", jQuery.Callbacks("once memory"), jQuery.Callbacks("once memory"), 1, "rejected"]],
        state = "pending",
        promise = {
          state: function () {
            return state;
          },
          always: function () {
            deferred.done(arguments).fail(arguments);
            return this;
          },
          "catch": function (fn) {
            return promise.then(null, fn);
          },
          // Keep pipe for back-compat
          pipe: function /* fnDone, fnFail, fnProgress */
          () {
            var fns = arguments;
            return jQuery.Deferred(function (newDefer) {
              jQuery.each(tuples, function (_i, tuple) {
                // Map tuples (progress, done, fail) to arguments (done, fail, progress)
                var fn = isFunction(fns[tuple[4]]) && fns[tuple[4]];

                // deferred.progress(function() { bind to newDefer or newDefer.notify })
                // deferred.done(function() { bind to newDefer or newDefer.resolve })
                // deferred.fail(function() { bind to newDefer or newDefer.reject })
                deferred[tuple[1]](function () {
                  var returned = fn && fn.apply(this, arguments);
                  if (returned && isFunction(returned.promise)) {
                    returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);
                  } else {
                    newDefer[tuple[0] + "With"](this, fn ? [returned] : arguments);
                  }
                });
              });
              fns = null;
            }).promise();
          },
          then: function (onFulfilled, onRejected, onProgress) {
            var maxDepth = 0;
            function resolve(depth, deferred, handler, special) {
              return function () {
                var that = this,
                  args = arguments,
                  mightThrow = function () {
                    var returned, then;

                    // Support: Promises/A+ section 2.3.3.3.3
                    // https://promisesaplus.com/#point-59
                    // Ignore double-resolution attempts
                    if (depth < maxDepth) {
                      return;
                    }
                    returned = handler.apply(that, args);

                    // Support: Promises/A+ section 2.3.1
                    // https://promisesaplus.com/#point-48
                    if (returned === deferred.promise()) {
                      throw new TypeError("Thenable self-resolution");
                    }

                    // Support: Promises/A+ sections 2.3.3.1, 3.5
                    // https://promisesaplus.com/#point-54
                    // https://promisesaplus.com/#point-75
                    // Retrieve `then` only once
                    then = returned && (
                    // Support: Promises/A+ section 2.3.4
                    // https://promisesaplus.com/#point-64
                    // Only check objects and functions for thenability
                    typeof returned === "object" || typeof returned === "function") && returned.then;

                    // Handle a returned thenable
                    if (isFunction(then)) {
                      // Special processors (notify) just wait for resolution
                      if (special) {
                        then.call(returned, resolve(maxDepth, deferred, Identity, special), resolve(maxDepth, deferred, Thrower, special));

                        // Normal processors (resolve) also hook into progress
                      } else {
                        // ...and disregard older resolution values
                        maxDepth++;
                        then.call(returned, resolve(maxDepth, deferred, Identity, special), resolve(maxDepth, deferred, Thrower, special), resolve(maxDepth, deferred, Identity, deferred.notifyWith));
                      }

                      // Handle all other returned values
                    } else {
                      // Only substitute handlers pass on context
                      // and multiple values (non-spec behavior)
                      if (handler !== Identity) {
                        that = undefined;
                        args = [returned];
                      }

                      // Process the value(s)
                      // Default process is resolve
                      (special || deferred.resolveWith)(that, args);
                    }
                  },
                  // Only normal processors (resolve) catch and reject exceptions
                  process = special ? mightThrow : function () {
                    try {
                      mightThrow();
                    } catch (e) {
                      if (jQuery.Deferred.exceptionHook) {
                        jQuery.Deferred.exceptionHook(e, process.error);
                      }

                      // Support: Promises/A+ section 2.3.3.3.4.1
                      // https://promisesaplus.com/#point-61
                      // Ignore post-resolution exceptions
                      if (depth + 1 >= maxDepth) {
                        // Only substitute handlers pass on context
                        // and multiple values (non-spec behavior)
                        if (handler !== Thrower) {
                          that = undefined;
                          args = [e];
                        }
                        deferred.rejectWith(that, args);
                      }
                    }
                  };

                // Support: Promises/A+ section 2.3.3.3.1
                // https://promisesaplus.com/#point-57
                // Re-resolve promises immediately to dodge false rejection from
                // subsequent errors
                if (depth) {
                  process();
                } else {
                  // Call an optional hook to record the error, in case of exception
                  // since it's otherwise lost when execution goes async
                  if (jQuery.Deferred.getErrorHook) {
                    process.error = jQuery.Deferred.getErrorHook();

                    // The deprecated alias of the above. While the name suggests
                    // returning the stack, not an error instance, jQuery just passes
                    // it directly to `console.warn` so both will work; an instance
                    // just better cooperates with source maps.
                  } else if (jQuery.Deferred.getStackHook) {
                    process.error = jQuery.Deferred.getStackHook();
                  }
                  window.setTimeout(process);
                }
              };
            }
            return jQuery.Deferred(function (newDefer) {
              // progress_handlers.add( ... )
              tuples[0][3].add(resolve(0, newDefer, isFunction(onProgress) ? onProgress : Identity, newDefer.notifyWith));

              // fulfilled_handlers.add( ... )
              tuples[1][3].add(resolve(0, newDefer, isFunction(onFulfilled) ? onFulfilled : Identity));

              // rejected_handlers.add( ... )
              tuples[2][3].add(resolve(0, newDefer, isFunction(onRejected) ? onRejected : Thrower));
            }).promise();
          },
          // Get a promise for this deferred
          // If obj is provided, the promise aspect is added to the object
          promise: function (obj) {
            return obj != null ? jQuery.extend(obj, promise) : promise;
          }
        },
        deferred = {};

      // Add list-specific methods
      jQuery.each(tuples, function (i, tuple) {
        var list = tuple[2],
          stateString = tuple[5];

        // promise.progress = list.add
        // promise.done = list.add
        // promise.fail = list.add
        promise[tuple[1]] = list.add;

        // Handle state
        if (stateString) {
          list.add(function () {
            // state = "resolved" (i.e., fulfilled)
            // state = "rejected"
            state = stateString;
          },
          // rejected_callbacks.disable
          // fulfilled_callbacks.disable
          tuples[3 - i][2].disable,
          // rejected_handlers.disable
          // fulfilled_handlers.disable
          tuples[3 - i][3].disable,
          // progress_callbacks.lock
          tuples[0][2].lock,
          // progress_handlers.lock
          tuples[0][3].lock);
        }

        // progress_handlers.fire
        // fulfilled_handlers.fire
        // rejected_handlers.fire
        list.add(tuple[3].fire);

        // deferred.notify = function() { deferred.notifyWith(...) }
        // deferred.resolve = function() { deferred.resolveWith(...) }
        // deferred.reject = function() { deferred.rejectWith(...) }
        deferred[tuple[0]] = function () {
          deferred[tuple[0] + "With"](this === deferred ? undefined : this, arguments);
          return this;
        };

        // deferred.notifyWith = list.fireWith
        // deferred.resolveWith = list.fireWith
        // deferred.rejectWith = list.fireWith
        deferred[tuple[0] + "With"] = list.fireWith;
      });

      // Make the deferred a promise
      promise.promise(deferred);

      // Call given func if any
      if (func) {
        func.call(deferred, deferred);
      }

      // All done!
      return deferred;
    },
    // Deferred helper
    when: function (singleValue) {
      var
        // count of uncompleted subordinates
        remaining = arguments.length,
        // count of unprocessed arguments
        i = remaining,
        // subordinate fulfillment data
        resolveContexts = Array(i),
        resolveValues = slice.call(arguments),
        // the primary Deferred
        primary = jQuery.Deferred(),
        // subordinate callback factory
        updateFunc = function (i) {
          return function (value) {
            resolveContexts[i] = this;
            resolveValues[i] = arguments.length > 1 ? slice.call(arguments) : value;
            if (! --remaining) {
              primary.resolveWith(resolveContexts, resolveValues);
            }
          };
        };

      // Single- and empty arguments are adopted like Promise.resolve
      if (remaining <= 1) {
        adoptValue(singleValue, primary.done(updateFunc(i)).resolve, primary.reject, !remaining);

        // Use .then() to unwrap secondary thenables (cf. gh-3000)
        if (primary.state() === "pending" || isFunction(resolveValues[i] && resolveValues[i].then)) {
          return primary.then();
        }
      }

      // Multiple arguments are aggregated like Promise.all array elements
      while (i--) {
        adoptValue(resolveValues[i], updateFunc(i), primary.reject);
      }
      return primary.promise();
    }
  });

  // These usually indicate a programmer mistake during development,
  // warn about them ASAP rather than swallowing them by default.
  var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;

  // If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error
  // captured before the async barrier to get the original error cause
  // which may otherwise be hidden.
  jQuery.Deferred.exceptionHook = function (error, asyncError) {
    // Support: IE 8 - 9 only
    // Console exists when dev tools are open, which can happen at any time
    if (window.console && window.console.warn && error && rerrorNames.test(error.name)) {
      window.console.warn("jQuery.Deferred exception: " + error.message, error.stack, asyncError);
    }
  };
  jQuery.readyException = function (error) {
    window.setTimeout(function () {
      throw error;
    });
  };

  // The deferred used on DOM ready
  var readyList = jQuery.Deferred();
  jQuery.fn.ready = function (fn) {
    readyList.then(fn)

    // Wrap jQuery.readyException in a function so that the lookup
    // happens at the time of error handling instead of callback
    // registration.
    .catch(function (error) {
      jQuery.readyException(error);
    });
    return this;
  };
  jQuery.extend({
    // Is the DOM ready to be used? Set to true once it occurs.
    isReady: false,
    // A counter to track how many items to wait for before
    // the ready event fires. See trac-6781
    readyWait: 1,
    // Handle when the DOM is ready
    ready: function (wait) {
      // Abort if there are pending holds or we're already ready
      if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
        return;
      }

      // Remember that the DOM is ready
      jQuery.isReady = true;

      // If a normal DOM Ready event fired, decrement, and wait if need be
      if (wait !== true && --jQuery.readyWait > 0) {
        return;
      }

      // If there are functions bound, to execute
      readyList.resolveWith(document, [jQuery]);
    }
  });
  jQuery.ready.then = readyList.then;

  // The ready event handler and self cleanup method
  function completed() {
    document.removeEventListener("DOMContentLoaded", completed);
    window.removeEventListener("load", completed);
    jQuery.ready();
  }

  // Catch cases where $(document).ready() is called
  // after the browser event has already occurred.
  // Support: IE <=9 - 10 only
  // Older IE sometimes signals "interactive" too soon
  if (document.readyState === "complete" || document.readyState !== "loading" && !document.documentElement.doScroll) {
    // Handle it asynchronously to allow scripts the opportunity to delay ready
    window.setTimeout(jQuery.ready);
  } else {
    // Use the handy event callback
    document.addEventListener("DOMContentLoaded", completed);

    // A fallback to window.onload, that will always work
    window.addEventListener("load", completed);
  }

  // Multifunctional method to get and set values of a collection
  // The value/s can optionally be executed if it's a function
  var access = function (elems, fn, key, value, chainable, emptyGet, raw) {
    var i = 0,
      len = elems.length,
      bulk = key == null;

    // Sets many values
    if (toType(key) === "object") {
      chainable = true;
      for (i in key) {
        access(elems, fn, i, key[i], true, emptyGet, raw);
      }

      // Sets one value
    } else if (value !== undefined) {
      chainable = true;
      if (!isFunction(value)) {
        raw = true;
      }
      if (bulk) {
        // Bulk operations run against the entire set
        if (raw) {
          fn.call(elems, value);
          fn = null;

          // ...except when executing function values
        } else {
          bulk = fn;
          fn = function (elem, _key, value) {
            return bulk.call(jQuery(elem), value);
          };
        }
      }
      if (fn) {
        for (; i < len; i++) {
          fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));
        }
      }
    }
    if (chainable) {
      return elems;
    }

    // Gets
    if (bulk) {
      return fn.call(elems);
    }
    return len ? fn(elems[0], key) : emptyGet;
  };

  // Matches dashed string for camelizing
  var rmsPrefix = /^-ms-/,
    rdashAlpha = /-([a-z])/g;

  // Used by camelCase as callback to replace()
  function fcamelCase(_all, letter) {
    return letter.toUpperCase();
  }

  // Convert dashed to camelCase; used by the css and data modules
  // Support: IE <=9 - 11, Edge 12 - 15
  // Microsoft forgot to hump their vendor prefix (trac-9572)
  function camelCase(string) {
    return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
  }
  var acceptData = function (owner) {
    // Accepts only:
    //  - Node
    //    - Node.ELEMENT_NODE
    //    - Node.DOCUMENT_NODE
    //  - Object
    //    - Any
    return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType;
  };
  function Data() {
    this.expando = jQuery.expando + Data.uid++;
  }
  Data.uid = 1;
  Data.prototype = {
    cache: function (owner) {
      // Check if the owner object already has a cache
      var value = owner[this.expando];

      // If not, create one
      if (!value) {
        value = {};

        // We can accept data for non-element nodes in modern browsers,
        // but we should not, see trac-8335.
        // Always return an empty object.
        if (acceptData(owner)) {
          // If it is a node unlikely to be stringify-ed or looped over
          // use plain assignment
          if (owner.nodeType) {
            owner[this.expando] = value;

            // Otherwise secure it in a non-enumerable property
            // configurable must be true to allow the property to be
            // deleted when data is removed
          } else {
            Object.defineProperty(owner, this.expando, {
              value: value,
              configurable: true
            });
          }
        }
      }
      return value;
    },
    set: function (owner, data, value) {
      var prop,
        cache = this.cache(owner);

      // Handle: [ owner, key, value ] args
      // Always use camelCase key (gh-2257)
      if (typeof data === "string") {
        cache[camelCase(data)] = value;

        // Handle: [ owner, { properties } ] args
      } else {
        // Copy the properties one-by-one to the cache object
        for (prop in data) {
          cache[camelCase(prop)] = data[prop];
        }
      }
      return cache;
    },
    get: function (owner, key) {
      return key === undefined ? this.cache(owner) :
      // Always use camelCase key (gh-2257)
      owner[this.expando] && owner[this.expando][camelCase(key)];
    },
    access: function (owner, key, value) {
      // In cases where either:
      //
      //   1. No key was specified
      //   2. A string key was specified, but no value provided
      //
      // Take the "read" path and allow the get method to determine
      // which value to return, respectively either:
      //
      //   1. The entire cache object
      //   2. The data stored at the key
      //
      if (key === undefined || key && typeof key === "string" && value === undefined) {
        return this.get(owner, key);
      }

      // When the key is not a string, or both a key and value
      // are specified, set or extend (existing objects) with either:
      //
      //   1. An object of properties
      //   2. A key and value
      //
      this.set(owner, key, value);

      // Since the "set" path can have two possible entry points
      // return the expected data based on which path was taken[*]
      return value !== undefined ? value : key;
    },
    remove: function (owner, key) {
      var i,
        cache = owner[this.expando];
      if (cache === undefined) {
        return;
      }
      if (key !== undefined) {
        // Support array or space separated string of keys
        if (Array.isArray(key)) {
          // If key is an array of keys...
          // We always set camelCase keys, so remove that.
          key = key.map(camelCase);
        } else {
          key = camelCase(key);

          // If a key with the spaces exists, use it.
          // Otherwise, create an array by matching non-whitespace
          key = key in cache ? [key] : key.match(rnothtmlwhite) || [];
        }
        i = key.length;
        while (i--) {
          delete cache[key[i]];
        }
      }

      // Remove the expando if there's no more data
      if (key === undefined || jQuery.isEmptyObject(cache)) {
        // Support: Chrome <=35 - 45
        // Webkit & Blink performance suffers when deleting properties
        // from DOM nodes, so set to undefined instead
        // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
        if (owner.nodeType) {
          owner[this.expando] = undefined;
        } else {
          delete owner[this.expando];
        }
      }
    },
    hasData: function (owner) {
      var cache = owner[this.expando];
      return cache !== undefined && !jQuery.isEmptyObject(cache);
    }
  };
  var dataPriv = new Data();
  var dataUser = new Data();

  //	Implementation Summary
  //
  //	1. Enforce API surface and semantic compatibility with 1.9.x branch
  //	2. Improve the module's maintainability by reducing the storage
  //		paths to a single mechanism.
  //	3. Use the same single mechanism to support "private" and "user" data.
  //	4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  //	5. Avoid exposing implementation details on user objects (eg. expando properties)
  //	6. Provide a clear path for implementation upgrade to WeakMap in 2014

  var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
    rmultiDash = /[A-Z]/g;
  function getData(data) {
    if (data === "true") {
      return true;
    }
    if (data === "false") {
      return false;
    }
    if (data === "null") {
      return null;
    }

    // Only convert to a number if it doesn't change the string
    if (data === +data + "") {
      return +data;
    }
    if (rbrace.test(data)) {
      return JSON.parse(data);
    }
    return data;
  }
  function dataAttr(elem, key, data) {
    var name;

    // If nothing was found internally, try to fetch any
    // data from the HTML5 data-* attribute
    if (data === undefined && elem.nodeType === 1) {
      name = "data-" + key.replace(rmultiDash, "-$&").toLowerCase();
      data = elem.getAttribute(name);
      if (typeof data === "string") {
        try {
          data = getData(data);
        } catch (e) {}

        // Make sure we set the data so it isn't changed later
        dataUser.set(elem, key, data);
      } else {
        data = undefined;
      }
    }
    return data;
  }
  jQuery.extend({
    hasData: function (elem) {
      return dataUser.hasData(elem) || dataPriv.hasData(elem);
    },
    data: function (elem, name, data) {
      return dataUser.access(elem, name, data);
    },
    removeData: function (elem, name) {
      dataUser.remove(elem, name);
    },
    // TODO: Now that all calls to _data and _removeData have been replaced
    // with direct calls to dataPriv methods, these can be deprecated.
    _data: function (elem, name, data) {
      return dataPriv.access(elem, name, data);
    },
    _removeData: function (elem, name) {
      dataPriv.remove(elem, name);
    }
  });
  jQuery.fn.extend({
    data: function (key, value) {
      var i,
        name,
        data,
        elem = this[0],
        attrs = elem && elem.attributes;

      // Gets all values
      if (key === undefined) {
        if (this.length) {
          data = dataUser.get(elem);
          if (elem.nodeType === 1 && !dataPriv.get(elem, "hasDataAttrs")) {
            i = attrs.length;
            while (i--) {
              // Support: IE 11 only
              // The attrs elements can be null (trac-14894)
              if (attrs[i]) {
                name = attrs[i].name;
                if (name.indexOf("data-") === 0) {
                  name = camelCase(name.slice(5));
                  dataAttr(elem, name, data[name]);
                }
              }
            }
            dataPriv.set(elem, "hasDataAttrs", true);
          }
        }
        return data;
      }

      // Sets multiple values
      if (typeof key === "object") {
        return this.each(function () {
          dataUser.set(this, key);
        });
      }
      return access(this, function (value) {
        var data;

        // The calling jQuery object (element matches) is not empty
        // (and therefore has an element appears at this[ 0 ]) and the
        // `value` parameter was not undefined. An empty jQuery object
        // will result in `undefined` for elem = this[ 0 ] which will
        // throw an exception if an attempt to read a data cache is made.
        if (elem && value === undefined) {
          // Attempt to get data from the cache
          // The key will always be camelCased in Data
          data = dataUser.get(elem, key);
          if (data !== undefined) {
            return data;
          }

          // Attempt to "discover" the data in
          // HTML5 custom data-* attrs
          data = dataAttr(elem, key);
          if (data !== undefined) {
            return data;
          }

          // We tried really hard, but the data doesn't exist.
          return;
        }

        // Set the data...
        this.each(function () {
          // We always store the camelCased key
          dataUser.set(this, key, value);
        });
      }, null, value, arguments.length > 1, null, true);
    },
    removeData: function (key) {
      return this.each(function () {
        dataUser.remove(this, key);
      });
    }
  });
  jQuery.extend({
    queue: function (elem, type, data) {
      var queue;
      if (elem) {
        type = (type || "fx") + "queue";
        queue = dataPriv.get(elem, type);

        // Speed up dequeue by getting out quickly if this is just a lookup
        if (data) {
          if (!queue || Array.isArray(data)) {
            queue = dataPriv.access(elem, type, jQuery.makeArray(data));
          } else {
            queue.push(data);
          }
        }
        return queue || [];
      }
    },
    dequeue: function (elem, type) {
      type = type || "fx";
      var queue = jQuery.queue(elem, type),
        startLength = queue.length,
        fn = queue.shift(),
        hooks = jQuery._queueHooks(elem, type),
        next = function () {
          jQuery.dequeue(elem, type);
        };

      // If the fx queue is dequeued, always remove the progress sentinel
      if (fn === "inprogress") {
        fn = queue.shift();
        startLength--;
      }
      if (fn) {
        // Add a progress sentinel to prevent the fx queue from being
        // automatically dequeued
        if (type === "fx") {
          queue.unshift("inprogress");
        }

        // Clear up the last queue stop function
        delete hooks.stop;
        fn.call(elem, next, hooks);
      }
      if (!startLength && hooks) {
        hooks.empty.fire();
      }
    },
    // Not public - generate a queueHooks object, or return the current one
    _queueHooks: function (elem, type) {
      var key = type + "queueHooks";
      return dataPriv.get(elem, key) || dataPriv.access(elem, key, {
        empty: jQuery.Callbacks("once memory").add(function () {
          dataPriv.remove(elem, [type + "queue", key]);
        })
      });
    }
  });
  jQuery.fn.extend({
    queue: function (type, data) {
      var setter = 2;
      if (typeof type !== "string") {
        data = type;
        type = "fx";
        setter--;
      }
      if (arguments.length < setter) {
        return jQuery.queue(this[0], type);
      }
      return data === undefined ? this : this.each(function () {
        var queue = jQuery.queue(this, type, data);

        // Ensure a hooks for this queue
        jQuery._queueHooks(this, type);
        if (type === "fx" && queue[0] !== "inprogress") {
          jQuery.dequeue(this, type);
        }
      });
    },
    dequeue: function (type) {
      return this.each(function () {
        jQuery.dequeue(this, type);
      });
    },
    clearQueue: function (type) {
      return this.queue(type || "fx", []);
    },
    // Get a promise resolved when queues of a certain type
    // are emptied (fx is the type by default)
    promise: function (type, obj) {
      var tmp,
        count = 1,
        defer = jQuery.Deferred(),
        elements = this,
        i = this.length,
        resolve = function () {
          if (! --count) {
            defer.resolveWith(elements, [elements]);
          }
        };
      if (typeof type !== "string") {
        obj = type;
        type = undefined;
      }
      type = type || "fx";
      while (i--) {
        tmp = dataPriv.get(elements[i], type + "queueHooks");
        if (tmp && tmp.empty) {
          count++;
          tmp.empty.add(resolve);
        }
      }
      resolve();
      return defer.promise(obj);
    }
  });
  var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;
  var rcssNum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i");
  var cssExpand = ["Top", "Right", "Bottom", "Left"];
  var documentElement = document.documentElement;
  var isAttached = function (elem) {
      return jQuery.contains(elem.ownerDocument, elem);
    },
    composed = {
      composed: true
    };

  // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
  // Check attachment across shadow DOM boundaries when possible (gh-3504)
  // Support: iOS 10.0-10.2 only
  // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
  // leading to errors. We need to check for `getRootNode`.
  if (documentElement.getRootNode) {
    isAttached = function (elem) {
      return jQuery.contains(elem.ownerDocument, elem) || elem.getRootNode(composed) === elem.ownerDocument;
    };
  }
  var isHiddenWithinTree = function (elem, el) {
    // isHiddenWithinTree might be called from jQuery#filter function;
    // in that case, element will be second argument
    elem = el || elem;

    // Inline style trumps all
    return elem.style.display === "none" || elem.style.display === "" &&
    // Otherwise, check computed style
    // Support: Firefox <=43 - 45
    // Disconnected elements can have computed display: none, so first confirm that elem is
    // in the document.
    isAttached(elem) && jQuery.css(elem, "display") === "none";
  };
  function adjustCSS(elem, prop, valueParts, tween) {
    var adjusted,
      scale,
      maxIterations = 20,
      currentValue = tween ? function () {
        return tween.cur();
      } : function () {
        return jQuery.css(elem, prop, "");
      },
      initial = currentValue(),
      unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? "" : "px"),
      // Starting value computation is required for potential unit mismatches
      initialInUnit = elem.nodeType && (jQuery.cssNumber[prop] || unit !== "px" && +initial) && rcssNum.exec(jQuery.css(elem, prop));
    if (initialInUnit && initialInUnit[3] !== unit) {
      // Support: Firefox <=54
      // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
      initial = initial / 2;

      // Trust units reported by jQuery.css
      unit = unit || initialInUnit[3];

      // Iteratively approximate from a nonzero starting point
      initialInUnit = +initial || 1;
      while (maxIterations--) {
        // Evaluate and update our best guess (doubling guesses that zero out).
        // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
        jQuery.style(elem, prop, initialInUnit + unit);
        if ((1 - scale) * (1 - (scale = currentValue() / initial || 0.5)) <= 0) {
          maxIterations = 0;
        }
        initialInUnit = initialInUnit / scale;
      }
      initialInUnit = initialInUnit * 2;
      jQuery.style(elem, prop, initialInUnit + unit);

      // Make sure we update the tween properties later on
      valueParts = valueParts || [];
    }
    if (valueParts) {
      initialInUnit = +initialInUnit || +initial || 0;

      // Apply relative offset (+=/-=) if specified
      adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2];
      if (tween) {
        tween.unit = unit;
        tween.start = initialInUnit;
        tween.end = adjusted;
      }
    }
    return adjusted;
  }
  var defaultDisplayMap = {};
  function getDefaultDisplay(elem) {
    var temp,
      doc = elem.ownerDocument,
      nodeName = elem.nodeName,
      display = defaultDisplayMap[nodeName];
    if (display) {
      return display;
    }
    temp = doc.body.appendChild(doc.createElement(nodeName));
    display = jQuery.css(temp, "display");
    temp.parentNode.removeChild(temp);
    if (display === "none") {
      display = "block";
    }
    defaultDisplayMap[nodeName] = display;
    return display;
  }
  function showHide(elements, show) {
    var display,
      elem,
      values = [],
      index = 0,
      length = elements.length;

    // Determine new display value for elements that need to change
    for (; index < length; index++) {
      elem = elements[index];
      if (!elem.style) {
        continue;
      }
      display = elem.style.display;
      if (show) {
        // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
        // check is required in this first loop unless we have a nonempty display value (either
        // inline or about-to-be-restored)
        if (display === "none") {
          values[index] = dataPriv.get(elem, "display") || null;
          if (!values[index]) {
            elem.style.display = "";
          }
        }
        if (elem.style.display === "" && isHiddenWithinTree(elem)) {
          values[index] = getDefaultDisplay(elem);
        }
      } else {
        if (display !== "none") {
          values[index] = "none";

          // Remember what we're overwriting
          dataPriv.set(elem, "display", display);
        }
      }
    }

    // Set the display of the elements in a second loop to avoid constant reflow
    for (index = 0; index < length; index++) {
      if (values[index] != null) {
        elements[index].style.display = values[index];
      }
    }
    return elements;
  }
  jQuery.fn.extend({
    show: function () {
      return showHide(this, true);
    },
    hide: function () {
      return showHide(this);
    },
    toggle: function (state) {
      if (typeof state === "boolean") {
        return state ? this.show() : this.hide();
      }
      return this.each(function () {
        if (isHiddenWithinTree(this)) {
          jQuery(this).show();
        } else {
          jQuery(this).hide();
        }
      });
    }
  });
  var rcheckableType = /^(?:checkbox|radio)$/i;
  var rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i;
  var rscriptType = /^$|^module$|\/(?:java|ecma)script/i;
  (function () {
    var fragment = document.createDocumentFragment(),
      div = fragment.appendChild(document.createElement("div")),
      input = document.createElement("input");

    // Support: Android 4.0 - 4.3 only
    // Check state lost if the name is set (trac-11217)
    // Support: Windows Web Apps (WWA)
    // `name` and `type` must use .setAttribute for WWA (trac-14901)
    input.setAttribute("type", "radio");
    input.setAttribute("checked", "checked");
    input.setAttribute("name", "t");
    div.appendChild(input);

    // Support: Android <=4.1 only
    // Older WebKit doesn't clone checked state correctly in fragments
    support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;

    // Support: IE <=11 only
    // Make sure textarea (and checkbox) defaultValue is properly cloned
    div.innerHTML = "<textarea>x</textarea>";
    support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;

    // Support: IE <=9 only
    // IE <=9 replaces <option> tags with their contents when inserted outside of
    // the select element.
    div.innerHTML = "<option></option>";
    support.option = !!div.lastChild;
  })();

  // We have to close these tags to support XHTML (trac-13200)
  var wrapMap = {
    // XHTML parsers do not magically insert elements in the
    // same way that tag soup parsers do. So we cannot shorten
    // this by omitting <tbody> or other required elements.
    thead: [1, "<table>", "</table>"],
    col: [2, "<table><colgroup>", "</colgroup></table>"],
    tr: [2, "<table><tbody>", "</tbody></table>"],
    td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
    _default: [0, "", ""]
  };
  wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  wrapMap.th = wrapMap.td;

  // Support: IE <=9 only
  if (!support.option) {
    wrapMap.optgroup = wrapMap.option = [1, "<select multiple='multiple'>", "</select>"];
  }
  function getAll(context, tag) {
    // Support: IE <=9 - 11 only
    // Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
    var ret;
    if (typeof context.getElementsByTagName !== "undefined") {
      ret = context.getElementsByTagName(tag || "*");
    } else if (typeof context.querySelectorAll !== "undefined") {
      ret = context.querySelectorAll(tag || "*");
    } else {
      ret = [];
    }
    if (tag === undefined || tag && nodeName(context, tag)) {
      return jQuery.merge([context], ret);
    }
    return ret;
  }

  // Mark scripts as having already been evaluated
  function setGlobalEval(elems, refElements) {
    var i = 0,
      l = elems.length;
    for (; i < l; i++) {
      dataPriv.set(elems[i], "globalEval", !refElements || dataPriv.get(refElements[i], "globalEval"));
    }
  }
  var rhtml = /<|&#?\w+;/;
  function buildFragment(elems, context, scripts, selection, ignored) {
    var elem,
      tmp,
      tag,
      wrap,
      attached,
      j,
      fragment = context.createDocumentFragment(),
      nodes = [],
      i = 0,
      l = elems.length;
    for (; i < l; i++) {
      elem = elems[i];
      if (elem || elem === 0) {
        // Add nodes directly
        if (toType(elem) === "object") {
          // Support: Android <=4.0 only, PhantomJS 1 only
          // push.apply(_, arraylike) throws on ancient WebKit
          jQuery.merge(nodes, elem.nodeType ? [elem] : elem);

          // Convert non-html into a text node
        } else if (!rhtml.test(elem)) {
          nodes.push(context.createTextNode(elem));

          // Convert html into DOM nodes
        } else {
          tmp = tmp || fragment.appendChild(context.createElement("div"));

          // Deserialize a standard representation
          tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
          wrap = wrapMap[tag] || wrapMap._default;
          tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2];

          // Descend through wrappers to the right content
          j = wrap[0];
          while (j--) {
            tmp = tmp.lastChild;
          }

          // Support: Android <=4.0 only, PhantomJS 1 only
          // push.apply(_, arraylike) throws on ancient WebKit
          jQuery.merge(nodes, tmp.childNodes);

          // Remember the top-level container
          tmp = fragment.firstChild;

          // Ensure the created nodes are orphaned (trac-12392)
          tmp.textContent = "";
        }
      }
    }

    // Remove wrapper from fragment
    fragment.textContent = "";
    i = 0;
    while (elem = nodes[i++]) {
      // Skip elements already in the context collection (trac-4087)
      if (selection && jQuery.inArray(elem, selection) > -1) {
        if (ignored) {
          ignored.push(elem);
        }
        continue;
      }
      attached = isAttached(elem);

      // Append to fragment
      tmp = getAll(fragment.appendChild(elem), "script");

      // Preserve script evaluation history
      if (attached) {
        setGlobalEval(tmp);
      }

      // Capture executables
      if (scripts) {
        j = 0;
        while (elem = tmp[j++]) {
          if (rscriptType.test(elem.type || "")) {
            scripts.push(elem);
          }
        }
      }
    }
    return fragment;
  }
  var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  function returnTrue() {
    return true;
  }
  function returnFalse() {
    return false;
  }
  function on(elem, types, selector, data, fn, one) {
    var origFn, type;

    // Types can be a map of types/handlers
    if (typeof types === "object") {
      // ( types-Object, selector, data )
      if (typeof selector !== "string") {
        // ( types-Object, data )
        data = data || selector;
        selector = undefined;
      }
      for (type in types) {
        on(elem, type, selector, data, types[type], one);
      }
      return elem;
    }
    if (data == null && fn == null) {
      // ( types, fn )
      fn = selector;
      data = selector = undefined;
    } else if (fn == null) {
      if (typeof selector === "string") {
        // ( types, selector, fn )
        fn = data;
        data = undefined;
      } else {
        // ( types, data, fn )
        fn = data;
        data = selector;
        selector = undefined;
      }
    }
    if (fn === false) {
      fn = returnFalse;
    } else if (!fn) {
      return elem;
    }
    if (one === 1) {
      origFn = fn;
      fn = function (event) {
        // Can use an empty set, since event contains the info
        jQuery().off(event);
        return origFn.apply(this, arguments);
      };

      // Use same guid so caller can remove using origFn
      fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);
    }
    return elem.each(function () {
      jQuery.event.add(this, types, fn, data, selector);
    });
  }

  /*
   * Helper functions for managing events -- not part of the public interface.
   * Props to Dean Edwards' addEvent library for many of the ideas.
   */
  jQuery.event = {
    global: {},
    add: function (elem, types, handler, data, selector) {
      var handleObjIn,
        eventHandle,
        tmp,
        events,
        t,
        handleObj,
        special,
        handlers,
        type,
        namespaces,
        origType,
        elemData = dataPriv.get(elem);

      // Only attach events to objects that accept data
      if (!acceptData(elem)) {
        return;
      }

      // Caller can pass in an object of custom data in lieu of the handler
      if (handler.handler) {
        handleObjIn = handler;
        handler = handleObjIn.handler;
        selector = handleObjIn.selector;
      }

      // Ensure that invalid selectors throw exceptions at attach time
      // Evaluate against documentElement in case elem is a non-element node (e.g., document)
      if (selector) {
        jQuery.find.matchesSelector(documentElement, selector);
      }

      // Make sure that the handler has a unique ID, used to find/remove it later
      if (!handler.guid) {
        handler.guid = jQuery.guid++;
      }

      // Init the element's event structure and main handler, if this is the first
      if (!(events = elemData.events)) {
        events = elemData.events = Object.create(null);
      }
      if (!(eventHandle = elemData.handle)) {
        eventHandle = elemData.handle = function (e) {
          // Discard the second event of a jQuery.event.trigger() and
          // when an event is called after a page has unloaded
          return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : undefined;
        };
      }

      // Handle multiple events separated by a space
      types = (types || "").match(rnothtmlwhite) || [""];
      t = types.length;
      while (t--) {
        tmp = rtypenamespace.exec(types[t]) || [];
        type = origType = tmp[1];
        namespaces = (tmp[2] || "").split(".").sort();

        // There *must* be a type, no attaching namespace-only handlers
        if (!type) {
          continue;
        }

        // If event changes its type, use the special event handlers for the changed type
        special = jQuery.event.special[type] || {};

        // If selector defined, determine special event api type, otherwise given type
        type = (selector ? special.delegateType : special.bindType) || type;

        // Update special based on newly reset type
        special = jQuery.event.special[type] || {};

        // handleObj is passed to all event handlers
        handleObj = jQuery.extend({
          type: type,
          origType: origType,
          data: data,
          handler: handler,
          guid: handler.guid,
          selector: selector,
          needsContext: selector && jQuery.expr.match.needsContext.test(selector),
          namespace: namespaces.join(".")
        }, handleObjIn);

        // Init the event handler queue if we're the first
        if (!(handlers = events[type])) {
          handlers = events[type] = [];
          handlers.delegateCount = 0;

          // Only use addEventListener if the special events handler returns false
          if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
            if (elem.addEventListener) {
              elem.addEventListener(type, eventHandle);
            }
          }
        }
        if (special.add) {
          special.add.call(elem, handleObj);
          if (!handleObj.handler.guid) {
            handleObj.handler.guid = handler.guid;
          }
        }

        // Add to the element's handler list, delegates in front
        if (selector) {
          handlers.splice(handlers.delegateCount++, 0, handleObj);
        } else {
          handlers.push(handleObj);
        }

        // Keep track of which events have ever been used, for event optimization
        jQuery.event.global[type] = true;
      }
    },
    // Detach an event or set of events from an element
    remove: function (elem, types, handler, selector, mappedTypes) {
      var j,
        origCount,
        tmp,
        events,
        t,
        handleObj,
        special,
        handlers,
        type,
        namespaces,
        origType,
        elemData = dataPriv.hasData(elem) && dataPriv.get(elem);
      if (!elemData || !(events = elemData.events)) {
        return;
      }

      // Once for each type.namespace in types; type may be omitted
      types = (types || "").match(rnothtmlwhite) || [""];
      t = types.length;
      while (t--) {
        tmp = rtypenamespace.exec(types[t]) || [];
        type = origType = tmp[1];
        namespaces = (tmp[2] || "").split(".").sort();

        // Unbind all events (on this namespace, if provided) for the element
        if (!type) {
          for (type in events) {
            jQuery.event.remove(elem, type + types[t], handler, selector, true);
          }
          continue;
        }
        special = jQuery.event.special[type] || {};
        type = (selector ? special.delegateType : special.bindType) || type;
        handlers = events[type] || [];
        tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");

        // Remove matching events
        origCount = j = handlers.length;
        while (j--) {
          handleObj = handlers[j];
          if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
            handlers.splice(j, 1);
            if (handleObj.selector) {
              handlers.delegateCount--;
            }
            if (special.remove) {
              special.remove.call(elem, handleObj);
            }
          }
        }

        // Remove generic event handler if we removed something and no more handlers exist
        // (avoids potential for endless recursion during removal of special event handlers)
        if (origCount && !handlers.length) {
          if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
            jQuery.removeEvent(elem, type, elemData.handle);
          }
          delete events[type];
        }
      }

      // Remove data and the expando if it's no longer used
      if (jQuery.isEmptyObject(events)) {
        dataPriv.remove(elem, "handle events");
      }
    },
    dispatch: function (nativeEvent) {
      var i,
        j,
        ret,
        matched,
        handleObj,
        handlerQueue,
        args = new Array(arguments.length),
        // Make a writable jQuery.Event from the native event object
        event = jQuery.event.fix(nativeEvent),
        handlers = (dataPriv.get(this, "events") || Object.create(null))[event.type] || [],
        special = jQuery.event.special[event.type] || {};

      // Use the fix-ed jQuery.Event rather than the (read-only) native event
      args[0] = event;
      for (i = 1; i < arguments.length; i++) {
        args[i] = arguments[i];
      }
      event.delegateTarget = this;

      // Call the preDispatch hook for the mapped type, and let it bail if desired
      if (special.preDispatch && special.preDispatch.call(this, event) === false) {
        return;
      }

      // Determine handlers
      handlerQueue = jQuery.event.handlers.call(this, event, handlers);

      // Run delegates first; they may want to stop propagation beneath us
      i = 0;
      while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {
        event.currentTarget = matched.elem;
        j = 0;
        while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {
          // If the event is namespaced, then each handler is only invoked if it is
          // specially universal or its namespaces are a superset of the event's.
          if (!event.rnamespace || handleObj.namespace === false || event.rnamespace.test(handleObj.namespace)) {
            event.handleObj = handleObj;
            event.data = handleObj.data;
            ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);
            if (ret !== undefined) {
              if ((event.result = ret) === false) {
                event.preventDefault();
                event.stopPropagation();
              }
            }
          }
        }
      }

      // Call the postDispatch hook for the mapped type
      if (special.postDispatch) {
        special.postDispatch.call(this, event);
      }
      return event.result;
    },
    handlers: function (event, handlers) {
      var i,
        handleObj,
        sel,
        matchedHandlers,
        matchedSelectors,
        handlerQueue = [],
        delegateCount = handlers.delegateCount,
        cur = event.target;

      // Find delegate handlers
      if (delegateCount &&
      // Support: IE <=9
      // Black-hole SVG <use> instance trees (trac-13180)
      cur.nodeType &&
      // Support: Firefox <=42
      // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
      // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
      // Support: IE 11 only
      // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
      !(event.type === "click" && event.button >= 1)) {
        for (; cur !== this; cur = cur.parentNode || this) {
          // Don't check non-elements (trac-13208)
          // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)
          if (cur.nodeType === 1 && !(event.type === "click" && cur.disabled === true)) {
            matchedHandlers = [];
            matchedSelectors = {};
            for (i = 0; i < delegateCount; i++) {
              handleObj = handlers[i];

              // Don't conflict with Object.prototype properties (trac-13203)
              sel = handleObj.selector + " ";
              if (matchedSelectors[sel] === undefined) {
                matchedSelectors[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) > -1 : jQuery.find(sel, this, null, [cur]).length;
              }
              if (matchedSelectors[sel]) {
                matchedHandlers.push(handleObj);
              }
            }
            if (matchedHandlers.length) {
              handlerQueue.push({
                elem: cur,
                handlers: matchedHandlers
              });
            }
          }
        }
      }

      // Add the remaining (directly-bound) handlers
      cur = this;
      if (delegateCount < handlers.length) {
        handlerQueue.push({
          elem: cur,
          handlers: handlers.slice(delegateCount)
        });
      }
      return handlerQueue;
    },
    addProp: function (name, hook) {
      Object.defineProperty(jQuery.Event.prototype, name, {
        enumerable: true,
        configurable: true,
        get: isFunction(hook) ? function () {
          if (this.originalEvent) {
            return hook(this.originalEvent);
          }
        } : function () {
          if (this.originalEvent) {
            return this.originalEvent[name];
          }
        },
        set: function (value) {
          Object.defineProperty(this, name, {
            enumerable: true,
            configurable: true,
            writable: true,
            value: value
          });
        }
      });
    },
    fix: function (originalEvent) {
      return originalEvent[jQuery.expando] ? originalEvent : new jQuery.Event(originalEvent);
    },
    special: {
      load: {
        // Prevent triggered image.load events from bubbling to window.load
        noBubble: true
      },
      click: {
        // Utilize native event to ensure correct state for checkable inputs
        setup: function (data) {
          // For mutual compressibility with _default, replace `this` access with a local var.
          // `|| data` is dead code meant only to preserve the variable through minification.
          var el = this || data;

          // Claim the first handler
          if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
            // dataPriv.set( el, "click", ... )
            leverageNative(el, "click", true);
          }

          // Return false to allow normal processing in the caller
          return false;
        },
        trigger: function (data) {
          // For mutual compressibility with _default, replace `this` access with a local var.
          // `|| data` is dead code meant only to preserve the variable through minification.
          var el = this || data;

          // Force setup before triggering a click
          if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
            leverageNative(el, "click");
          }

          // Return non-false to allow normal event-path propagation
          return true;
        },
        // For cross-browser consistency, suppress native .click() on links
        // Also prevent it if we're currently inside a leveraged native-event stack
        _default: function (event) {
          var target = event.target;
          return rcheckableType.test(target.type) && target.click && nodeName(target, "input") && dataPriv.get(target, "click") || nodeName(target, "a");
        }
      },
      beforeunload: {
        postDispatch: function (event) {
          // Support: Firefox 20+
          // Firefox doesn't alert if the returnValue field is not set.
          if (event.result !== undefined && event.originalEvent) {
            event.originalEvent.returnValue = event.result;
          }
        }
      }
    }
  };

  // Ensure the presence of an event listener that handles manually-triggered
  // synthetic events by interrupting progress until reinvoked in response to
  // *native* events that it fires directly, ensuring that state changes have
  // already occurred before other listeners are invoked.
  function leverageNative(el, type, isSetup) {
    // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add
    if (!isSetup) {
      if (dataPriv.get(el, type) === undefined) {
        jQuery.event.add(el, type, returnTrue);
      }
      return;
    }

    // Register the controller as a special universal handler for all event namespaces
    dataPriv.set(el, type, false);
    jQuery.event.add(el, type, {
      namespace: false,
      handler: function (event) {
        var result,
          saved = dataPriv.get(this, type);
        if (event.isTrigger & 1 && this[type]) {
          // Interrupt processing of the outer synthetic .trigger()ed event
          if (!saved) {
            // Store arguments for use when handling the inner native event
            // There will always be at least one argument (an event object), so this array
            // will not be confused with a leftover capture object.
            saved = slice.call(arguments);
            dataPriv.set(this, type, saved);

            // Trigger the native event and capture its result
            this[type]();
            result = dataPriv.get(this, type);
            dataPriv.set(this, type, false);
            if (saved !== result) {
              // Cancel the outer synthetic event
              event.stopImmediatePropagation();
              event.preventDefault();
              return result;
            }

            // If this is an inner synthetic event for an event with a bubbling surrogate
            // (focus or blur), assume that the surrogate already propagated from triggering
            // the native event and prevent that from happening again here.
            // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
            // bubbling surrogate propagates *after* the non-bubbling base), but that seems
            // less bad than duplication.
          } else if ((jQuery.event.special[type] || {}).delegateType) {
            event.stopPropagation();
          }

          // If this is a native event triggered above, everything is now in order
          // Fire an inner synthetic event with the original arguments
        } else if (saved) {
          // ...and capture the result
          dataPriv.set(this, type, jQuery.event.trigger(saved[0], saved.slice(1), this));

          // Abort handling of the native event by all jQuery handlers while allowing
          // native handlers on the same element to run. On target, this is achieved
          // by stopping immediate propagation just on the jQuery event. However,
          // the native event is re-wrapped by a jQuery one on each level of the
          // propagation so the only way to stop it for jQuery is to stop it for
          // everyone via native `stopPropagation()`. This is not a problem for
          // focus/blur which don't bubble, but it does also stop click on checkboxes
          // and radios. We accept this limitation.
          event.stopPropagation();
          event.isImmediatePropagationStopped = returnTrue;
        }
      }
    });
  }
  jQuery.removeEvent = function (elem, type, handle) {
    // This "if" is needed for plain objects
    if (elem.removeEventListener) {
      elem.removeEventListener(type, handle);
    }
  };
  jQuery.Event = function (src, props) {
    // Allow instantiation without the 'new' keyword
    if (!(this instanceof jQuery.Event)) {
      return new jQuery.Event(src, props);
    }

    // Event object
    if (src && src.type) {
      this.originalEvent = src;
      this.type = src.type;

      // Events bubbling up the document may have been marked as prevented
      // by a handler lower down the tree; reflect the correct value.
      this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined &&
      // Support: Android <=2.3 only
      src.returnValue === false ? returnTrue : returnFalse;

      // Create target properties
      // Support: Safari <=6 - 7 only
      // Target should not be a text node (trac-504, trac-13143)
      this.target = src.target && src.target.nodeType === 3 ? src.target.parentNode : src.target;
      this.currentTarget = src.currentTarget;
      this.relatedTarget = src.relatedTarget;

      // Event type
    } else {
      this.type = src;
    }

    // Put explicitly provided properties onto the event object
    if (props) {
      jQuery.extend(this, props);
    }

    // Create a timestamp if incoming event doesn't have one
    this.timeStamp = src && src.timeStamp || Date.now();

    // Mark it as fixed
    this[jQuery.expando] = true;
  };

  // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  jQuery.Event.prototype = {
    constructor: jQuery.Event,
    isDefaultPrevented: returnFalse,
    isPropagationStopped: returnFalse,
    isImmediatePropagationStopped: returnFalse,
    isSimulated: false,
    preventDefault: function () {
      var e = this.originalEvent;
      this.isDefaultPrevented = returnTrue;
      if (e && !this.isSimulated) {
        e.preventDefault();
      }
    },
    stopPropagation: function () {
      var e = this.originalEvent;
      this.isPropagationStopped = returnTrue;
      if (e && !this.isSimulated) {
        e.stopPropagation();
      }
    },
    stopImmediatePropagation: function () {
      var e = this.originalEvent;
      this.isImmediatePropagationStopped = returnTrue;
      if (e && !this.isSimulated) {
        e.stopImmediatePropagation();
      }
      this.stopPropagation();
    }
  };

  // Includes all common event props including KeyEvent and MouseEvent specific props
  jQuery.each({
    altKey: true,
    bubbles: true,
    cancelable: true,
    changedTouches: true,
    ctrlKey: true,
    detail: true,
    eventPhase: true,
    metaKey: true,
    pageX: true,
    pageY: true,
    shiftKey: true,
    view: true,
    "char": true,
    code: true,
    charCode: true,
    key: true,
    keyCode: true,
    button: true,
    buttons: true,
    clientX: true,
    clientY: true,
    offsetX: true,
    offsetY: true,
    pointerId: true,
    pointerType: true,
    screenX: true,
    screenY: true,
    targetTouches: true,
    toElement: true,
    touches: true,
    which: true
  }, jQuery.event.addProp);
  jQuery.each({
    focus: "focusin",
    blur: "focusout"
  }, function (type, delegateType) {
    function focusMappedHandler(nativeEvent) {
      if (document.documentMode) {
        // Support: IE 11+
        // Attach a single focusin/focusout handler on the document while someone wants
        // focus/blur. This is because the former are synchronous in IE while the latter
        // are async. In other browsers, all those handlers are invoked synchronously.

        // `handle` from private data would already wrap the event, but we need
        // to change the `type` here.
        var handle = dataPriv.get(this, "handle"),
          event = jQuery.event.fix(nativeEvent);
        event.type = nativeEvent.type === "focusin" ? "focus" : "blur";
        event.isSimulated = true;

        // First, handle focusin/focusout
        handle(nativeEvent);

        // ...then, handle focus/blur
        //
        // focus/blur don't bubble while focusin/focusout do; simulate the former by only
        // invoking the handler at the lower level.
        if (event.target === event.currentTarget) {
          // The setup part calls `leverageNative`, which, in turn, calls
          // `jQuery.event.add`, so event handle will already have been set
          // by this point.
          handle(event);
        }
      } else {
        // For non-IE browsers, attach a single capturing handler on the document
        // while someone wants focusin/focusout.
        jQuery.event.simulate(delegateType, nativeEvent.target, jQuery.event.fix(nativeEvent));
      }
    }
    jQuery.event.special[type] = {
      // Utilize native event if possible so blur/focus sequence is correct
      setup: function () {
        var attaches;

        // Claim the first handler
        // dataPriv.set( this, "focus", ... )
        // dataPriv.set( this, "blur", ... )
        leverageNative(this, type, true);
        if (document.documentMode) {
          // Support: IE 9 - 11+
          // We use the same native handler for focusin & focus (and focusout & blur)
          // so we need to coordinate setup & teardown parts between those events.
          // Use `delegateType` as the key as `type` is already used by `leverageNative`.
          attaches = dataPriv.get(this, delegateType);
          if (!attaches) {
            this.addEventListener(delegateType, focusMappedHandler);
          }
          dataPriv.set(this, delegateType, (attaches || 0) + 1);
        } else {
          // Return false to allow normal processing in the caller
          return false;
        }
      },
      trigger: function () {
        // Force setup before trigger
        leverageNative(this, type);

        // Return non-false to allow normal event-path propagation
        return true;
      },
      teardown: function () {
        var attaches;
        if (document.documentMode) {
          attaches = dataPriv.get(this, delegateType) - 1;
          if (!attaches) {
            this.removeEventListener(delegateType, focusMappedHandler);
            dataPriv.remove(this, delegateType);
          } else {
            dataPriv.set(this, delegateType, attaches);
          }
        } else {
          // Return false to indicate standard teardown should be applied
          return false;
        }
      },
      // Suppress native focus or blur if we're currently inside
      // a leveraged native-event stack
      _default: function (event) {
        return dataPriv.get(event.target, type);
      },
      delegateType: delegateType
    };

    // Support: Firefox <=44
    // Firefox doesn't have focus(in | out) events
    // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
    //
    // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
    // focus(in | out) events fire after focus & blur events,
    // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
    // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
    //
    // Support: IE 9 - 11+
    // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch,
    // attach a single handler for both events in IE.
    jQuery.event.special[delegateType] = {
      setup: function () {
        // Handle: regular nodes (via `this.ownerDocument`), window
        // (via `this.document`) & document (via `this`).
        var doc = this.ownerDocument || this.document || this,
          dataHolder = document.documentMode ? this : doc,
          attaches = dataPriv.get(dataHolder, delegateType);

        // Support: IE 9 - 11+
        // We use the same native handler for focusin & focus (and focusout & blur)
        // so we need to coordinate setup & teardown parts between those events.
        // Use `delegateType` as the key as `type` is already used by `leverageNative`.
        if (!attaches) {
          if (document.documentMode) {
            this.addEventListener(delegateType, focusMappedHandler);
          } else {
            doc.addEventListener(type, focusMappedHandler, true);
          }
        }
        dataPriv.set(dataHolder, delegateType, (attaches || 0) + 1);
      },
      teardown: function () {
        var doc = this.ownerDocument || this.document || this,
          dataHolder = document.documentMode ? this : doc,
          attaches = dataPriv.get(dataHolder, delegateType) - 1;
        if (!attaches) {
          if (document.documentMode) {
            this.removeEventListener(delegateType, focusMappedHandler);
          } else {
            doc.removeEventListener(type, focusMappedHandler, true);
          }
          dataPriv.remove(dataHolder, delegateType);
        } else {
          dataPriv.set(dataHolder, delegateType, attaches);
        }
      }
    };
  });

  // Create mouseenter/leave events using mouseover/out and event-time checks
  // so that event delegation works in jQuery.
  // Do the same for pointerenter/pointerleave and pointerover/pointerout
  //
  // Support: Safari 7 only
  // Safari sends mouseenter too often; see:
  // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  // for the description of the bug (it existed in older Chrome versions as well).
  jQuery.each({
    mouseenter: "mouseover",
    mouseleave: "mouseout",
    pointerenter: "pointerover",
    pointerleave: "pointerout"
  }, function (orig, fix) {
    jQuery.event.special[orig] = {
      delegateType: fix,
      bindType: fix,
      handle: function (event) {
        var ret,
          target = this,
          related = event.relatedTarget,
          handleObj = event.handleObj;

        // For mouseenter/leave call the handler if related is outside the target.
        // NB: No relatedTarget if the mouse left/entered the browser window
        if (!related || related !== target && !jQuery.contains(target, related)) {
          event.type = handleObj.origType;
          ret = handleObj.handler.apply(this, arguments);
          event.type = fix;
        }
        return ret;
      }
    };
  });
  jQuery.fn.extend({
    on: function (types, selector, data, fn) {
      return on(this, types, selector, data, fn);
    },
    one: function (types, selector, data, fn) {
      return on(this, types, selector, data, fn, 1);
    },
    off: function (types, selector, fn) {
      var handleObj, type;
      if (types && types.preventDefault && types.handleObj) {
        // ( event )  dispatched jQuery.Event
        handleObj = types.handleObj;
        jQuery(types.delegateTarget).off(handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler);
        return this;
      }
      if (typeof types === "object") {
        // ( types-object [, selector] )
        for (type in types) {
          this.off(type, selector, types[type]);
        }
        return this;
      }
      if (selector === false || typeof selector === "function") {
        // ( types [, fn] )
        fn = selector;
        selector = undefined;
      }
      if (fn === false) {
        fn = returnFalse;
      }
      return this.each(function () {
        jQuery.event.remove(this, types, fn, selector);
      });
    }
  });
  var
    // Support: IE <=10 - 11, Edge 12 - 13 only
    // In IE/Edge using regex groups here causes severe slowdowns.
    // See https://connect.microsoft.com/IE/feedback/details/1736512/
    rnoInnerhtml = /<script|<style|<link/i,
    // checked="checked" or checked
    rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
    rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;

  // Prefer a tbody over its parent table for containing new rows
  function manipulationTarget(elem, content) {
    if (nodeName(elem, "table") && nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr")) {
      return jQuery(elem).children("tbody")[0] || elem;
    }
    return elem;
  }

  // Replace/restore the type attribute of script elements for safe DOM manipulation
  function disableScript(elem) {
    elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
    return elem;
  }
  function restoreScript(elem) {
    if ((elem.type || "").slice(0, 5) === "true/") {
      elem.type = elem.type.slice(5);
    } else {
      elem.removeAttribute("type");
    }
    return elem;
  }
  function cloneCopyEvent(src, dest) {
    var i, l, type, pdataOld, udataOld, udataCur, events;
    if (dest.nodeType !== 1) {
      return;
    }

    // 1. Copy private data: events, handlers, etc.
    if (dataPriv.hasData(src)) {
      pdataOld = dataPriv.get(src);
      events = pdataOld.events;
      if (events) {
        dataPriv.remove(dest, "handle events");
        for (type in events) {
          for (i = 0, l = events[type].length; i < l; i++) {
            jQuery.event.add(dest, type, events[type][i]);
          }
        }
      }
    }

    // 2. Copy user data
    if (dataUser.hasData(src)) {
      udataOld = dataUser.access(src);
      udataCur = jQuery.extend({}, udataOld);
      dataUser.set(dest, udataCur);
    }
  }

  // Fix IE bugs, see support tests
  function fixInput(src, dest) {
    var nodeName = dest.nodeName.toLowerCase();

    // Fails to persist the checked state of a cloned checkbox or radio button.
    if (nodeName === "input" && rcheckableType.test(src.type)) {
      dest.checked = src.checked;

      // Fails to return the selected option to the default selected state when cloning options
    } else if (nodeName === "input" || nodeName === "textarea") {
      dest.defaultValue = src.defaultValue;
    }
  }
  function domManip(collection, args, callback, ignored) {
    // Flatten any nested arrays
    args = flat(args);
    var fragment,
      first,
      scripts,
      hasScripts,
      node,
      doc,
      i = 0,
      l = collection.length,
      iNoClone = l - 1,
      value = args[0],
      valueIsFunction = isFunction(value);

    // We can't cloneNode fragments that contain checked, in WebKit
    if (valueIsFunction || l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value)) {
      return collection.each(function (index) {
        var self = collection.eq(index);
        if (valueIsFunction) {
          args[0] = value.call(this, index, self.html());
        }
        domManip(self, args, callback, ignored);
      });
    }
    if (l) {
      fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored);
      first = fragment.firstChild;
      if (fragment.childNodes.length === 1) {
        fragment = first;
      }

      // Require either new content or an interest in ignored elements to invoke the callback
      if (first || ignored) {
        scripts = jQuery.map(getAll(fragment, "script"), disableScript);
        hasScripts = scripts.length;

        // Use the original fragment for the last item
        // instead of the first because it can end up
        // being emptied incorrectly in certain situations (trac-8070).
        for (; i < l; i++) {
          node = fragment;
          if (i !== iNoClone) {
            node = jQuery.clone(node, true, true);

            // Keep references to cloned scripts for later restoration
            if (hasScripts) {
              // Support: Android <=4.0 only, PhantomJS 1 only
              // push.apply(_, arraylike) throws on ancient WebKit
              jQuery.merge(scripts, getAll(node, "script"));
            }
          }
          callback.call(collection[i], node, i);
        }
        if (hasScripts) {
          doc = scripts[scripts.length - 1].ownerDocument;

          // Re-enable scripts
          jQuery.map(scripts, restoreScript);

          // Evaluate executable scripts on first document insertion
          for (i = 0; i < hasScripts; i++) {
            node = scripts[i];
            if (rscriptType.test(node.type || "") && !dataPriv.access(node, "globalEval") && jQuery.contains(doc, node)) {
              if (node.src && (node.type || "").toLowerCase() !== "module") {
                // Optional AJAX dependency, but won't run scripts if not present
                if (jQuery._evalUrl && !node.noModule) {
                  jQuery._evalUrl(node.src, {
                    nonce: node.nonce || node.getAttribute("nonce")
                  }, doc);
                }
              } else {
                // Unwrap a CDATA section containing script contents. This shouldn't be
                // needed as in XML documents they're already not visible when
                // inspecting element contents and in HTML documents they have no
                // meaning but we're preserving that logic for backwards compatibility.
                // This will be removed completely in 4.0. See gh-4904.
                DOMEval(node.textContent.replace(rcleanScript, ""), node, doc);
              }
            }
          }
        }
      }
    }
    return collection;
  }
  function remove(elem, selector, keepData) {
    var node,
      nodes = selector ? jQuery.filter(selector, elem) : elem,
      i = 0;
    for (; (node = nodes[i]) != null; i++) {
      if (!keepData && node.nodeType === 1) {
        jQuery.cleanData(getAll(node));
      }
      if (node.parentNode) {
        if (keepData && isAttached(node)) {
          setGlobalEval(getAll(node, "script"));
        }
        node.parentNode.removeChild(node);
      }
    }
    return elem;
  }
  jQuery.extend({
    htmlPrefilter: function (html) {
      return html;
    },
    clone: function (elem, dataAndEvents, deepDataAndEvents) {
      var i,
        l,
        srcElements,
        destElements,
        clone = elem.cloneNode(true),
        inPage = isAttached(elem);

      // Fix IE cloning issues
      if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) {
        // We eschew jQuery#find here for performance reasons:
        // https://jsperf.com/getall-vs-sizzle/2
        destElements = getAll(clone);
        srcElements = getAll(elem);
        for (i = 0, l = srcElements.length; i < l; i++) {
          fixInput(srcElements[i], destElements[i]);
        }
      }

      // Copy the events from the original to the clone
      if (dataAndEvents) {
        if (deepDataAndEvents) {
          srcElements = srcElements || getAll(elem);
          destElements = destElements || getAll(clone);
          for (i = 0, l = srcElements.length; i < l; i++) {
            cloneCopyEvent(srcElements[i], destElements[i]);
          }
        } else {
          cloneCopyEvent(elem, clone);
        }
      }

      // Preserve script evaluation history
      destElements = getAll(clone, "script");
      if (destElements.length > 0) {
        setGlobalEval(destElements, !inPage && getAll(elem, "script"));
      }

      // Return the cloned set
      return clone;
    },
    cleanData: function (elems) {
      var data,
        elem,
        type,
        special = jQuery.event.special,
        i = 0;
      for (; (elem = elems[i]) !== undefined; i++) {
        if (acceptData(elem)) {
          if (data = elem[dataPriv.expando]) {
            if (data.events) {
              for (type in data.events) {
                if (special[type]) {
                  jQuery.event.remove(elem, type);

                  // This is a shortcut to avoid jQuery.event.remove's overhead
                } else {
                  jQuery.removeEvent(elem, type, data.handle);
                }
              }
            }

            // Support: Chrome <=35 - 45+
            // Assign undefined instead of using delete, see Data#remove
            elem[dataPriv.expando] = undefined;
          }
          if (elem[dataUser.expando]) {
            // Support: Chrome <=35 - 45+
            // Assign undefined instead of using delete, see Data#remove
            elem[dataUser.expando] = undefined;
          }
        }
      }
    }
  });
  jQuery.fn.extend({
    detach: function (selector) {
      return remove(this, selector, true);
    },
    remove: function (selector) {
      return remove(this, selector);
    },
    text: function (value) {
      return access(this, function (value) {
        return value === undefined ? jQuery.text(this) : this.empty().each(function () {
          if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
            this.textContent = value;
          }
        });
      }, null, value, arguments.length);
    },
    append: function () {
      return domManip(this, arguments, function (elem) {
        if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
          var target = manipulationTarget(this, elem);
          target.appendChild(elem);
        }
      });
    },
    prepend: function () {
      return domManip(this, arguments, function (elem) {
        if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
          var target = manipulationTarget(this, elem);
          target.insertBefore(elem, target.firstChild);
        }
      });
    },
    before: function () {
      return domManip(this, arguments, function (elem) {
        if (this.parentNode) {
          this.parentNode.insertBefore(elem, this);
        }
      });
    },
    after: function () {
      return domManip(this, arguments, function (elem) {
        if (this.parentNode) {
          this.parentNode.insertBefore(elem, this.nextSibling);
        }
      });
    },
    empty: function () {
      var elem,
        i = 0;
      for (; (elem = this[i]) != null; i++) {
        if (elem.nodeType === 1) {
          // Prevent memory leaks
          jQuery.cleanData(getAll(elem, false));

          // Remove any remaining nodes
          elem.textContent = "";
        }
      }
      return this;
    },
    clone: function (dataAndEvents, deepDataAndEvents) {
      dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
      deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
      return this.map(function () {
        return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
      });
    },
    html: function (value) {
      return access(this, function (value) {
        var elem = this[0] || {},
          i = 0,
          l = this.length;
        if (value === undefined && elem.nodeType === 1) {
          return elem.innerHTML;
        }

        // See if we can take a shortcut and just use innerHTML
        if (typeof value === "string" && !rnoInnerhtml.test(value) && !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) {
          value = jQuery.htmlPrefilter(value);
          try {
            for (; i < l; i++) {
              elem = this[i] || {};

              // Remove element nodes and prevent memory leaks
              if (elem.nodeType === 1) {
                jQuery.cleanData(getAll(elem, false));
                elem.innerHTML = value;
              }
            }
            elem = 0;

            // If using innerHTML throws an exception, use the fallback method
          } catch (e) {}
        }
        if (elem) {
          this.empty().append(value);
        }
      }, null, value, arguments.length);
    },
    replaceWith: function () {
      var ignored = [];

      // Make the changes, replacing each non-ignored context element with the new content
      return domManip(this, arguments, function (elem) {
        var parent = this.parentNode;
        if (jQuery.inArray(this, ignored) < 0) {
          jQuery.cleanData(getAll(this));
          if (parent) {
            parent.replaceChild(elem, this);
          }
        }

        // Force callback invocation
      }, ignored);
    }
  });
  jQuery.each({
    appendTo: "append",
    prependTo: "prepend",
    insertBefore: "before",
    insertAfter: "after",
    replaceAll: "replaceWith"
  }, function (name, original) {
    jQuery.fn[name] = function (selector) {
      var elems,
        ret = [],
        insert = jQuery(selector),
        last = insert.length - 1,
        i = 0;
      for (; i <= last; i++) {
        elems = i === last ? this : this.clone(true);
        jQuery(insert[i])[original](elems);

        // Support: Android <=4.0 only, PhantomJS 1 only
        // .get() because push.apply(_, arraylike) throws on ancient WebKit
        push.apply(ret, elems.get());
      }
      return this.pushStack(ret);
    };
  });
  var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i");
  var rcustomProp = /^--/;
  var getStyles = function (elem) {
    // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)
    // IE throws on elements created in popups
    // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
    var view = elem.ownerDocument.defaultView;
    if (!view || !view.opener) {
      view = window;
    }
    return view.getComputedStyle(elem);
  };
  var swap = function (elem, options, callback) {
    var ret,
      name,
      old = {};

    // Remember the old values, and insert the new ones
    for (name in options) {
      old[name] = elem.style[name];
      elem.style[name] = options[name];
    }
    ret = callback.call(elem);

    // Revert the old values
    for (name in options) {
      elem.style[name] = old[name];
    }
    return ret;
  };
  var rboxStyle = new RegExp(cssExpand.join("|"), "i");
  (function () {
    // Executing both pixelPosition & boxSizingReliable tests require only one layout
    // so they're executed at the same time to save the second computation.
    function computeStyleTests() {
      // This is a singleton, we need to execute it only once
      if (!div) {
        return;
      }
      container.style.cssText = "position:absolute;left:-11111px;width:60px;" + "margin-top:1px;padding:0;border:0";
      div.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + "margin:auto;border:1px;padding:1px;" + "width:60%;top:1%";
      documentElement.appendChild(container).appendChild(div);
      var divStyle = window.getComputedStyle(div);
      pixelPositionVal = divStyle.top !== "1%";

      // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
      reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12;

      // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
      // Some styles come back with percentage values, even though they shouldn't
      div.style.right = "60%";
      pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36;

      // Support: IE 9 - 11 only
      // Detect misreporting of content dimensions for box-sizing:border-box elements
      boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36;

      // Support: IE 9 only
      // Detect overflow:scroll screwiness (gh-3699)
      // Support: Chrome <=64
      // Don't get tricked when zoom affects offsetWidth (gh-4029)
      div.style.position = "absolute";
      scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;
      documentElement.removeChild(container);

      // Nullify the div so it wouldn't be stored in the memory and
      // it will also be a sign that checks already performed
      div = null;
    }
    function roundPixelMeasures(measure) {
      return Math.round(parseFloat(measure));
    }
    var pixelPositionVal,
      boxSizingReliableVal,
      scrollboxSizeVal,
      pixelBoxStylesVal,
      reliableTrDimensionsVal,
      reliableMarginLeftVal,
      container = document.createElement("div"),
      div = document.createElement("div");

    // Finish early in limited (non-browser) environments
    if (!div.style) {
      return;
    }

    // Support: IE <=9 - 11 only
    // Style of cloned element affects source element cloned (trac-8908)
    div.style.backgroundClip = "content-box";
    div.cloneNode(true).style.backgroundClip = "";
    support.clearCloneStyle = div.style.backgroundClip === "content-box";
    jQuery.extend(support, {
      boxSizingReliable: function () {
        computeStyleTests();
        return boxSizingReliableVal;
      },
      pixelBoxStyles: function () {
        computeStyleTests();
        return pixelBoxStylesVal;
      },
      pixelPosition: function () {
        computeStyleTests();
        return pixelPositionVal;
      },
      reliableMarginLeft: function () {
        computeStyleTests();
        return reliableMarginLeftVal;
      },
      scrollboxSize: function () {
        computeStyleTests();
        return scrollboxSizeVal;
      },
      // Support: IE 9 - 11+, Edge 15 - 18+
      // IE/Edge misreport `getComputedStyle` of table rows with width/height
      // set in CSS while `offset*` properties report correct values.
      // Behavior in IE 9 is more subtle than in newer versions & it passes
      // some versions of this test; make sure not to make it pass there!
      //
      // Support: Firefox 70+
      // Only Firefox includes border widths
      // in computed dimensions. (gh-4529)
      reliableTrDimensions: function () {
        var table, tr, trChild, trStyle;
        if (reliableTrDimensionsVal == null) {
          table = document.createElement("table");
          tr = document.createElement("tr");
          trChild = document.createElement("div");
          table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
          tr.style.cssText = "box-sizing:content-box;border:1px solid";

          // Support: Chrome 86+
          // Height set through cssText does not get applied.
          // Computed height then comes back as 0.
          tr.style.height = "1px";
          trChild.style.height = "9px";

          // Support: Android 8 Chrome 86+
          // In our bodyBackground.html iframe,
          // display for all div elements is set to "inline",
          // which causes a problem only in Android 8 Chrome 86.
          // Ensuring the div is `display: block`
          // gets around this issue.
          trChild.style.display = "block";
          documentElement.appendChild(table).appendChild(tr).appendChild(trChild);
          trStyle = window.getComputedStyle(tr);
          reliableTrDimensionsVal = parseInt(trStyle.height, 10) + parseInt(trStyle.borderTopWidth, 10) + parseInt(trStyle.borderBottomWidth, 10) === tr.offsetHeight;
          documentElement.removeChild(table);
        }
        return reliableTrDimensionsVal;
      }
    });
  })();
  function curCSS(elem, name, computed) {
    var width,
      minWidth,
      maxWidth,
      ret,
      isCustomProp = rcustomProp.test(name),
      // Support: Firefox 51+
      // Retrieving style before computed somehow
      // fixes an issue with getting wrong values
      // on detached elements
      style = elem.style;
    computed = computed || getStyles(elem);

    // getPropertyValue is needed for:
    //   .css('filter') (IE 9 only, trac-12537)
    //   .css('--customProperty) (gh-3144)
    if (computed) {
      // Support: IE <=9 - 11+
      // IE only supports `"float"` in `getPropertyValue`; in computed styles
      // it's only available as `"cssFloat"`. We no longer modify properties
      // sent to `.css()` apart from camelCasing, so we need to check both.
      // Normally, this would create difference in behavior: if
      // `getPropertyValue` returns an empty string, the value returned
      // by `.css()` would be `undefined`. This is usually the case for
      // disconnected elements. However, in IE even disconnected elements
      // with no styles return `"none"` for `getPropertyValue( "float" )`
      ret = computed.getPropertyValue(name) || computed[name];
      if (isCustomProp && ret) {
        // Support: Firefox 105+, Chrome <=105+
        // Spec requires trimming whitespace for custom properties (gh-4926).
        // Firefox only trims leading whitespace. Chrome just collapses
        // both leading & trailing whitespace to a single space.
        //
        // Fall back to `undefined` if empty string returned.
        // This collapses a missing definition with property defined
        // and set to an empty string but there's no standard API
        // allowing us to differentiate them without a performance penalty
        // and returning `undefined` aligns with older jQuery.
        //
        // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED
        // as whitespace while CSS does not, but this is not a problem
        // because CSS preprocessing replaces them with U+000A LINE FEED
        // (which *is* CSS whitespace)
        // https://www.w3.org/TR/css-syntax-3/#input-preprocessing
        ret = ret.replace(rtrimCSS, "$1") || undefined;
      }
      if (ret === "" && !isAttached(elem)) {
        ret = jQuery.style(elem, name);
      }

      // A tribute to the "awesome hack by Dean Edwards"
      // Android Browser returns percentage for some values,
      // but width seems to be reliably pixels.
      // This is against the CSSOM draft spec:
      // https://drafts.csswg.org/cssom/#resolved-values
      if (!support.pixelBoxStyles() && rnumnonpx.test(ret) && rboxStyle.test(name)) {
        // Remember the original values
        width = style.width;
        minWidth = style.minWidth;
        maxWidth = style.maxWidth;

        // Put in the new values to get a computed value out
        style.minWidth = style.maxWidth = style.width = ret;
        ret = computed.width;

        // Revert the changed values
        style.width = width;
        style.minWidth = minWidth;
        style.maxWidth = maxWidth;
      }
    }
    return ret !== undefined ?
    // Support: IE <=9 - 11 only
    // IE returns zIndex value as an integer.
    ret + "" : ret;
  }
  function addGetHookIf(conditionFn, hookFn) {
    // Define the hook, we'll check on the first run if it's really needed.
    return {
      get: function () {
        if (conditionFn()) {
          // Hook not needed (or it's not possible to use it due
          // to missing dependency), remove it.
          delete this.get;
          return;
        }

        // Hook needed; redefine it so that the support test is not executed again.
        return (this.get = hookFn).apply(this, arguments);
      }
    };
  }
  var cssPrefixes = ["Webkit", "Moz", "ms"],
    emptyStyle = document.createElement("div").style,
    vendorProps = {};

  // Return a vendor-prefixed property or undefined
  function vendorPropName(name) {
    // Check for vendor prefixed names
    var capName = name[0].toUpperCase() + name.slice(1),
      i = cssPrefixes.length;
    while (i--) {
      name = cssPrefixes[i] + capName;
      if (name in emptyStyle) {
        return name;
      }
    }
  }

  // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
  function finalPropName(name) {
    var final = jQuery.cssProps[name] || vendorProps[name];
    if (final) {
      return final;
    }
    if (name in emptyStyle) {
      return name;
    }
    return vendorProps[name] = vendorPropName(name) || name;
  }
  var
    // Swappable if display is none or starts with table
    // except "table", "table-cell", or "table-caption"
    // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
    rdisplayswap = /^(none|table(?!-c[ea]).+)/,
    cssShow = {
      position: "absolute",
      visibility: "hidden",
      display: "block"
    },
    cssNormalTransform = {
      letterSpacing: "0",
      fontWeight: "400"
    };
  function setPositiveNumber(_elem, value, subtract) {
    // Any relative (+/-) values have already been
    // normalized at this point
    var matches = rcssNum.exec(value);
    return matches ?
    // Guard against undefined "subtract", e.g., when used as in cssHooks
    Math.max(0, matches[2] - (subtract || 0)) + (matches[3] || "px") : value;
  }
  function boxModelAdjustment(elem, dimension, box, isBorderBox, styles, computedVal) {
    var i = dimension === "width" ? 1 : 0,
      extra = 0,
      delta = 0,
      marginDelta = 0;

    // Adjustment may not be necessary
    if (box === (isBorderBox ? "border" : "content")) {
      return 0;
    }
    for (; i < 4; i += 2) {
      // Both box models exclude margin
      // Count margin delta separately to only add it after scroll gutter adjustment.
      // This is needed to make negative margins work with `outerHeight( true )` (gh-3982).
      if (box === "margin") {
        marginDelta += jQuery.css(elem, box + cssExpand[i], true, styles);
      }

      // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
      if (!isBorderBox) {
        // Add padding
        delta += jQuery.css(elem, "padding" + cssExpand[i], true, styles);

        // For "border" or "margin", add border
        if (box !== "padding") {
          delta += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);

          // But still keep track of it otherwise
        } else {
          extra += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
        }

        // If we get here with a border-box (content + padding + border), we're seeking "content" or
        // "padding" or "margin"
      } else {
        // For "content", subtract padding
        if (box === "content") {
          delta -= jQuery.css(elem, "padding" + cssExpand[i], true, styles);
        }

        // For "content" or "padding", subtract border
        if (box !== "margin") {
          delta -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
        }
      }
    }

    // Account for positive content-box scroll gutter when requested by providing computedVal
    if (!isBorderBox && computedVal >= 0) {
      // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
      // Assuming integer scroll gutter, subtract the rest and round down
      delta += Math.max(0, Math.ceil(elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - computedVal - delta - extra - 0.5

      // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
      // Use an explicit zero to avoid NaN (gh-3964)
      )) || 0;
    }
    return delta + marginDelta;
  }
  function getWidthOrHeight(elem, dimension, extra) {
    // Start with computed style
    var styles = getStyles(elem),
      // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
      // Fake content-box until we know it's needed to know the true value.
      boxSizingNeeded = !support.boxSizingReliable() || extra,
      isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box",
      valueIsBorderBox = isBorderBox,
      val = curCSS(elem, dimension, styles),
      offsetProp = "offset" + dimension[0].toUpperCase() + dimension.slice(1);

    // Support: Firefox <=54
    // Return a confounding non-pixel value or feign ignorance, as appropriate.
    if (rnumnonpx.test(val)) {
      if (!extra) {
        return val;
      }
      val = "auto";
    }

    // Support: IE 9 - 11 only
    // Use offsetWidth/offsetHeight for when box sizing is unreliable.
    // In those cases, the computed value can be trusted to be border-box.
    if ((!support.boxSizingReliable() && isBorderBox ||
    // Support: IE 10 - 11+, Edge 15 - 18+
    // IE/Edge misreport `getComputedStyle` of table rows with width/height
    // set in CSS while `offset*` properties report correct values.
    // Interestingly, in some cases IE 9 doesn't suffer from this issue.
    !support.reliableTrDimensions() && nodeName(elem, "tr") ||
    // Fall back to offsetWidth/offsetHeight when value is "auto"
    // This happens for inline elements with no explicit setting (gh-3571)
    val === "auto" ||
    // Support: Android <=4.1 - 4.3 only
    // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
    !parseFloat(val) && jQuery.css(elem, "display", false, styles) === "inline") &&
    // Make sure the element is visible & connected
    elem.getClientRects().length) {
      isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box";

      // Where available, offsetWidth/offsetHeight approximate border box dimensions.
      // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
      // retrieved value as a content box dimension.
      valueIsBorderBox = offsetProp in elem;
      if (valueIsBorderBox) {
        val = elem[offsetProp];
      }
    }

    // Normalize "" and auto
    val = parseFloat(val) || 0;

    // Adjust for the element's box model
    return val + boxModelAdjustment(elem, dimension, extra || (isBorderBox ? "border" : "content"), valueIsBorderBox, styles,
    // Provide the current computed size to request scroll gutter calculation (gh-3589)
    val) + "px";
  }
  jQuery.extend({
    // Add in style property hooks for overriding the default
    // behavior of getting and setting a style property
    cssHooks: {
      opacity: {
        get: function (elem, computed) {
          if (computed) {
            // We should always get a number back from opacity
            var ret = curCSS(elem, "opacity");
            return ret === "" ? "1" : ret;
          }
        }
      }
    },
    // Don't automatically add "px" to these possibly-unitless properties
    cssNumber: {
      animationIterationCount: true,
      aspectRatio: true,
      borderImageSlice: true,
      columnCount: true,
      flexGrow: true,
      flexShrink: true,
      fontWeight: true,
      gridArea: true,
      gridColumn: true,
      gridColumnEnd: true,
      gridColumnStart: true,
      gridRow: true,
      gridRowEnd: true,
      gridRowStart: true,
      lineHeight: true,
      opacity: true,
      order: true,
      orphans: true,
      scale: true,
      widows: true,
      zIndex: true,
      zoom: true,
      // SVG-related
      fillOpacity: true,
      floodOpacity: true,
      stopOpacity: true,
      strokeMiterlimit: true,
      strokeOpacity: true
    },
    // Add in properties whose names you wish to fix before
    // setting or getting the value
    cssProps: {},
    // Get and set the style property on a DOM Node
    style: function (elem, name, value, extra) {
      // Don't set styles on text and comment nodes
      if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
        return;
      }

      // Make sure that we're working with the right name
      var ret,
        type,
        hooks,
        origName = camelCase(name),
        isCustomProp = rcustomProp.test(name),
        style = elem.style;

      // Make sure that we're working with the right name. We don't
      // want to query the value if it is a CSS custom property
      // since they are user-defined.
      if (!isCustomProp) {
        name = finalPropName(origName);
      }

      // Gets hook for the prefixed version, then unprefixed version
      hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];

      // Check if we're setting a value
      if (value !== undefined) {
        type = typeof value;

        // Convert "+=" or "-=" to relative numbers (trac-7345)
        if (type === "string" && (ret = rcssNum.exec(value)) && ret[1]) {
          value = adjustCSS(elem, name, ret);

          // Fixes bug trac-9237
          type = "number";
        }

        // Make sure that null and NaN values aren't set (trac-7116)
        if (value == null || value !== value) {
          return;
        }

        // If a number was passed in, add the unit (except for certain CSS properties)
        // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
        // "px" to a few hardcoded values.
        if (type === "number" && !isCustomProp) {
          value += ret && ret[3] || (jQuery.cssNumber[origName] ? "" : "px");
        }

        // background-* props affect original clone's values
        if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
          style[name] = "inherit";
        }

        // If a hook was provided, use that value, otherwise just set the specified value
        if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) {
          if (isCustomProp) {
            style.setProperty(name, value);
          } else {
            style[name] = value;
          }
        }
      } else {
        // If a hook was provided get the non-computed value from there
        if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) {
          return ret;
        }

        // Otherwise just get the value from the style object
        return style[name];
      }
    },
    css: function (elem, name, extra, styles) {
      var val,
        num,
        hooks,
        origName = camelCase(name),
        isCustomProp = rcustomProp.test(name);

      // Make sure that we're working with the right name. We don't
      // want to modify the value if it is a CSS custom property
      // since they are user-defined.
      if (!isCustomProp) {
        name = finalPropName(origName);
      }

      // Try prefixed name followed by the unprefixed name
      hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];

      // If a hook was provided get the computed value from there
      if (hooks && "get" in hooks) {
        val = hooks.get(elem, true, extra);
      }

      // Otherwise, if a way to get the computed value exists, use that
      if (val === undefined) {
        val = curCSS(elem, name, styles);
      }

      // Convert "normal" to computed value
      if (val === "normal" && name in cssNormalTransform) {
        val = cssNormalTransform[name];
      }

      // Make numeric if forced or a qualifier was provided and val looks numeric
      if (extra === "" || extra) {
        num = parseFloat(val);
        return extra === true || isFinite(num) ? num || 0 : val;
      }
      return val;
    }
  });
  jQuery.each(["height", "width"], function (_i, dimension) {
    jQuery.cssHooks[dimension] = {
      get: function (elem, computed, extra) {
        if (computed) {
          // Certain elements can have dimension info if we invisibly show them
          // but it must have a current display style that would benefit
          return rdisplayswap.test(jQuery.css(elem, "display")) && (
          // Support: Safari 8+
          // Table columns in Safari have non-zero offsetWidth & zero
          // getBoundingClientRect().width unless display is changed.
          // Support: IE <=11 only
          // Running getBoundingClientRect on a disconnected node
          // in IE throws an error.
          !elem.getClientRects().length || !elem.getBoundingClientRect().width) ? swap(elem, cssShow, function () {
            return getWidthOrHeight(elem, dimension, extra);
          }) : getWidthOrHeight(elem, dimension, extra);
        }
      },
      set: function (elem, value, extra) {
        var matches,
          styles = getStyles(elem),
          // Only read styles.position if the test has a chance to fail
          // to avoid forcing a reflow.
          scrollboxSizeBuggy = !support.scrollboxSize() && styles.position === "absolute",
          // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
          boxSizingNeeded = scrollboxSizeBuggy || extra,
          isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box",
          subtract = extra ? boxModelAdjustment(elem, dimension, extra, isBorderBox, styles) : 0;

        // Account for unreliable border-box dimensions by comparing offset* to computed and
        // faking a content-box to get border and padding (gh-3699)
        if (isBorderBox && scrollboxSizeBuggy) {
          subtract -= Math.ceil(elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - parseFloat(styles[dimension]) - boxModelAdjustment(elem, dimension, "border", false, styles) - 0.5);
        }

        // Convert to pixels if value adjustment is needed
        if (subtract && (matches = rcssNum.exec(value)) && (matches[3] || "px") !== "px") {
          elem.style[dimension] = value;
          value = jQuery.css(elem, dimension);
        }
        return setPositiveNumber(elem, value, subtract);
      }
    };
  });
  jQuery.cssHooks.marginLeft = addGetHookIf(support.reliableMarginLeft, function (elem, computed) {
    if (computed) {
      return (parseFloat(curCSS(elem, "marginLeft")) || elem.getBoundingClientRect().left - swap(elem, {
        marginLeft: 0
      }, function () {
        return elem.getBoundingClientRect().left;
      })) + "px";
    }
  });

  // These hooks are used by animate to expand properties
  jQuery.each({
    margin: "",
    padding: "",
    border: "Width"
  }, function (prefix, suffix) {
    jQuery.cssHooks[prefix + suffix] = {
      expand: function (value) {
        var i = 0,
          expanded = {},
          // Assumes a single number if not a string
          parts = typeof value === "string" ? value.split(" ") : [value];
        for (; i < 4; i++) {
          expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0];
        }
        return expanded;
      }
    };
    if (prefix !== "margin") {
      jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
    }
  });
  jQuery.fn.extend({
    css: function (name, value) {
      return access(this, function (elem, name, value) {
        var styles,
          len,
          map = {},
          i = 0;
        if (Array.isArray(name)) {
          styles = getStyles(elem);
          len = name.length;
          for (; i < len; i++) {
            map[name[i]] = jQuery.css(elem, name[i], false, styles);
          }
          return map;
        }
        return value !== undefined ? jQuery.style(elem, name, value) : jQuery.css(elem, name);
      }, name, value, arguments.length > 1);
    }
  });
  function Tween(elem, options, prop, end, easing) {
    return new Tween.prototype.init(elem, options, prop, end, easing);
  }
  jQuery.Tween = Tween;
  Tween.prototype = {
    constructor: Tween,
    init: function (elem, options, prop, end, easing, unit) {
      this.elem = elem;
      this.prop = prop;
      this.easing = easing || jQuery.easing._default;
      this.options = options;
      this.start = this.now = this.cur();
      this.end = end;
      this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
    },
    cur: function () {
      var hooks = Tween.propHooks[this.prop];
      return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this);
    },
    run: function (percent) {
      var eased,
        hooks = Tween.propHooks[this.prop];
      if (this.options.duration) {
        this.pos = eased = jQuery.easing[this.easing](percent, this.options.duration * percent, 0, 1, this.options.duration);
      } else {
        this.pos = eased = percent;
      }
      this.now = (this.end - this.start) * eased + this.start;
      if (this.options.step) {
        this.options.step.call(this.elem, this.now, this);
      }
      if (hooks && hooks.set) {
        hooks.set(this);
      } else {
        Tween.propHooks._default.set(this);
      }
      return this;
    }
  };
  Tween.prototype.init.prototype = Tween.prototype;
  Tween.propHooks = {
    _default: {
      get: function (tween) {
        var result;

        // Use a property on the element directly when it is not a DOM element,
        // or when there is no matching style property that exists.
        if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) {
          return tween.elem[tween.prop];
        }

        // Passing an empty string as a 3rd parameter to .css will automatically
        // attempt a parseFloat and fallback to a string if the parse fails.
        // Simple values such as "10px" are parsed to Float;
        // complex values such as "rotate(1rad)" are returned as-is.
        result = jQuery.css(tween.elem, tween.prop, "");

        // Empty strings, null, undefined and "auto" are converted to 0.
        return !result || result === "auto" ? 0 : result;
      },
      set: function (tween) {
        // Use step hook for back compat.
        // Use cssHook if its there.
        // Use .style if available and use plain properties where available.
        if (jQuery.fx.step[tween.prop]) {
          jQuery.fx.step[tween.prop](tween);
        } else if (tween.elem.nodeType === 1 && (jQuery.cssHooks[tween.prop] || tween.elem.style[finalPropName(tween.prop)] != null)) {
          jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
        } else {
          tween.elem[tween.prop] = tween.now;
        }
      }
    }
  };

  // Support: IE <=9 only
  // Panic based approach to setting things on disconnected nodes
  Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
    set: function (tween) {
      if (tween.elem.nodeType && tween.elem.parentNode) {
        tween.elem[tween.prop] = tween.now;
      }
    }
  };
  jQuery.easing = {
    linear: function (p) {
      return p;
    },
    swing: function (p) {
      return 0.5 - Math.cos(p * Math.PI) / 2;
    },
    _default: "swing"
  };
  jQuery.fx = Tween.prototype.init;

  // Back compat <1.8 extension point
  jQuery.fx.step = {};
  var fxNow,
    inProgress,
    rfxtypes = /^(?:toggle|show|hide)$/,
    rrun = /queueHooks$/;
  function schedule() {
    if (inProgress) {
      if (document.hidden === false && window.requestAnimationFrame) {
        window.requestAnimationFrame(schedule);
      } else {
        window.setTimeout(schedule, jQuery.fx.interval);
      }
      jQuery.fx.tick();
    }
  }

  // Animations created synchronously will run synchronously
  function createFxNow() {
    window.setTimeout(function () {
      fxNow = undefined;
    });
    return fxNow = Date.now();
  }

  // Generate parameters to create a standard animation
  function genFx(type, includeWidth) {
    var which,
      i = 0,
      attrs = {
        height: type
      };

    // If we include width, step value is 1 to do all cssExpand values,
    // otherwise step value is 2 to skip over Left and Right
    includeWidth = includeWidth ? 1 : 0;
    for (; i < 4; i += 2 - includeWidth) {
      which = cssExpand[i];
      attrs["margin" + which] = attrs["padding" + which] = type;
    }
    if (includeWidth) {
      attrs.opacity = attrs.width = type;
    }
    return attrs;
  }
  function createTween(value, prop, animation) {
    var tween,
      collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners["*"]),
      index = 0,
      length = collection.length;
    for (; index < length; index++) {
      if (tween = collection[index].call(animation, prop, value)) {
        // We're done with this property
        return tween;
      }
    }
  }
  function defaultPrefilter(elem, props, opts) {
    var prop,
      value,
      toggle,
      hooks,
      oldfire,
      propTween,
      restoreDisplay,
      display,
      isBox = "width" in props || "height" in props,
      anim = this,
      orig = {},
      style = elem.style,
      hidden = elem.nodeType && isHiddenWithinTree(elem),
      dataShow = dataPriv.get(elem, "fxshow");

    // Queue-skipping animations hijack the fx hooks
    if (!opts.queue) {
      hooks = jQuery._queueHooks(elem, "fx");
      if (hooks.unqueued == null) {
        hooks.unqueued = 0;
        oldfire = hooks.empty.fire;
        hooks.empty.fire = function () {
          if (!hooks.unqueued) {
            oldfire();
          }
        };
      }
      hooks.unqueued++;
      anim.always(function () {
        // Ensure the complete handler is called before this completes
        anim.always(function () {
          hooks.unqueued--;
          if (!jQuery.queue(elem, "fx").length) {
            hooks.empty.fire();
          }
        });
      });
    }

    // Detect show/hide animations
    for (prop in props) {
      value = props[prop];
      if (rfxtypes.test(value)) {
        delete props[prop];
        toggle = toggle || value === "toggle";
        if (value === (hidden ? "hide" : "show")) {
          // Pretend to be hidden if this is a "show" and
          // there is still data from a stopped show/hide
          if (value === "show" && dataShow && dataShow[prop] !== undefined) {
            hidden = true;

            // Ignore all other no-op show/hide data
          } else {
            continue;
          }
        }
        orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
      }
    }

    // Bail out if this is a no-op like .hide().hide()
    propTween = !jQuery.isEmptyObject(props);
    if (!propTween && jQuery.isEmptyObject(orig)) {
      return;
    }

    // Restrict "overflow" and "display" styles during box animations
    if (isBox && elem.nodeType === 1) {
      // Support: IE <=9 - 11, Edge 12 - 15
      // Record all 3 overflow attributes because IE does not infer the shorthand
      // from identically-valued overflowX and overflowY and Edge just mirrors
      // the overflowX value there.
      opts.overflow = [style.overflow, style.overflowX, style.overflowY];

      // Identify a display type, preferring old show/hide data over the CSS cascade
      restoreDisplay = dataShow && dataShow.display;
      if (restoreDisplay == null) {
        restoreDisplay = dataPriv.get(elem, "display");
      }
      display = jQuery.css(elem, "display");
      if (display === "none") {
        if (restoreDisplay) {
          display = restoreDisplay;
        } else {
          // Get nonempty value(s) by temporarily forcing visibility
          showHide([elem], true);
          restoreDisplay = elem.style.display || restoreDisplay;
          display = jQuery.css(elem, "display");
          showHide([elem]);
        }
      }

      // Animate inline elements as inline-block
      if (display === "inline" || display === "inline-block" && restoreDisplay != null) {
        if (jQuery.css(elem, "float") === "none") {
          // Restore the original display value at the end of pure show/hide animations
          if (!propTween) {
            anim.done(function () {
              style.display = restoreDisplay;
            });
            if (restoreDisplay == null) {
              display = style.display;
              restoreDisplay = display === "none" ? "" : display;
            }
          }
          style.display = "inline-block";
        }
      }
    }
    if (opts.overflow) {
      style.overflow = "hidden";
      anim.always(function () {
        style.overflow = opts.overflow[0];
        style.overflowX = opts.overflow[1];
        style.overflowY = opts.overflow[2];
      });
    }

    // Implement show/hide animations
    propTween = false;
    for (prop in orig) {
      // General show/hide setup for this element animation
      if (!propTween) {
        if (dataShow) {
          if ("hidden" in dataShow) {
            hidden = dataShow.hidden;
          }
        } else {
          dataShow = dataPriv.access(elem, "fxshow", {
            display: restoreDisplay
          });
        }

        // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
        if (toggle) {
          dataShow.hidden = !hidden;
        }

        // Show elements before animating them
        if (hidden) {
          showHide([elem], true);
        }

        /* eslint-disable no-loop-func */

        anim.done(function () {
          /* eslint-enable no-loop-func */

          // The final step of a "hide" animation is actually hiding the element
          if (!hidden) {
            showHide([elem]);
          }
          dataPriv.remove(elem, "fxshow");
          for (prop in orig) {
            jQuery.style(elem, prop, orig[prop]);
          }
        });
      }

      // Per-property setup
      propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
      if (!(prop in dataShow)) {
        dataShow[prop] = propTween.start;
        if (hidden) {
          propTween.end = propTween.start;
          propTween.start = 0;
        }
      }
    }
  }
  function propFilter(props, specialEasing) {
    var index, name, easing, value, hooks;

    // camelCase, specialEasing and expand cssHook pass
    for (index in props) {
      name = camelCase(index);
      easing = specialEasing[name];
      value = props[index];
      if (Array.isArray(value)) {
        easing = value[1];
        value = props[index] = value[0];
      }
      if (index !== name) {
        props[name] = value;
        delete props[index];
      }
      hooks = jQuery.cssHooks[name];
      if (hooks && "expand" in hooks) {
        value = hooks.expand(value);
        delete props[name];

        // Not quite $.extend, this won't overwrite existing keys.
        // Reusing 'index' because we have the correct "name"
        for (index in value) {
          if (!(index in props)) {
            props[index] = value[index];
            specialEasing[index] = easing;
          }
        }
      } else {
        specialEasing[name] = easing;
      }
    }
  }
  function Animation(elem, properties, options) {
    var result,
      stopped,
      index = 0,
      length = Animation.prefilters.length,
      deferred = jQuery.Deferred().always(function () {
        // Don't match elem in the :animated selector
        delete tick.elem;
      }),
      tick = function () {
        if (stopped) {
          return false;
        }
        var currentTime = fxNow || createFxNow(),
          remaining = Math.max(0, animation.startTime + animation.duration - currentTime),
          // Support: Android 2.3 only
          // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497)
          temp = remaining / animation.duration || 0,
          percent = 1 - temp,
          index = 0,
          length = animation.tweens.length;
        for (; index < length; index++) {
          animation.tweens[index].run(percent);
        }
        deferred.notifyWith(elem, [animation, percent, remaining]);

        // If there's more to do, yield
        if (percent < 1 && length) {
          return remaining;
        }

        // If this was an empty animation, synthesize a final progress notification
        if (!length) {
          deferred.notifyWith(elem, [animation, 1, 0]);
        }

        // Resolve the animation and report its conclusion
        deferred.resolveWith(elem, [animation]);
        return false;
      },
      animation = deferred.promise({
        elem: elem,
        props: jQuery.extend({}, properties),
        opts: jQuery.extend(true, {
          specialEasing: {},
          easing: jQuery.easing._default
        }, options),
        originalProperties: properties,
        originalOptions: options,
        startTime: fxNow || createFxNow(),
        duration: options.duration,
        tweens: [],
        createTween: function (prop, end) {
          var tween = jQuery.Tween(elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing);
          animation.tweens.push(tween);
          return tween;
        },
        stop: function (gotoEnd) {
          var index = 0,
            // If we are going to the end, we want to run all the tweens
            // otherwise we skip this part
            length = gotoEnd ? animation.tweens.length : 0;
          if (stopped) {
            return this;
          }
          stopped = true;
          for (; index < length; index++) {
            animation.tweens[index].run(1);
          }

          // Resolve when we played the last frame; otherwise, reject
          if (gotoEnd) {
            deferred.notifyWith(elem, [animation, 1, 0]);
            deferred.resolveWith(elem, [animation, gotoEnd]);
          } else {
            deferred.rejectWith(elem, [animation, gotoEnd]);
          }
          return this;
        }
      }),
      props = animation.props;
    propFilter(props, animation.opts.specialEasing);
    for (; index < length; index++) {
      result = Animation.prefilters[index].call(animation, elem, props, animation.opts);
      if (result) {
        if (isFunction(result.stop)) {
          jQuery._queueHooks(animation.elem, animation.opts.queue).stop = result.stop.bind(result);
        }
        return result;
      }
    }
    jQuery.map(props, createTween, animation);
    if (isFunction(animation.opts.start)) {
      animation.opts.start.call(elem, animation);
    }

    // Attach callbacks from options
    animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);
    jQuery.fx.timer(jQuery.extend(tick, {
      elem: elem,
      anim: animation,
      queue: animation.opts.queue
    }));
    return animation;
  }
  jQuery.Animation = jQuery.extend(Animation, {
    tweeners: {
      "*": [function (prop, value) {
        var tween = this.createTween(prop, value);
        adjustCSS(tween.elem, prop, rcssNum.exec(value), tween);
        return tween;
      }]
    },
    tweener: function (props, callback) {
      if (isFunction(props)) {
        callback = props;
        props = ["*"];
      } else {
        props = props.match(rnothtmlwhite);
      }
      var prop,
        index = 0,
        length = props.length;
      for (; index < length; index++) {
        prop = props[index];
        Animation.tweeners[prop] = Animation.tweeners[prop] || [];
        Animation.tweeners[prop].unshift(callback);
      }
    },
    prefilters: [defaultPrefilter],
    prefilter: function (callback, prepend) {
      if (prepend) {
        Animation.prefilters.unshift(callback);
      } else {
        Animation.prefilters.push(callback);
      }
    }
  });
  jQuery.speed = function (speed, easing, fn) {
    var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
      complete: fn || !fn && easing || isFunction(speed) && speed,
      duration: speed,
      easing: fn && easing || easing && !isFunction(easing) && easing
    };

    // Go to the end state if fx are off
    if (jQuery.fx.off) {
      opt.duration = 0;
    } else {
      if (typeof opt.duration !== "number") {
        if (opt.duration in jQuery.fx.speeds) {
          opt.duration = jQuery.fx.speeds[opt.duration];
        } else {
          opt.duration = jQuery.fx.speeds._default;
        }
      }
    }

    // Normalize opt.queue - true/undefined/null -> "fx"
    if (opt.queue == null || opt.queue === true) {
      opt.queue = "fx";
    }

    // Queueing
    opt.old = opt.complete;
    opt.complete = function () {
      if (isFunction(opt.old)) {
        opt.old.call(this);
      }
      if (opt.queue) {
        jQuery.dequeue(this, opt.queue);
      }
    };
    return opt;
  };
  jQuery.fn.extend({
    fadeTo: function (speed, to, easing, callback) {
      // Show any hidden elements after setting opacity to 0
      return this.filter(isHiddenWithinTree).css("opacity", 0).show()

      // Animate to the value specified
      .end().animate({
        opacity: to
      }, speed, easing, callback);
    },
    animate: function (prop, speed, easing, callback) {
      var empty = jQuery.isEmptyObject(prop),
        optall = jQuery.speed(speed, easing, callback),
        doAnimation = function () {
          // Operate on a copy of prop so per-property easing won't be lost
          var anim = Animation(this, jQuery.extend({}, prop), optall);

          // Empty animations, or finishing resolves immediately
          if (empty || dataPriv.get(this, "finish")) {
            anim.stop(true);
          }
        };
      doAnimation.finish = doAnimation;
      return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation);
    },
    stop: function (type, clearQueue, gotoEnd) {
      var stopQueue = function (hooks) {
        var stop = hooks.stop;
        delete hooks.stop;
        stop(gotoEnd);
      };
      if (typeof type !== "string") {
        gotoEnd = clearQueue;
        clearQueue = type;
        type = undefined;
      }
      if (clearQueue) {
        this.queue(type || "fx", []);
      }
      return this.each(function () {
        var dequeue = true,
          index = type != null && type + "queueHooks",
          timers = jQuery.timers,
          data = dataPriv.get(this);
        if (index) {
          if (data[index] && data[index].stop) {
            stopQueue(data[index]);
          }
        } else {
          for (index in data) {
            if (data[index] && data[index].stop && rrun.test(index)) {
              stopQueue(data[index]);
            }
          }
        }
        for (index = timers.length; index--;) {
          if (timers[index].elem === this && (type == null || timers[index].queue === type)) {
            timers[index].anim.stop(gotoEnd);
            dequeue = false;
            timers.splice(index, 1);
          }
        }

        // Start the next in the queue if the last step wasn't forced.
        // Timers currently will call their complete callbacks, which
        // will dequeue but only if they were gotoEnd.
        if (dequeue || !gotoEnd) {
          jQuery.dequeue(this, type);
        }
      });
    },
    finish: function (type) {
      if (type !== false) {
        type = type || "fx";
      }
      return this.each(function () {
        var index,
          data = dataPriv.get(this),
          queue = data[type + "queue"],
          hooks = data[type + "queueHooks"],
          timers = jQuery.timers,
          length = queue ? queue.length : 0;

        // Enable finishing flag on private data
        data.finish = true;

        // Empty the queue first
        jQuery.queue(this, type, []);
        if (hooks && hooks.stop) {
          hooks.stop.call(this, true);
        }

        // Look for any active animations, and finish them
        for (index = timers.length; index--;) {
          if (timers[index].elem === this && timers[index].queue === type) {
            timers[index].anim.stop(true);
            timers.splice(index, 1);
          }
        }

        // Look for any animations in the old queue and finish them
        for (index = 0; index < length; index++) {
          if (queue[index] && queue[index].finish) {
            queue[index].finish.call(this);
          }
        }

        // Turn off finishing flag
        delete data.finish;
      });
    }
  });
  jQuery.each(["toggle", "show", "hide"], function (_i, name) {
    var cssFn = jQuery.fn[name];
    jQuery.fn[name] = function (speed, easing, callback) {
      return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback);
    };
  });

  // Generate shortcuts for custom animations
  jQuery.each({
    slideDown: genFx("show"),
    slideUp: genFx("hide"),
    slideToggle: genFx("toggle"),
    fadeIn: {
      opacity: "show"
    },
    fadeOut: {
      opacity: "hide"
    },
    fadeToggle: {
      opacity: "toggle"
    }
  }, function (name, props) {
    jQuery.fn[name] = function (speed, easing, callback) {
      return this.animate(props, speed, easing, callback);
    };
  });
  jQuery.timers = [];
  jQuery.fx.tick = function () {
    var timer,
      i = 0,
      timers = jQuery.timers;
    fxNow = Date.now();
    for (; i < timers.length; i++) {
      timer = timers[i];

      // Run the timer and safely remove it when done (allowing for external removal)
      if (!timer() && timers[i] === timer) {
        timers.splice(i--, 1);
      }
    }
    if (!timers.length) {
      jQuery.fx.stop();
    }
    fxNow = undefined;
  };
  jQuery.fx.timer = function (timer) {
    jQuery.timers.push(timer);
    jQuery.fx.start();
  };
  jQuery.fx.interval = 13;
  jQuery.fx.start = function () {
    if (inProgress) {
      return;
    }
    inProgress = true;
    schedule();
  };
  jQuery.fx.stop = function () {
    inProgress = null;
  };
  jQuery.fx.speeds = {
    slow: 600,
    fast: 200,
    // Default speed
    _default: 400
  };

  // Based off of the plugin by Clint Helfers, with permission.
  jQuery.fn.delay = function (time, type) {
    time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
    type = type || "fx";
    return this.queue(type, function (next, hooks) {
      var timeout = window.setTimeout(next, time);
      hooks.stop = function () {
        window.clearTimeout(timeout);
      };
    });
  };
  (function () {
    var input = document.createElement("input"),
      select = document.createElement("select"),
      opt = select.appendChild(document.createElement("option"));
    input.type = "checkbox";

    // Support: Android <=4.3 only
    // Default value for a checkbox should be "on"
    support.checkOn = input.value !== "";

    // Support: IE <=11 only
    // Must access selectedIndex to make default options select
    support.optSelected = opt.selected;

    // Support: IE <=11 only
    // An input loses its value after becoming a radio
    input = document.createElement("input");
    input.value = "t";
    input.type = "radio";
    support.radioValue = input.value === "t";
  })();
  var boolHook,
    attrHandle = jQuery.expr.attrHandle;
  jQuery.fn.extend({
    attr: function (name, value) {
      return access(this, jQuery.attr, name, value, arguments.length > 1);
    },
    removeAttr: function (name) {
      return this.each(function () {
        jQuery.removeAttr(this, name);
      });
    }
  });
  jQuery.extend({
    attr: function (elem, name, value) {
      var ret,
        hooks,
        nType = elem.nodeType;

      // Don't get/set attributes on text, comment and attribute nodes
      if (nType === 3 || nType === 8 || nType === 2) {
        return;
      }

      // Fallback to prop when attributes are not supported
      if (typeof elem.getAttribute === "undefined") {
        return jQuery.prop(elem, name, value);
      }

      // Attribute hooks are determined by the lowercase version
      // Grab necessary hook if one is defined
      if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
        hooks = jQuery.attrHooks[name.toLowerCase()] || (jQuery.expr.match.bool.test(name) ? boolHook : undefined);
      }
      if (value !== undefined) {
        if (value === null) {
          jQuery.removeAttr(elem, name);
          return;
        }
        if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {
          return ret;
        }
        elem.setAttribute(name, value + "");
        return value;
      }
      if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
        return ret;
      }
      ret = jQuery.find.attr(elem, name);

      // Non-existent attributes return null, we normalize to undefined
      return ret == null ? undefined : ret;
    },
    attrHooks: {
      type: {
        set: function (elem, value) {
          if (!support.radioValue && value === "radio" && nodeName(elem, "input")) {
            var val = elem.value;
            elem.setAttribute("type", value);
            if (val) {
              elem.value = val;
            }
            return value;
          }
        }
      }
    },
    removeAttr: function (elem, value) {
      var name,
        i = 0,
        // Attribute names can contain non-HTML whitespace characters
        // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
        attrNames = value && value.match(rnothtmlwhite);
      if (attrNames && elem.nodeType === 1) {
        while (name = attrNames[i++]) {
          elem.removeAttribute(name);
        }
      }
    }
  });

  // Hooks for boolean attributes
  boolHook = {
    set: function (elem, value, name) {
      if (value === false) {
        // Remove boolean attributes when set to false
        jQuery.removeAttr(elem, name);
      } else {
        elem.setAttribute(name, name);
      }
      return name;
    }
  };
  jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function (_i, name) {
    var getter = attrHandle[name] || jQuery.find.attr;
    attrHandle[name] = function (elem, name, isXML) {
      var ret,
        handle,
        lowercaseName = name.toLowerCase();
      if (!isXML) {
        // Avoid an infinite loop by temporarily removing this function from the getter
        handle = attrHandle[lowercaseName];
        attrHandle[lowercaseName] = ret;
        ret = getter(elem, name, isXML) != null ? lowercaseName : null;
        attrHandle[lowercaseName] = handle;
      }
      return ret;
    };
  });
  var rfocusable = /^(?:input|select|textarea|button)$/i,
    rclickable = /^(?:a|area)$/i;
  jQuery.fn.extend({
    prop: function (name, value) {
      return access(this, jQuery.prop, name, value, arguments.length > 1);
    },
    removeProp: function (name) {
      return this.each(function () {
        delete this[jQuery.propFix[name] || name];
      });
    }
  });
  jQuery.extend({
    prop: function (elem, name, value) {
      var ret,
        hooks,
        nType = elem.nodeType;

      // Don't get/set properties on text, comment and attribute nodes
      if (nType === 3 || nType === 8 || nType === 2) {
        return;
      }
      if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
        // Fix name and attach hooks
        name = jQuery.propFix[name] || name;
        hooks = jQuery.propHooks[name];
      }
      if (value !== undefined) {
        if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {
          return ret;
        }
        return elem[name] = value;
      }
      if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
        return ret;
      }
      return elem[name];
    },
    propHooks: {
      tabIndex: {
        get: function (elem) {
          // Support: IE <=9 - 11 only
          // elem.tabIndex doesn't always return the
          // correct value when it hasn't been explicitly set
          // Use proper attribute retrieval (trac-12072)
          var tabindex = jQuery.find.attr(elem, "tabindex");
          if (tabindex) {
            return parseInt(tabindex, 10);
          }
          if (rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href) {
            return 0;
          }
          return -1;
        }
      }
    },
    propFix: {
      "for": "htmlFor",
      "class": "className"
    }
  });

  // Support: IE <=11 only
  // Accessing the selectedIndex property
  // forces the browser to respect setting selected
  // on the option
  // The getter ensures a default option is selected
  // when in an optgroup
  // eslint rule "no-unused-expressions" is disabled for this code
  // since it considers such accessions noop
  if (!support.optSelected) {
    jQuery.propHooks.selected = {
      get: function (elem) {
        /* eslint no-unused-expressions: "off" */

        var parent = elem.parentNode;
        if (parent && parent.parentNode) {
          parent.parentNode.selectedIndex;
        }
        return null;
      },
      set: function (elem) {
        /* eslint no-unused-expressions: "off" */

        var parent = elem.parentNode;
        if (parent) {
          parent.selectedIndex;
          if (parent.parentNode) {
            parent.parentNode.selectedIndex;
          }
        }
      }
    };
  }
  jQuery.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () {
    jQuery.propFix[this.toLowerCase()] = this;
  });

  // Strip and collapse whitespace according to HTML spec
  // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
  function stripAndCollapse(value) {
    var tokens = value.match(rnothtmlwhite) || [];
    return tokens.join(" ");
  }
  function getClass(elem) {
    return elem.getAttribute && elem.getAttribute("class") || "";
  }
  function classesToArray(value) {
    if (Array.isArray(value)) {
      return value;
    }
    if (typeof value === "string") {
      return value.match(rnothtmlwhite) || [];
    }
    return [];
  }
  jQuery.fn.extend({
    addClass: function (value) {
      var classNames, cur, curValue, className, i, finalValue;
      if (isFunction(value)) {
        return this.each(function (j) {
          jQuery(this).addClass(value.call(this, j, getClass(this)));
        });
      }
      classNames = classesToArray(value);
      if (classNames.length) {
        return this.each(function () {
          curValue = getClass(this);
          cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
          if (cur) {
            for (i = 0; i < classNames.length; i++) {
              className = classNames[i];
              if (cur.indexOf(" " + className + " ") < 0) {
                cur += className + " ";
              }
            }

            // Only assign if different to avoid unneeded rendering.
            finalValue = stripAndCollapse(cur);
            if (curValue !== finalValue) {
              this.setAttribute("class", finalValue);
            }
          }
        });
      }
      return this;
    },
    removeClass: function (value) {
      var classNames, cur, curValue, className, i, finalValue;
      if (isFunction(value)) {
        return this.each(function (j) {
          jQuery(this).removeClass(value.call(this, j, getClass(this)));
        });
      }
      if (!arguments.length) {
        return this.attr("class", "");
      }
      classNames = classesToArray(value);
      if (classNames.length) {
        return this.each(function () {
          curValue = getClass(this);

          // This expression is here for better compressibility (see addClass)
          cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
          if (cur) {
            for (i = 0; i < classNames.length; i++) {
              className = classNames[i];

              // Remove *all* instances
              while (cur.indexOf(" " + className + " ") > -1) {
                cur = cur.replace(" " + className + " ", " ");
              }
            }

            // Only assign if different to avoid unneeded rendering.
            finalValue = stripAndCollapse(cur);
            if (curValue !== finalValue) {
              this.setAttribute("class", finalValue);
            }
          }
        });
      }
      return this;
    },
    toggleClass: function (value, stateVal) {
      var classNames,
        className,
        i,
        self,
        type = typeof value,
        isValidValue = type === "string" || Array.isArray(value);
      if (isFunction(value)) {
        return this.each(function (i) {
          jQuery(this).toggleClass(value.call(this, i, getClass(this), stateVal), stateVal);
        });
      }
      if (typeof stateVal === "boolean" && isValidValue) {
        return stateVal ? this.addClass(value) : this.removeClass(value);
      }
      classNames = classesToArray(value);
      return this.each(function () {
        if (isValidValue) {
          // Toggle individual class names
          self = jQuery(this);
          for (i = 0; i < classNames.length; i++) {
            className = classNames[i];

            // Check each className given, space separated list
            if (self.hasClass(className)) {
              self.removeClass(className);
            } else {
              self.addClass(className);
            }
          }

          // Toggle whole class name
        } else if (value === undefined || type === "boolean") {
          className = getClass(this);
          if (className) {
            // Store className if set
            dataPriv.set(this, "__className__", className);
          }

          // If the element has a class name or if we're passed `false`,
          // then remove the whole classname (if there was one, the above saved it).
          // Otherwise bring back whatever was previously saved (if anything),
          // falling back to the empty string if nothing was stored.
          if (this.setAttribute) {
            this.setAttribute("class", className || value === false ? "" : dataPriv.get(this, "__className__") || "");
          }
        }
      });
    },
    hasClass: function (selector) {
      var className,
        elem,
        i = 0;
      className = " " + selector + " ";
      while (elem = this[i++]) {
        if (elem.nodeType === 1 && (" " + stripAndCollapse(getClass(elem)) + " ").indexOf(className) > -1) {
          return true;
        }
      }
      return false;
    }
  });
  var rreturn = /\r/g;
  jQuery.fn.extend({
    val: function (value) {
      var hooks,
        ret,
        valueIsFunction,
        elem = this[0];
      if (!arguments.length) {
        if (elem) {
          hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
          if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) {
            return ret;
          }
          ret = elem.value;

          // Handle most common string cases
          if (typeof ret === "string") {
            return ret.replace(rreturn, "");
          }

          // Handle cases where value is null/undef or number
          return ret == null ? "" : ret;
        }
        return;
      }
      valueIsFunction = isFunction(value);
      return this.each(function (i) {
        var val;
        if (this.nodeType !== 1) {
          return;
        }
        if (valueIsFunction) {
          val = value.call(this, i, jQuery(this).val());
        } else {
          val = value;
        }

        // Treat null/undefined as ""; convert numbers to string
        if (val == null) {
          val = "";
        } else if (typeof val === "number") {
          val += "";
        } else if (Array.isArray(val)) {
          val = jQuery.map(val, function (value) {
            return value == null ? "" : value + "";
          });
        }
        hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];

        // If set returns undefined, fall back to normal setting
        if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === undefined) {
          this.value = val;
        }
      });
    }
  });
  jQuery.extend({
    valHooks: {
      option: {
        get: function (elem) {
          var val = jQuery.find.attr(elem, "value");
          return val != null ? val :
          // Support: IE <=10 - 11 only
          // option.text throws exceptions (trac-14686, trac-14858)
          // Strip and collapse whitespace
          // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
          stripAndCollapse(jQuery.text(elem));
        }
      },
      select: {
        get: function (elem) {
          var value,
            option,
            i,
            options = elem.options,
            index = elem.selectedIndex,
            one = elem.type === "select-one",
            values = one ? null : [],
            max = one ? index + 1 : options.length;
          if (index < 0) {
            i = max;
          } else {
            i = one ? index : 0;
          }

          // Loop through all the selected options
          for (; i < max; i++) {
            option = options[i];

            // Support: IE <=9 only
            // IE8-9 doesn't update selected after form reset (trac-2551)
            if ((option.selected || i === index) &&
            // Don't return options that are disabled or in a disabled optgroup
            !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, "optgroup"))) {
              // Get the specific value for the option
              value = jQuery(option).val();

              // We don't need an array for one selects
              if (one) {
                return value;
              }

              // Multi-Selects return an array
              values.push(value);
            }
          }
          return values;
        },
        set: function (elem, value) {
          var optionSet,
            option,
            options = elem.options,
            values = jQuery.makeArray(value),
            i = options.length;
          while (i--) {
            option = options[i];

            /* eslint-disable no-cond-assign */

            if (option.selected = jQuery.inArray(jQuery.valHooks.option.get(option), values) > -1) {
              optionSet = true;
            }

            /* eslint-enable no-cond-assign */
          }

          // Force browsers to behave consistently when non-matching value is set
          if (!optionSet) {
            elem.selectedIndex = -1;
          }
          return values;
        }
      }
    }
  });

  // Radios and checkboxes getter/setter
  jQuery.each(["radio", "checkbox"], function () {
    jQuery.valHooks[this] = {
      set: function (elem, value) {
        if (Array.isArray(value)) {
          return elem.checked = jQuery.inArray(jQuery(elem).val(), value) > -1;
        }
      }
    };
    if (!support.checkOn) {
      jQuery.valHooks[this].get = function (elem) {
        return elem.getAttribute("value") === null ? "on" : elem.value;
      };
    }
  });

  // Return jQuery for attributes-only inclusion
  var location = window.location;
  var nonce = {
    guid: Date.now()
  };
  var rquery = /\?/;

  // Cross-browser xml parsing
  jQuery.parseXML = function (data) {
    var xml, parserErrorElem;
    if (!data || typeof data !== "string") {
      return null;
    }

    // Support: IE 9 - 11 only
    // IE throws on parseFromString with invalid input.
    try {
      xml = new window.DOMParser().parseFromString(data, "text/xml");
    } catch (e) {}
    parserErrorElem = xml && xml.getElementsByTagName("parsererror")[0];
    if (!xml || parserErrorElem) {
      jQuery.error("Invalid XML: " + (parserErrorElem ? jQuery.map(parserErrorElem.childNodes, function (el) {
        return el.textContent;
      }).join("\n") : data));
    }
    return xml;
  };
  var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
    stopPropagationCallback = function (e) {
      e.stopPropagation();
    };
  jQuery.extend(jQuery.event, {
    trigger: function (event, data, elem, onlyHandlers) {
      var i,
        cur,
        tmp,
        bubbleType,
        ontype,
        handle,
        special,
        lastElement,
        eventPath = [elem || document],
        type = hasOwn.call(event, "type") ? event.type : event,
        namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
      cur = lastElement = tmp = elem = elem || document;

      // Don't do events on text and comment nodes
      if (elem.nodeType === 3 || elem.nodeType === 8) {
        return;
      }

      // focus/blur morphs to focusin/out; ensure we're not firing them right now
      if (rfocusMorph.test(type + jQuery.event.triggered)) {
        return;
      }
      if (type.indexOf(".") > -1) {
        // Namespaced trigger; create a regexp to match event type in handle()
        namespaces = type.split(".");
        type = namespaces.shift();
        namespaces.sort();
      }
      ontype = type.indexOf(":") < 0 && "on" + type;

      // Caller can pass in a jQuery.Event object, Object, or just an event type string
      event = event[jQuery.expando] ? event : new jQuery.Event(type, typeof event === "object" && event);

      // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
      event.isTrigger = onlyHandlers ? 2 : 3;
      event.namespace = namespaces.join(".");
      event.rnamespace = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;

      // Clean up the event in case it is being reused
      event.result = undefined;
      if (!event.target) {
        event.target = elem;
      }

      // Clone any incoming data and prepend the event, creating the handler arg list
      data = data == null ? [event] : jQuery.makeArray(data, [event]);

      // Allow special events to draw outside the lines
      special = jQuery.event.special[type] || {};
      if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
        return;
      }

      // Determine event propagation path in advance, per W3C events spec (trac-9951)
      // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)
      if (!onlyHandlers && !special.noBubble && !isWindow(elem)) {
        bubbleType = special.delegateType || type;
        if (!rfocusMorph.test(bubbleType + type)) {
          cur = cur.parentNode;
        }
        for (; cur; cur = cur.parentNode) {
          eventPath.push(cur);
          tmp = cur;
        }

        // Only add window if we got to document (e.g., not plain obj or detached DOM)
        if (tmp === (elem.ownerDocument || document)) {
          eventPath.push(tmp.defaultView || tmp.parentWindow || window);
        }
      }

      // Fire handlers on the event path
      i = 0;
      while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {
        lastElement = cur;
        event.type = i > 1 ? bubbleType : special.bindType || type;

        // jQuery handler
        handle = (dataPriv.get(cur, "events") || Object.create(null))[event.type] && dataPriv.get(cur, "handle");
        if (handle) {
          handle.apply(cur, data);
        }

        // Native handler
        handle = ontype && cur[ontype];
        if (handle && handle.apply && acceptData(cur)) {
          event.result = handle.apply(cur, data);
          if (event.result === false) {
            event.preventDefault();
          }
        }
      }
      event.type = type;

      // If nobody prevented the default action, do it now
      if (!onlyHandlers && !event.isDefaultPrevented()) {
        if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) {
          // Call a native DOM method on the target with the same name as the event.
          // Don't do default actions on window, that's where global variables be (trac-6170)
          if (ontype && isFunction(elem[type]) && !isWindow(elem)) {
            // Don't re-trigger an onFOO event when we call its FOO() method
            tmp = elem[ontype];
            if (tmp) {
              elem[ontype] = null;
            }

            // Prevent re-triggering of the same event, since we already bubbled it above
            jQuery.event.triggered = type;
            if (event.isPropagationStopped()) {
              lastElement.addEventListener(type, stopPropagationCallback);
            }
            elem[type]();
            if (event.isPropagationStopped()) {
              lastElement.removeEventListener(type, stopPropagationCallback);
            }
            jQuery.event.triggered = undefined;
            if (tmp) {
              elem[ontype] = tmp;
            }
          }
        }
      }
      return event.result;
    },
    // Piggyback on a donor event to simulate a different one
    // Used only for `focus(in | out)` events
    simulate: function (type, elem, event) {
      var e = jQuery.extend(new jQuery.Event(), event, {
        type: type,
        isSimulated: true
      });
      jQuery.event.trigger(e, null, elem);
    }
  });
  jQuery.fn.extend({
    trigger: function (type, data) {
      return this.each(function () {
        jQuery.event.trigger(type, data, this);
      });
    },
    triggerHandler: function (type, data) {
      var elem = this[0];
      if (elem) {
        return jQuery.event.trigger(type, data, elem, true);
      }
    }
  });
  var rbracket = /\[\]$/,
    rCRLF = /\r?\n/g,
    rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
    rsubmittable = /^(?:input|select|textarea|keygen)/i;
  function buildParams(prefix, obj, traditional, add) {
    var name;
    if (Array.isArray(obj)) {
      // Serialize array item.
      jQuery.each(obj, function (i, v) {
        if (traditional || rbracket.test(prefix)) {
          // Treat each array item as a scalar.
          add(prefix, v);
        } else {
          // Item is non-scalar (array or object), encode its numeric index.
          buildParams(prefix + "[" + (typeof v === "object" && v != null ? i : "") + "]", v, traditional, add);
        }
      });
    } else if (!traditional && toType(obj) === "object") {
      // Serialize object item.
      for (name in obj) {
        buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
      }
    } else {
      // Serialize scalar item.
      add(prefix, obj);
    }
  }

  // Serialize an array of form elements or a set of
  // key/values into a query string
  jQuery.param = function (a, traditional) {
    var prefix,
      s = [],
      add = function (key, valueOrFunction) {
        // If value is a function, invoke it and use its return value
        var value = isFunction(valueOrFunction) ? valueOrFunction() : valueOrFunction;
        s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value == null ? "" : value);
      };
    if (a == null) {
      return "";
    }

    // If an array was passed in, assume that it is an array of form elements.
    if (Array.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) {
      // Serialize the form elements
      jQuery.each(a, function () {
        add(this.name, this.value);
      });
    } else {
      // If traditional, encode the "old" way (the way 1.3.2 or older
      // did it), otherwise encode params recursively.
      for (prefix in a) {
        buildParams(prefix, a[prefix], traditional, add);
      }
    }

    // Return the resulting serialization
    return s.join("&");
  };
  jQuery.fn.extend({
    serialize: function () {
      return jQuery.param(this.serializeArray());
    },
    serializeArray: function () {
      return this.map(function () {
        // Can add propHook for "elements" to filter or add form elements
        var elements = jQuery.prop(this, "elements");
        return elements ? jQuery.makeArray(elements) : this;
      }).filter(function () {
        var type = this.type;

        // Use .is( ":disabled" ) so that fieldset[disabled] works
        return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type));
      }).map(function (_i, elem) {
        var val = jQuery(this).val();
        if (val == null) {
          return null;
        }
        if (Array.isArray(val)) {
          return jQuery.map(val, function (val) {
            return {
              name: elem.name,
              value: val.replace(rCRLF, "\r\n")
            };
          });
        }
        return {
          name: elem.name,
          value: val.replace(rCRLF, "\r\n")
        };
      }).get();
    }
  });
  var r20 = /%20/g,
    rhash = /#.*$/,
    rantiCache = /([?&])_=[^&]*/,
    rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
    // trac-7653, trac-8125, trac-8152: local protocol detection
    rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
    rnoContent = /^(?:GET|HEAD)$/,
    rprotocol = /^\/\//,
    /* Prefilters
     * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
     * 2) These are called:
     *    - BEFORE asking for a transport
     *    - AFTER param serialization (s.data is a string if s.processData is true)
     * 3) key is the dataType
     * 4) the catchall symbol "*" can be used
     * 5) execution will start with transport dataType and THEN continue down to "*" if needed
     */
    prefilters = {},
    /* Transports bindings
     * 1) key is the dataType
     * 2) the catchall symbol "*" can be used
     * 3) selection will start with transport dataType and THEN go to "*" if needed
     */
    transports = {},
    // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression
    allTypes = "*/".concat("*"),
    // Anchor tag for parsing the document origin
    originAnchor = document.createElement("a");
  originAnchor.href = location.href;

  // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  function addToPrefiltersOrTransports(structure) {
    // dataTypeExpression is optional and defaults to "*"
    return function (dataTypeExpression, func) {
      if (typeof dataTypeExpression !== "string") {
        func = dataTypeExpression;
        dataTypeExpression = "*";
      }
      var dataType,
        i = 0,
        dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || [];
      if (isFunction(func)) {
        // For each dataType in the dataTypeExpression
        while (dataType = dataTypes[i++]) {
          // Prepend if requested
          if (dataType[0] === "+") {
            dataType = dataType.slice(1) || "*";
            (structure[dataType] = structure[dataType] || []).unshift(func);

            // Otherwise append
          } else {
            (structure[dataType] = structure[dataType] || []).push(func);
          }
        }
      }
    };
  }

  // Base inspection function for prefilters and transports
  function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {
    var inspected = {},
      seekingTransport = structure === transports;
    function inspect(dataType) {
      var selected;
      inspected[dataType] = true;
      jQuery.each(structure[dataType] || [], function (_, prefilterOrFactory) {
        var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);
        if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
          options.dataTypes.unshift(dataTypeOrTransport);
          inspect(dataTypeOrTransport);
          return false;
        } else if (seekingTransport) {
          return !(selected = dataTypeOrTransport);
        }
      });
      return selected;
    }
    return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*");
  }

  // A special extend for ajax options
  // that takes "flat" options (not to be deep extended)
  // Fixes trac-9887
  function ajaxExtend(target, src) {
    var key,
      deep,
      flatOptions = jQuery.ajaxSettings.flatOptions || {};
    for (key in src) {
      if (src[key] !== undefined) {
        (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];
      }
    }
    if (deep) {
      jQuery.extend(true, target, deep);
    }
    return target;
  }

  /* Handles responses to an ajax request:
   * - finds the right dataType (mediates between content-type and expected dataType)
   * - returns the corresponding response
   */
  function ajaxHandleResponses(s, jqXHR, responses) {
    var ct,
      type,
      finalDataType,
      firstDataType,
      contents = s.contents,
      dataTypes = s.dataTypes;

    // Remove auto dataType and get content-type in the process
    while (dataTypes[0] === "*") {
      dataTypes.shift();
      if (ct === undefined) {
        ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
      }
    }

    // Check if we're dealing with a known content-type
    if (ct) {
      for (type in contents) {
        if (contents[type] && contents[type].test(ct)) {
          dataTypes.unshift(type);
          break;
        }
      }
    }

    // Check to see if we have a response for the expected dataType
    if (dataTypes[0] in responses) {
      finalDataType = dataTypes[0];
    } else {
      // Try convertible dataTypes
      for (type in responses) {
        if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) {
          finalDataType = type;
          break;
        }
        if (!firstDataType) {
          firstDataType = type;
        }
      }

      // Or just use first one
      finalDataType = finalDataType || firstDataType;
    }

    // If we found a dataType
    // We add the dataType to the list if needed
    // and return the corresponding response
    if (finalDataType) {
      if (finalDataType !== dataTypes[0]) {
        dataTypes.unshift(finalDataType);
      }
      return responses[finalDataType];
    }
  }

  /* Chain conversions given the request and the original response
   * Also sets the responseXXX fields on the jqXHR instance
   */
  function ajaxConvert(s, response, jqXHR, isSuccess) {
    var conv2,
      current,
      conv,
      tmp,
      prev,
      converters = {},
      // Work with a copy of dataTypes in case we need to modify it for conversion
      dataTypes = s.dataTypes.slice();

    // Create converters map with lowercased keys
    if (dataTypes[1]) {
      for (conv in s.converters) {
        converters[conv.toLowerCase()] = s.converters[conv];
      }
    }
    current = dataTypes.shift();

    // Convert to each sequential dataType
    while (current) {
      if (s.responseFields[current]) {
        jqXHR[s.responseFields[current]] = response;
      }

      // Apply the dataFilter if provided
      if (!prev && isSuccess && s.dataFilter) {
        response = s.dataFilter(response, s.dataType);
      }
      prev = current;
      current = dataTypes.shift();
      if (current) {
        // There's only work to do if current dataType is non-auto
        if (current === "*") {
          current = prev;

          // Convert response if prev dataType is non-auto and differs from current
        } else if (prev !== "*" && prev !== current) {
          // Seek a direct converter
          conv = converters[prev + " " + current] || converters["* " + current];

          // If none found, seek a pair
          if (!conv) {
            for (conv2 in converters) {
              // If conv2 outputs current
              tmp = conv2.split(" ");
              if (tmp[1] === current) {
                // If prev can be converted to accepted input
                conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]];
                if (conv) {
                  // Condense equivalence converters
                  if (conv === true) {
                    conv = converters[conv2];

                    // Otherwise, insert the intermediate dataType
                  } else if (converters[conv2] !== true) {
                    current = tmp[0];
                    dataTypes.unshift(tmp[1]);
                  }
                  break;
                }
              }
            }
          }

          // Apply converter (if not an equivalence)
          if (conv !== true) {
            // Unless errors are allowed to bubble, catch and return them
            if (conv && s.throws) {
              response = conv(response);
            } else {
              try {
                response = conv(response);
              } catch (e) {
                return {
                  state: "parsererror",
                  error: conv ? e : "No conversion from " + prev + " to " + current
                };
              }
            }
          }
        }
      }
    }
    return {
      state: "success",
      data: response
    };
  }
  jQuery.extend({
    // Counter for holding the number of active queries
    active: 0,
    // Last-Modified header cache for next request
    lastModified: {},
    etag: {},
    ajaxSettings: {
      url: location.href,
      type: "GET",
      isLocal: rlocalProtocol.test(location.protocol),
      global: true,
      processData: true,
      async: true,
      contentType: "application/x-www-form-urlencoded; charset=UTF-8",
      /*
      timeout: 0,
      data: null,
      dataType: null,
      username: null,
      password: null,
      cache: null,
      throws: false,
      traditional: false,
      headers: {},
      */

      accepts: {
        "*": allTypes,
        text: "text/plain",
        html: "text/html",
        xml: "application/xml, text/xml",
        json: "application/json, text/javascript"
      },
      contents: {
        xml: /\bxml\b/,
        html: /\bhtml/,
        json: /\bjson\b/
      },
      responseFields: {
        xml: "responseXML",
        text: "responseText",
        json: "responseJSON"
      },
      // Data converters
      // Keys separate source (or catchall "*") and destination types with a single space
      converters: {
        // Convert anything to text
        "* text": String,
        // Text to html (true = no transformation)
        "text html": true,
        // Evaluate text as a json expression
        "text json": JSON.parse,
        // Parse text as xml
        "text xml": jQuery.parseXML
      },
      // For options that shouldn't be deep extended:
      // you can add your own custom options here if
      // and when you create one that shouldn't be
      // deep extended (see ajaxExtend)
      flatOptions: {
        url: true,
        context: true
      }
    },
    // Creates a full fledged settings object into target
    // with both ajaxSettings and settings fields.
    // If target is omitted, writes into ajaxSettings.
    ajaxSetup: function (target, settings) {
      return settings ?
      // Building a settings object
      ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) :
      // Extending ajaxSettings
      ajaxExtend(jQuery.ajaxSettings, target);
    },
    ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
    ajaxTransport: addToPrefiltersOrTransports(transports),
    // Main method
    ajax: function (url, options) {
      // If url is an object, simulate pre-1.5 signature
      if (typeof url === "object") {
        options = url;
        url = undefined;
      }

      // Force options to be an object
      options = options || {};
      var transport,
        // URL without anti-cache param
        cacheURL,
        // Response headers
        responseHeadersString,
        responseHeaders,
        // timeout handle
        timeoutTimer,
        // Url cleanup var
        urlAnchor,
        // Request state (becomes false upon send and true upon completion)
        completed,
        // To know if global events are to be dispatched
        fireGlobals,
        // Loop variable
        i,
        // uncached part of the url
        uncached,
        // Create the final options object
        s = jQuery.ajaxSetup({}, options),
        // Callbacks context
        callbackContext = s.context || s,
        // Context for global events is callbackContext if it is a DOM node or jQuery collection
        globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event,
        // Deferreds
        deferred = jQuery.Deferred(),
        completeDeferred = jQuery.Callbacks("once memory"),
        // Status-dependent callbacks
        statusCode = s.statusCode || {},
        // Headers (they are sent all at once)
        requestHeaders = {},
        requestHeadersNames = {},
        // Default abort message
        strAbort = "canceled",
        // Fake xhr
        jqXHR = {
          readyState: 0,
          // Builds headers hashtable if needed
          getResponseHeader: function (key) {
            var match;
            if (completed) {
              if (!responseHeaders) {
                responseHeaders = {};
                while (match = rheaders.exec(responseHeadersString)) {
                  responseHeaders[match[1].toLowerCase() + " "] = (responseHeaders[match[1].toLowerCase() + " "] || []).concat(match[2]);
                }
              }
              match = responseHeaders[key.toLowerCase() + " "];
            }
            return match == null ? null : match.join(", ");
          },
          // Raw string
          getAllResponseHeaders: function () {
            return completed ? responseHeadersString : null;
          },
          // Caches the header
          setRequestHeader: function (name, value) {
            if (completed == null) {
              name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name;
              requestHeaders[name] = value;
            }
            return this;
          },
          // Overrides response content-type header
          overrideMimeType: function (type) {
            if (completed == null) {
              s.mimeType = type;
            }
            return this;
          },
          // Status-dependent callbacks
          statusCode: function (map) {
            var code;
            if (map) {
              if (completed) {
                // Execute the appropriate callbacks
                jqXHR.always(map[jqXHR.status]);
              } else {
                // Lazy-add the new callbacks in a way that preserves old ones
                for (code in map) {
                  statusCode[code] = [statusCode[code], map[code]];
                }
              }
            }
            return this;
          },
          // Cancel the request
          abort: function (statusText) {
            var finalText = statusText || strAbort;
            if (transport) {
              transport.abort(finalText);
            }
            done(0, finalText);
            return this;
          }
        };

      // Attach deferreds
      deferred.promise(jqXHR);

      // Add protocol if not provided (prefilters might expect it)
      // Handle falsy url in the settings object (trac-10093: consistency with old signature)
      // We also use the url parameter if available
      s.url = ((url || s.url || location.href) + "").replace(rprotocol, location.protocol + "//");

      // Alias method option to type as per ticket trac-12004
      s.type = options.method || options.type || s.method || s.type;

      // Extract dataTypes list
      s.dataTypes = (s.dataType || "*").toLowerCase().match(rnothtmlwhite) || [""];

      // A cross-domain request is in order when the origin doesn't match the current origin.
      if (s.crossDomain == null) {
        urlAnchor = document.createElement("a");

        // Support: IE <=8 - 11, Edge 12 - 15
        // IE throws exception on accessing the href property if url is malformed,
        // e.g. http://example.com:80x/
        try {
          urlAnchor.href = s.url;

          // Support: IE <=8 - 11 only
          // Anchor's host property isn't correctly set when s.url is relative
          urlAnchor.href = urlAnchor.href;
          s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host;
        } catch (e) {
          // If there is an error parsing the URL, assume it is crossDomain,
          // it can be rejected by the transport if it is invalid
          s.crossDomain = true;
        }
      }

      // Convert data if not already a string
      if (s.data && s.processData && typeof s.data !== "string") {
        s.data = jQuery.param(s.data, s.traditional);
      }

      // Apply prefilters
      inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);

      // If request was aborted inside a prefilter, stop there
      if (completed) {
        return jqXHR;
      }

      // We can fire global events as of now if asked to
      // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)
      fireGlobals = jQuery.event && s.global;

      // Watch for a new set of requests
      if (fireGlobals && jQuery.active++ === 0) {
        jQuery.event.trigger("ajaxStart");
      }

      // Uppercase the type
      s.type = s.type.toUpperCase();

      // Determine if request has content
      s.hasContent = !rnoContent.test(s.type);

      // Save the URL in case we're toying with the If-Modified-Since
      // and/or If-None-Match header later on
      // Remove hash to simplify url manipulation
      cacheURL = s.url.replace(rhash, "");

      // More options handling for requests with no content
      if (!s.hasContent) {
        // Remember the hash so we can put it back
        uncached = s.url.slice(cacheURL.length);

        // If data is available and should be processed, append data to url
        if (s.data && (s.processData || typeof s.data === "string")) {
          cacheURL += (rquery.test(cacheURL) ? "&" : "?") + s.data;

          // trac-9682: remove data so that it's not used in an eventual retry
          delete s.data;
        }

        // Add or update anti-cache param if needed
        if (s.cache === false) {
          cacheURL = cacheURL.replace(rantiCache, "$1");
          uncached = (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce.guid++ + uncached;
        }

        // Put hash and anti-cache on the URL that will be requested (gh-1732)
        s.url = cacheURL + uncached;

        // Change '%20' to '+' if this is encoded form body content (gh-2658)
      } else if (s.data && s.processData && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0) {
        s.data = s.data.replace(r20, "+");
      }

      // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
      if (s.ifModified) {
        if (jQuery.lastModified[cacheURL]) {
          jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
        }
        if (jQuery.etag[cacheURL]) {
          jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
        }
      }

      // Set the correct header, if data is being sent
      if (s.data && s.hasContent && s.contentType !== false || options.contentType) {
        jqXHR.setRequestHeader("Content-Type", s.contentType);
      }

      // Set the Accepts header for the server, depending on the dataType
      jqXHR.setRequestHeader("Accept", s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"]);

      // Check for headers option
      for (i in s.headers) {
        jqXHR.setRequestHeader(i, s.headers[i]);
      }

      // Allow custom headers/mimetypes and early abort
      if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || completed)) {
        // Abort if not done already and return
        return jqXHR.abort();
      }

      // Aborting is no longer a cancellation
      strAbort = "abort";

      // Install callbacks on deferreds
      completeDeferred.add(s.complete);
      jqXHR.done(s.success);
      jqXHR.fail(s.error);

      // Get transport
      transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);

      // If no transport, we auto-abort
      if (!transport) {
        done(-1, "No Transport");
      } else {
        jqXHR.readyState = 1;

        // Send global event
        if (fireGlobals) {
          globalEventContext.trigger("ajaxSend", [jqXHR, s]);
        }

        // If request was aborted inside ajaxSend, stop there
        if (completed) {
          return jqXHR;
        }

        // Timeout
        if (s.async && s.timeout > 0) {
          timeoutTimer = window.setTimeout(function () {
            jqXHR.abort("timeout");
          }, s.timeout);
        }
        try {
          completed = false;
          transport.send(requestHeaders, done);
        } catch (e) {
          // Rethrow post-completion exceptions
          if (completed) {
            throw e;
          }

          // Propagate others as results
          done(-1, e);
        }
      }

      // Callback for when everything is done
      function done(status, nativeStatusText, responses, headers) {
        var isSuccess,
          success,
          error,
          response,
          modified,
          statusText = nativeStatusText;

        // Ignore repeat invocations
        if (completed) {
          return;
        }
        completed = true;

        // Clear timeout if it exists
        if (timeoutTimer) {
          window.clearTimeout(timeoutTimer);
        }

        // Dereference transport for early garbage collection
        // (no matter how long the jqXHR object will be used)
        transport = undefined;

        // Cache response headers
        responseHeadersString = headers || "";

        // Set readyState
        jqXHR.readyState = status > 0 ? 4 : 0;

        // Determine if successful
        isSuccess = status >= 200 && status < 300 || status === 304;

        // Get response data
        if (responses) {
          response = ajaxHandleResponses(s, jqXHR, responses);
        }

        // Use a noop converter for missing script but not if jsonp
        if (!isSuccess && jQuery.inArray("script", s.dataTypes) > -1 && jQuery.inArray("json", s.dataTypes) < 0) {
          s.converters["text script"] = function () {};
        }

        // Convert no matter what (that way responseXXX fields are always set)
        response = ajaxConvert(s, response, jqXHR, isSuccess);

        // If successful, handle type chaining
        if (isSuccess) {
          // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
          if (s.ifModified) {
            modified = jqXHR.getResponseHeader("Last-Modified");
            if (modified) {
              jQuery.lastModified[cacheURL] = modified;
            }
            modified = jqXHR.getResponseHeader("etag");
            if (modified) {
              jQuery.etag[cacheURL] = modified;
            }
          }

          // if no content
          if (status === 204 || s.type === "HEAD") {
            statusText = "nocontent";

            // if not modified
          } else if (status === 304) {
            statusText = "notmodified";

            // If we have data, let's convert it
          } else {
            statusText = response.state;
            success = response.data;
            error = response.error;
            isSuccess = !error;
          }
        } else {
          // Extract error from statusText and normalize for non-aborts
          error = statusText;
          if (status || !statusText) {
            statusText = "error";
            if (status < 0) {
              status = 0;
            }
          }
        }

        // Set data for the fake xhr object
        jqXHR.status = status;
        jqXHR.statusText = (nativeStatusText || statusText) + "";

        // Success/Error
        if (isSuccess) {
          deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
        } else {
          deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
        }

        // Status-dependent callbacks
        jqXHR.statusCode(statusCode);
        statusCode = undefined;
        if (fireGlobals) {
          globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error]);
        }

        // Complete
        completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
        if (fireGlobals) {
          globalEventContext.trigger("ajaxComplete", [jqXHR, s]);

          // Handle the global AJAX counter
          if (! --jQuery.active) {
            jQuery.event.trigger("ajaxStop");
          }
        }
      }
      return jqXHR;
    },
    getJSON: function (url, data, callback) {
      return jQuery.get(url, data, callback, "json");
    },
    getScript: function (url, callback) {
      return jQuery.get(url, undefined, callback, "script");
    }
  });
  jQuery.each(["get", "post"], function (_i, method) {
    jQuery[method] = function (url, data, callback, type) {
      // Shift arguments if data argument was omitted
      if (isFunction(data)) {
        type = type || callback;
        callback = data;
        data = undefined;
      }

      // The url can be an options object (which then must have .url)
      return jQuery.ajax(jQuery.extend({
        url: url,
        type: method,
        dataType: type,
        data: data,
        success: callback
      }, jQuery.isPlainObject(url) && url));
    };
  });
  jQuery.ajaxPrefilter(function (s) {
    var i;
    for (i in s.headers) {
      if (i.toLowerCase() === "content-type") {
        s.contentType = s.headers[i] || "";
      }
    }
  });
  jQuery._evalUrl = function (url, options, doc) {
    return jQuery.ajax({
      url: url,
      // Make this explicit, since user can override this through ajaxSetup (trac-11264)
      type: "GET",
      dataType: "script",
      cache: true,
      async: false,
      global: false,
      // Only evaluate the response if it is successful (gh-4126)
      // dataFilter is not invoked for failure responses, so using it instead
      // of the default converter is kludgy but it works.
      converters: {
        "text script": function () {}
      },
      dataFilter: function (response) {
        jQuery.globalEval(response, options, doc);
      }
    });
  };
  jQuery.fn.extend({
    wrapAll: function (html) {
      var wrap;
      if (this[0]) {
        if (isFunction(html)) {
          html = html.call(this[0]);
        }

        // The elements to wrap the target around
        wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
        if (this[0].parentNode) {
          wrap.insertBefore(this[0]);
        }
        wrap.map(function () {
          var elem = this;
          while (elem.firstElementChild) {
            elem = elem.firstElementChild;
          }
          return elem;
        }).append(this);
      }
      return this;
    },
    wrapInner: function (html) {
      if (isFunction(html)) {
        return this.each(function (i) {
          jQuery(this).wrapInner(html.call(this, i));
        });
      }
      return this.each(function () {
        var self = jQuery(this),
          contents = self.contents();
        if (contents.length) {
          contents.wrapAll(html);
        } else {
          self.append(html);
        }
      });
    },
    wrap: function (html) {
      var htmlIsFunction = isFunction(html);
      return this.each(function (i) {
        jQuery(this).wrapAll(htmlIsFunction ? html.call(this, i) : html);
      });
    },
    unwrap: function (selector) {
      this.parent(selector).not("body").each(function () {
        jQuery(this).replaceWith(this.childNodes);
      });
      return this;
    }
  });
  jQuery.expr.pseudos.hidden = function (elem) {
    return !jQuery.expr.pseudos.visible(elem);
  };
  jQuery.expr.pseudos.visible = function (elem) {
    return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
  };
  jQuery.ajaxSettings.xhr = function () {
    try {
      return new window.XMLHttpRequest();
    } catch (e) {}
  };
  var xhrSuccessStatus = {
      // File protocol always yields status code 0, assume 200
      0: 200,
      // Support: IE <=9 only
      // trac-1450: sometimes IE returns 1223 when it should be 204
      1223: 204
    },
    xhrSupported = jQuery.ajaxSettings.xhr();
  support.cors = !!xhrSupported && "withCredentials" in xhrSupported;
  support.ajax = xhrSupported = !!xhrSupported;
  jQuery.ajaxTransport(function (options) {
    var callback, errorCallback;

    // Cross domain only allowed if supported through XMLHttpRequest
    if (support.cors || xhrSupported && !options.crossDomain) {
      return {
        send: function (headers, complete) {
          var i,
            xhr = options.xhr();
          xhr.open(options.type, options.url, options.async, options.username, options.password);

          // Apply custom fields if provided
          if (options.xhrFields) {
            for (i in options.xhrFields) {
              xhr[i] = options.xhrFields[i];
            }
          }

          // Override mime type if needed
          if (options.mimeType && xhr.overrideMimeType) {
            xhr.overrideMimeType(options.mimeType);
          }

          // X-Requested-With header
          // For cross-domain requests, seeing as conditions for a preflight are
          // akin to a jigsaw puzzle, we simply never set it to be sure.
          // (it can always be set on a per-request basis or even using ajaxSetup)
          // For same-domain requests, won't change header if already provided.
          if (!options.crossDomain && !headers["X-Requested-With"]) {
            headers["X-Requested-With"] = "XMLHttpRequest";
          }

          // Set headers
          for (i in headers) {
            xhr.setRequestHeader(i, headers[i]);
          }

          // Callback
          callback = function (type) {
            return function () {
              if (callback) {
                callback = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.ontimeout = xhr.onreadystatechange = null;
                if (type === "abort") {
                  xhr.abort();
                } else if (type === "error") {
                  // Support: IE <=9 only
                  // On a manual native abort, IE9 throws
                  // errors on any property access that is not readyState
                  if (typeof xhr.status !== "number") {
                    complete(0, "error");
                  } else {
                    complete(
                    // File: protocol always yields status 0; see trac-8605, trac-14207
                    xhr.status, xhr.statusText);
                  }
                } else {
                  complete(xhrSuccessStatus[xhr.status] || xhr.status, xhr.statusText,
                  // Support: IE <=9 only
                  // IE9 has no XHR2 but throws on binary (trac-11426)
                  // For XHR2 non-text, let the caller handle it (gh-2498)
                  (xhr.responseType || "text") !== "text" || typeof xhr.responseText !== "string" ? {
                    binary: xhr.response
                  } : {
                    text: xhr.responseText
                  }, xhr.getAllResponseHeaders());
                }
              }
            };
          };

          // Listen to events
          xhr.onload = callback();
          errorCallback = xhr.onerror = xhr.ontimeout = callback("error");

          // Support: IE 9 only
          // Use onreadystatechange to replace onabort
          // to handle uncaught aborts
          if (xhr.onabort !== undefined) {
            xhr.onabort = errorCallback;
          } else {
            xhr.onreadystatechange = function () {
              // Check readyState before timeout as it changes
              if (xhr.readyState === 4) {
                // Allow onerror to be called first,
                // but that will not handle a native abort
                // Also, save errorCallback to a variable
                // as xhr.onerror cannot be accessed
                window.setTimeout(function () {
                  if (callback) {
                    errorCallback();
                  }
                });
              }
            };
          }

          // Create the abort callback
          callback = callback("abort");
          try {
            // Do send the request (this may raise an exception)
            xhr.send(options.hasContent && options.data || null);
          } catch (e) {
            // trac-14683: Only rethrow if this hasn't been notified as an error yet
            if (callback) {
              throw e;
            }
          }
        },
        abort: function () {
          if (callback) {
            callback();
          }
        }
      };
    }
  });

  // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
  jQuery.ajaxPrefilter(function (s) {
    if (s.crossDomain) {
      s.contents.script = false;
    }
  });

  // Install script dataType
  jQuery.ajaxSetup({
    accepts: {
      script: "text/javascript, application/javascript, " + "application/ecmascript, application/x-ecmascript"
    },
    contents: {
      script: /\b(?:java|ecma)script\b/
    },
    converters: {
      "text script": function (text) {
        jQuery.globalEval(text);
        return text;
      }
    }
  });

  // Handle cache's special case and crossDomain
  jQuery.ajaxPrefilter("script", function (s) {
    if (s.cache === undefined) {
      s.cache = false;
    }
    if (s.crossDomain) {
      s.type = "GET";
    }
  });

  // Bind script tag hack transport
  jQuery.ajaxTransport("script", function (s) {
    // This transport only deals with cross domain or forced-by-attrs requests
    if (s.crossDomain || s.scriptAttrs) {
      var script, callback;
      return {
        send: function (_, complete) {
          script = jQuery("<script>").attr(s.scriptAttrs || {}).prop({
            charset: s.scriptCharset,
            src: s.url
          }).on("load error", callback = function (evt) {
            script.remove();
            callback = null;
            if (evt) {
              complete(evt.type === "error" ? 404 : 200, evt.type);
            }
          });

          // Use native DOM manipulation to avoid our domManip AJAX trickery
          document.head.appendChild(script[0]);
        },
        abort: function () {
          if (callback) {
            callback();
          }
        }
      };
    }
  });
  var oldCallbacks = [],
    rjsonp = /(=)\?(?=&|$)|\?\?/;

  // Default jsonp settings
  jQuery.ajaxSetup({
    jsonp: "callback",
    jsonpCallback: function () {
      var callback = oldCallbacks.pop() || jQuery.expando + "_" + nonce.guid++;
      this[callback] = true;
      return callback;
    }
  });

  // Detect, normalize options and install callbacks for jsonp requests
  jQuery.ajaxPrefilter("json jsonp", function (s, originalSettings, jqXHR) {
    var callbackName,
      overwritten,
      responseContainer,
      jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ? "url" : typeof s.data === "string" && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0 && rjsonp.test(s.data) && "data");

    // Handle iff the expected data type is "jsonp" or we have a parameter to set
    if (jsonProp || s.dataTypes[0] === "jsonp") {
      // Get callback name, remembering preexisting value associated with it
      callbackName = s.jsonpCallback = isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback;

      // Insert callback into url or form data
      if (jsonProp) {
        s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
      } else if (s.jsonp !== false) {
        s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName;
      }

      // Use data converter to retrieve json after script execution
      s.converters["script json"] = function () {
        if (!responseContainer) {
          jQuery.error(callbackName + " was not called");
        }
        return responseContainer[0];
      };

      // Force json dataType
      s.dataTypes[0] = "json";

      // Install callback
      overwritten = window[callbackName];
      window[callbackName] = function () {
        responseContainer = arguments;
      };

      // Clean-up function (fires after converters)
      jqXHR.always(function () {
        // If previous value didn't exist - remove it
        if (overwritten === undefined) {
          jQuery(window).removeProp(callbackName);

          // Otherwise restore preexisting value
        } else {
          window[callbackName] = overwritten;
        }

        // Save back as free
        if (s[callbackName]) {
          // Make sure that re-using the options doesn't screw things around
          s.jsonpCallback = originalSettings.jsonpCallback;

          // Save the callback name for future use
          oldCallbacks.push(callbackName);
        }

        // Call if it was a function and we have a response
        if (responseContainer && isFunction(overwritten)) {
          overwritten(responseContainer[0]);
        }
        responseContainer = overwritten = undefined;
      });

      // Delegate to script
      return "script";
    }
  });

  // Support: Safari 8 only
  // In Safari 8 documents created via document.implementation.createHTMLDocument
  // collapse sibling forms: the second one becomes a child of the first one.
  // Because of that, this security measure has to be disabled in Safari 8.
  // https://bugs.webkit.org/show_bug.cgi?id=137337
  support.createHTMLDocument = function () {
    var body = document.implementation.createHTMLDocument("").body;
    body.innerHTML = "<form></form><form></form>";
    return body.childNodes.length === 2;
  }();

  // Argument "data" should be string of html
  // context (optional): If specified, the fragment will be created in this context,
  // defaults to document
  // keepScripts (optional): If true, will include scripts passed in the html string
  jQuery.parseHTML = function (data, context, keepScripts) {
    if (typeof data !== "string") {
      return [];
    }
    if (typeof context === "boolean") {
      keepScripts = context;
      context = false;
    }
    var base, parsed, scripts;
    if (!context) {
      // Stop scripts or inline event handlers from being executed immediately
      // by using document.implementation
      if (support.createHTMLDocument) {
        context = document.implementation.createHTMLDocument("");

        // Set the base href for the created document
        // so any parsed elements with URLs
        // are based on the document's URL (gh-2965)
        base = context.createElement("base");
        base.href = document.location.href;
        context.head.appendChild(base);
      } else {
        context = document;
      }
    }
    parsed = rsingleTag.exec(data);
    scripts = !keepScripts && [];

    // Single tag
    if (parsed) {
      return [context.createElement(parsed[1])];
    }
    parsed = buildFragment([data], context, scripts);
    if (scripts && scripts.length) {
      jQuery(scripts).remove();
    }
    return jQuery.merge([], parsed.childNodes);
  };

  /**
   * Load a url into a page
   */
  jQuery.fn.load = function (url, params, callback) {
    var selector,
      type,
      response,
      self = this,
      off = url.indexOf(" ");
    if (off > -1) {
      selector = stripAndCollapse(url.slice(off));
      url = url.slice(0, off);
    }

    // If it's a function
    if (isFunction(params)) {
      // We assume that it's the callback
      callback = params;
      params = undefined;

      // Otherwise, build a param string
    } else if (params && typeof params === "object") {
      type = "POST";
    }

    // If we have elements to modify, make the request
    if (self.length > 0) {
      jQuery.ajax({
        url: url,
        // If "type" variable is undefined, then "GET" method will be used.
        // Make value of this field explicit since
        // user can override it through ajaxSetup method
        type: type || "GET",
        dataType: "html",
        data: params
      }).done(function (responseText) {
        // Save response for use in complete callback
        response = arguments;
        self.html(selector ?
        // If a selector was specified, locate the right elements in a dummy div
        // Exclude scripts to avoid IE 'Permission Denied' errors
        jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) :
        // Otherwise use the full result
        responseText);

        // If the request succeeds, this function gets "data", "status", "jqXHR"
        // but they are ignored because response was set above.
        // If it fails, this function gets "jqXHR", "status", "error"
      }).always(callback && function (jqXHR, status) {
        self.each(function () {
          callback.apply(this, response || [jqXHR.responseText, status, jqXHR]);
        });
      });
    }
    return this;
  };
  jQuery.expr.pseudos.animated = function (elem) {
    return jQuery.grep(jQuery.timers, function (fn) {
      return elem === fn.elem;
    }).length;
  };
  jQuery.offset = {
    setOffset: function (elem, options, i) {
      var curPosition,
        curLeft,
        curCSSTop,
        curTop,
        curOffset,
        curCSSLeft,
        calculatePosition,
        position = jQuery.css(elem, "position"),
        curElem = jQuery(elem),
        props = {};

      // Set position first, in-case top/left are set even on static elem
      if (position === "static") {
        elem.style.position = "relative";
      }
      curOffset = curElem.offset();
      curCSSTop = jQuery.css(elem, "top");
      curCSSLeft = jQuery.css(elem, "left");
      calculatePosition = (position === "absolute" || position === "fixed") && (curCSSTop + curCSSLeft).indexOf("auto") > -1;

      // Need to be able to calculate position if either
      // top or left is auto and position is either absolute or fixed
      if (calculatePosition) {
        curPosition = curElem.position();
        curTop = curPosition.top;
        curLeft = curPosition.left;
      } else {
        curTop = parseFloat(curCSSTop) || 0;
        curLeft = parseFloat(curCSSLeft) || 0;
      }
      if (isFunction(options)) {
        // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
        options = options.call(elem, i, jQuery.extend({}, curOffset));
      }
      if (options.top != null) {
        props.top = options.top - curOffset.top + curTop;
      }
      if (options.left != null) {
        props.left = options.left - curOffset.left + curLeft;
      }
      if ("using" in options) {
        options.using.call(elem, props);
      } else {
        curElem.css(props);
      }
    }
  };
  jQuery.fn.extend({
    // offset() relates an element's border box to the document origin
    offset: function (options) {
      // Preserve chaining for setter
      if (arguments.length) {
        return options === undefined ? this : this.each(function (i) {
          jQuery.offset.setOffset(this, options, i);
        });
      }
      var rect,
        win,
        elem = this[0];
      if (!elem) {
        return;
      }

      // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
      // Support: IE <=11 only
      // Running getBoundingClientRect on a
      // disconnected node in IE throws an error
      if (!elem.getClientRects().length) {
        return {
          top: 0,
          left: 0
        };
      }

      // Get document-relative position by adding viewport scroll to viewport-relative gBCR
      rect = elem.getBoundingClientRect();
      win = elem.ownerDocument.defaultView;
      return {
        top: rect.top + win.pageYOffset,
        left: rect.left + win.pageXOffset
      };
    },
    // position() relates an element's margin box to its offset parent's padding box
    // This corresponds to the behavior of CSS absolute positioning
    position: function () {
      if (!this[0]) {
        return;
      }
      var offsetParent,
        offset,
        doc,
        elem = this[0],
        parentOffset = {
          top: 0,
          left: 0
        };

      // position:fixed elements are offset from the viewport, which itself always has zero offset
      if (jQuery.css(elem, "position") === "fixed") {
        // Assume position:fixed implies availability of getBoundingClientRect
        offset = elem.getBoundingClientRect();
      } else {
        offset = this.offset();

        // Account for the *real* offset parent, which can be the document or its root element
        // when a statically positioned element is identified
        doc = elem.ownerDocument;
        offsetParent = elem.offsetParent || doc.documentElement;
        while (offsetParent && (offsetParent === doc.body || offsetParent === doc.documentElement) && jQuery.css(offsetParent, "position") === "static") {
          offsetParent = offsetParent.parentNode;
        }
        if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
          // Incorporate borders into its offset, since they are outside its content origin
          parentOffset = jQuery(offsetParent).offset();
          parentOffset.top += jQuery.css(offsetParent, "borderTopWidth", true);
          parentOffset.left += jQuery.css(offsetParent, "borderLeftWidth", true);
        }
      }

      // Subtract parent offsets and element margins
      return {
        top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
        left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
      };
    },
    // This method will return documentElement in the following cases:
    // 1) For the element inside the iframe without offsetParent, this method will return
    //    documentElement of the parent window
    // 2) For the hidden or detached element
    // 3) For body or html element, i.e. in case of the html node - it will return itself
    //
    // but those exceptions were never presented as a real life use-cases
    // and might be considered as more preferable results.
    //
    // This logic, however, is not guaranteed and can change at any point in the future
    offsetParent: function () {
      return this.map(function () {
        var offsetParent = this.offsetParent;
        while (offsetParent && jQuery.css(offsetParent, "position") === "static") {
          offsetParent = offsetParent.offsetParent;
        }
        return offsetParent || documentElement;
      });
    }
  });

  // Create scrollLeft and scrollTop methods
  jQuery.each({
    scrollLeft: "pageXOffset",
    scrollTop: "pageYOffset"
  }, function (method, prop) {
    var top = "pageYOffset" === prop;
    jQuery.fn[method] = function (val) {
      return access(this, function (elem, method, val) {
        // Coalesce documents and windows
        var win;
        if (isWindow(elem)) {
          win = elem;
        } else if (elem.nodeType === 9) {
          win = elem.defaultView;
        }
        if (val === undefined) {
          return win ? win[prop] : elem[method];
        }
        if (win) {
          win.scrollTo(!top ? val : win.pageXOffset, top ? val : win.pageYOffset);
        } else {
          elem[method] = val;
        }
      }, method, val, arguments.length);
    };
  });

  // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  // Add the top/left cssHooks using jQuery.fn.position
  // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  // getComputedStyle returns percent when specified for top/left/bottom/right;
  // rather than make the css module depend on the offset module, just check for it here
  jQuery.each(["top", "left"], function (_i, prop) {
    jQuery.cssHooks[prop] = addGetHookIf(support.pixelPosition, function (elem, computed) {
      if (computed) {
        computed = curCSS(elem, prop);

        // If curCSS returns percentage, fallback to offset
        return rnumnonpx.test(computed) ? jQuery(elem).position()[prop] + "px" : computed;
      }
    });
  });

  // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  jQuery.each({
    Height: "height",
    Width: "width"
  }, function (name, type) {
    jQuery.each({
      padding: "inner" + name,
      content: type,
      "": "outer" + name
    }, function (defaultExtra, funcName) {
      // Margin is only for outerHeight, outerWidth
      jQuery.fn[funcName] = function (margin, value) {
        var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"),
          extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
        return access(this, function (elem, type, value) {
          var doc;
          if (isWindow(elem)) {
            // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
            return funcName.indexOf("outer") === 0 ? elem["inner" + name] : elem.document.documentElement["client" + name];
          }

          // Get document width or height
          if (elem.nodeType === 9) {
            doc = elem.documentElement;

            // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
            // whichever is greatest
            return Math.max(elem.body["scroll" + name], doc["scroll" + name], elem.body["offset" + name], doc["offset" + name], doc["client" + name]);
          }
          return value === undefined ?
          // Get width or height on the element, requesting but not forcing parseFloat
          jQuery.css(elem, type, extra) :
          // Set width or height on the element
          jQuery.style(elem, type, value, extra);
        }, type, chainable ? margin : undefined, chainable);
      };
    });
  });
  jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (_i, type) {
    jQuery.fn[type] = function (fn) {
      return this.on(type, fn);
    };
  });
  jQuery.fn.extend({
    bind: function (types, data, fn) {
      return this.on(types, null, data, fn);
    },
    unbind: function (types, fn) {
      return this.off(types, null, fn);
    },
    delegate: function (selector, types, data, fn) {
      return this.on(types, selector, data, fn);
    },
    undelegate: function (selector, types, fn) {
      // ( namespace ) or ( selector, types [, fn] )
      return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn);
    },
    hover: function (fnOver, fnOut) {
      return this.on("mouseenter", fnOver).on("mouseleave", fnOut || fnOver);
    }
  });
  jQuery.each(("blur focus focusin focusout resize scroll click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup contextmenu").split(" "), function (_i, name) {
    // Handle event binding
    jQuery.fn[name] = function (data, fn) {
      return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name);
    };
  });

  // Support: Android <=4.0 only
  // Make sure we trim BOM and NBSP
  // Require that the "whitespace run" starts from a non-whitespace
  // to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
  var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;

  // Bind a function to a context, optionally partially applying any
  // arguments.
  // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
  // However, it is not slated for removal any time soon
  jQuery.proxy = function (fn, context) {
    var tmp, args, proxy;
    if (typeof context === "string") {
      tmp = fn[context];
      context = fn;
      fn = tmp;
    }

    // Quick check to determine if target is callable, in the spec
    // this throws a TypeError, but we will just return undefined.
    if (!isFunction(fn)) {
      return undefined;
    }

    // Simulated bind
    args = slice.call(arguments, 2);
    proxy = function () {
      return fn.apply(context || this, args.concat(slice.call(arguments)));
    };

    // Set the guid of unique handler to the same of original handler, so it can be removed
    proxy.guid = fn.guid = fn.guid || jQuery.guid++;
    return proxy;
  };
  jQuery.holdReady = function (hold) {
    if (hold) {
      jQuery.readyWait++;
    } else {
      jQuery.ready(true);
    }
  };
  jQuery.isArray = Array.isArray;
  jQuery.parseJSON = JSON.parse;
  jQuery.nodeName = nodeName;
  jQuery.isFunction = isFunction;
  jQuery.isWindow = isWindow;
  jQuery.camelCase = camelCase;
  jQuery.type = toType;
  jQuery.now = Date.now;
  jQuery.isNumeric = function (obj) {
    // As of jQuery 3.0, isNumeric is limited to
    // strings and numbers (primitives or objects)
    // that can be coerced to finite numbers (gh-2662)
    var type = jQuery.type(obj);
    return (type === "number" || type === "string") &&
    // parseFloat NaNs numeric-cast false positives ("")
    // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
    // subtraction forces infinities to NaN
    !isNaN(obj - parseFloat(obj));
  };
  jQuery.trim = function (text) {
    return text == null ? "" : (text + "").replace(rtrim, "$1");
  };
  var
    // Map over jQuery in case of overwrite
    _jQuery = window.jQuery,
    // Map over the $ in case of overwrite
    _$ = window.$;
  jQuery.noConflict = function (deep) {
    if (window.$ === jQuery) {
      window.$ = _$;
    }
    if (deep && window.jQuery === jQuery) {
      window.jQuery = _jQuery;
    }
    return jQuery;
  };

  // Expose jQuery and $ identifiers, even in AMD
  // (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)
  // and CommonJS for browser emulators (trac-13566)
  if (typeof noGlobal === "undefined") {
    window.jQuery = window.$ = jQuery;
  }
  return jQuery;
});
});

//
var script$4W = {
  name: 'PreviewLooseLeafRender',
  props: {
    businessType: String,
    //业务类型：looseLeaf，textBook
    renderMode: {
      type: String,
      default: ''
    },
    renderData: {
      type: Object,
      default: () => {}
    },
    renderLooseLeaf: {
      type: Object,
      default: () => {}
    },
    looseLeafId: {
      type: String,
      default: ''
    },
    pTitle: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      xmlCompList: [],
      pageType: 'h5',
      // 页面类型：取值h5、pc、pad
      looseLeafData: {},
      title: '',
      showEmpty: false,
      inlineWordsModal: {
        title: '',
        visible: false,
        content: ''
      }
    };
  },
  watch: {
    looseLeafId: {
      handler(newValue) {
        if (newValue) {
          this.queryData();
        }
      },
      immediate: true,
      deep: true
    },
    pTitle: {
      handler(newValue) {
        // if (newValue) {
        this.title = newValue;
        // }
      },
      immediate: true,
      deep: true
    }
  },
  created() {
    this.$nextTick(() => {
      setTimeout(() => {
        jquery('a').attr('target', '_self');
      }, 2000);
      window.inlineWordsShow = uuid => {
        let ele = document.getElementById(`words__${uuid}`);
        let {
          title = '',
          content = ''
        } = ele.dataset || {};
        this.inlineWordsModal = {
          title,
          content,
          visible: true
        };
      };
    });
  },
  methods: {
    queryData() {
      if (this.renderMode === 'localview') {
        setTimeout(() => {
          let dataDict = {
            looseLeaf: this.renderData,
            textBook: this.renderData
          };
          let data = dataDict[this.businessType] || {};
          console.log('当前为本地预览模式，加载resource路径资源文件数据', this.renderData, data);
          this.looseLeafData = data;
          if (this.looseLeafData.looseLeafInfo) {
            this.xmlCompList = JSON.parse(this.looseLeafData.looseLeafInfo);
          }
          if (this.businessType === 'looseLeaf') {
            this.title = this.looseLeafData.looseLeafName;
            this.$emit('onLoadLeafData', this.looseLeafData);
          } else {
            this.title = this.looseLeafData.looseLeafName;
            this.$emit('onLoadLeafData', this.looseLeafData);
          }
        }, 100);
      } else {
        console.log('调用接口获取活页数据');
        // getLeaf(this.looseLeafId).then((response) => {
        //   response.data.fileList = [
        //     {
        //       name: '',
        //       url: response.data.looseLeafFileUrl
        //     }
        //   ]
        //   this.looseLeafData = response.data
        //   if (this.looseLeafData.looseLeafInfo) {
        //     this.xmlCompList = JSON.parse(this.looseLeafData.looseLeafInfo)
        //   }
        //   if (this.businessType === 'looseLeaf') {
        //     this.title = this.looseLeafData.looseLeafName
        //     this.$emit('onLoadLeafData', this.looseLeafData)
        //   }
        // })
      }
    },
    goBack() {
      this.$emit('onGoBack', this.looseLeafId);
    }
  }
};

/* script */
const __vue_script__$4W = script$4W;
/* template */
var __vue_render__$4W = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", [
    _c(
      "div",
      { staticClass: "preview-container" },
      [
        _c(
          "div",
          {
            staticClass: "preview-container-title",
            staticStyle: { display: "none" },
          },
          [
            _vm.businessType === "textBook"
              ? _c("i", {
                  staticClass: "el-icon-back container-icon",
                  on: { click: _vm.goBack },
                })
              : _vm._e(),
            _vm._v(" "),
            _c("span", { staticClass: "container-text" }, [
              _vm._v(_vm._s(_vm.title)),
            ]),
          ]
        ),
        _vm._v(" "),
        _c(
          "div",
          {
            class: "preview-container-" + _vm.pageType,
            attrs: { id: _vm.looseLeafId },
          },
          [
            _vm._l(_vm.xmlCompList, function (item) {
              return _c(item.componentsName + "-render", {
                key: item.xmlCompRef,
                ref: item.xmlCompRef,
                refInFor: true,
                tag: "component",
                attrs: {
                  mode: "preview",
                  pageType: _vm.pageType,
                  pGroupData: item.data.pGroupData,
                  currentRule: item,
                  "extend-params": item.data.extendParams,
                },
              })
            }),
            _vm._v(" "),
            _vm.xmlCompList.length == 0
              ? _c("el-empty", {
                  staticClass: "empty",
                  attrs: {
                    image:
                      "data:image/png;base64, ",
                  },
                })
              : _vm._e(),
          ],
          2
        ),
        _vm._v(" "),
        _c(
          "el-dialog",
          {
            staticClass: "preview-box-dialog",
            attrs: {
              "show-close": false,
              visible: _vm.inlineWordsModal.visible,
              "modal-append-to-body": false,
              width: "80%",
              center: "",
            },
            on: {
              "update:visible": function ($event) {
                return _vm.$set(_vm.inlineWordsModal, "visible", $event)
              },
            },
          },
          [_c("div", [_vm._v(_vm._s(_vm.inlineWordsModal.content))])]
        ),
      ],
      1
    ),
  ])
};
var __vue_staticRenderFns__$4W = [];
__vue_render__$4W._withStripped = true;

  /* style */
  const __vue_inject_styles__$4W = undefined;
  /* scoped */
  const __vue_scope_id__$4W = "data-v-25742cb8";
  /* module identifier */
  const __vue_module_identifier__$4W = undefined;
  /* functional template */
  const __vue_is_functional_template__$4W = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4W = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4W, staticRenderFns: __vue_staticRenderFns__$4W },
    __vue_inject_styles__$4W,
    __vue_script__$4W,
    __vue_scope_id__$4W,
    __vue_is_functional_template__$4W,
    __vue_module_identifier__$4W,
    false,
    undefined,
    undefined,
    undefined
  );

//
let target$1;
Array.prototype.Remove = function (item, all) {
  let result,
    isType = Object.prototype.toString,
    i,
    len,
    start,
    hasLast = arguments[2];
  start = 0, len = this.length;
  for (i = start; i < len;) {
    var isPass = true,
      inx;
    if (!hasLast) {
      inx = i;
    } else {
      inx = len - 1;
    }
    if (isType.call(item) == '[object Array]') {
      for (let ii = 0, iimax = item.length; ii < iimax; ii++) {
        if (this[inx] === item[ii]) {
          isPass = false;
          break;
        }
      }
    } else if (this[inx] === item) {
      isPass = false;
    }
    if (!isPass) {
      result = true;
      this.splice(inx, 1);
      if (all) {
        break;
      }
    } else if (!hasLast) {
      len = this.length;
      i++;
    } else {
      len--;
    }
  }
  return result ? this : void 0;
};
var script$4V = {
  name: 'XmlRender',
  components: {
    PreviewLooseLeafRender: __vue_component__$4W,
    PreviewCatalogRender: __vue_component__$4X
  },
  props: {
    uuid: {
      type: String,
      default: ''
    },
    renderType: {
      type: String,
      default: ''
    },
    renderMode: {
      type: String,
      default: ''
    },
    renderData: {
      type: Object,
      default: () => {}
    },
    renderLooseLeaf: {
      type: Object,
      default: () => {}
    },
    renderCatalog: {
      type: Array,
      default: () => []
    },
    pageType: {
      type: String,
      default: 'h5'
    },
    styleType: {
      type: String,
      default: 'A'
    },
    projectId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      pageTitle: '',
      imageTitle: '',
      showViewer: false,
      previewSrc: '',
      businessType: String,
      //业务类型：looseLeaf，textBook
      looseLeafId: '',
      textBookId: '',
      xmlCompList: [],
      // pageType: 'h5', // 页面类型：取值h5、pc、pad
      looseLeafData: {},
      leafTitle: '',
      showType: 'leaf',
      //显示的类型：leaf 活页，catalog
      catalogList: [],
      imageShow: false,
      previewList: [],
      showPageIndex: 0,
      isStop: false,
      contentList: [],
      //内容list，只有3个
      initialIndex: 0,
      selectId: '',
      textBookData: {
        textBooksName: ''
      },
      uuidState: false
    };
  },
  computed: {
    // 公告滚动自定义
    cityOption() {
      return {
        step: 1,
        // 数值越大速度滚动越快
        limitMoveNum: 4,
        // 开始无缝滚动的数据量 this.cityData.length
        hoverStop: true,
        // 是否开启鼠标悬停stop
        direction: 1,
        // 0向下 1向上 2向左 3向右
        openWatch: true,
        // 开启数据实时监控刷新dom
        singleHeight: 0,
        // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
        singleWidth: 0,
        // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
        waitTime: 1000 // 单步运动停止的时间(默认值1000ms)
      };
    }
  },
  watch: {},
  created() {
    this.uuidState = true;
    // if (this.$route.query.pageType) {
    //   this.pageType = this.$route.query.pageType
    // } else {
    //   this.deviceType()
    // }
    //TODO http://${url}/previewLooseLeaf?businessType=looseLeaf&looseLeafId=1556533500887220224
    switch (this.renderType) {
      case 'looseLeaf':
        this.looseLeafId = this.uuid;
        break;
      case 'textBook':
        this.textBookId = this.uuid;
        break;
    }
    // if (this.$route.query.looseLeafId) {
    //   this.looseLeafId = this.$route.query.looseLeafId
    // }
    // if (this.$route.query.textBookId) {
    //   this.textBookId = this.$route.query.textBookId
    // }
    this.businessType = this.renderType;
    console.log('渲染数据源', this.renderData);
    // this.businessType = this.$route.query.businessType
    this.queryData();
    this.$nextTick(() => {
      window.showImageBYDate = () => {
        target$1 = window.event.target;
        if (target$1.isShow == true) return;
        target$1.isShow = true;
        jquery(target$1).find('img').click();
        setTimeout(() => {
          target$1.isShow = false;
        }, 1000);
        return false;
      };
      window.inlineAudioPlay = uuid => {
        target$1 = window.event.target;
        if (target$1.isShow == true) return;
        target$1.isShow = true;
        let audio = document.getElementById(`audio${uuid}`);
        if (audio.paused) {
          audio.play();
          document.getElementById(`icon${uuid}`).className = 'wifi-symbol playing';
        } else {
          audio.pause();
          audio.currentTime = 0; //音乐从头播放
          document.getElementById(`icon${uuid}`).className = 'wifi-symbol';
        }
        setTimeout(() => {
          target$1.isShow = false;
        }, 1000);
        return false;
      };
    });
  },
  methods: {
    showTitle(leafData) {
      if (this.businessType === 'looseLeaf') {
        this.pageTitle = leafData.looseLeafName;
      }
    },
    srcollChangeData() {
      let {
        scrollTop
      } = this.$refs.rightContent;
      console.log('===scrollTop', scrollTop);
      let id = '';
      this.contentList.forEach((it, index) => {
        let top = jquery(`#page_${it.id}`).get(0).offsetTop;
        if (top <= scrollTop) {
          id = this.contentList[index + 1] ? this.contentList[index + 1].id : it.id;
        }
      });
      this.selectId = id;
      console.log(this.selectId);
    },
    closeViewer() {
      this.showViewer = false;
    },
    debounce: (func, delay) => {
      let timer = null;
      return function () {
        let context = this;
        let args = arguments;
        if (timer) {
          clearTimeout(timer);
        }
        timer = setTimeout(function () {
          func.apply(context, args);
          timer = null;
        }, delay);
      };
    },
    getHeightByIndex(h) {
      let height = 0;
      h = h || this.showPageIndex;
      for (let i = 0; i <= h; i++) {
        height += jquery(jquery('.preview-list').get(i)).height();
      }
      return height;
    },
    //新的滚动方式
    scrollIndexPage(e) {
      this.isRunAnm = this.isRunAnm || false;
      let direction = e.deltaY > 0 ? 'down' : 'up'; //deltaY为正则滚轮向下，为负滚轮向上
      //console.log("==========================",this.initialIndex,this.showPageIndex)
      if (this.initialIndex != this.showPageIndex) return;
      if (direction == 'down' && e.deltaY >= 100) {
        //125为用户一次滚动鼠标的wheelDelta的值
        //   if ( this.isRunAnm == true ) return;
        console.log(this.initialIndex, jquery('.preview-list').length - 1);
        if (this.initialIndex >= jquery('.preview-list').length - 1) {
          this.initialIndex = jquery('.preview-list').length - 1;
        } else {
          let dom = jquery(`.preview-list:eq(${this.initialIndex})  > div > div `);
          // console.log(dom.height(),dom.parent().parent().get(0).scrollTop);
          if (dom.height() > 896 && dom.parent().parent().get(0).scrollTop + 896 < dom.height()) {
            this.isRunAnm = false;
          } else {
            this.isRunAnm = true;
            this.initialIndex = this.showPageIndex + 1;
            this.setActiveItem(this.initialIndex, direction);
            //  this.showPageIndex =  this.initialIndex;
          }
        }
      }
      if (direction == 'up' && e.deltaY <= -100) {
        //    if ( this.isRunAnm == true ) return;
        // console.log( this.initialIndex,"====================",$(".preview-list").length - 1);

        if (this.initialIndex <= 0) {
          this.initialIndex = 0;
          this.setActiveItem(0);
        } else {
          if (this.initialIndex >= jquery('.preview-list').length - 1) {
            this.initialIndex = jquery('.preview-list').length - 1;
          }
          let dom = jquery(`.preview-list:eq(${this.initialIndex})  > div > div `);
          //console.log(dom.parent().parent().get(0).scrollTop);

          if (dom.height() > 896 && dom.parent().parent().get(0).scrollTop > 0) {
            this.isRunAnm = false;
          } else {
            this.isRunAnm = true;
            this.initialIndex -= 1;
            this.setActiveItem(this.initialIndex, direction);
          }
        }
      }
    },
    /**
     *  滚轮的滚动结果
     * @param {页索引} index
     * @param {方向} direction
     */
    setActiveItem(index, direction) {
      //  this.isRunAnm = true;
      if (direction == 'down') {
        if (index < jquery('.preview-list').length) {
          jquery('.preview-list').each(function (i) {
            jquery(this).css('top', (index - i) * -896);
            //     console.log(i,index, $(this).css("top"));
          });
        }
      } else {
        // console.log($(".preview-list:eq(0)").position().top <= -896 );
        if (index >= 0 && jquery('.preview-list:eq(0)').position().top <= -896) {
          jquery('.preview-list').each(function (i) {
            jquery(this).css('top', (i - index) * 896);
            //   console.log(i,index, $(this).css("top"));
          });
        }
      }
      setTimeout(() => {
        this.isRunAnm = false;
        this.showPageIndex = this.initialIndex;
      }, 600);
    },
    deviceType() {
      if (/pad|iPad|phone|pod|iPhone|iPod|ios|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(navigator.userAgent)) {
        if (/pad|iPad/i.test(navigator.userAgent)) {
          this.pageType = 'pad';
        } else {
          this.pageType = 'h5';
        }
      } else {
        this.pageType = 'pc';
      }
    },
    queryData() {
      if (this.businessType === 'textBook') {
        if (this.renderMode === 'localview') {
          // eslint-disable-next-line no-undef
          let textBookData = this.renderData || {};
          this.textBookData = textBookData;
          this.pageTitle = textBookData.textBooksName;
          // eslint-disable-next-line no-undef
          let catalogList = this.renderCatalog || [];
          this.catalogList = catalogList;
          if (this.catalogList.length > 0) {
            this.looseLeafId = this.catalogList[0].id;
            this.leafTitle = this.catalogList[0].label;
          }
          this.contentList = [];
          const getItemByChild = list => {
            for (let i = 0; i < list.length; i++) {
              let it = list[i];
              this.contentList.push(it);
              if (it.children) {
                getItemByChild(it.children);
              }
            }
          };
          getItemByChild(this.catalogList);
          this.initialIndex = 0;
          this.showPageIndex = 0;
          if (this.contentList[0] && this.contentList[1] && this.contentList[0].id == this.contentList[1].id) {
            this.contentList.splice(0, 1);
          }
        } else {
          console.log('开始查询教材数据');
          // getBooks(this.textBookId).then((response) => {
          //   console.log('教材数据：', response.data)
          //   this.textBookData = response.data
          //   this.pageTitle = this.textBookData.textBooksName
          // })
          // listCatalog({ textBookId: this.textBookId }).then((res) => {
          //   console.log('目录列表：', res.data)
          //   this.catalogList = res.data

          //   if (this.catalogList.length > 0) {
          //     this.looseLeafId = this.catalogList[0].id
          //     this.leafTitle = this.catalogList[0].label
          //   }
          //   this.contentList = []
          //   //  if ( this.catalogList.length > 3) {
          //   const getItemByChild = (list) => {
          //     for (let i = 0; i < list.length; i++) {
          //       let it = list[i]
          //       this.contentList.push(it)

          //       if (it.children) {
          //         getItemByChild(it.children)
          //       }
          //     }
          //   }

          //   getItemByChild(this.catalogList)
          //   this.initialIndex = 0
          //   this.showPageIndex = 0
          //   if (this.contentList[0] && this.contentList[1] && this.contentList[0].id == this.contentList[1].id) {
          //     this.contentList.splice(0, 1)
          //   }
          //   console.log('============================', this.contentList)
          //   //}
          // })
        }
      } else {
        this.contentList.push({
          id: this.looseLeafId
        });
      }
    },
    showCatalog() {
      this.showType = 'catalog';
    },
    catalogClick(obj) {
      this.showType = 'leaf';
      this.looseLeafId = obj.id;
      this.selectId = obj.id;
      this.leafTitle = obj.label;
      this.contentList.forEach((it, index) => {
        if (it.id == obj.id) {
          this.initialIndex = index;
          this.setActiveItem(index, 'down');
        }
      });
      this.$forceUpdate();
      this.$nextTick(() => {
        setTimeout(() => {
          // alert($("#mo2g").attr("href"));
          // alert(1);
          console.log(this.selectId, '=========', jquery(`#${this.selectId}`).length);
          let isPc = 50;
          if (this.pageType == 'pc') isPc = 0;
          let top = jquery(`#page_${this.selectId}`).get(0).offsetTop - isPc;
          // alert(top);
          document.body.scrollTop = top;
          this.$refs.rightContent.scrollTop = top;
        }, 300);
      });
    }
  }
};

/* script */
const __vue_script__$4V = script$4V;
/* template */
var __vue_render__$4V = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticClass: "ouchn-container preview-mode" }, [
    _vm.uuidState
      ? _c("div", [
          _c(
            "div",
            { class: "phone-preview preview-for-" + _vm.pageType },
            [
              _vm.pageType === "pc"
                ? [
                    _c(
                      "div",
                      { staticClass: "pc-container" },
                      [
                        _vm.businessType === "textBook"
                          ? _c("preview-catalog-render", {
                              staticClass: "pc-catalog pc-catalog--render",
                              attrs: {
                                "page-type": _vm.pageType,
                                "text-book-id": _vm.textBookId,
                                "style-type": _vm.styleType,
                                "catalog-list": _vm.catalogList,
                                checkedId: _vm.selectId,
                              },
                              on: { onNodeClick: _vm.catalogClick },
                            })
                          : _vm._e(),
                        _vm._v(" "),
                        _c(
                          "div",
                          {
                            ref: "rightContent",
                            staticClass: "preview-list-counter",
                            on: {
                              scroll: function ($event) {
                                return _vm.srcollChangeData($event)
                              },
                            },
                          },
                          _vm._l(_vm.contentList, function (item, index) {
                            return _c(
                              "div",
                              {
                                key: "page" + index,
                                ref: "page" + index,
                                refInFor: true,
                                staticClass: "preview-list",
                                attrs: { id: "page_" + item.id },
                              },
                              [
                                _c("preview-loose-leaf-render", {
                                  class: "preview-screen-" + _vm.pageType,
                                  attrs: {
                                    "business-type": _vm.businessType,
                                    "loose-leaf-id": item.id,
                                    "p-title": item.label,
                                    renderMode: _vm.renderMode,
                                    renderData: _vm.renderData,
                                    renderLooseLeaf: _vm.renderLooseLeaf,
                                  },
                                  on: { onGoBack: _vm.showCatalog },
                                }),
                              ],
                              1
                            )
                          }),
                          0
                        ),
                      ],
                      1
                    ),
                  ]
                : [
                    _c(
                      "div",
                      {
                        directives: [
                          {
                            name: "show",
                            rawName: "v-show",
                            value: _vm.showType === "leaf",
                            expression: "showType === 'leaf'",
                          },
                        ],
                        ref: "rightContent",
                        staticClass: "preview-list-counter",
                        on: {
                          scroll: function ($event) {
                            return _vm.srcollChangeData($event)
                          },
                        },
                      },
                      [
                        _vm.pageType !== "pc"
                          ? _c(
                              "div",
                              { staticClass: "preview-container-title" },
                              [
                                _vm.businessType === "textBook"
                                  ? _c("i", {
                                      staticClass:
                                        "el-icon-s-fold container-icon",
                                      on: { click: _vm.showCatalog },
                                    })
                                  : _vm._e(),
                                _vm._v(" "),
                                _c("span", { staticClass: "container-text" }, [
                                  _vm._v(_vm._s(_vm.pageTitle)),
                                ]),
                              ]
                            )
                          : _vm._e(),
                        _vm._v(" "),
                        _vm._l(_vm.contentList, function (item, index) {
                          return _c(
                            "div",
                            {
                              key: "page" + index,
                              ref: "page" + index,
                              refInFor: true,
                              staticClass: "preview-list",
                              style: { top: index * 896 + "px" },
                              attrs: { id: "page_" + item.id },
                            },
                            [
                              _c("preview-loose-leaf-render", {
                                key: index,
                                class: "preview-screen-" + _vm.pageType,
                                attrs: {
                                  "business-type": _vm.businessType,
                                  "loose-leaf-id": item.id,
                                  "p-title": item.label,
                                  renderMode: _vm.renderMode,
                                  renderData: _vm.renderData,
                                  renderLooseLeaf: _vm.renderLooseLeaf,
                                },
                                on: {
                                  onGoBack: _vm.showCatalog,
                                  onLoadLeafData: _vm.showTitle,
                                },
                              }),
                            ],
                            1
                          )
                        }),
                      ],
                      2
                    ),
                    _vm._v(" "),
                    _vm.businessType === "textBook"
                      ? _c("preview-catalog-render", {
                          directives: [
                            {
                              name: "show",
                              rawName: "v-show",
                              value: _vm.showType === "catalog",
                              expression: "showType === 'catalog'",
                            },
                          ],
                          attrs: {
                            "page-type": _vm.pageType,
                            "text-book-id": _vm.textBookId,
                            "style-type": _vm.styleType,
                            "catalog-list": _vm.catalogList,
                            "is-show": _vm.showType === "catalog",
                            checkedId: _vm.selectId,
                          },
                          on: { onNodeClick: _vm.catalogClick },
                        })
                      : _vm._e(),
                  ],
            ],
            2
          ),
          _vm._v(" "),
          _c("a", { attrs: { id: "mo2g", href: "#" + _vm.selectId } }),
        ])
      : _c("div", { attrs: { id: "out" } }, [_vm._v("预览地址已失效")]),
  ])
};
var __vue_staticRenderFns__$4V = [];
__vue_render__$4V._withStripped = true;

  /* style */
  const __vue_inject_styles__$4V = undefined;
  /* scoped */
  const __vue_scope_id__$4V = undefined;
  /* module identifier */
  const __vue_module_identifier__$4V = undefined;
  /* functional template */
  const __vue_is_functional_template__$4V = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4V = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4V, staticRenderFns: __vue_staticRenderFns__$4V },
    __vue_inject_styles__$4V,
    __vue_script__$4V,
    __vue_scope_id__$4V,
    __vue_is_functional_template__$4V,
    __vue_module_identifier__$4V,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$4V.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('render', {
    prefix: options.prefix
  }), __vue_component__$4V);
};

const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate

let poolPtr = rnds8Pool.length;
function rng() {
  if (poolPtr > rnds8Pool.length - 16) {
    crypto$1.randomFillSync(rnds8Pool);
    poolPtr = 0;
  }
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
}

var REGEX$1 = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;

function validate(uuid) {
  return typeof uuid === 'string' && REGEX$1.test(uuid);
}

/**
 * Convert array of 16 byte values to UUID string format of the form:
 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
 */

const byteToHex = [];
for (let i = 0; i < 256; ++i) {
  byteToHex.push((i + 0x100).toString(16).substr(1));
}
function stringify$1(arr, offset = 0) {
  // Note: Be careful editing this code!  It's been tuned for performance
  // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID.  If this throws, it's likely due to one
  // of the following:
  // - One or more input array values don't map to a hex octet (leading to
  // "undefined" in the uuid)
  // - Invalid input values for the RFC `version` or `variant` fields

  if (!validate(uuid)) {
    throw TypeError('Stringified UUID is invalid');
  }
  return uuid;
}

function v4(options, buf, offset) {
  options = options || {};
  const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`

  rnds[6] = rnds[6] & 0x0f | 0x40;
  rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided

  if (buf) {
    offset = offset || 0;
    for (let i = 0; i < 16; ++i) {
      buf[offset + i] = rnds[i];
    }
    return buf;
  }
  return stringify$1(rnds);
}

var defaultLang = {
  el: {
    colorpicker: {
      confirm: '确定',
      clear: '清空'
    },
    datepicker: {
      now: '此刻',
      today: '今天',
      cancel: '取消',
      clear: '清空',
      confirm: '确定',
      selectDate: '选择日期',
      selectTime: '选择时间',
      startDate: '开始日期',
      startTime: '开始时间',
      endDate: '结束日期',
      endTime: '结束时间',
      prevYear: '前一年',
      nextYear: '后一年',
      prevMonth: '上个月',
      nextMonth: '下个月',
      year: '年',
      month1: '1 月',
      month2: '2 月',
      month3: '3 月',
      month4: '4 月',
      month5: '5 月',
      month6: '6 月',
      month7: '7 月',
      month8: '8 月',
      month9: '9 月',
      month10: '10 月',
      month11: '11 月',
      month12: '12 月',
      // week: '周次',
      weeks: {
        sun: '日',
        mon: '一',
        tue: '二',
        wed: '三',
        thu: '四',
        fri: '五',
        sat: '六'
      },
      months: {
        jan: '一月',
        feb: '二月',
        mar: '三月',
        apr: '四月',
        may: '五月',
        jun: '六月',
        jul: '七月',
        aug: '八月',
        sep: '九月',
        oct: '十月',
        nov: '十一月',
        dec: '十二月'
      }
    },
    select: {
      loading: '加载中',
      noMatch: '无匹配数据',
      noData: '无数据',
      placeholder: '请选择'
    },
    cascader: {
      noMatch: '无匹配数据',
      loading: '加载中',
      placeholder: '请选择',
      noData: '暂无数据'
    },
    pagination: {
      goto: '前往',
      pagesize: '条/页',
      total: '共 {total} 条',
      pageClassifier: '页'
    },
    messagebox: {
      title: '提示',
      confirm: '确定',
      cancel: '取消',
      error: '输入的数据不合法!'
    },
    upload: {
      deleteTip: '按 delete 键可删除',
      delete: '删除',
      preview: '查看图片',
      continue: '继续上传'
    },
    table: {
      emptyText: '暂无数据',
      confirmFilter: '筛选',
      resetFilter: '重置',
      clearFilter: '全部',
      sumText: '合计'
    },
    tree: {
      emptyText: '暂无数据'
    },
    transfer: {
      noMatch: '无匹配数据',
      noData: '无数据',
      titles: ['列表 1', '列表 2'],
      filterPlaceholder: '请输入搜索内容',
      noCheckedFormat: '共 {total} 项',
      hasCheckedFormat: '已选 {checked}/{total} 项'
    },
    image: {
      error: '加载失败'
    },
    pageHeader: {
      title: '返回'
    },
    popconfirm: {
      confirmButtonText: '确定',
      cancelButtonText: '取消'
    },
    empty: {
      description: '暂无数据'
    }
  }
};

var isMergeableObject = function isMergeableObject(value) {
  return isNonNullObject(value) && !isSpecial(value);
};
function isNonNullObject(value) {
  return !!value && typeof value === 'object';
}
function isSpecial(value) {
  var stringValue = Object.prototype.toString.call(value);
  return stringValue === '[object RegExp]' || stringValue === '[object Date]' || isReactElement(value);
}

// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
function isReactElement(value) {
  return value.$$typeof === REACT_ELEMENT_TYPE;
}
function emptyTarget(val) {
  return Array.isArray(val) ? [] : {};
}
function cloneIfNecessary(value, optionsArgument) {
  var clone = optionsArgument && optionsArgument.clone === true;
  return clone && isMergeableObject(value) ? deepmerge(emptyTarget(value), value, optionsArgument) : value;
}
function defaultArrayMerge(target, source, optionsArgument) {
  var destination = target.slice();
  source.forEach(function (e, i) {
    if (typeof destination[i] === 'undefined') {
      destination[i] = cloneIfNecessary(e, optionsArgument);
    } else if (isMergeableObject(e)) {
      destination[i] = deepmerge(target[i], e, optionsArgument);
    } else if (target.indexOf(e) === -1) {
      destination.push(cloneIfNecessary(e, optionsArgument));
    }
  });
  return destination;
}
function mergeObject(target, source, optionsArgument) {
  var destination = {};
  if (isMergeableObject(target)) {
    Object.keys(target).forEach(function (key) {
      destination[key] = cloneIfNecessary(target[key], optionsArgument);
    });
  }
  Object.keys(source).forEach(function (key) {
    if (!isMergeableObject(source[key]) || !target[key]) {
      destination[key] = cloneIfNecessary(source[key], optionsArgument);
    } else {
      destination[key] = deepmerge(target[key], source[key], optionsArgument);
    }
  });
  return destination;
}
function deepmerge(target, source, optionsArgument) {
  var sourceIsArray = Array.isArray(source);
  var targetIsArray = Array.isArray(target);
  var options = optionsArgument || {
    arrayMerge: defaultArrayMerge
  };
  var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
  if (!sourceAndTargetTypesMatch) {
    return cloneIfNecessary(source, optionsArgument);
  } else if (sourceIsArray) {
    var arrayMerge = options.arrayMerge || defaultArrayMerge;
    return arrayMerge(target, source, optionsArgument);
  } else {
    return mergeObject(target, source, optionsArgument);
  }
}
deepmerge.all = function deepmergeAll(array, optionsArgument) {
  if (!Array.isArray(array) || array.length < 2) {
    throw new Error('first argument should be an array with at least two elements');
  }

  // we are sure there are at least 2 values, so it is safe to have no initial value
  return array.reduce(function (prev, next) {
    return deepmerge(prev, next, optionsArgument);
  });
};
var deepmerge_1 = deepmerge;

function isString$1(obj) {
  return Object.prototype.toString.call(obj) === '[object String]';
}
function isHtmlElement(node) {
  return node && node.nodeType === Node.ELEMENT_NODE;
}
if (typeof /./ !== 'function' && typeof Int8Array !== 'object' && (Vue.prototype.$isServer || typeof document.childNodes !== 'function')) ;

const hasOwnProperty$2 = Object.prototype.hasOwnProperty;
function hasOwn(obj, key) {
  return hasOwnProperty$2.call(obj, key);
}
const isFirefox = function () {
  return !Vue.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
};
function rafThrottle(fn) {
  let locked = false;
  return function (...args) {
    if (locked) return;
    locked = true;
    window.requestAnimationFrame(_ => {
      fn.apply(this, args);
      locked = false;
    });
  };
}

const RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
/**
 *  String format template
 *  - Inspired:
 *    https://github.com/Matt-Esch/string-template/index.js
 */
function Format (Vue) {
  /**
   * template
   *
   * @param {String} string
   * @param {Array} ...args
   * @return {String}
   */

  function template(string, ...args) {
    if (args.length === 1 && typeof args[0] === 'object') {
      args = args[0];
    }
    if (!args || !args.hasOwnProperty) {
      args = {};
    }
    return string.replace(RE_NARGS, (match, prefix, i, index) => {
      let result;
      if (string[index - 1] === '{' && string[index + match.length] === '}') {
        return i;
      } else {
        result = hasOwn(args, i) ? args[i] : null;
        if (result === null || result === undefined) {
          return '';
        }
        return result;
      }
    });
  }
  return template;
}

const format$1 = Format();
let lang = defaultLang;
let merged = false;
let i18nHandler = function () {
  const vuei18n = Object.getPrototypeOf(this || Vue).$t;
  if (typeof vuei18n === 'function' && !!Vue.locale) {
    if (!merged) {
      merged = true;
      Vue.locale(Vue.config.lang, deepmerge_1(lang, Vue.locale(Vue.config.lang) || {}, {
        clone: true
      }));
    }
    return vuei18n.apply(this, arguments);
  }
};
const t$1 = function (path, options) {
  let value = i18nHandler.apply(this, arguments);
  if (value !== null && value !== undefined) return value;
  const array = path.split('.');
  let current = lang;
  for (let i = 0, j = array.length; i < j; i++) {
    const property = array[i];
    value = current[property];
    if (i === j - 1) return format$1(value, options);
    if (!value) return '';
    current = value;
  }
  return '';
};

var Locale = {
  methods: {
    t(...args) {
      return t$1.apply(this, args);
    }
  }
};

/* istanbul ignore next */
const isServer = Vue.prototype.$isServer;
const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
const MOZ_HACK_REGEXP = /^moz([A-Z])/;
const ieVersion = isServer ? 0 : Number(document.documentMode);

/* istanbul ignore next */
const trim$2 = function (string) {
  return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
};
/* istanbul ignore next */
const camelCase$1 = function (name) {
  return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
    return offset ? letter.toUpperCase() : letter;
  }).replace(MOZ_HACK_REGEXP, 'Moz$1');
};

/* istanbul ignore next */
const on$1 = function () {
  if (!isServer && document.addEventListener) {
    return function (element, event, handler) {
      if (element && event && handler) {
        element.addEventListener(event, handler, false);
      }
    };
  } else {
    return function (element, event, handler) {
      if (element && event && handler) {
        element.attachEvent('on' + event, handler);
      }
    };
  }
}();

/* istanbul ignore next */
const off$1 = function () {
  if (!isServer && document.removeEventListener) {
    return function (element, event, handler) {
      if (element && event) {
        element.removeEventListener(event, handler, false);
      }
    };
  } else {
    return function (element, event, handler) {
      if (element && event) {
        element.detachEvent('on' + event, handler);
      }
    };
  }
}();

/* istanbul ignore next */
function hasClass$2(el, cls) {
  if (!el || !cls) return false;
  if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');
  if (el.classList) {
    return el.classList.contains(cls);
  } else {
    return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
  }
}

/* istanbul ignore next */
function addClass$1(el, cls) {
  if (!el) return;
  var curClass = el.className;
  var classes = (cls || '').split(' ');
  for (var i = 0, j = classes.length; i < j; i++) {
    var clsName = classes[i];
    if (!clsName) continue;
    if (el.classList) {
      el.classList.add(clsName);
    } else if (!hasClass$2(el, clsName)) {
      curClass += ' ' + clsName;
    }
  }
  if (!el.classList) {
    el.setAttribute('class', curClass);
  }
}

/* istanbul ignore next */
function removeClass$1(el, cls) {
  if (!el || !cls) return;
  var classes = cls.split(' ');
  var curClass = ' ' + el.className + ' ';
  for (var i = 0, j = classes.length; i < j; i++) {
    var clsName = classes[i];
    if (!clsName) continue;
    if (el.classList) {
      el.classList.remove(clsName);
    } else if (hasClass$2(el, clsName)) {
      curClass = curClass.replace(' ' + clsName + ' ', ' ');
    }
  }
  if (!el.classList) {
    el.setAttribute('class', trim$2(curClass));
  }
}

/* istanbul ignore next */
const getStyle = ieVersion < 9 ? function (element, styleName) {
  if (isServer) return;
  if (!element || !styleName) return null;
  styleName = camelCase$1(styleName);
  if (styleName === 'float') {
    styleName = 'styleFloat';
  }
  try {
    switch (styleName) {
      case 'opacity':
        try {
          return element.filters.item('alpha').opacity / 100;
        } catch (e) {
          return 1.0;
        }
      default:
        return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
    }
  } catch (e) {
    return element.style[styleName];
  }
} : function (element, styleName) {
  if (isServer) return;
  if (!element || !styleName) return null;
  styleName = camelCase$1(styleName);
  if (styleName === 'float') {
    styleName = 'cssFloat';
  }
  try {
    var computed = document.defaultView.getComputedStyle(element, '');
    return element.style[styleName] || computed ? computed[styleName] : null;
  } catch (e) {
    return element.style[styleName];
  }
};
const isScroll = (el, vertical) => {
  if (isServer) return;
  const determinedDirection = vertical !== null && vertical !== undefined;
  const overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
  return overflow.match(/(scroll|auto|overlay)/);
};
const getScrollContainer = (el, vertical) => {
  if (isServer) return;
  let parent = el;
  while (parent) {
    if ([window, document, document.documentElement].includes(parent)) {
      return window;
    }
    if (isScroll(parent, vertical)) {
      return parent;
    }
    parent = parent.parentNode;
  }
  return parent;
};
const isInContainer = (el, container) => {
  if (isServer || !el || !container) return false;
  const elRect = el.getBoundingClientRect();
  let containerRect;
  if ([window, document, document.documentElement, null, undefined].includes(container)) {
    containerRect = {
      top: 0,
      right: window.innerWidth,
      bottom: window.innerHeight,
      left: 0
    };
  } else {
    containerRect = container.getBoundingClientRect();
  }
  return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
};

/* eslint-disable no-undefined,no-param-reassign,no-shadow */

/**
 * Throttle execution of a function. Especially useful for rate limiting
 * execution of handlers on events like resize and scroll.
 *
 * @param  {Number}    delay          A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
 * @param  {Boolean}   [noTrailing]   Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds while the
 *                                    throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time
 *                                    after the last throttled-function call. (After the throttled-function has not been called for `delay` milliseconds,
 *                                    the internal counter is reset)
 * @param  {Function}  callback       A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
 *                                    to `callback` when the throttled-function is executed.
 * @param  {Boolean}   [debounceMode] If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is false (at end),
 *                                    schedule `callback` to execute after `delay` ms.
 *
 * @return {Function}  A new, throttled, function.
 */
var throttle$2 = function (delay, noTrailing, callback, debounceMode) {
  // After wrapper has stopped being called, this timeout ensures that
  // `callback` is executed at the proper times in `throttle` and `end`
  // debounce modes.
  var timeoutID;

  // Keep track of the last time `callback` was executed.
  var lastExec = 0;

  // `noTrailing` defaults to falsy.
  if (typeof noTrailing !== 'boolean') {
    debounceMode = callback;
    callback = noTrailing;
    noTrailing = undefined;
  }

  // The `wrapper` function encapsulates all of the throttling / debouncing
  // functionality and when executed will limit the rate at which `callback`
  // is executed.
  function wrapper() {
    var self = this;
    var elapsed = Number(new Date()) - lastExec;
    var args = arguments;

    // Execute `callback` and update the `lastExec` timestamp.
    function exec() {
      lastExec = Number(new Date());
      callback.apply(self, args);
    }

    // If `debounceMode` is true (at begin) this is used to clear the flag
    // to allow future `callback` executions.
    function clear() {
      timeoutID = undefined;
    }
    if (debounceMode && !timeoutID) {
      // Since `wrapper` is being called for the first time and
      // `debounceMode` is true (at begin), execute `callback`.
      exec();
    }

    // Clear any existing timeout.
    if (timeoutID) {
      clearTimeout(timeoutID);
    }
    if (debounceMode === undefined && elapsed > delay) {
      // In throttle mode, if `delay` time has been exceeded, execute
      // `callback`.
      exec();
    } else if (noTrailing !== true) {
      // In trailing throttle mode, since `delay` time has not been
      // exceeded, schedule `callback` to execute `delay` ms after most
      // recent execution.
      //
      // If `debounceMode` is true (at begin), schedule `clear` to execute
      // after `delay` ms.
      //
      // If `debounceMode` is false (at end), schedule `callback` to
      // execute after `delay` ms.
      timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
    }
  }

  // Return the wrapper function.
  return wrapper;
};

//
const isSupportObjectFit = () => document.documentElement.style.objectFit !== undefined;
const ObjectFit = {
  NONE: 'none',
  CONTAIN: 'contain',
  COVER: 'cover',
  FILL: 'fill',
  SCALE_DOWN: 'scale-down'
};
var script$4U = {
  name: 'DesignPreviewImage',
  mixins: [Locale],
  inheritAttrs: false,
  props: {
    src: String,
    fit: String,
    lazy: Boolean,
    mode: String,
    scrollContainer: {},
    previewSrcList: {
      type: Array,
      default: () => []
    },
    zIndex: {
      type: Number,
      default: 2000
    },
    currentIndex: {
      type: Number,
      default: -1
    },
    current: {
      type: Number,
      default: 0
    },
    showTitle: {
      type: Boolean,
      default: false
    },
    title: {
      type: Array,
      default: () => []
    },
    contents: {
      type: Array,
      default: () => []
    },
    self: {
      type: Object,
      default: () => {
      }
    },
    titlePosition: {
      type: String,
      default: 'under'
    },
    titleAlign: {
      type: String,
      default: 'left'
    },
    clickEffect: {
      type: String,
      default: 'dian-ji-fang-da'
    },
    width: {
      type: Number,
      default: 100
    },
    pageType: {
      type: String,
      default: 'h5'
    }
  },
  data() {
    return {
      loading: true,
      error: false,
      show: !this.lazy,
      imageWidth: 0,
      imageHeight: 0,
      showViewer: false
    };
  },
  computed: {
    imageStyle() {
      const {
        fit
      } = this;
      if (!this.$isServer && fit) {
        return isSupportObjectFit() ? {
          'object-fit': 'contain',
          width: this.width + '% !important'
        } : this.getImageStyle(fit);
      }
      return {
        width: this.width + '% !important'
      };
    },
    alignCenter() {
      return !this.$isServer && !isSupportObjectFit() && this.fit !== ObjectFit.FILL;
    },
    preview() {
      const {
        previewSrcList
      } = this;
      return Array.isArray(previewSrcList) && previewSrcList.length > 0 && this.mode === 'preview' && (this.clickEffect === 'dian-ji-fang-da' || this.clickEffect === 'dian-ji-tiao-zhuan');
    },
    imageIndex() {
      if (this.currentIndex !== -1) {
        return this.currentIndex;
      }
      let previewIndex = 0;
      const srcIndex = this.previewSrcList.indexOf(this.src);
      if (srcIndex >= 0) {
        previewIndex = srcIndex;
      }
      return previewIndex;
    }
  },
  watch: {
    src(val) {
      this.show && this.loadImage();
    },
    show(val) {
      val && this.loadImage();
    },
    title: {
      handler(n, o) {
        // console.log(n, o)
      },
      immediate: true,
      deep: true
    }
  },
  mounted() {
    if (this.lazy) {
      this.addLazyLoadListener();
    } else {
      this.loadImage();
    }
  },
  beforeDestroy() {
    this.lazy && this.removeLazyLoadListener();
  },
  methods: {
    loadImage() {
      if (this.$isServer) return;

      // reset status
      this.loading = true;
      this.error = false;
      const img = new Image();
      img.onload = e => this.handleLoad(e, img);
      img.onerror = this.handleError.bind(this);

      // bind html attrs
      // so it can behave consistently
      Object.keys(this.$attrs).forEach(key => {
        const value = this.$attrs[key];
        img.setAttribute(key, value);
      });
      img.src = this.src;
    },
    handleLoad(e, img) {
      this.imageWidth = img.width;
      this.imageHeight = img.height;
      this.loading = false;
      this.error = false;
    },
    handleError(e) {
      this.loading = false;
      this.error = true;
      this.$emit('error', e);
    },
    handleLazyLoad() {
      if (isInContainer(this.$el, this._scrollContainer)) {
        this.show = true;
        this.removeLazyLoadListener();
      }
    },
    addLazyLoadListener() {
      if (this.$isServer) return;
      const {
        scrollContainer
      } = this;
      let _scrollContainer = null;
      if (isHtmlElement(scrollContainer)) {
        _scrollContainer = scrollContainer;
      } else if (isString$1(scrollContainer)) {
        _scrollContainer = document.querySelector(scrollContainer);
      } else {
        _scrollContainer = getScrollContainer(this.$el);
      }
      if (_scrollContainer) {
        this._scrollContainer = _scrollContainer;
        this._lazyLoadHandler = throttle$2(200, this.handleLazyLoad);
        on$1(_scrollContainer, 'scroll', this._lazyLoadHandler);
        this.handleLazyLoad();
      }
    },
    removeLazyLoadListener() {
      const {
        _scrollContainer,
        _lazyLoadHandler
      } = this;
      if (this.$isServer || !_scrollContainer || !_lazyLoadHandler) return;
      off$1(_scrollContainer, 'scroll', _lazyLoadHandler);
      this._scrollContainer = null;
      this._lazyLoadHandler = null;
    },
    /**
     * simulate object-fit behavior to compatible with IE11 and other browsers which not support object-fit
     */
    getImageStyle(fit) {
      const {
        imageWidth,
        imageHeight
      } = this;
      const {
        clientWidth: containerWidth,
        clientHeight: containerHeight
      } = this.$el;
      if (!imageWidth || !imageHeight || !containerWidth || !containerHeight) return {};
      const imageAspectRatio = imageWidth / imageHeight;
      const containerAspectRatio = containerWidth / containerHeight;
      if (fit === ObjectFit.SCALE_DOWN) {
        const isSmaller = imageWidth < containerWidth && imageHeight < containerHeight;
        fit = isSmaller ? ObjectFit.NONE : ObjectFit.CONTAIN;
      }
      switch (fit) {
        case ObjectFit.NONE:
          return {
            width: this.width + '% !important',
            height: 'auto'
          };
        case ObjectFit.CONTAIN:
          return imageAspectRatio < containerAspectRatio ? {
            width: this.width + '% !important'
          } : {
            height: 'auto',
            width: this.width + '% !important'
          };
        case ObjectFit.COVER:
          return imageAspectRatio < containerAspectRatio ? {
            width: this.width + '% !important'
          } : {
            width: 'auto',
            width: this.width + '% !important'
          };
        default:
          return {
            width: this.width + '% !important'
          };
      }
    },
    clickHandler(isByTitle) {
      // don't show viewer when preview is false
      if (!this.preview) {
        return;
      }
      if (this.clickEffect === 'dian-ji-fang-da') {
        this.$xmlImgPreview({
          multiple: true,
          nowImgIndex: 0,
          imgList: [{
            url: this.previewSrcList[0],
            title: this.self.title
          }]
        });
      }
      if (isByTitle) {
        this.$emit('onBottomTitleClick');
      }
    }
  }
};

/* script */
const __vue_script__$4U = script$4U;
/* template */
var __vue_render__$4U = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { staticClass: "el-image", staticStyle: { "{\n      width": "100px" } },
    [
      _vm.self && _vm.self.title && _vm.showTitle && _vm.titlePosition === "on"
        ? _c(
            "div",
            {
              staticClass: "image-title--lay image-title--on",
              style: { textAlign: _vm.titleAlign || "left" },
            },
            [_vm._v("\n    " + _vm._s(_vm.self.title) + "\n  ")]
          )
        : _vm._e(),
      _vm._v(" "),
      _vm.loading
        ? _vm._t("placeholder", function () {
            return [_vm._m(0)]
          })
        : _vm.error
        ? _vm._t("error", function () {
            return [
              _c("div", { staticClass: "el-image__error" }, [
                _vm._v(_vm._s(_vm.t("el.image.error"))),
              ]),
            ]
          })
        : _c(
            "img",
            _vm._g(
              _vm._b(
                {
                  staticClass: "el-image__inner",
                  class: {
                    "el-image__inner--center": _vm.alignCenter,
                    "el-image__preview": _vm.preview,
                  },
                  style: _vm.imageStyle,
                  attrs: { src: _vm.src },
                  on: { click: _vm.clickHandler },
                },
                "img",
                _vm.$attrs,
                false
              ),
              _vm.$listeners
            )
          ),
      _vm._v(" "),
      _vm.self &&
      _vm.self.title &&
      _vm.showTitle &&
      _vm.titlePosition === "bottom"
        ? _c(
            "div",
            {
              staticClass: "image-title--fixed image-title--bottom",
              style: { textAlign: _vm.titleAlign || "left" },
              on: {
                click: function ($event) {
                  return _vm.clickHandler(1)
                },
              },
            },
            [_vm._v("\n    " + _vm._s(_vm.self.title) + "\n  ")]
          )
        : _vm._e(),
      _vm._v(" "),
      _vm.self && _vm.self.title && _vm.showTitle && _vm.titlePosition === "top"
        ? _c(
            "div",
            {
              staticClass: "image-title--fixed image-title--top",
              style: { textAlign: _vm.titleAlign || "left" },
              on: {
                click: function ($event) {
                  return _vm.clickHandler(1)
                },
              },
            },
            [_vm._v("\n    " + _vm._s(_vm.self.title) + "\n  ")]
          )
        : _vm._e(),
      _vm._v(" "),
      _vm.self &&
      _vm.self.title &&
      _vm.showTitle &&
      _vm.titlePosition === "under"
        ? _c(
            "div",
            {
              staticClass: "image-title--lay image-title--under",
              style: { textAlign: _vm.titleAlign || "left" },
            },
            [_vm._v("\n    " + _vm._s(_vm.self.title) + "\n  ")]
          )
        : _vm._e(),
    ],
    2
  )
};
var __vue_staticRenderFns__$4U = [
  function () {
    var _vm = this;
    var _h = _vm.$createElement;
    var _c = _vm._self._c || _h;
    return _c(
      "div",
      {
        staticClass: "el-image__placeholder",
        staticStyle: { padding: "40% 0" },
      },
      [_c("i", { staticClass: "el-icon-loading" })]
    )
  },
];
__vue_render__$4U._withStripped = true;

  /* style */
  const __vue_inject_styles__$4U = undefined;
  /* scoped */
  const __vue_scope_id__$4U = "data-v-15928cc6";
  /* module identifier */
  const __vue_module_identifier__$4U = undefined;
  /* functional template */
  const __vue_is_functional_template__$4U = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4U = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4U, staticRenderFns: __vue_staticRenderFns__$4U },
    __vue_inject_styles__$4U,
    __vue_script__$4U,
    __vue_scope_id__$4U,
    __vue_is_functional_template__$4U,
    __vue_module_identifier__$4U,
    false,
    undefined,
    undefined,
    undefined
  );

let hasModal = false;
let hasInitZIndex = false;
let zIndex;
const getModal = function () {
  if (Vue.prototype.$isServer) return;
  let modalDom = PopupManager.modalDom;
  if (modalDom) {
    hasModal = true;
  } else {
    hasModal = false;
    modalDom = document.createElement('div');
    PopupManager.modalDom = modalDom;
    modalDom.addEventListener('touchmove', function (event) {
      event.preventDefault();
      event.stopPropagation();
    });
    modalDom.addEventListener('click', function () {
      PopupManager.doOnModalClick && PopupManager.doOnModalClick();
    });
  }
  return modalDom;
};
const instances = {};
const PopupManager = {
  modalFade: true,
  getInstance: function (id) {
    return instances[id];
  },
  register: function (id, instance) {
    if (id && instance) {
      instances[id] = instance;
    }
  },
  deregister: function (id) {
    if (id) {
      instances[id] = null;
      delete instances[id];
    }
  },
  nextZIndex: function () {
    return PopupManager.zIndex++;
  },
  modalStack: [],
  doOnModalClick: function () {
    const topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
    if (!topItem) return;
    const instance = PopupManager.getInstance(topItem.id);
    if (instance && instance.closeOnClickModal) {
      instance.close();
    }
  },
  openModal: function (id, zIndex, dom, modalClass, modalFade) {
    if (Vue.prototype.$isServer) return;
    if (!id || zIndex === undefined) return;
    this.modalFade = modalFade;
    const modalStack = this.modalStack;
    for (let i = 0, j = modalStack.length; i < j; i++) {
      const item = modalStack[i];
      if (item.id === id) {
        return;
      }
    }
    const modalDom = getModal();
    addClass$1(modalDom, 'v-modal');
    if (this.modalFade && !hasModal) {
      addClass$1(modalDom, 'v-modal-enter');
    }
    if (modalClass) {
      let classArr = modalClass.trim().split(/\s+/);
      classArr.forEach(item => addClass$1(modalDom, item));
    }
    setTimeout(() => {
      removeClass$1(modalDom, 'v-modal-enter');
    }, 200);
    if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
      dom.parentNode.appendChild(modalDom);
    } else {
      document.body.appendChild(modalDom);
    }
    if (zIndex) {
      modalDom.style.zIndex = zIndex;
    }
    modalDom.tabIndex = 0;
    modalDom.style.display = '';
    this.modalStack.push({
      id: id,
      zIndex: zIndex,
      modalClass: modalClass
    });
  },
  closeModal: function (id) {
    const modalStack = this.modalStack;
    const modalDom = getModal();
    if (modalStack.length > 0) {
      const topItem = modalStack[modalStack.length - 1];
      if (topItem.id === id) {
        if (topItem.modalClass) {
          let classArr = topItem.modalClass.trim().split(/\s+/);
          classArr.forEach(item => removeClass$1(modalDom, item));
        }
        modalStack.pop();
        if (modalStack.length > 0) {
          modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
        }
      } else {
        for (let i = modalStack.length - 1; i >= 0; i--) {
          if (modalStack[i].id === id) {
            modalStack.splice(i, 1);
            break;
          }
        }
      }
    }
    if (modalStack.length === 0) {
      if (this.modalFade) {
        addClass$1(modalDom, 'v-modal-leave');
      }
      setTimeout(() => {
        if (modalStack.length === 0) {
          if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
          modalDom.style.display = 'none';
          PopupManager.modalDom = undefined;
        }
        removeClass$1(modalDom, 'v-modal-leave');
      }, 200);
    }
  }
};
Object.defineProperty(PopupManager, 'zIndex', {
  configurable: true,
  get() {
    if (!hasInitZIndex) {
      zIndex = zIndex || (Vue.prototype.$ELEMENT || {}).zIndex || 2000;
      hasInitZIndex = true;
    }
    return zIndex;
  },
  set(value) {
    zIndex = value;
  }
});
const getTopPopup = function () {
  if (Vue.prototype.$isServer) return;
  if (PopupManager.modalStack.length > 0) {
    const topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
    if (!topPopup) return;
    const instance = PopupManager.getInstance(topPopup.id);
    return instance;
  }
};
if (!Vue.prototype.$isServer) {
  // handle `esc` key when the popup is shown
  window.addEventListener('keydown', function (event) {
    if (event.keyCode === 27) {
      const topPopup = getTopPopup();
      if (topPopup && topPopup.closeOnPressEscape) {
        topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();
      }
    }
  });
}

//
const Mode = {
  CONTAIN: {
    name: 'contain',
    icon: 'el-icon-full-screen'
  },
  ORIGINAL: {
    name: 'original',
    icon: 'el-icon-c-scale-to-original'
  }
};
const mousewheelEventName = isFirefox() ? 'DOMMouseScroll' : 'mousewheel';
var script$4T = {
  name: 'XmlImageViewer',
  props: {
    urlList: {
      type: Array,
      default: () => []
    },
    zIndex: {
      type: Number,
      default: 2000
    },
    onSwitch: {
      type: Function,
      default: () => {}
    },
    onClose: {
      type: Function,
      default: () => {}
    },
    initialIndex: {
      type: Number,
      default: 0
    },
    appendToBody: {
      type: Boolean,
      default: true
    },
    maskClosable: {
      type: Boolean,
      default: true
    },
    title: {
      type: Array,
      default: () => []
    },
    contents: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      index: this.initialIndex,
      isShow: false,
      infinite: true,
      loading: false,
      mode: Mode.CONTAIN,
      transform: {
        scale: 1,
        deg: 0,
        offsetX: 0,
        offsetY: 0,
        enableTransition: false
      },
      contentExpand: false,
      ellipsisReady: true,
      showEllipsisButton: false,
      startX: 0,
      startY: 0,
      offsetX: 0,
      offsetY: 0,
      slide: false
    };
  },
  computed: {
    isSingle() {
      return this.urlList.length <= 1;
    },
    isFirst() {
      return this.index === 0;
    },
    isLast() {
      return this.index === this.urlList.length - 1;
    },
    currentImg() {
      return this.urlList[this.index];
    },
    imgStyle() {
      const {
        scale,
        deg,
        offsetX,
        offsetY,
        enableTransition
      } = this.transform;
      const style = {
        transform: `scale(${scale}) rotate(${deg}deg)`,
        transition: enableTransition ? 'transform .3s' : '',
        'margin-left': `${offsetX}px`,
        'margin-top': `${offsetY}px`
      };
      if (this.mode === Mode.CONTAIN) {
        style.maxWidth = style.maxHeight = '100%';
      }
      return style;
    },
    viewerZIndex() {
      const nextZIndex = PopupManager.nextZIndex();
      return this.zIndex > nextZIndex ? this.zIndex : nextZIndex;
    }
  },
  watch: {
    index: {
      handler: function (val) {
        this.reset();
        this.onSwitch(val);
        this.contentExpand = false;
        this.ellipsisReady = true;
        this.setEllipsisButton();
      }
    },
    currentImg(val) {
      this.$nextTick(_ => {
        const $img = this.$refs.img[0];
        if (!$img.complete) {
          this.loading = true;
        }
      });
    }
  },
  methods: {
    setEllipsisButton() {
      this.$nextTick(() => {
        let wrapper = this.$refs['el-image-viewer__wrapper'] ? this.$refs['el-image-viewer__wrapper'].getBoundingClientRect() : {};
        if (!wrapper.width) {
          this.showEllipsisButton = false;
          return;
        }
        let content = this.contents.length ? this.contents[this.index] : '';
        let vDom = document.createElement('div');
        vDom.style.width = wrapper.width + 'px';
        vDom.style.padding = '0 15px';
        vDom.style.fontSize = '14px';
        vDom.style.lineHeight = '22px';
        vDom.style.position = 'absolute';
        vDom.style.top = '-9999px';
        vDom.innerHTML = content;
        document.documentElement.appendChild(vDom);
        let vRect = vDom.getBoundingClientRect();
        if (vRect.height && vRect.height > 66) {
          this.showEllipsisButton = true;
          return;
        }
        this.showEllipsisButton = false;
      });
    },
    toggleEllipsis() {
      this.contentExpand = !this.contentExpand;
      if (this.contentExpand) {
        this.ellipsisReady = false;
        setTimeout(() => {
          this.ellipsisReady = true;
        }, 80);
      }
    },
    hide() {
      this.deviceSupportUninstall();
      this.onClose();
    },
    deviceSupportInstall() {
      this._keyDownHandler = e => {
        e.stopPropagation();
        const keyCode = e.keyCode;
        switch (keyCode) {
          // ESC
          case 27:
            this.hide();
            break;
          // SPACE
          case 32:
            this.toggleMode();
            break;
          // LEFT_ARROW
          case 37:
            this.prev();
            break;
          // UP_ARROW
          case 38:
            this.handleActions('zoomIn');
            break;
          // RIGHT_ARROW
          case 39:
            this.next();
            break;
          // DOWN_ARROW
          case 40:
            this.handleActions('zoomOut');
            break;
        }
      };
      this._mouseWheelHandler = rafThrottle(e => {
        const delta = e.wheelDelta ? e.wheelDelta : -e.detail;
        if (delta > 0) {
          this.handleActions('zoomIn', {
            zoomRate: 0.015,
            enableTransition: false
          });
        } else {
          this.handleActions('zoomOut', {
            zoomRate: 0.015,
            enableTransition: false
          });
        }
      });
      on$1(document, 'keydown', this._keyDownHandler);
      on$1(document, mousewheelEventName, this._mouseWheelHandler);
    },
    deviceSupportUninstall() {
      off$1(document, 'keydown', this._keyDownHandler);
      off$1(document, mousewheelEventName, this._mouseWheelHandler);
      this._keyDownHandler = null;
      this._mouseWheelHandler = null;
    },
    handleImgLoad(e) {
      this.loading = false;
    },
    handleImgError(e) {
      this.loading = false;
      e.target.alt = '加载失败';
    },
    // 移动端触摸开始
    touchstart(event) {
      let ev = event.touches[0];
      this.startX = ev.pageX;
      this.startY = ev.pageY;
      this.offsetY = this.transform.offsetY;
      this.offsetX = this.transform.offsetX;
      if (this.loading || ev.button !== 0) return;
    },
    // 移动端触摸结束
    touchmove(event) {
      let ev = event.touches[0];
      if (!this.slide) {
        this.slide = true;
        this.transform.offsetX = this.offsetX + ev.pageX - this.startX;
        this.transform.offsetY = this.offsetY + ev.pageY - this.startY;
        setTimeout(() => {
          this.slide = false;
        }, 100);
      }
      event.preventDefault();
    },
    handleMouseDown(e) {
      if (this.loading || e.button !== 0) return;
      const {
        offsetX,
        offsetY
      } = this.transform;
      const startX = e.pageX;
      const startY = e.pageY;
      this._dragHandler = rafThrottle(ev => {
        this.transform.offsetX = offsetX + ev.pageX - startX;
        this.transform.offsetY = offsetY + ev.pageY - startY;
      });
      on$1(document, 'mousemove', this._dragHandler);
      on$1(document, 'mouseup', ev => {
        off$1(document, 'mousemove', this._dragHandler);
      });
      e.preventDefault();
    },
    handleMaskClick() {
      if (this.maskClosable) {
        this.hide();
      }
    },
    reset() {
      this.transform = {
        scale: 1,
        deg: 0,
        offsetX: 0,
        offsetY: 0,
        enableTransition: false
      };
    },
    toggleMode() {
      if (this.loading) return;
      const modeNames = Object.keys(Mode);
      const modeValues = Object.values(Mode);
      const index = modeValues.indexOf(this.mode);
      const nextIndex = (index + 1) % modeNames.length;
      this.mode = Mode[modeNames[nextIndex]];
      this.reset();
    },
    prev() {
      if (this.isFirst && !this.infinite) return;
      const len = this.urlList.length;
      this.index = (this.index - 1 + len) % len;
    },
    next() {
      if (this.isLast && !this.infinite) return;
      const len = this.urlList.length;
      this.index = (this.index + 1) % len;
    },
    handleActions(action, options = {}) {
      if (this.loading) return;
      const {
        zoomRate,
        rotateDeg,
        enableTransition
      } = {
        zoomRate: 0.2,
        rotateDeg: 90,
        enableTransition: true,
        ...options
      };
      const {
        transform
      } = this;
      switch (action) {
        case 'zoomOut':
          if (transform.scale > 0.2) {
            transform.scale = parseFloat((transform.scale - zoomRate).toFixed(3));
          }
          break;
        case 'zoomIn':
          transform.scale = parseFloat((transform.scale + zoomRate).toFixed(3));
          break;
        case 'clocelise':
          transform.deg += rotateDeg;
          break;
        case 'anticlocelise':
          transform.deg -= rotateDeg;
          break;
      }
      transform.enableTransition = enableTransition;
    }
  },
  mounted() {
    this.deviceSupportInstall();
    if (this.appendToBody) {
      document.body.appendChild(this.$el);
    }
    // add tabindex then wrapper can be focusable via Javascript
    // focus wrapper so arrow key can't cause inner scroll behavior underneath
    this.$refs['el-image-viewer__wrapper'].focus();
    this.setEllipsisButton();
  },
  destroyed() {
    // if appendToBody is true, remove DOM node after destroy
    if (this.appendToBody && this.$el && this.$el.parentNode) {
      this.$el.parentNode.removeChild(this.$el);
    }
  }
};

/* script */
const __vue_script__$4T = script$4T;

/* template */
var __vue_render__$4T = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("transition", { attrs: { name: "viewer-fade" } }, [
    _c(
      "div",
      {
        ref: "el-image-viewer__wrapper",
        staticClass: "el-image-viewer__wrapper",
        style: { "z-index": _vm.viewerZIndex },
        attrs: { tabindex: "-1" },
      },
      [
        _c("div", {
          staticClass: "el-image-viewer__mask",
          on: {
            click: function ($event) {
              if ($event.target !== $event.currentTarget) {
                return null
              }
              return _vm.handleMaskClick.apply(null, arguments)
            },
          },
        }),
        _vm._v(" "),
        _c(
          "span",
          {
            staticClass: "el-image-viewer__btn el-image-viewer__close",
            on: { click: _vm.hide },
          },
          [_c("i", { staticClass: "el-icon-close" })]
        ),
        _vm._v(" "),
        _c(
          "div",
          { staticClass: "el-image-viewer__btn el-image-viewer__actions" },
          [
            _c("div", { staticClass: "el-image-viewer__actions__inner" }, [
              !_vm.isSingle
                ? _c("i", {
                    class: [
                      "el-icon-arrow-left",
                      !_vm.infinite && _vm.isFirst ? "is-disabled" : "",
                    ],
                    on: { click: _vm.prev },
                  })
                : _vm._e(),
              _vm._v(" "),
              _c("i", {
                staticClass: "el-icon-zoom-out",
                on: {
                  click: function ($event) {
                    return _vm.handleActions("zoomOut")
                  },
                },
              }),
              _vm._v(" "),
              _c("i", {
                staticClass: "el-icon-zoom-in",
                on: {
                  click: function ($event) {
                    return _vm.handleActions("zoomIn")
                  },
                },
              }),
              _vm._v(" "),
              _c("i", { staticClass: "el-image-viewer__actions__divider" }),
              _vm._v(" "),
              _c("i", { class: _vm.mode.icon, on: { click: _vm.toggleMode } }),
              _vm._v(" "),
              _c("i", { staticClass: "el-image-viewer__actions__divider" }),
              _vm._v(" "),
              _c("i", {
                staticClass: "el-icon-refresh-left",
                on: {
                  click: function ($event) {
                    return _vm.handleActions("anticlocelise")
                  },
                },
              }),
              _vm._v(" "),
              _c("i", {
                staticClass: "el-icon-refresh-right",
                on: {
                  click: function ($event) {
                    return _vm.handleActions("clocelise")
                  },
                },
              }),
              _vm._v(" "),
              !_vm.isSingle
                ? _c("i", {
                    class: [
                      "el-icon-arrow-right",
                      !_vm.infinite && _vm.isLast ? "is-disabled" : "",
                    ],
                    on: { click: _vm.next },
                  })
                : _vm._e(),
            ]),
          ]
        ),
        _vm._v(" "),
        _vm.title.length && _vm.title[_vm.index]
          ? _c(
              "div",
              { staticClass: "el-image-viewer__btn el-image-viewer__title" },
              [
                _vm._v(
                  "\n      " +
                    _vm._s(_vm.title.length ? _vm.title[_vm.index] : "") +
                    "\n    "
                ),
              ]
            )
          : _vm._e(),
        _vm._v(" "),
        _vm.contents.length && _vm.contents[_vm.index]
          ? _c(
              "div",
              { staticClass: "el-image-viewer__btn el-image-viewer__content" },
              [
                _c(
                  "el-collapse-transition",
                  { attrs: { name: "el-fade-in" } },
                  [
                    _c(
                      "div",
                      {
                        directives: [
                          {
                            name: "show",
                            rawName: "v-show",
                            value: _vm.ellipsisReady,
                            expression: "ellipsisReady",
                          },
                        ],
                        class: [
                          "ellipsis-box",
                          _vm.contentExpand ? "" : "text-ellipsis-3",
                        ],
                      },
                      [
                        _vm._v(
                          "\n          " +
                            _vm._s(
                              _vm.contents.length ? _vm.contents[_vm.index] : ""
                            ) +
                            "\n        "
                        ),
                      ]
                    ),
                  ]
                ),
                _vm._v(" "),
                _c(
                  "el-button",
                  {
                    directives: [
                      {
                        name: "show",
                        rawName: "v-show",
                        value: _vm.showEllipsisButton,
                        expression: "showEllipsisButton",
                      },
                    ],
                    attrs: { type: "text", size: "mini" },
                    on: { click: _vm.toggleEllipsis },
                  },
                  [
                    _vm._v(_vm._s(_vm.contentExpand ? "收起" : "展开")),
                    _c("i", {
                      class: _vm.contentExpand
                        ? "el-icon-arrow-up"
                        : "el-icon-arrow-down",
                    }),
                  ]
                ),
              ],
              1
            )
          : _vm._e(),
        _vm._v(" "),
        _c(
          "div",
          { staticClass: "el-image-viewer__canvas" },
          _vm._l(_vm.urlList, function (url, i) {
            return i === _vm.index
              ? _c("img", {
                  key: url,
                  ref: "img",
                  refInFor: true,
                  staticClass: "el-image-viewer__img",
                  style: _vm.imgStyle,
                  attrs: { src: _vm.currentImg },
                  on: {
                    load: _vm.handleImgLoad,
                    error: _vm.handleImgError,
                    mousedown: _vm.handleMouseDown,
                    touchstart: _vm.touchstart,
                    touchmove: _vm.touchmove,
                  },
                })
              : _vm._e()
          }),
          0
        ),
      ]
    ),
  ])
};
var __vue_staticRenderFns__$4T = [];
__vue_render__$4T._withStripped = true;

  /* style */
  const __vue_inject_styles__$4T = undefined;
  /* scoped */
  const __vue_scope_id__$4T = undefined;
  /* module identifier */
  const __vue_module_identifier__$4T = undefined;
  /* functional template */
  const __vue_is_functional_template__$4T = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4T = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4T, staticRenderFns: __vue_staticRenderFns__$4T },
    __vue_inject_styles__$4T,
    __vue_script__$4T,
    __vue_scope_id__$4T,
    __vue_is_functional_template__$4T,
    __vue_module_identifier__$4T,
    false,
    undefined,
    undefined,
    undefined
  );

/* istanbul ignore next */
__vue_component__$4U.install = function (Vue) {
  Vue.component(__vue_component__$4U.name, __vue_component__$4U);
};

//
/***
 * 文本块
 */
var script$4S = {
  name: 'XmlImageRender',
  components: {
    previewImageRender: __vue_component__$4U
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    pBlockData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    showTitle: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      // image,
      // noImage,
      previewKey: Math.random(),
      blockId: `blockId${Math.random()}`,
      //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
      blockData: {
        imageMode: 'dan-tu',
        showEffect: 'hua-lang',
        clickEffect: 'wu',
        titlePosition: 'under',
        // width: 100,
        titleAlign: 'left',
        imageList: [{
          source: 'upload',
          //来源：上传，素材
          uploadFileUrl: '',
          title: '',
          content: '',
          href: '' //跳转链接
        }]
      },
      carouselActiveIndex: 0,
      //属性组件名
      propertyComponentsName: 'xml-image-property',
      currentPreviewList: [],
      carouselHeight: '',
      currentIndex: -1
    };
  },
  computed: {
    blockPreviewList() {
      let images = this.blockData.imageList || [],
        list = [];
      images.map(item => {
        let src = this.resourceBasisPath ? this.resourceBasisPath + item.uploadFileUrl.split('./')[1] : item.uploadFileUrl;
        list.push(src);
      });
      return this.blockData.imageMode == 'dan-tu' ? [list[0]] : list;
    },
    blockPreviewTitleList() {
      let images = this.blockData.imageList || [],
        list = [];
      images.map(item => {
        list.push(item.title);
      });
      return this.blockData.imageMode == 'dan-tu' ? [list[0]] : list;
    },
    blockPreviewContentList() {
      let images = this.blockData.imageList || [],
        list = [];
      images.map(item => {
        list.push(item.content || '');
      });
      return this.blockData.imageMode == 'dan-tu' ? [list[0]] : list;
    },
    indicatorText() {
      let allNum = this.blockData.imageList.length;
      return `${this.carouselActiveIndex + 1} / ${allNum}`;
    },
    carouselActiveTitle() {
      return this.blockData.imageList[this.carouselActiveIndex].title || '';
    },
    carouselActiveItem() {
      return this.blockData.imageList[this.carouselActiveIndex] || {};
    },
    allHaveNoTitle() {
      let has = false;
      this.blockData.imageList.forEach(item => {
        if (item.title) {
          has = true;
        }
      });
      return !has;
    }
  },
  watch: {
    pBlockData: {
      handler(newValue) {
        this.$nextTick(() => {
          this.blockData = Object.assign({}, this.blockData, newValue);
        });
      },
      deep: true,
      immediate: true
    },
    'blockData.showEffect': {
      handler(newValue) {
        if (newValue === 'lun-bo') {
          this.setCarouselHeight();
        }
      },
      deep: true,
      immediate: true
    }
  },
  updated() {},
  methods: {
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    imageClick({
      source,
      uploadFileUrl,
      title,
      link,
      content,
      href,
      businessType,
      linkId,
      cIndex
    }, imgList) {
      if (this.mode === 'editor') return;
      console.log('??????????????????', linkId, cIndex);
      if (cIndex !== undefined) {
        this.currentIndex = cIndex;
      }
      if (this.blockData.clickEffect === 'dian-ji-fang-da') ; else if (this.blockData.clickEffect === 'dian-ji-tiao-zhuan') {
        //点击跳转
        // window.href = href
        if (linkId) {
          // window.open(link, '_blank')
          window.open(process.env.VUE_APP_TEXTBOOK_WEB + 'previewLooseLeaf?pageType=' + this.pageType + '&businessType=looseLeaf' + '&looseLeafId=' + linkId + '&uuid=' + v4() + '&styleType=' + 'B', '_blank');
        } else {
          this.$message.warning('获取资源链接失败，请检查链接地址');
        }
      }
    },
    setImage(image) {
      let imageEle = image.path[0];
      let {
        naturalWidth,
        naturalHeight
      } = imageEle;
      let renderWidth = naturalWidth / (naturalHeight / 200);
      image.path[0].style.width = `${renderWidth}px`;
    },
    setActiveImageIndex(current) {
      this.carouselActiveIndex = current;
    },
    setCarouselHeight() {
      // 获取容器宽度以16:9计算高度并设置
      let containerRect = this.$refs.carouselContainer ? this.$refs.carouselContainer.getBoundingClientRect() : {
        width: 568
      };
      this.carouselHeight = parseInt(containerRect.width / 16 * 9) + 'px';
    },
    clickImg() {
      this.$emit('clickImg');
    }
  },
  mounted() {
    this.setCarouselHeight();
  }
};

/* script */
const __vue_script__$4S = script$4S;
/* template */
var __vue_render__$4S = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      ref: "carouselContainer",
      class:
        "xml-image-container-" +
        _vm.pageType +
        " image-container " +
        (_vm.blockData.showEffect === "hua-lang"
          ? "hua-lang-image-container"
          : ""),
      attrs: { id: _vm.blockId },
      on: { click: _vm.blockClick },
    },
    [
      _vm.blockData.imageList.length > 0
        ? [
            _vm.blockData.imageMode == "dan-tu"
              ? _c(
                  "div",
                  { staticClass: "xml-image-dan-tu" },
                  [
                    _c("preview-image-render", {
                      class: "xml-image-dan-tu-" + _vm.pageType,
                      attrs: {
                        src: _vm.blockData.imageList[0].uploadFileUrl
                          ? _vm.blockData.imageList[0].uploadFileUrl.indexOf(
                              "./"
                            ) != -1
                            ? _vm.resourceBasisPath +
                              _vm.blockData.imageList[0].uploadFileUrl.split(
                                "./"
                              )[1]
                            : _vm.blockData.imageList[0].uploadFileUrl
                          : "../../../../static/images/defaultCover/no-image.png",
                        mode: _vm.mode,
                        showTitle: _vm.showTitle,
                        pageType: _vm.pageType,
                        "preview-text": _vm.blockPreviewTitleList,
                        contents: _vm.blockPreviewContentList,
                        current: 0,
                        previewSrcList: _vm.blockPreviewList,
                        clickEffect: _vm.blockData.clickEffect,
                        width: _vm.blockData.width,
                      },
                      on: {
                        click: function ($event) {
                          return _vm.imageClick(_vm.blockData.imageList[0])
                        },
                      },
                    }),
                  ],
                  1
                )
              : _vm._e(),
            _vm._v(" "),
            _vm.blockData.imageMode == "duo-tu"
              ? _c(
                  "div",
                  {
                    staticClass: "xml-image-duo-tu",
                    class: "xml-image-duo-tu " + _vm.blockData.showEffect,
                  },
                  [
                    _vm.blockData.showEffect === "hua-lang"
                      ? _c(
                          "div",
                          {
                            class: [
                              "xml-image-hualang",
                              _vm.allHaveNoTitle ? "no-title" : "",
                            ],
                            on: {
                              touchstart: _vm.clickImg,
                              mousedown: _vm.clickImg,
                            },
                          },
                          _vm._l(
                            _vm.blockData.imageList,
                            function (item, index) {
                              return _c("preview-image-render", {
                                directives: [
                                  {
                                    name: "show",
                                    rawName: "v-show",
                                    value:
                                      _vm.blockData.showEffect === "hua-lang",
                                    expression:
                                      "blockData.showEffect === 'hua-lang'",
                                  },
                                ],
                                key: index,
                                class: [
                                  "xml-image-" +
                                    _vm.blockData.showEffect +
                                    "-" +
                                    _vm.pageType,
                                  "xml-image-hua-lang  xml-group-item",
                                ],
                                style: {
                                  width: _vm.blockData.width
                                    ? (290 / 100) *
                                        Number(_vm.blockData.width) +
                                      "px"
                                    : "290px",
                                  height:
                                    (_vm.blockData.galleryHeight || 290) + "px",
                                },
                                attrs: {
                                  src: item.uploadFileUrl
                                    ? _vm.blockData.imageList[0].uploadFileUrl.indexOf(
                                        "./"
                                      ) != -1
                                      ? _vm.resourceBasisPath +
                                        item.uploadFileUrl.split("./")[1]
                                      : item.uploadFileUrl
                                    : "../../../../static/images/defaultCover/no-image.png",
                                  "preview-text": _vm.blockPreviewTitleList,
                                  previewSrcList: _vm.blockPreviewList,
                                  showTitle: _vm.showTitle,
                                  pageType: _vm.pageType,
                                  current: index,
                                  title: _vm.blockPreviewTitleList,
                                  contents: _vm.blockPreviewContentList,
                                  currentIndex: _vm.currentIndex,
                                  titlePosition: _vm.blockData.titlePosition,
                                  titleAlign: _vm.blockData.titleAlign,
                                  mode: _vm.mode,
                                  self: item,
                                  clickEffect: _vm.blockData.clickEffect,
                                  width: _vm.blockData.width,
                                },
                                on: {
                                  click: function ($event) {
                                    return _vm.imageClick(
                                      Object.assign({}, item, {
                                        cIndex: index,
                                      }),
                                      _vm.blockData
                                    )
                                  },
                                  onBottomTitleClick: function ($event) {
                                    return _vm.imageClick(item, _vm.blockData)
                                  },
                                },
                              })
                            }
                          ),
                          1
                        )
                      : _vm._e(),
                    _vm._v(" "),
                    _vm.blockData.showEffect === "ping-pu"
                      ? _c(
                          "div",
                          { staticClass: "xml-image-ping-pu" },
                          _vm._l(
                            _vm.blockData.imageList,
                            function (item, index) {
                              return _c("preview-image-render", {
                                key: index,
                                staticClass: "xml-group-item",
                                class:
                                  "xml-image-" +
                                  _vm.blockData.showEffect +
                                  "-" +
                                  _vm.pageType,
                                attrs: {
                                  src: item.uploadFileUrl
                                    ? _vm.blockData.imageList[0].uploadFileUrl.indexOf(
                                        "./"
                                      ) != -1
                                      ? _vm.resourceBasisPath +
                                        item.uploadFileUrl.split("./")[1]
                                      : item.uploadFileUrl
                                    : "../../../../static/images/defaultCover/no-image.png",
                                  fit: "cover",
                                  title: _vm.blockPreviewTitleList,
                                  pageType: _vm.pageType,
                                  contents: _vm.blockPreviewContentList,
                                  currentIndex: _vm.currentIndex,
                                  current: index,
                                  showTitle: _vm.showTitle,
                                  titlePosition: _vm.blockData.titlePosition,
                                  titleAlign: _vm.blockData.titleAlign,
                                  self: item,
                                  mode: _vm.mode,
                                  "preview-text": _vm.blockPreviewTitleList,
                                  previewSrcList: _vm.blockPreviewList,
                                  clickEffect: _vm.blockData.clickEffect,
                                  width: _vm.blockData.width,
                                },
                                on: {
                                  click: function ($event) {
                                    return _vm.imageClick(
                                      Object.assign({}, item, { cIndex: index })
                                    )
                                  },
                                  onBottomTitleClick: function ($event) {
                                    return _vm.imageClick(item, _vm.blockData)
                                  },
                                },
                              })
                            }
                          ),
                          1
                        )
                      : _vm._e(),
                    _vm._v(" "),
                    _vm.blockData.showEffect === "lun-bo"
                      ? _c(
                          "div",
                          { staticClass: "xml-image-lun-bo xml-group-item" },
                          [
                            _vm.showTitle &&
                            _vm.blockData.titlePosition === "on" &&
                            !_vm.allHaveNoTitle
                              ? _c(
                                  "div",
                                  {
                                    staticClass:
                                      "image-title--lay image-title--on",
                                    style: {
                                      textAlign:
                                        _vm.blockData.titleAlign || "left",
                                    },
                                  },
                                  [
                                    _vm._v(
                                      "\n          " +
                                        _vm._s(_vm.carouselActiveTitle) +
                                        "\n        "
                                    ),
                                  ]
                                )
                              : _vm._e(),
                            _vm._v(" "),
                            _c(
                              "el-carousel",
                              {
                                ref: "imageCarousel",
                                attrs: {
                                  height: _vm.carouselHeight,
                                  arrow: "never",
                                  loop: "",
                                  "indicator-position": "none",
                                },
                                on: { change: _vm.setActiveImageIndex },
                              },
                              [
                                _vm._l(
                                  _vm.blockData.imageList,
                                  function (item, index) {
                                    return _c(
                                      "el-carousel-item",
                                      { key: index },
                                      [
                                        _c("img", {
                                          style: {
                                            width: _vm.blockData.width + "%",
                                          },
                                          attrs: {
                                            src: item.uploadFileUrl
                                              ? _vm.blockData.imageList[0].uploadFileUrl.indexOf(
                                                  "./"
                                                ) != -1
                                                ? _vm.resourceBasisPath +
                                                  item.uploadFileUrl.split(
                                                    "./"
                                                  )[1]
                                                : item.uploadFileUrl
                                              : "../../../../static/images/defaultCover/no-image.png",
                                          },
                                          on: {
                                            click: function ($event) {
                                              return _vm.imageClick(item)
                                            },
                                          },
                                        }),
                                      ]
                                    )
                                  }
                                ),
                                _vm._v(" "),
                                _c(
                                  "div",
                                  {
                                    class: [
                                      "custom-indicator",
                                      _vm.blockData.titlePosition === "bottom"
                                        ? "withBottomTitle"
                                        : _vm.blockData.titlePosition === "top"
                                        ? "withTopTitle"
                                        : "",
                                    ],
                                  },
                                  [
                                    _vm._v(
                                      "\n            " +
                                        _vm._s(_vm.indicatorText) +
                                        "\n          "
                                    ),
                                  ]
                                ),
                                _vm._v(" "),
                                _vm.showTitle &&
                                _vm.blockData.titlePosition === "bottom" &&
                                _vm.carouselActiveTitle
                                  ? _c(
                                      "div",
                                      {
                                        staticClass:
                                          "image-title--fixed image-title--bottom",
                                        style: {
                                          textAlign:
                                            _vm.blockData.titleAlign || "left",
                                        },
                                        on: {
                                          click: function ($event) {
                                            return _vm.imageClick(
                                              _vm.carouselActiveItem
                                            )
                                          },
                                        },
                                      },
                                      [
                                        _vm._v(
                                          "\n            " +
                                            _vm._s(_vm.carouselActiveTitle) +
                                            "\n          "
                                        ),
                                      ]
                                    )
                                  : _vm._e(),
                                _vm._v(" "),
                                _vm.showTitle &&
                                _vm.blockData.titlePosition === "top" &&
                                _vm.carouselActiveTitle
                                  ? _c(
                                      "div",
                                      {
                                        staticClass:
                                          "image-title--fixed image-title--top",
                                        style: {
                                          textAlign:
                                            _vm.blockData.titleAlign || "left",
                                        },
                                        on: {
                                          click: function ($event) {
                                            return _vm.imageClick(
                                              _vm.carouselActiveItem
                                            )
                                          },
                                        },
                                      },
                                      [
                                        _vm._v(
                                          "\n            " +
                                            _vm._s(_vm.carouselActiveTitle) +
                                            "\n          "
                                        ),
                                      ]
                                    )
                                  : _vm._e(),
                              ],
                              2
                            ),
                            _vm._v(" "),
                            _vm.showTitle &&
                            _vm.blockData.titlePosition === "under" &&
                            !_vm.allHaveNoTitle
                              ? _c(
                                  "div",
                                  {
                                    staticClass:
                                      "xml-image-title image-title--lay image-title--under",
                                    style: {
                                      textAlign:
                                        _vm.blockData.titleAlign || "left",
                                    },
                                  },
                                  [
                                    _vm._v(
                                      "\n          " +
                                        _vm._s(_vm.carouselActiveTitle) +
                                        "\n        "
                                    ),
                                  ]
                                )
                              : _vm._e(),
                          ],
                          1
                        )
                      : _vm._e(),
                  ]
                )
              : _vm._e(),
          ]
        : [
            _c(
              "div",
              { staticClass: "xml-noimage-container" },
              [
                _c("el-image", {
                  staticClass: "xml-noimage",
                  class: "xml-image-dan-tu-" + _vm.pageType,
                  attrs: {
                    src: "../../../../static/images/defaultCover/no-image.png",
                    fit: "cover",
                  },
                }),
              ],
              1
            ),
          ],
    ],
    2
  )
};
var __vue_staticRenderFns__$4S = [];
__vue_render__$4S._withStripped = true;

  /* style */
  const __vue_inject_styles__$4S = undefined;
  /* scoped */
  const __vue_scope_id__$4S = undefined;
  /* module identifier */
  const __vue_module_identifier__$4S = undefined;
  /* functional template */
  const __vue_is_functional_template__$4S = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4S = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4S, staticRenderFns: __vue_staticRenderFns__$4S },
    __vue_inject_styles__$4S,
    __vue_script__$4S,
    __vue_scope_id__$4S,
    __vue_is_functional_template__$4S,
    __vue_module_identifier__$4S,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$4S.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('image-render', {
    prefix: options.prefix
  }), __vue_component__$4S);
};

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

// import "../block.scss"
var script$4R = {
  name: 'xmlHtmlRender',
  components: {},
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'preview';
      }
    },
    //属性中传递过来的块儿数据
    pBlockData: {},
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    isCopyUrl: {
      type: Boolean,
      default: false
    }
  },
  watch: {
    pBlockData: {
      handler(newValue) {
        console.log('XmlHtml组件(ruleIndex:' + this.ruleIndex + ')，watch触发，变量pBlockData：', newValue);
        this.$nextTick(() => {
          this.blockData = Object.assign({}, this.blockData, newValue);

          // ios扫描二维码微信端不支持srcdoc，改为获取dom写入
          var iframe = this.$refs.iframe;
          iframe.contentWindow.document.write(this.blockData.code); // 动态写入返回页面到iframe
          iframe.contentWindow.document.close();
        });
      },
      deep: true,
      immediate: true
    }
  },
  data() {
    return {
      blockId: 'blockId' + Math.random(),
      //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
      blockData: {},
      //属性组件名
      propertyComponentsName: 'xml-html-property',
      src: 'data:image/png;base64, '
      // ebookSetList:[]
    };
  },
  methods: {
    catchtouchmove() {},
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    goRead(info) {
      console.log('🚀 ~ goRead ~ info:', info);
      if (this.mode === 'preview') {
        let url = '';
        if (info.htmlType == 'url') {
          url = info.link;
        } else {
          url = this.resourceBasisPath + info.file.split('./')[1];
        }
        if (this.pageType == 'pc') {
          window.open(url);
        } else {
          this.$emit('openHtml', {
            previewUrl: url,
            title: info.materialName
          });
        }
      }
    }
  },
  created() {
    // this.blockData = Object.assign( this.blockData,this.pBlockData)
  }
};

/* script */
const __vue_script__$4R = script$4R;

/* template */
var __vue_render__$4R = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "xml-group-item xml-single-html-group-render",
      class: "xml-ebook-container-" + _vm.pageType,
      attrs: { id: _vm.blockId },
      on: { click: _vm.blockClick },
    },
    [
      _vm.mode === "editor"
        ? _c("div", {
            staticClass: "xml-html-mask",
            attrs: { catchtouchmove: "catchtouchmove" },
          })
        : _vm._e(),
      _vm._v(" "),
      _vm.blockData.htmlType === "url"
        ? _c("div", { staticStyle: { width: "100%", overflow: "auto" } }, [
            _vm.isCopyUrl
              ? _c(
                  "div",
                  {
                    staticClass: "web-file-box",
                    on: {
                      click: function ($event) {
                        return _vm.$emit("copyHtmlUrl", _vm.blockData)
                      },
                    },
                  },
                  [
                    _c("div", { staticClass: "file-cover" }, [
                      _c("img", {
                        attrs: {
                          src: _vm.blockData.fileCover
                            ? _vm.blockData.fileCover.indexOf("http") !== -1
                              ? _vm.blockData.fileCover
                              : _vm.resourceBasisPath
                              ? _vm.resourceBasisPath +
                                _vm.blockData.fileCover.split("./")[1]
                              : _vm.blockData.file
                            : _vm.src,
                        },
                      }),
                    ]),
                    _vm._v(" "),
                    _c("div", { staticClass: "file-title" }, [
                      _vm._v(
                        "\n        " +
                          _vm._s(
                            _vm.blockData.fileNames
                              ? _vm.blockData.fileNames
                              : "--"
                          ) +
                          "\n      "
                      ),
                    ]),
                  ]
                )
              : !_vm.isCopyUrl && _vm.blockData.styleModel == "A"
              ? _c(
                  "div",
                  {
                    staticClass: "web-file-box",
                    on: {
                      click: function ($event) {
                        return _vm.goRead(_vm.blockData)
                      },
                    },
                  },
                  [
                    _c("div", { staticClass: "file-cover" }, [
                      _c("img", {
                        attrs: {
                          src: _vm.blockData.fileCover
                            ? _vm.blockData.fileCover.indexOf("http") !== -1
                              ? _vm.blockData.fileCover
                              : _vm.resourceBasisPath
                              ? _vm.resourceBasisPath +
                                _vm.blockData.fileCover.split("./")[1]
                              : _vm.blockData.file
                            : _vm.src,
                        },
                      }),
                    ]),
                    _vm._v(" "),
                    _c("div", { staticClass: "file-title" }, [
                      _vm._v(
                        "\n        " +
                          _vm._s(
                            _vm.blockData.fileNames
                              ? _vm.blockData.fileNames
                              : "--"
                          ) +
                          "\n      "
                      ),
                    ]),
                  ]
                )
              : _c("iframe", {
                  style: {
                    width: "100%",
                    height: _vm.blockData.htmlHeight + "px",
                    "padding-top": Number(_vm.blockData.htmlTopMargin) + "px",
                    "padding-bottom": _vm.blockData.htmlBottomMargin + "px",
                  },
                  attrs: { src: _vm.blockData.link, loading: "lazy" },
                }),
          ])
        : _vm._e(),
      _vm._v(" "),
      _c(
        "div",
        {
          directives: [
            {
              name: "show",
              rawName: "v-show",
              value: _vm.blockData.htmlType === "code",
              expression: "blockData.htmlType === 'code'",
            },
          ],
        },
        [
          _c("iframe", {
            ref: "iframe",
            style: {
              width: "100%",
              height: _vm.blockData.htmlHeight + "px",
              "padding-top": Number(_vm.blockData.htmlTopMargin) + "px",
              "padding-bottom": _vm.blockData.htmlBottomMargin + "px",
            },
            attrs: { loading: "lazy" },
          }),
        ]
      ),
      _vm._v(" "),
      _vm.blockData.htmlType === "file"
        ? _c("div", [
            _vm.blockData.styleModel == "A"
              ? _c(
                  "div",
                  {
                    staticClass: "web-file-box",
                    on: {
                      click: function ($event) {
                        return _vm.goRead(_vm.blockData)
                      },
                    },
                  },
                  [
                    _c("div", { staticClass: "file-cover" }, [
                      _c("img", {
                        attrs: {
                          src: _vm.blockData.fileCover
                            ? _vm.blockData.fileCover.indexOf("http") !== -1
                              ? _vm.blockData.fileCover
                              : _vm.resourceBasisPath
                              ? _vm.resourceBasisPath +
                                _vm.blockData.fileCover.split("./")[1]
                              : _vm.blockData.file
                            : _vm.src,
                        },
                      }),
                    ]),
                    _vm._v(" "),
                    _c("div", { staticClass: "file-title" }, [
                      _vm._v(
                        "\n        " +
                          _vm._s(
                            _vm.blockData.fileNames
                              ? _vm.blockData.fileNames
                              : "--"
                          ) +
                          "\n      "
                      ),
                    ]),
                  ]
                )
              : _c("div", [
                  _c("iframe", {
                    style: {
                      width: "100%",
                      height: _vm.blockData.htmlHeight + "px",
                      "padding-top": Number(_vm.blockData.htmlTopMargin) + "px",
                      "padding-bottom": _vm.blockData.htmlBottomMargin + "px",
                    },
                    attrs: {
                      src: _vm.blockData.file
                        ? _vm.blockData.file.indexOf("http") !== -1
                          ? _vm.blockData.file
                          : _vm.resourceBasisPath
                          ? _vm.resourceBasisPath +
                            _vm.blockData.file.split("./")[1]
                          : _vm.blockData.file
                        : "",
                      loading: "lazy",
                    },
                  }),
                ]),
          ])
        : _vm._e(),
    ]
  )
};
var __vue_staticRenderFns__$4R = [];
__vue_render__$4R._withStripped = true;

  /* style */
  const __vue_inject_styles__$4R = undefined;
  /* scoped */
  const __vue_scope_id__$4R = undefined;
  /* module identifier */
  const __vue_module_identifier__$4R = undefined;
  /* functional template */
  const __vue_is_functional_template__$4R = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4R = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4R, staticRenderFns: __vue_staticRenderFns__$4R },
    __vue_inject_styles__$4R,
    __vue_script__$4R,
    __vue_scope_id__$4R,
    __vue_is_functional_template__$4R,
    __vue_module_identifier__$4R,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$4R.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('html-render', {
    prefix: options.prefix
  }), __vue_component__$4R);
};

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

// import '../block.scss'
var script$4Q = {
  name: 'XmlCatalogRender',
  components: {},
  inject: ['getCatalogList'],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'preview';
      }
    },
    //属性中传递过来的块儿数据
    pBlockData: {},
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      blockId: `blockId${Math.random()}`,
      //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
      blockData: {},
      //属性组件名
      propertyComponentsName: 'xml-catalog-property',
      defaultProps: {
        children: 'children',
        label: 'label'
      },
      filteredTree: []
    };
  },
  computed: {
    catalogList() {
      return this.getCatalogList().data;
    }
  },
  watch: {
    pBlockData: {
      handler(newValue) {
        this.$nextTick(() => {
          this.blockData = Object.assign({}, this.blockData, newValue);
          this.$forceUpdate();
          // this.ebookSetList=Object.assign({},this.blockData.ebookSetList);
        });
      },
      deep: true,
      immediate: true
    },
    catalogList: {
      handler(newValue) {
        // this.$nextTick(() => {
        //   this.$refs.tree.filter('unexpected')
        // })
        let origin = newValue || [];
        const filterMenu = menuList => {
          return menuList.filter(item => {
            return item.hiddenFlag !== '1';
          }).map(item => {
            item = Object.assign({}, item);
            if (item.children) {
              item.children = filterMenu(item.children);
            }
            return item;
          });
        };
        this.filteredTree = filterMenu(origin);
      },
      deep: true,
      immediate: true
    }
  },
  created() {
    // this.blockData = Object.assign( this.blockData,this.pBlockData)
  },
  methods: {
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    nodeClick(data, node) {
      this.$EventBus.$emit('treeNodeClick', {
        data,
        node
      });
    },
    filterNode(value, data) {
      // if (!value) return true;
      return data.hiddenFlag !== '1';
    }
  }
};

/* script */
const __vue_script__$4Q = script$4Q;
/* template */
var __vue_render__$4Q = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "xml-show-catalog xml-group-item",
      class: "xml-catalog-container-" + _vm.pageType,
      attrs: { id: _vm.blockId },
      on: { click: _vm.blockClick },
    },
    [
      _c("el-tree", {
        ref: "tree",
        class: "preview-tree-box-" + _vm.pageType,
        staticStyle: { "margin-top": "0px" },
        attrs: {
          id: "built-in-tree",
          draggable: _vm.blockData.draggable,
          "default-expand-all": true,
          "highlight-current": "",
          data: _vm.filteredTree,
          "node-key": "id",
          props: _vm.defaultProps,
          "filter-node-method": _vm.filterNode,
          "expand-on-click-node": false,
        },
        on: { "node-click": _vm.nodeClick },
        scopedSlots: _vm._u([
          {
            key: "default",
            fn: function (ref) {
              var node = ref.node;
              var data = ref.data;
              return _c("div", { staticClass: "catalog-node-label" }, [
                data.uploadFileUrl
                  ? _c("img", {
                      staticStyle: { width: "15px", height: "15px" },
                      attrs: { src: data.uploadFileUrl, alt: "" },
                    })
                  : _vm._e(),
                _vm._v(" "),
                _c(
                  "div",
                  {
                    class: ["node-label", node.expanded ? "expanded-node" : ""],
                  },
                  [_vm._v(_vm._s(node.label))]
                ),
              ])
            },
          },
        ]),
      }),
    ],
    1
  )
};
var __vue_staticRenderFns__$4Q = [];
__vue_render__$4Q._withStripped = true;

  /* style */
  const __vue_inject_styles__$4Q = undefined;
  /* scoped */
  const __vue_scope_id__$4Q = "data-v-61c986fa";
  /* module identifier */
  const __vue_module_identifier__$4Q = undefined;
  /* functional template */
  const __vue_is_functional_template__$4Q = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4Q = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4Q, staticRenderFns: __vue_staticRenderFns__$4Q },
    __vue_inject_styles__$4Q,
    __vue_script__$4Q,
    __vue_scope_id__$4Q,
    __vue_is_functional_template__$4Q,
    __vue_module_identifier__$4Q,
    false,
    undefined,
    undefined,
    undefined
  );

// 提交
__vue_component__$4Q.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('catalog-render', {
    prefix: options.prefix
  }), __vue_component__$4Q);
};

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

var script$4P = {
  name: 'XmlTextDialogRender',
  props: {
    content: {
      type: String,
      default: ''
    },
    textstyle: {
      type: String,
      default: 'A'
    },
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    projectId: {
      type: String,
      default: ''
    }
  },
  watch: {
    content() {
      this.show = false;
      this.$nextTick(() => {
        this.show = true;
      });
    }
  },
  data() {
    return {
      show: true,
      source: ''
    };
  },
  created() {
    this.source = this.$route.query.pageType;
  },
  methods: {
    formatImg(str) {
      if (str) {
        let data = str.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, (match, p1) => {
          if (match.indexOf('style') !== -1) {
            let src = this.resourceBasisPath + p1.split('./')[1];
            let image = match.indexOf('http') !== -1 ? match : match.replace(p1, src);
            return image.split('style="')[0] + 'style="max-width:100% !important;' + image.split('style="')[1];
          } else {
            return `<img src='${p1.indexOf('http') > -1 ? p1 : this.resourceBasisPath + p1.split('./')[1]}' style="max-width:100%;" />`;
          }
        });
        return data;
      }
    }
  }
};

var __$_require_static_images_leaflet_icons_scroll_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAAPCAYAAAChtYCSAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QjkxMUYzODUxMkZFMTFFRThGNzY5QzE0NjRGQzZERjciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QjkxMUYzODYxMkZFMTFFRThGNzY5QzE0NjRGQzZERjciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpCOTExRjM4MzEyRkUxMUVFOEY3NjlDMTQ2NEZDNkRGNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpCOTExRjM4NDEyRkUxMUVFOEY3NjlDMTQ2NEZDNkRGNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pgx/R5cAAAJ7SURBVHja7JpPaNNQHMe/L03TbuqUiehlKv456EE8KV5Ehn/Ag3/w4k1PXibuIljcwIKCiiAoO+lFRRARke2qKCh69KLzNIYbKG6Msbaza9o0z99LGywleYngpenvA1/ya36/95L8ml9e8hJz7Gw/dBzJvfTNa6QcKQuG6VwqpNuk/OtbZyKDTdIQaZh0ivStPSCVtnxzhJTm/DIdjrrAX1UFoonZT3pGuiNoBCmSsYZUJ82EtThx4+02zi2TFCZGB6dDXCnSlqZdNJvF4TtCiyCTXcVZZZJEnAt+nxm3N6tnNaeU6TpiF0gmywXCdGGBbNp5AFIKzE19AoQBq3cdhBAkdcclyecCroRl/Z28ki0diIBOZYtPhsRE9SVDfreujxsDTRtothlnvS4PUQT1234MQccYN7e6PsNyjojcIaCt1OxPnP//f+Quat/b2/b0bWzYdReuW/XOd8NMo2aX4dgl9A/sgZASojA/KyulRbwYGcSx4cfYvu84yoV5SNelxg7qTpVUw/rNu/hywiSGpZ9TSJkWYKS8AUEVR+/aDViYmcTz3EEcHXqIgb2HYH4eH4PZnMqdfPMEP75+gF0pwa051JaqykjTKCJx+OI9ziqTGD4+vU7ntuEViEGieyVvuVJY8PyzX95jefEX1DRvYzQStJDhg92FR985q0xieHB+6z8+pEv9naBdLnBWme57SI8baFeKnC2mKwtkmeTP4c6RfgcFOnaZ36QzSWJa41Nv0tU07pJ6BrlExmXSOdK79siT+Ve+WQV/i8UkgxrJGs+fDvPvJk2Q7qoR5H5TgTi1Fd+8SbpCynB+mQ7GRuNrXh3qo90dyvgjwAA2ZLfYDdkYOgAAAABJRU5ErkJggg==";

/* script */
const __vue_script__$4P = script$4P;
var __vue_render__$4P = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", [
    _vm.textstyle == "D"
      ? _c("div", [
          _c("div", { staticClass: "style-body-boxA" }, [
            _c("div", { staticClass: "style-wrapper" }, [
              _c("div", { staticClass: "top-line" }),
              _vm._v(" "),
              _c("div", {
                staticClass: "native-html-wrapper",
                domProps: { innerHTML: _vm._s(_vm.formatImg(_vm.content)) },
              }),
              _vm._v(" "),
              _c("div", { staticClass: "bottom-margin" }),
              _vm._v(" "),
              _c("div", { staticClass: "bottom-triangle" }),
            ]),
          ]),
        ])
      : _vm._e(),
    _vm._v(" "),
    _vm.textstyle == "A"
      ? _c("div", [
          _c("div", { staticClass: "style-body-boxA" }, [
            _c("div", { staticClass: "top-bg" }),
            _vm._v(" "),
            _c("div", {
              staticClass: "style-content-box",
              domProps: { innerHTML: _vm._s(_vm.formatImg(_vm.content)) },
            }),
            _vm._v(" "),
            _c("div", { staticClass: "paper-clip-icon" }),
            _vm._v(" "),
            _c("div", { staticClass: "style-content-bg" }),
          ]),
        ])
      : _vm._e(),
    _vm._v(" "),
    _vm.textstyle == "B"
      ? _c("div", [
          _c("div", { staticClass: "style-body-boxB" }, [
            _c("div", { staticClass: "top-bg" }),
            _vm._v(" "),
            _c("div", {
              staticClass: "style-content-box",
              domProps: { innerHTML: _vm._s(_vm.formatImg(_vm.content)) },
            }),
            _vm._v(" "),
            _c("div", { staticClass: "style-content-bg" }),
            _vm._v(" "),
            _vm._m(0),
          ]),
        ])
      : _vm._e(),
    _vm._v(" "),
    _vm.textstyle == "C"
      ? _c("div", [
          _c("div", { staticClass: "style-body-boxC" }, [
            _c("div", { staticClass: "top-bg" }),
            _vm._v(" "),
            _c("div", {
              staticClass: "style-content-box",
              domProps: { innerHTML: _vm._s(_vm.formatImg(_vm.content)) },
            }),
            _vm._v(" "),
            _c("div", { staticClass: "style-content-bg" }),
            _vm._v(" "),
            _vm._m(1),
          ]),
        ])
      : _vm._e(),
    _vm._v(" "),
    _vm.textstyle == "E"
      ? _c("div", [
          _c("div", { staticClass: "style-body-boxE" }, [
            _c("div", { staticClass: "scroll-top" }, [
              _c("img", {
                style: _vm.pageType == "pc" ? "height:20px" : "",
                attrs: {
                  src: __$_require_static_images_leaflet_icons_scroll_png__,
                  alt: "",
                },
              }),
            ]),
            _vm._v(" "),
            _c("div", {
              staticClass: "style-content-box",
              domProps: { innerHTML: _vm._s(_vm.formatImg(_vm.content)) },
            }),
            _vm._v(" "),
            _c("div", { staticClass: "scroll-bottom" }, [
              _c("img", {
                style: _vm.pageType == "pc" ? "height:20px" : "",
                attrs: {
                  src: __$_require_static_images_leaflet_icons_scroll_png__,
                  alt: "",
                },
              }),
            ]),
          ]),
        ])
      : _vm._e(),
  ])
};
var __vue_staticRenderFns__$4P = [
  function () {
    var _vm = this;
    var _h = _vm.$createElement;
    var _c = _vm._self._c || _h;
    return _c("div", { staticClass: "top-style-box" }, [
      _c("div"),
      _vm._v(" "),
      _c("div"),
      _vm._v(" "),
      _c("div"),
      _vm._v(" "),
      _c("div"),
      _vm._v(" "),
      _c("div"),
      _vm._v(" "),
      _c("div"),
      _vm._v(" "),
      _c("div"),
      _vm._v(" "),
      _c("div"),
    ])
  },
  function () {
    var _vm = this;
    var _h = _vm.$createElement;
    var _c = _vm._self._c || _h;
    return _c("div", { staticClass: "top-style-box" }, [
      _c("div"),
      _vm._v(" "),
      _c("div"),
      _vm._v(" "),
      _c("div"),
      _vm._v(" "),
      _c("div"),
      _vm._v(" "),
      _c("div"),
      _vm._v(" "),
      _c("div"),
      _vm._v(" "),
      _c("div"),
      _vm._v(" "),
      _c("div"),
    ])
  },
];
__vue_render__$4P._withStripped = true;

  /* style */
  const __vue_inject_styles__$4P = undefined;
  /* scoped */
  const __vue_scope_id__$4P = "data-v-0994a01b";
  /* module identifier */
  const __vue_module_identifier__$4P = undefined;
  /* functional template */
  const __vue_is_functional_template__$4P = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4P = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4P, staticRenderFns: __vue_staticRenderFns__$4P },
    __vue_inject_styles__$4P,
    __vue_script__$4P,
    __vue_scope_id__$4P,
    __vue_is_functional_template__$4P,
    __vue_module_identifier__$4P,
    false,
    undefined,
    undefined,
    undefined
  );

const reHtml = str => {
  return str ? str.replace(/&((g|l|quo|ldquo|rdquo)t|amp|#39|nbsp);/g, function (m) {
    return {
      '&lt;': '<',
      '&amp;': '&',
      '&quot;': '"',
      '&ldquo;': '“',
      '&rdquo;': '”',
      '&gt;': '>',
      '&#39;': "'",
      '&nbsp;': ' '
    }[m];
  }) : '';
};
class MagicLink extends HTMLElement {
  static get observedAttributes() {
    return ['data-plaintext', 'data-type', 'data-title', 'data-content', 'data-isplaying'];
  }
  constructor() {
    super();
    this.createShadow();
    setTimeout(() => {
      this.insertContent();
    });
  }
  createShadow() {
    this.shadow = this.attachShadow({
      mode: 'closed'
    });
  }
  insertContent() {
    const type = this.getAttribute('data-type');
    const title = this.getAttribute('data-title');
    const wrapper = document.createElement('span');
    wrapper.setAttribute('class', `magic-link magic-link--${type}`);
    wrapper.setAttribute('contenteditable', 'false');
    wrapper.innerHTML = reHtml(title);
    const style = document.createElement('style');
    // console.log("%c%s","font-size:2em;background: #00965E;color: #FFF",'WCE内部样式连接',style.isConnected)

    style.textContent = `
      p {
        margin: 0;
      }
      .magic-link {
        display: inline;
        text-indent: initial;
        // color: #6883FA;
        color: #00F;
        transition: all 240ms ease-in-out;
      }
      .magic-link:hover {
        text-decoration: underline;
      }
      .wifi-symbol {
        display: inline-block;
        width: 21px;
        height: 21px;
        box-sizing: border-box;
        overflow: hidden;
        vertical-align: text-bottom;
      }
      .wifi-symbol svg {
        display:block;
      }
      .wifi-symbol.playing .play-path {
        animation: fade-in 900ms cubic-bezier(0.43, 0.2, 0.56, 0.94) infinite;
      }
      @keyframes fadeInOut {
        0% {
          opacity: 0;
        }
        100% {
          opacity: 1;
        }
      }
    `;
    this.shadow.appendChild(style);
    this.shadow.appendChild(wrapper);
    if (type === 'audio') {
      let audioExtra = document.createElement('div');
      audioExtra.setAttribute('class', 'wifi-symbol');
      audioExtra.innerHTML = `
      <svg width="21" height="21" viewBox="-3 -5 50 64">
        <defs>
          <style>
            .play-path {fill:#3fa9f5;}
            @keyframes fade-in{
              to {opacity: 0;}
            }
            .play-path:nth-of-type(2){
              animation-delay: 0.25s !important;
            }
            .play-path:nth-of-type(3){
              animation-delay: 0.5s !important;
            }
          </style>
        </defs>
        <path class="play-path" d="M12.69,39.57a12,12,0,0,0-1.3-21.73L1.18,28.06Z" />
        <path class="play-path" d="M24,29a17,17,0,0,1-7.67,14.2l3.59,3.6A22,22,0,0,0,18.8,10.44l-3.65,3.64A17,17,0,0,1,24,29Z" />
        <path class="play-path" d="M26.4,2.56,22.83,6.13a27,27,0,0,1,.2,43.6l3.56,3.56A32,32,0,0,0,26.4,2.56Z" />
      </svg>
      `;
      this.shadow.appendChild(audioExtra);
    }
  }
  updateContent({
    key,
    oldValue,
    newValue
  }) {
    let _this = this;
    // console.log("%c%s","font-size:2em;background: #00965E;color: #FFF",'wce更新逻辑',[this],this.shadow)
    const type = this.getAttribute('data-type');
    this.getAttribute('data-title');
    const content = this.getAttribute('data-content');
    if (oldValue === null && newValue) {
      // 首次加载
      if (type === 'leaflet' && key === 'data-title') {
        setTimeout(() => {
          const links = this.shadow.querySelectorAll('.magic-link a');
          this.shadow.querySelector('.magic-link.magic-link--leaflet');
          // console.log("%c%s","font-size:2em;background: #00965E;color: #FFF",'wcce leflet', links, this.shadow)
          links.forEach((elem, index) => {
            elem.addEventListener('click', e => {
              // console.log("%c%s","font-size:2em;background: #00965E;color: #FFF",'link内点击',e,elem)
              _this.shadow.dispatchEvent(new CustomEvent('openTarget', {
                detail: {
                  aid: elem.id,
                  aindex: index,
                  elem,
                  targets: content
                }
              }));
            });
          });
        }, 50);
      }
    }
    if (oldValue !== null && newValue) {
      // 后续更新
      if (type === 'audio') {
        if (key === 'data-isplaying') {
          let target = this.shadow.querySelector('.wifi-symbol');
          let classNames = newValue === 'true' ? 'wifi-symbol playing' : 'wifi-symbol';
          target.setAttribute('class', classNames);
          // console.log("%c%s","font-size:2em;background: #00965E;color: #FFF", 'target', [target])
        }
      }
    }
  }

  //生命周期 - 首次被插入文档 DOM 时
  connectedCallback() {
    // console.log("%c%s","font-size:2em;background: #00965E;color: #FFF",'WCE嵌入',)
    // updateContent(this);
  }

  //生命周期 - 从文档 DOM 中删除时
  disconnectedCallback() {
    // console.log("%c%s","font-size:2em;background: #00965E;color: #FFF",'WCE销毁',)
  }

  //生命周期 - 被移动到新的文档时
  adoptedCallback() {
    // console.log("%c%s","font-size:2em;background: #00965E;color: #FFF",'WCE迁移',)
  }

  //生命周期 - 增加、删除、修改自身属性时
  attributeChangedCallback(key, oldValue, newValue) {
    // console.log("%c%s","font-size:2em;background: #00965E;color: #FFF",'WCE更新',{key, oldValue, newValue})
    this.updateContent({
      key,
      oldValue,
      newValue
    });
  }
}

var recorder_mp3_min = createCommonjsModule(function (module) {
/*
录音
https://github.com/xiangyuecn/Recorder
src: recorder-core.js,engine/mp3.js,engine/mp3-engine.js
*/
!function (e) {
  var t = "object" == typeof window && !!window.document,
    a = t ? window : Object;
  !function (e, w) {

    var S = function () {},
      f = function (e) {
        return "number" == typeof e;
      },
      N = function (e) {
        return new l(e);
      },
      M = N.LM = "2024-04-09 19:15",
      y = "https://github.com/xiangyuecn/Recorder",
      R = "Recorder",
      A = "getUserMedia",
      V = "srcSampleRate",
      D = "sampleRate",
      i = "bitRate",
      x = "catch",
      t = e[R];
    if (t && t.LM == M) return t.CLog(t.i18n.$T("K8zP::重复导入{1}", 0, R), 3);
    N.IsOpen = function () {
      var e = N.Stream;
      if (e) {
        var t = e.getTracks && e.getTracks() || e.audioTracks || [],
          a = t[0];
        if (a) {
          var n = a.readyState;
          return "live" == n || n == a.LIVE;
        }
      }
      return !1;
    }, N.BufferSize = 4096, N.Destroy = function () {
      for (var e in O(R + " Destroy"), L(), a) a[e]();
    };
    var a = {};
    N.BindDestroy = function (e, t) {
      a[e] = t;
    }, N.Support = function () {
      if (!w) return !1;
      var e = navigator.mediaDevices || {};
      return e[A] || (e = navigator)[A] || (e[A] = e.webkitGetUserMedia || e.mozGetUserMedia || e.msGetUserMedia), !!e[A] && (N.Scope = e, !!N.GetContext());
    }, N.GetContext = function (e) {
      if (!w) return null;
      var t = window.AudioContext;
      if (t || (t = window.webkitAudioContext), !t) return null;
      var a = N.Ctx;
      if (a && "closed" != a.state || (a = N.Ctx = new t(), N.NewCtxs = N.NewCtxs || [], N.BindDestroy("Ctx", function () {
        var e = N.Ctx;
        e && e.close && (s(e), N.Ctx = 0);
        var t = N.NewCtxs;
        N.NewCtxs = [];
        for (var a = 0; a < t.length; a++) s(t[a]);
      })), e && a.close) try {
        a = new t(), N.NewCtxs.push(a);
      } catch (e) {
        O("GetContext tryNew Error", 1, e);
      }
      return a;
    }, N.CloseNewCtx = function (e) {
      if (e && e != N.Ctx) {
        s(e);
        for (var t = N.NewCtxs || [], a = t.length, n = 0; n < t.length; n++) if (t[n] == e) {
          t.splice(n, 1);
          break;
        }
        O(z("mSxV::剩{1}个GetContext未close", 0, a + "-1=" + t.length), t.length ? 3 : 0);
      }
    };
    var s = function (e) {
        if (e && e.close) {
          e._isC = 1;
          try {
            e.close();
          } catch (e) {
            O("ctx close err", 1, e);
          }
        }
      },
      B = N.ResumeCtx = function (a, n, s, r) {
        var i = 0,
          o = 0,
          _ = 0,
          l = 0,
          f = "EventListener",
          c = "ResumeCtx ",
          u = function (e, t) {
            o && h(), i || (i = 1, e && r(e, l), t && s(l)), t && (!a._LsSC && a["add" + f] && a["add" + f]("statechange", b), a._LsSC = 1, _ = 1);
          },
          h = function (e) {
            if (!e || !o) {
              o = e ? 1 : 0;
              for (var t = ["focus", "mousedown", "mouseup", "touchstart", "touchend"], a = 0; a < t.length; a++) window[(e ? "add" : "remove") + f](t[a], b, !0);
            }
          },
          b = function () {
            var e = a.state,
              t = p(e);
            if (!i && !n(t ? ++l : l)) return u();
            t ? (_ && O(c + "sc " + e, 3), h(1), a.resume().then(function () {
              _ && O(c + "sc " + a.state), u(0, 1);
            })[x](function (e) {
              O(c + "error", 1, e), p(a.state) || u(e.message || "error");
            })) : "closed" == e ? (_ && !a._isC && O(c + "sc " + e, 1), u("ctx closed")) : u(0, 1);
          };
        b();
      },
      p = N.CtxSpEnd = function (e) {
        return "suspended" == e || "interrupted" == e;
      },
      k = function (e) {
        var t = e.state,
          a = "ctx.state=" + t;
        return p(t) && (a += z("nMIy::（注意：ctx不是running状态，rec.open和start至少要有一个在用户操作(触摸、点击等)时进行调用，否则将在rec.start时尝试进行ctx.resume，可能会产生兼容性问题(仅iOS)，请参阅文档中runningContext配置）")), a;
      },
      T = "ConnectEnableWebM";
    N[T] = !0;
    var E = "ConnectEnableWorklet";
    N[E] = !1;
    var C = function (e, _) {
        var l = e.BufferSize || N.BufferSize,
          f = e.Stream,
          c = f._RC || f._c || N.GetContext(!0);
        f._c = c;
        var u,
          a,
          h,
          i = function (e) {
            var t = f._m = c.createMediaStreamSource(f),
              a = c.destination,
              n = "createMediaStreamDestination";
            c[n] && (a = f._d = c[n]()), t.connect(e), e.connect(a);
          },
          b = "",
          p = f._call,
          m = function (e) {
            for (var t in p) {
              for (var a = e.length, n = new Int16Array(a), s = 0, r = 0; r < a; r++) {
                var i = Math.max(-1, Math.min(1, e[r]));
                i = i < 0 ? 32768 * i : 32767 * i, n[r] = i, s += Math.abs(i);
              }
              for (var o in p) p[o](n, s);
              return;
            }
          },
          v = "ScriptProcessor",
          d = "audioWorklet",
          o = R + " " + d,
          g = "RecProc",
          w = "MediaRecorder",
          S = w + ".WebM.PCM",
          M = c.createScriptProcessor || c.createJavaScriptNode,
          y = z("ZGlf::。由于{1}内部1秒375次回调，在移动端可能会有性能问题导致回调丢失录音变短，PC端无影响，暂不建议开启{1}。", 0, d),
          A = function () {
            a = f.isWorklet = !1, n(f), O(z("7TU0::Connect采用老的{1}，", 0, v) + Y.get(z(N[E] ? "JwCL::但已设置{1}尝试启用{2}" : "VGjB::可设置{1}尝试启用{2}", 2), [R + "." + E + "=true", d]) + b + y, 3);
            var e = f._p = M.call(c, l, 1, 1);
            i(e), e.onaudioprocess = function (e) {
              var t = e.inputBuffer.getChannelData(0);
              m(t);
            };
          },
          k = function () {
            u = f.isWebM = !1, I(f), a = f.isWorklet = !M || N[E];
            var t = window.AudioWorkletNode;
            if (a && c[d] && t) {
              var n = function () {
                  return a && f._na;
                },
                s = f._na = function () {
                  "" !== h && (clearTimeout(h), h = setTimeout(function () {
                    h = 0, n() && (O(z("MxX1::{1}未返回任何音频，恢复使用{2}", 0, d, v), 3), M && A());
                  }, 500));
                },
                r = function () {
                  if (n()) {
                    var e = f._n = new t(c, g, {
                      processorOptions: {
                        bufferSize: l
                      }
                    });
                    i(e), e.port.onmessage = function (e) {
                      h && (clearTimeout(h), h = ""), n() ? m(e.data.val) : a || O(z("XUap::{1}多余回调", 0, d), 3);
                    }, O(z("yOta::Connect采用{1}，设置{2}可恢复老式{3}", 0, d, R + "." + E + "=false", v) + b + y, 3);
                  }
                },
                e = function () {
                  if (n()) if (c[g]) r();else {
                    var e,
                      t,
                      a = (t = "class " + g + " extends AudioWorkletProcessor{", t += "constructor " + (e = function (e) {
                        return e.toString().replace(/^function|DEL_/g, "").replace(/\$RA/g, o);
                      })(function (e) {
                        DEL_super(e);
                        var t = this,
                          a = e.processorOptions.bufferSize;
                        t.bufferSize = a, t.buffer = new Float32Array(2 * a), t.pos = 0, t.port.onmessage = function (e) {
                          e.data.kill && (t.kill = !0, $C.log("$RA kill call"));
                        }, $C.log("$RA .ctor call", e);
                      }), t += "process " + e(function (e, t, a) {
                        var n = this,
                          s = n.bufferSize,
                          r = n.buffer,
                          i = n.pos;
                        if ((e = (e[0] || [])[0] || []).length) {
                          r.set(e, i);
                          var o = ~~((i += e.length) / s) * s;
                          if (o) {
                            this.port.postMessage({
                              val: r.slice(0, o)
                            });
                            var _ = r.subarray(o, i);
                            (r = new Float32Array(2 * s)).set(_), i = _.length, n.buffer = r;
                          }
                          n.pos = i;
                        }
                        return !n.kill;
                      }), t = (t += '}try{registerProcessor("' + g + '", ' + g + ')}catch(e){$C.error("' + o + ' Reg Error",e)}').replace(/\$C\./g, "console."), "data:text/javascript;base64," + btoa(unescape(encodeURIComponent(t))));
                    c[d].addModule(a).then(function (e) {
                      n() && (c[g] = 1, r(), h && s());
                    })[x](function (e) {
                      O(d + ".addModule Error", 1, e), n() && A();
                    });
                  }
                };
              B(c, function () {
                return n();
              }, e, e);
            } else A();
          };
        !function () {
          var e = window[w],
            t = "ondataavailable",
            a = "audio/webm; codecs=pcm";
          u = f.isWebM = N[T];
          var n = e && t in e.prototype && e.isTypeSupported(a);
          if (b = n ? "" : z("VwPd::（此浏览器不支持{1}）", 0, S), !_ || !u || !n) return k();
          var s = function () {
              return u && f._ra;
            },
            r = (f._ra = function () {
              "" !== h && (clearTimeout(h), h = setTimeout(function () {
                s() && (O(z("vHnb::{1}未返回任何音频，降级使用{2}", 0, w, d), 3), k());
              }, 500));
            }, Object.assign({
              mimeType: a
            }, N.ConnectWebMOptions)),
            i = f._r = new e(f, r),
            o = f._rd = {
              sampleRate: c[D]
            };
          i[t] = function (e) {
            var t = new FileReader();
            t.onloadend = function () {
              if (s()) {
                var e = P(new Uint8Array(t.result), o);
                if (!e) return;
                if (-1 == e) return void k();
                h && (clearTimeout(h), h = ""), m(e);
              } else u || O(z("O9P7::{1}多余回调", 0, w), 3);
            }, t.readAsArrayBuffer(e.data);
          }, i.start(~~(l / 48)), O(z("LMEm::Connect采用{1}，设置{2}可恢复使用{3}或老式{4}", 0, S, R + "." + T + "=false", d, v));
        }();
      },
      r = function (e) {
        e._na && e._na(), e._ra && e._ra();
      },
      n = function (e) {
        e._na = null, e._n && (e._n.port.postMessage({
          kill: !0
        }), e._n.disconnect(), e._n = null);
      },
      I = function (e) {
        if (e._ra = null, e._r) {
          try {
            e._r.stop();
          } catch (e) {
            O("mr stop err", 1, e);
          }
          e._r = null;
        }
      },
      L = function (e) {
        var t = (e = e || N) == N,
          a = e.Stream;
        a && (a._m && (a._m.disconnect(), a._m = null), !a._RC && a._c && N.CloseNewCtx(a._c), a._RC = null, a._c = null, a._d && (o(a._d.stream), a._d = null), a._p && (a._p.disconnect(), a._p.onaudioprocess = a._p = null), n(a), I(a), t && o(a)), e.Stream = 0;
      },
      o = N.StopS_ = function (e) {
        for (var t = e.getTracks && e.getTracks() || e.audioTracks || [], a = 0; a < t.length; a++) {
          var n = t[a];
          n.stop && n.stop();
        }
        e.stop && e.stop();
      };
    N.SampleData = function (e, t, a, n, s) {
      var r = "SampleData";
      n || (n = {});
      var i = n.index || 0,
        o = n.offset || 0,
        _ = n.filter;
      if (_ && _.fn && _.sr != t && (_ = null, O(z("d48C::{1}的filter采样率变了，重设滤波", 0, r), 3)), !_) {
        var l = 3 * t / 4 < a ? 0 : a / 2 * 3 / 4;
        _ = {
          fn: l ? N.IIRFilter(!0, t, l) : 0
        };
      }
      _.sr = t;
      var f = _.fn,
        c = n.frameNext || [];
      s || (s = {});
      var u = s.frameSize || 1;
      s.frameType && (u = "mp3" == s.frameType ? 1152 : 1);
      var h = e.length;
      h + 1 < i && O(z("tlbC::{1}似乎传入了未重置chunk {2}", 0, r, i + ">" + h), 3);
      for (var b = 0, p = i; p < h; p++) b += e[p].length;
      b = Math.max(0, b - Math.floor(o));
      var m = t / a;
      1 < m ? b = Math.floor(b / m) : (m = 1, a = t), b += c.length;
      for (var v = new Int16Array(b), d = 0, p = 0; p < c.length; p++) v[d] = c[p], d++;
      for (; i < h; i++) {
        for (var g = e[i], p = o, w = g.length, S = f && f.Embed, M = 0, y = 0, A = 0, k = 0, R = 0, x = 0; R < w; R++, x++) if (x < w && (S ? (A = g[x], k = S.b0 * A + S.b1 * S.x1 + S.b0 * S.x2 - S.a1 * S.y1 - S.a2 * S.y2, S.x2 = S.x1, S.x1 = A, S.y2 = S.y1, S.y1 = k) : k = f ? f(g[x]) : g[x]), M = y, y = k, 0 != x) {
          var B = Math.floor(p);
          if (R == B) {
            var T = Math.ceil(p),
              E = p - B,
              C = M,
              I = T < w ? y : C,
              L = C + (I - C) * E;
            32767 < L ? L = 32767 : L < -32768 && (L = -32768), v[d] = L, d++, p += m;
          }
        } else R--;
        o = Math.max(0, p - w);
      }
      c = null;
      var P = v.length % u;
      if (0 < P) {
        var H = 2 * (v.length - P);
        c = new Int16Array(v.buffer.slice(H)), v = new Int16Array(v.buffer.slice(0, H));
      }
      return {
        index: i,
        offset: o,
        filter: _,
        frameNext: c,
        sampleRate: a,
        data: v
      };
    }, N.IIRFilter = function (e, t, a) {
      var n = 2 * Math.PI * a / t,
        s = Math.sin(n),
        r = Math.cos(n),
        i = s / 2,
        o = 1 + i,
        _ = -2 * r / o,
        l = (1 - i) / o;
      if (e) var f = (1 - r) / 2 / o,
        c = (1 - r) / o;else var f = (1 + r) / 2 / o,
        c = -(1 + r) / o;
      var u = 0,
        h = 0,
        b = 0,
        p = 0,
        m = 0,
        v = function (e) {
          return b = f * e + c * u + f * h - _ * p - l * m, h = u, u = e, m = p, p = b;
        };
      return v.Embed = {
        x1: 0,
        x2: 0,
        y1: 0,
        y2: 0,
        b0: f,
        b1: c,
        a1: _,
        a2: l
      }, v;
    }, N.PowerLevel = function (e, t) {
      var a = e / t || 0;
      return a < 1251 ? Math.round(a / 1250 * 10) : Math.round(Math.min(100, Math.max(0, 100 * (1 + Math.log(a / 1e4) / Math.log(10)))));
    }, N.PowerDBFS = function (e) {
      var t = Math.max(.1, e || 0);
      return t = Math.min(t, 32767), t = 20 * Math.log(t / 32767) / Math.log(10), Math.max(-100, Math.round(t));
    }, N.CLog = function (e, t) {
      if ("object" == typeof console) {
        var a = new Date(),
          n = ("0" + a.getMinutes()).substr(-2) + ":" + ("0" + a.getSeconds()).substr(-2) + "." + ("00" + a.getMilliseconds()).substr(-3),
          s = this && this.envIn && this.envCheck && this.id,
          r = ["[" + n + " " + R + (s ? ":" + s : "") + "]" + e],
          i = arguments,
          o = N.CLog,
          _ = 2,
          l = o.log || console.log;
        for (f(t) ? l = 1 == t ? o.error || console.error : 3 == t ? o.warn || console.warn : l : _ = 1; _ < i.length; _++) r.push(i[_]);
        c ? l && l("[IsLoser]" + r[0], 1 < r.length ? r : "") : l.apply(console, r);
      }
    };
    var O = function () {
        N.CLog.apply(this, arguments);
      },
      c = !0;
    try {
      c = !console.log.apply;
    } catch (e) {}
    var _ = 0;
    function l(e) {
      var t = this;
      t.id = ++_, u();
      var a = {
        type: "mp3",
        onProcess: S
      };
      for (var n in e) a[n] = e[n];
      var s = (t.set = a)[i],
        r = a[D];
      (s && !f(s) || r && !f(r)) && t.CLog(z.G("IllegalArgs-1", [z("VtS4::{1}和{2}必须是数值", 0, D, i)]), 1, e), a[i] = +s || 16, a[D] = +r || 16e3, t.state = 0, t._S = 9, t.Sync = {
        O: 9,
        C: 9
      };
    }
    N.Sync = {
      O: 9,
      C: 9
    }, N.prototype = l.prototype = {
      CLog: O,
      _streamStore: function () {
        return this.set.sourceStream ? this : N;
      },
      _streamCtx: function () {
        var e = this._streamStore().Stream;
        return e && e._c;
      },
      open: function (e, a) {
        var n = this,
          s = n.set,
          r = n._streamStore(),
          i = 0;
        e = e || S;
        var o = function (e, t) {
          t = !!t, n.CLog(z("5tWi::录音open失败：") + e + ",isUserNotAllow:" + t, 1), i && N.CloseNewCtx(i), a && a(e, t);
        };
        n._streamTag = A;
        var _ = function () {
            n.CLog("open ok, id:" + n.id + " stream:" + n._streamTag), e(), n._SO = 0;
          },
          l = r.Sync,
          f = ++l.O,
          c = l.C;
        n._O = n._O_ = f, n._SO = n._S;
        if (w) {
          var t = n.envCheck({
            envName: "H5",
            canProcess: !0
          });
          if (t) o(z("A5bm::不能录音：") + t);else if (s.sourceStream) {
            if (n._streamTag = "set.sourceStream", !N.GetContext()) return void o(z("1iU7::不支持此浏览器从流中获取录音"));
            L(r);
            var u = n.Stream = s.sourceStream;
            u._RC = s.runningContext, u._call = {};
            try {
              C(r);
            } catch (e) {
              return L(r), void o(z("BTW2::从流中打开录音失败：") + e.message);
            }
            _();
          } else {
            var h = function (e, t) {
              try {
                window.top.a;
              } catch (e) {
                return void o(z("Nclz::无权录音(跨域，请尝试给iframe添加麦克风访问策略，如{1})", 0, 'allow="camera;microphone"'));
              }
              /Permission|Allow/i.test(e) ? o(z("gyO5::用户拒绝了录音权限"), !0) : !1 === window.isSecureContext ? o(z("oWNo::浏览器禁止不安全页面录音，可开启https解决")) : /Found/i.test(e) ? o(t + z("jBa9::，无可用麦克风")) : o(t);
            };
            if (N.IsOpen()) _();else if (N.Support()) {
              var b = s.runningContext;
              b || (b = i = N.GetContext(!0));
              var p = function (t) {
                  setTimeout(function () {
                    t._call = {};
                    var e = N.Stream;
                    e && (L(), t._call = e._call), (N.Stream = t)._c = b, t._RC = s.runningContext, function () {
                      if (c != l.C || !n._O) {
                        var e = z("dFm8::open被取消");
                        return f == l.O ? n.close() : e = z("VtJO::open被中断"), o(e), !0;
                      }
                    }() || (N.IsOpen() ? (e && n.CLog(z("upb8::发现同时多次调用open"), 1), C(r, 1), _()) : o(z("Q1GA::录音功能无效：无音频流")));
                  }, 100);
                },
                m = function (e) {
                  var t = e.name || e.message || e.code + ":" + e;
                  n.CLog(z("xEQR::请求录音权限错误"), 1, e), h(t, z("bDOG::无法录音：") + t);
                },
                v = s.audioTrackSet || {};
              v[D] = b[D];
              var d = {
                audio: v
              };
              try {
                var g = N.Scope[A](d, p, m);
              } catch (e) {
                n.CLog(A, 3, e), d = {
                  audio: !0
                }, g = N.Scope[A](d, p, m);
              }
              n.CLog(A + "(" + JSON.stringify(d) + ") " + k(b) + z("RiWe::，未配置noiseSuppression和echoCancellation时浏览器可能会自动打开降噪和回声消除，移动端可能会降低系统播放音量（关闭录音后可恢复），请参阅文档中audioTrackSet配置") + "(" + y + ") LM:" + M + " UA:" + navigator.userAgent), g && g.then && g.then(p)[x](m);
            } else h("", z("COxc::此浏览器不支持录音"));
          }
        } else o(z.G("NonBrowser-1", ["open"]) + z("EMJq::，可尝试使用RecordApp解决方案") + "(" + y + "/tree/master/app-support-sample)");
      },
      close: function (e) {
        e = e || S;
        var t = this,
          a = t._streamStore();
        t._stop();
        var n = " stream:" + t._streamTag,
          s = a.Sync;
        if (t._O = 0, t._O_ != s.O) return t.CLog(z("hWVz::close被忽略（因为同时open了多个rec，只有最后一个会真正close）") + n, 3), void e();
        s.C++, L(a), t.CLog("close," + n), e();
      },
      mock: function (e, t) {
        var a = this;
        return a._stop(), a.isMock = 1, a.mockEnvInfo = null, a.buffers = [e], a.recSize = e.length, a._setSrcSR(t), a._streamTag = "mock", a;
      },
      _setSrcSR: function (e) {
        var t = this.set,
          a = t[D];
        e < a ? t[D] = e : a = 0, this[V] = e, this.CLog(V + ": " + e + " set." + D + ": " + t[D] + (a ? " " + z("UHvm::忽略") + ": " + a : ""), a ? 3 : 0);
      },
      envCheck: function (e) {
        var t,
          a = this.set,
          n = "CPU_BE";
        if (t || N[n] || "function" != typeof Int8Array || new Int8Array(new Int32Array([1]).buffer)[0] || (u(n), t = z("Essp::不支持{1}架构", 0, n)), !t) {
          var s = a.type,
            r = this[s + "_envCheck"];
          a.takeoffEncodeChunk && (r ? e.canProcess || (t = z("7uMV::{1}环境不支持实时处理", 0, e.envName)) : t = z("2XBl::{1}类型不支持设置takeoffEncodeChunk", 0, s) + (this[s] ? "" : z("LG7e::(未加载编码器)"))), !t && r && (t = this[s + "_envCheck"](e, a));
        }
        return t || "";
      },
      envStart: function (e, t) {
        var a = this,
          n = a.set;
        if (a.isMock = e ? 1 : 0, a.mockEnvInfo = e, a.buffers = [], a.recSize = 0, e && (a._streamTag = "env$" + e.envName), a.state = 1, a.envInLast = 0, a.envInFirst = 0, a.envInFix = 0, a.envInFixTs = [], a._setSrcSR(t), a.engineCtx = 0, a[n.type + "_start"]) {
          var s = a.engineCtx = a[n.type + "_start"](n);
          s && (s.pcmDatas = [], s.pcmSize = 0);
        }
      },
      envResume: function () {
        this.envInFixTs = [];
      },
      envIn: function (e, t) {
        var s = this,
          r = s.set,
          i = s.engineCtx;
        if (1 == s.state) {
          var a = s[V],
            n = e.length,
            o = N.PowerLevel(t, n),
            _ = s.buffers,
            l = _.length;
          _.push(e);
          var f = _,
            c = l,
            u = Date.now(),
            h = Math.round(n / a * 1e3);
          s.envInLast = u, 1 == s.buffers.length && (s.envInFirst = u - h);
          var b = s.envInFixTs;
          b.splice(0, 0, {
            t: u,
            d: h
          });
          for (var p = u, m = 0, v = 0; v < b.length; v++) {
            var d = b[v];
            if (3e3 < u - d.t) {
              b.length = v;
              break;
            }
            p = d.t, m += d.d;
          }
          var g = b[1],
            w = u - p,
            S = w - m;
          if (w / 3 < S && (g && 1e3 < w || 6 <= b.length)) {
            var M = u - g.t - h;
            if (h / 5 < M) {
              var y = !r.disableEnvInFix;
              if (s.CLog("[" + u + "]" + Y.get(z(y ? "4Kfd::补偿{1}ms" : "bM5i::未补偿{1}ms", 1), [M]), 3), s.envInFix += M, y) {
                var A = new Int16Array(M * a / 1e3);
                n += A.length, _.push(A);
              }
            }
          }
          var k = s.recSize,
            R = n,
            x = k + R;
          if (s.recSize = x, i) {
            var B = N.SampleData(_, a, r[D], i.chunkInfo);
            i.chunkInfo = B, k = i.pcmSize, R = B.data.length, x = k + R, i.pcmSize = x, _ = i.pcmDatas, l = _.length, _.push(B.data), a = B[D];
          }
          var T = Math.round(x / a * 1e3),
            E = _.length,
            C = f.length,
            I = function () {
              for (var e = L ? 0 : -R, t = null == _[0], a = l; a < E; a++) {
                var n = _[a];
                null == n ? t = 1 : (e += n.length, i && n.length && s[r.type + "_encode"](i, n));
              }
              if (t && i) {
                var a = c;
                for (f[0] && (a = 0); a < C; a++) f[a] = null;
              }
              t && (e = L ? R : 0, _[0] = null), i ? i.pcmSize += e : s.recSize += e;
            },
            L = 0,
            P = "rec.set.onProcess";
          try {
            L = r.onProcess(_, o, T, a, l, I);
          } catch (e) {
            console.error(P + z("gFUF::回调出错是不允许的，需保证不会抛异常"), e);
          }
          var H = Date.now() - u;
          if (10 < H && 1e3 < s.envInFirst - u && s.CLog(P + z("2ghS::低性能，耗时{1}ms", 0, H), 3), !0 === L) {
            for (var O = 0, v = l; v < E; v++) null == _[v] ? O = 1 : _[v] = new Int16Array(0);
            O ? s.CLog(z("ufqH::未进入异步前不能清除buffers"), 3) : i ? i.pcmSize -= R : s.recSize -= R;
          } else I();
        } else s.state || s.CLog("envIn at state=0", 3);
      },
      start: function () {
        var t = this,
          e = 1;
        if (t.set.sourceStream ? t.Stream || (e = 0) : N.IsOpen() || (e = 0), e) {
          var a = t._streamCtx();
          if (t.CLog(z("kLDN::start 开始录音，") + k(a) + " stream:" + t._streamTag), t._stop(), t.envStart(null, a[D]), t.state = 3, t._SO && t._SO + 1 != t._S) t.CLog(z("Bp2y::start被中断"), 3);else {
            t._SO = 0;
            var n = function () {
                3 == t.state && (t.state = 1, t.resume());
              },
              s = "AudioContext resume: ";
            B(a, function (e) {
              return e && t.CLog(s + "wait..."), 3 == t.state;
            }, function (e) {
              e && t.CLog(s + a.state), n();
            }, function (e) {
              t.CLog(s + a.state + z("upkE::，可能无法录音：") + e, 1), n();
            });
          }
        } else t.CLog(z("6WmN::start失败：未open"), 1);
      },
      pause: function () {
        var e = this,
          t = e._streamStore().Stream;
        e.state && (e.state = 2, e.CLog("pause"), t && delete t._call[e.id]);
      },
      resume: function () {
        var a = this,
          t = a._streamStore().Stream,
          n = "resume(wait ctx)";
        if (3 == a.state) a.CLog(n);else if (a.state) {
          a.state = 1, a.CLog("resume"), a.envResume(), t && (t._call[a.id] = function (e, t) {
            1 == a.state && a.envIn(e, t);
          }, r(t));
          var s = a._streamCtx();
          s && B(s, function (e) {
            return e && a.CLog(n + "..."), 1 == a.state;
          }, function (e) {
            e && a.CLog(n + s.state), r(t);
          }, function (e) {
            a.CLog(n + s.state + "[err]" + e, 1);
          });
        }
      },
      _stop: function (e) {
        var t = this,
          a = t.set;
        t.isMock || t._S++, t.state && (t.pause(), t.state = 0), !e && t[a.type + "_stop"] && (t[a.type + "_stop"](t.engineCtx), t.engineCtx = 0);
      },
      stop: function (c, t, e) {
        var u,
          h = this,
          b = h.set,
          a = h.envInLast - h.envInFirst,
          n = a && h.buffers.length;
        h.CLog(z("Xq4s::stop 和start时差:") + (a ? a + "ms " + z("3CQP::补偿:") + h.envInFix + "ms envIn:" + n + " fps:" + (n / a * 1e3).toFixed(1) : "-") + " stream:" + h._streamTag + " (" + y + ") LM:" + M);
        var p = function () {
            h._stop(), e && h.close();
          },
          m = function (e) {
            h.CLog(z("u8JG::结束录音失败：") + e, 1), t && t(e), p();
          },
          s = function (e, t, a) {
            var n = "arraybuffer",
              s = "dataType",
              r = "DefaultDataType",
              i = h[s] || N[r] || "blob",
              o = s + "=" + i,
              _ = e instanceof ArrayBuffer,
              l = 0,
              f = _ ? e.byteLength : e.size;
            if (i == n ? _ || (l = 1) : "blob" == i ? "function" != typeof Blob ? l = z.G("NonBrowser-1", [o]) + z("1skY::，请设置{1}", 0, R + "." + r + '="' + n + '"') : (_ && (e = new Blob([e], {
              type: t
            })), e instanceof Blob || (l = 1), t = e.type || t) : l = z.G("NotSupport-1", [o]), h.CLog(z("Wv7l::结束录音 编码花{1}ms 音频时长{2}ms 文件大小{3}b", 0, Date.now() - u, a, f) + " " + o + "," + t), l) m(1 != l ? l : z("Vkbd::{1}编码器返回的不是{2}", 0, b.type, i) + ", " + o);else {
              if (b.takeoffEncodeChunk) h.CLog(z("QWnr::启用takeoffEncodeChunk后stop返回的blob长度为0不提供音频数据"), 3);else if (f < Math.max(50, a / 5)) return void m(z("Sz2H::生成的{1}无效", 0, b.type));
              c && c(e, a, t), p();
            }
          };
        if (!h.isMock) {
          var r = 3 == h.state;
          if (!h.state || r) return void m(z("wf9t::未开始录音") + (r ? z("Dl2c::，开始录音前无用户交互导致AudioContext未运行") : ""));
        }
        h._stop(!0);
        var i = h.recSize;
        if (i) {
          if (h[b.type]) {
            if (h.isMock) {
              var o = h.envCheck(h.mockEnvInfo || {
                envName: "mock",
                canProcess: !1
              });
              if (o) return void m(z("AxOH::录音错误：") + o);
            }
            var _ = h.engineCtx;
            if (h[b.type + "_complete"] && _) {
              var l = Math.round(_.pcmSize / b[D] * 1e3);
              return u = Date.now(), void h[b.type + "_complete"](_, function (e, t) {
                s(e, t, l);
              }, m);
            }
            if (u = Date.now(), h.buffers[0]) {
              var f = N.SampleData(h.buffers, h[V], b[D]);
              b[D] = f[D];
              var v = f.data,
                l = Math.round(v.length / b[D] * 1e3);
              h.CLog(z("CxeT::采样:{1} 花:{2}ms", 0, i + "->" + v.length, Date.now() - u)), setTimeout(function () {
                u = Date.now(), h[b.type](v, function (e, t) {
                  s(e, t, l);
                }, function (e) {
                  m(e);
                });
              });
            } else m(z("xkKd::音频buffers被释放"));
          } else m(z("xGuI::未加载{1}编码器，请尝试到{2}的src/engine内找到{1}的编码器并加载", 0, b.type, R));
        } else m(z("Ltz3::未采集到录音"));
      }
    };
    var P = function (e, t) {
        t.pos || (t.pos = [0], t.tracks = {}, t.bytes = []);
        var a = t.tracks,
          n = [t.pos[0]],
          s = function () {
            t.pos[0] = n[0];
          },
          r = t.bytes.length,
          i = new Uint8Array(r + e.length);
        if (i.set(t.bytes), i.set(e, r), t.bytes = i, !t._ht) {
          if (j(i, n), X(i, n), !H(j(i, n), [24, 83, 128, 103])) return;
          for (j(i, n); n[0] < i.length;) {
            var o = j(i, n),
              _ = X(i, n),
              l = [0],
              f = 0;
            if (!_) return;
            if (H(o, [22, 84, 174, 107])) {
              for (; l[0] < _.length;) {
                var c = j(_, l),
                  u = X(_, l),
                  h = [0],
                  b = {
                    channels: 0,
                    sampleRate: 0
                  };
                if (H(c, [174])) for (; h[0] < u.length;) {
                  var p = j(u, h),
                    m = X(u, h),
                    v = [0];
                  if (H(p, [215])) {
                    var d = F(m);
                    b.number = d, a[d] = b;
                  } else if (H(p, [131])) {
                    var d = F(m);
                    1 == d ? b.type = "video" : 2 == d ? (b.type = "audio", f || (t.track0 = b), b.idx = f++) : b.type = "Type-" + d;
                  } else if (H(p, [134])) {
                    for (var g = "", w = 0; w < m.length; w++) g += String.fromCharCode(m[w]);
                    b.codec = g;
                  } else if (H(p, [225])) for (; v[0] < m.length;) {
                    var S = j(m, v),
                      M = X(m, v);
                    if (H(S, [181])) {
                      var d = 0,
                        y = new Uint8Array(M.reverse()).buffer;
                      4 == M.length ? d = new Float32Array(y)[0] : 8 == M.length ? d = new Float64Array(y)[0] : O("WebM Track !Float", 1, M), b[D] = Math.round(d);
                    } else H(S, [98, 100]) ? b.bitDepth = F(M) : H(S, [159]) && (b.channels = F(M));
                  }
                }
              }
              t._ht = 1, O("WebM Tracks", a), s();
              break;
            }
          }
        }
        var A = t.track0;
        if (A) {
          if (16 == A.bitDepth && /FLOAT/i.test(A.codec) && (A.bitDepth = 32, O("WebM 16->32 bit", 3)), A[D] != t[D] || 32 != A.bitDepth || A.channels < 1 || !/(\b|_)PCM\b/i.test(A.codec)) return t.bytes = [], t.bad || O("WebM Track Unexpected", 3, t), -(t.bad = 1);
          for (var k = [], R = 0; n[0] < i.length;) {
            var c = j(i, n),
              u = X(i, n);
            if (!u) break;
            if (H(c, [163])) {
              var x = 15 & u[0],
                b = a[x];
              if (b) {
                if (0 === b.idx) {
                  for (var B = new Uint8Array(u.length - 4), w = 4; w < u.length; w++) B[w - 4] = u[w];
                  k.push(B), R += B.length;
                }
              } else O("WebM !Track" + x, 1, a);
            }
            s();
          }
          if (R) {
            var T = new Uint8Array(i.length - t.pos[0]);
            T.set(i.subarray(t.pos[0])), t.bytes = T, t.pos[0] = 0;
            for (var B = new Uint8Array(R), w = 0, E = 0; w < k.length; w++) B.set(k[w], E), E += k[w].length;
            var y = new Float32Array(B.buffer);
            if (1 < A.channels) {
              for (var C = [], w = 0; w < y.length;) C.push(y[w]), w += A.channels;
              y = new Float32Array(C);
            }
            return y;
          }
        }
      },
      H = function (e, t) {
        if (!e || e.length != t.length) return !1;
        if (1 == e.length) return e[0] == t[0];
        for (var a = 0; a < e.length; a++) if (e[a] != t[a]) return !1;
        return !0;
      },
      F = function (e) {
        for (var t = "", a = 0; a < e.length; a++) {
          var n = e[a];
          t += (n < 16 ? "0" : "") + n.toString(16);
        }
        return parseInt(t, 16) || 0;
      },
      j = function (e, t, a) {
        var n = t[0];
        if (!(n >= e.length)) {
          var s = e[n],
            r = ("0000000" + s.toString(2)).substr(-8),
            i = /^(0*1)(\d*)$/.exec(r);
          if (i) {
            var o = i[1].length,
              _ = [];
            if (!(n + o > e.length)) {
              for (var l = 0; l < o; l++) _[l] = e[n], n++;
              return a && (_[0] = parseInt(i[2] || "0", 2)), t[0] = n, _;
            }
          }
        }
      },
      X = function (e, t) {
        var a = j(e, t, 1);
        if (a) {
          var n = F(a),
            s = t[0],
            r = [];
          if (n < 2147483647) {
            if (s + n > e.length) return;
            for (var i = 0; i < n; i++) r[i] = e[s], s++;
          }
          return t[0] = s, r;
        }
      },
      Y = N.i18n = {
        lang: "zh-CN",
        alias: {
          "zh-CN": "zh",
          "en-US": "en"
        },
        locales: {},
        data: {},
        put: function (e, t) {
          var a = R + ".i18n.put: ",
            n = e.overwrite;
          n = null == n || n;
          var s = e.lang;
          if (!(s = Y.alias[s] || s)) throw new Error(a + "set.lang?");
          var r = Y.locales[s];
          r || (r = {}, Y.locales[s] = r);
          for (var i, o = /^([\w\-]+):/, _ = 0; _ < t.length; _++) {
            var l = t[_];
            if (i = o.exec(l)) {
              var f = i[1],
                l = l.substr(f.length + 1);
              !n && r[f] || (r[f] = l);
            } else O(a + "'key:'? " + l, 3, e);
          }
        },
        get: function () {
          return Y.v_G.apply(null, arguments);
        },
        v_G: function (n, s, e) {
          s = s || [], e = e || Y.lang, e = Y.alias[e] || e;
          var t = Y.locales[e],
            r = t && t[n] || "";
          return r || "zh" == e ? (Y.lastLang = e, "=Empty" == r ? "" : r.replace(/\{(\d+)(\!?)\}/g, function (e, t, a) {
            return e = s[(t = +t || 0) - 1], (t < 1 || t > s.length) && (e = "{?}", O("i18n[" + n + "] no {" + t + "}: " + r, 3)), a ? "" : e;
          })) : "en" == e ? Y.v_G(n, s, "zh") : Y.v_G(n, s, "en");
        },
        $T: function () {
          return Y.v_T.apply(null, arguments);
        },
        v_T: function () {
          for (var e, t = arguments, a = "", n = [], s = 0, r = R + ".i18n.$T:", i = /^([\w\-]*):/, o = 0; o < t.length; o++) {
            var _ = t[o];
            if (0 == o) {
              if (e = i.exec(_), !(a = e && e[1])) throw new Error(r + "0 'key:'?");
              _ = _.substr(a.length + 1);
            }
            if (-1 === s) n.push(_);else {
              if (s) throw new Error(r + " bad args");
              if (0 === _) s = -1;else if (f(_)) {
                if (_ < 1) throw new Error(r + " bad args");
                s = _;
              } else {
                var l = 1 == o ? "en" : o ? "" : "zh";
                if ((e = i.exec(_)) && (l = e[1] || l, _ = _.substr(e[1].length + 1)), !e || !l) throw new Error(r + o + " 'lang:'?");
                Y.put({
                  lang: l,
                  overwrite: !1
                }, [a + ":" + _]);
              }
            }
          }
          return a ? 0 < s ? a : Y.v_G(a, n) : "";
        }
      },
      z = Y.$T;
    z.G = Y.get, z("NonBrowser-1::非浏览器环境，不支持{1}", 1), z("IllegalArgs-1::参数错误：{1}", 1), z("NeedImport-2::调用{1}需要先导入{2}", 2), z("NotSupport-1::不支持：{1}", 1), N.TrafficImgUrl = "//ia.51.la/go1?id=20469973&pvFlag=1";
    var u = N.Traffic = function (e) {
      if (w) {
        e = e ? "/" + R + "/Report/" + e : "";
        var t = N.TrafficImgUrl;
        if (t) {
          var a = N.Traffic,
            n = /^(https?:..[^\/#]*\/?)[^#]*/i.exec(location.href) || [],
            s = n[1] || "http://file/",
            r = (n[0] || s) + e;
          if (0 == t.indexOf("//") && (t = /^https:/i.test(r) ? "https:" + t : "http:" + t), e && (t = t + "&cu=" + encodeURIComponent(s + e)), !a[r]) {
            a[r] = 1;
            var i = new Image();
            i.src = t, O("Traffic Analysis Image: " + (e || R + ".TrafficImgUrl=" + N.TrafficImgUrl));
          }
        }
      }
    };
    t && (O(z("8HO5::覆盖导入{1}", 0, R), 1), t.Destroy());
    e[R] = N;
  }(a, t), module.exports && (module.exports = a.Recorder);
}(), function (e) {
  var t = "object" == typeof window && !!window.document,
    a = (t ? window : Object).Recorder,
    n = a.i18n;
  !function (m, e, u, t) {

    var o = "48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000",
      _ = "8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 192, 224, 256, 320";
    m.prototype.enc_mp3 = {
      stable: !0,
      takeEC: "full",
      getTestMsg: function () {
        return u("Zm7L::采样率范围：{1}；比特率范围：{2}（不同比特率支持的采样率范围不同，小于32kbps时采样率需小于32000）", 0, o, _);
      }
    };
    var h,
      v = function (e) {
        var t = e.bitRate,
          a = e.sampleRate,
          n = a;
        if (-1 == (" " + _ + ",").indexOf(" " + t + ",") && m.CLog(u("eGB9::{1}不在mp3支持的取值范围：{2}", 0, "bitRate=" + t, _), 3), -1 == (" " + o + ",").indexOf(" " + a + ",")) {
          for (var s = o.split(", "), r = [], i = 0; i < s.length; i++) r.push({
            v: +s[i],
            s: Math.abs(s[i] - a)
          });
          r.sort(function (e, t) {
            return e.s - t.s;
          }), n = r[0].v, e.sampleRate = n, m.CLog(u("zLTa::sampleRate已更新为{1}，因为{2}不在mp3支持的取值范围：{3}", 0, n, a, o), 3);
        }
      },
      n = function () {
        return u.G("NeedImport-2", ["mp3.js", "src/engine/mp3-engine.js"]);
      },
      d = t && "function" == typeof Worker;
    m.prototype.mp3 = function (r, i, o) {
      var e = this,
        _ = e.set,
        l = r.length;
      if (m.lamejs) {
        if (d) {
          var t = e.mp3_start(_);
          if (t) {
            if (t.isW) return e.mp3_encode(t, r), void e.mp3_complete(t, i, o, 1);
            e.mp3_stop(t);
          }
        }
        v(_);
        var f = new m.lamejs.Mp3Encoder(1, _.sampleRate, _.bitRate),
          c = new Int8Array(5e5),
          u = 0,
          h = 0,
          b = 0,
          p = function () {
            try {
              if (h < l) var e = f.encodeBuffer(r.subarray(h, h + 57600));else {
                b = 1;
                var e = f.flush();
              }
            } catch (e) {
              if (console.error(e), !b) try {
                f.flush();
              } catch (e) {
                console.error(e);
              }
              return void o("MP3 Encoder: " + e.message);
            }
            var t = e.length;
            if (0 < t) {
              if (u + t > c.length) {
                var a = new Int8Array(c.length + Math.max(5e5, t));
                a.set(c.subarray(0, u)), c = a;
              }
              c.set(e, u), u += t;
            }
            if (h < l) h += 57600, setTimeout(p);else {
              var n = [c.buffer.slice(0, u)],
                s = g.fn(n, u, l, _.sampleRate);
              w(s, _), i(n[0] || new ArrayBuffer(0), "audio/mp3");
            }
          };
        p();
      } else o(n());
    }, m.BindDestroy("mp3Worker", function () {
      h && (m.CLog("mp3Worker Destroy"), h.terminate(), h = null);
    }), m.prototype.mp3_envCheck = function (e, t) {
      var a = "";
      return t.takeoffEncodeChunk && (p() || (a = u("yhUs::当前浏览器版本太低，无法实时处理"))), a || m.lamejs || (a = n()), a;
    }, m.prototype.mp3_start = function (e) {
      return p(e);
    };
    var b = {
        id: 0
      },
      p = function (t, e) {
        var f,
          a = function (e) {
            var t = e.data,
              a = f.wkScope.wk_ctxs,
              n = f.wkScope.wk_lame,
              s = f.wkScope.wk_mp3TrimFix,
              r = a[t.id];
            if ("init" == t.action) a[t.id] = {
              sampleRate: t.sampleRate,
              bitRate: t.bitRate,
              takeoff: t.takeoff,
              pcmSize: 0,
              memory: new Int8Array(5e5),
              mOffset: 0,
              encObj: new n.Mp3Encoder(1, t.sampleRate, t.bitRate)
            };else if (!r) return;
            var i = function (e) {
              var t = e.length;
              if (r.mOffset + t > r.memory.length) {
                var a = new Int8Array(r.memory.length + Math.max(5e5, t));
                a.set(r.memory.subarray(0, r.mOffset)), r.memory = a;
              }
              r.memory.set(e, r.mOffset), r.mOffset += t;
            };
            switch (t.action) {
              case "stop":
                if (!r.isCp) try {
                  r.encObj.flush();
                } catch (e) {
                  console.error(e);
                }
                r.encObj = null, delete a[t.id];
                break;
              case "encode":
                if (r.isCp) break;
                r.pcmSize += t.pcm.length;
                try {
                  var o = r.encObj.encodeBuffer(t.pcm);
                } catch (e) {
                  r.err = e, console.error(e);
                }
                o && 0 < o.length && (r.takeoff ? c.onmessage({
                  action: "takeoff",
                  id: t.id,
                  chunk: o
                }) : i(o));
                break;
              case "complete":
                r.isCp = 1;
                try {
                  var o = r.encObj.flush();
                } catch (e) {
                  r.err = e, console.error(e);
                }
                if (o && 0 < o.length && (r.takeoff ? c.onmessage({
                  action: "takeoff",
                  id: t.id,
                  chunk: o
                }) : i(o)), r.err) {
                  c.onmessage({
                    action: t.action,
                    id: t.id,
                    err: "MP3 Encoder: " + r.err.message
                  });
                  break;
                }
                var _ = [r.memory.buffer.slice(0, r.mOffset)],
                  l = s.fn(_, r.mOffset, r.pcmSize, r.sampleRate);
                c.onmessage({
                  action: t.action,
                  id: t.id,
                  blob: _[0] || new ArrayBuffer(0),
                  meta: l
                });
            }
          },
          n = function (n) {
            c.onmessage = function (e) {
              var t = e;
              n && (t = e.data);
              var a = b[t.id];
              a && ("takeoff" == t.action ? a.set.takeoffEncodeChunk(new Uint8Array(t.chunk.buffer)) : (a.call && a.call(t), a.call = null));
            };
          },
          s = function () {
            var e = {
              worker: c,
              set: t
            };
            return t ? (e.id = ++b.id, b[e.id] = e, v(t), c.postMessage({
              action: "init",
              id: e.id,
              sampleRate: t.sampleRate,
              bitRate: t.bitRate,
              takeoff: !!t.takeoffEncodeChunk,
              x: new Int16Array(5)
            })) : c.postMessage({
              x: new Int16Array(5)
            }), e;
          },
          c = h;
        if (e || !d) return m.CLog(u("k9PT::当前环境不支持Web Worker，mp3实时编码器运行在主线程中"), 3), c = {
          postMessage: function (e) {
            a({
              data: e
            });
          }
        }, f = {
          wkScope: {
            wk_ctxs: {},
            wk_lame: m.lamejs,
            wk_mp3TrimFix: g
          }
        }, n(), s();
        try {
          if (!c) {
            var r = (a + "").replace(/[\w\$]+\.onmessage/g, "self.postMessage"),
              i = ");wk_lame();self.onmessage=" + (r = r.replace(/[\w\$]+\.wkScope/g, "wkScope"));
            i += ";var wkScope={ wk_ctxs:{},wk_lame:wk_lame", i += ",wk_mp3TrimFix:{rm:" + g.rm + ",fn:" + g.fn + "} }";
            var o = m.lamejs.toString(),
              _ = (window.URL || webkitURL).createObjectURL(new Blob(["var wk_lame=(", o, i], {
                type: "text/javascript"
              }));
            c = new Worker(_), setTimeout(function () {
              (window.URL || webkitURL).revokeObjectURL(_);
            }, 1e4), n(1);
          }
          var l = s();
          return l.isW = 1, h = c, l;
        } catch (e) {
          return c && c.terminate(), console.error(e), p(t, 1);
        }
      };
    m.prototype.mp3_stop = function (e) {
      if (e && e.worker) {
        e.worker.postMessage({
          action: "stop",
          id: e.id
        }), e.worker = null, delete b[e.id];
        var t = -1;
        for (var a in b) t++;
        t && m.CLog(u("fT6M::mp3 worker剩{1}个未stop", 0, t), 3);
      }
    }, m.prototype.mp3_encode = function (e, t) {
      e && e.worker && e.worker.postMessage({
        action: "encode",
        id: e.id,
        pcm: t
      });
    }, m.prototype.mp3_complete = function (t, a, n, s) {
      var r = this;
      t && t.worker ? (t.call = function (e) {
        s && r.mp3_stop(t), e.err ? n(e.err) : (w(e.meta, t.set), a(e.blob, "audio/mp3"));
      }, t.worker.postMessage({
        action: "complete",
        id: t.id
      })) : n(u("mPxH::mp3编码器未start"));
    }, m.mp3ReadMeta = function (e, t) {
      var a = "undefined" != typeof window && window.parseInt || "undefined" != typeof self && self.parseInt || parseInt,
        n = new Uint8Array(e[0] || []);
      if (n.length < 4) return null;
      var s = function (e, t) {
          return ("0000000" + ((t || n)[e] || 0).toString(2)).substr(-8);
        },
        r = s(0) + s(1),
        i = s(2) + s(3);
      if (!/^1{11}/.test(r)) return null;
      var o = {
          "00": 2.5,
          10: 2,
          11: 1
        }[r.substr(11, 2)],
        _ = {
          "01": 3
        }[r.substr(13, 2)],
        l = {
          1: [44100, 48e3, 32e3],
          2: [22050, 24e3, 16e3],
          2.5: [11025, 12e3, 8e3]
        }[o];
      l && (l = l[a(i.substr(4, 2), 2)]);
      var f = [[0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160], [0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320]][1 == o ? 1 : 0][a(i.substr(0, 4), 2)];
      if (!(o && _ && f && l)) return null;
      for (var c = Math.round(8 * t / f), u = 1 == _ ? 384 : 2 == _ ? 1152 : 1 == o ? 1152 : 576, h = u / l * 1e3, b = Math.floor(u * f / 8 / l * 1e3), p = 0, m = 0, v = 0; v < e.length; v++) {
        var d = e[v];
        if (m += d.byteLength, b + 3 <= m) {
          var g = new Uint8Array(d),
            w = d.byteLength - (m - (b + 3) + 1),
            S = s(w, g);
          p = "1" == S.charAt(6);
          break;
        }
      }
      return p && b++, {
        version: o,
        layer: _,
        sampleRate: l,
        bitRate: f,
        duration: c,
        size: t,
        hasPadding: p,
        frameSize: b,
        frameDurationFloat: h
      };
    };
    var g = {
        rm: m.mp3ReadMeta,
        fn: function (e, t, a, n) {
          var s = this.rm(e, t);
          if (!s) return {
            err: "mp3 unknown format"
          };
          var r = Math.round(a / n * 1e3),
            i = Math.floor((s.duration - r) / s.frameDurationFloat);
          if (0 < i) {
            var o = i * s.frameSize - (s.hasPadding ? 1 : 0);
            t -= o;
            for (var _ = 0, l = [], f = 0; f < e.length; f++) {
              var c = e[f];
              if (o <= 0) break;
              o >= c.byteLength ? (o -= c.byteLength, l.push(c), e.splice(f, 1), f--) : (e[f] = c.slice(o), _ = c, o = 0);
            }
            var u = this.rm(e, t);
            if (!u) {
              _ && (e[0] = _);
              for (var f = 0; f < l.length; f++) e.splice(f, 0, l[f]);
              s.err = "mp3 fix error: 已还原，错误原因不明";
            }
            var h = s.trimFix = {};
            h.remove = i, h.removeDuration = Math.round(i * s.frameDurationFloat), h.duration = Math.round(8 * t / s.bitRate);
          }
          return s;
        }
      },
      w = function (e, t) {
        var a = "MP3 Info: ";
        (e.sampleRate && e.sampleRate != t.sampleRate || e.bitRate && e.bitRate != t.bitRate) && (m.CLog(a + u("uY9i::和设置的不匹配{1}，已更新成{2}", 0, "set:" + t.bitRate + "kbps " + t.sampleRate + "hz", "set:" + e.bitRate + "kbps " + e.sampleRate + "hz"), 3, t), t.sampleRate = e.sampleRate, t.bitRate = e.bitRate);
        var n = e.trimFix;
        n ? (a += u("iMSm::Fix移除{1}帧", 0, n.remove) + " " + n.removeDuration + "ms -> " + n.duration + "ms", 2 < n.remove && (e.err = (e.err ? e.err + ", " : "") + u("b9zm::移除帧数过多"))) : a += (e.duration || "-") + "ms", e.err ? m.CLog(a, 1, e.err, e) : m.CLog(a, e);
      };
  }(a, 0, n.$T, t);
}(), function (e) {

  function t() {
    var d = function (e) {
        return Math.log(e) / Math.log(10);
      },
      me = function (e) {
        throw new Error("abort(" + e + ")");
      };
    function S(e) {
      return new Int8Array(e);
    }
    function s(e) {
      return new Int16Array(e);
    }
    function ve(e) {
      return new Int32Array(e);
    }
    function de(e) {
      return new Float32Array(e);
    }
    function n(e) {
      return new Float64Array(e);
    }
    function ge(e) {
      if (1 == e.length) return de(e[0]);
      var t = e[0];
      e = e.slice(1);
      for (var a = [], n = 0; n < t; n++) a.push(ge(e));
      return a;
    }
    function w(e) {
      if (1 == e.length) return ve(e[0]);
      var t = e[0];
      e = e.slice(1);
      for (var a = [], n = 0; n < t; n++) a.push(w(e));
      return a;
    }
    function M(e) {
      if (1 == e.length) return s(e[0]);
      var t = e[0];
      e = e.slice(1);
      for (var a = [], n = 0; n < t; n++) a.push(M(e));
      return a;
    }
    function E(e) {
      if (1 == e.length) return new Array(e[0]);
      var t = e[0];
      e = e.slice(1);
      for (var a = [], n = 0; n < t; n++) a.push(E(e));
      return a;
    }
    var we = {
        fill: function (e, t, a, n) {
          if (2 == arguments.length) for (var s = 0; s < e.length; s++) e[s] = t;else for (var s = t; s < a; s++) e[s] = n;
        }
      },
      I = {
        arraycopy: function (e, t, a, n, s) {
          for (var r = t + s; t < r;) a[n++] = e[t++];
        }
      },
      V = {};
    function Se(e) {
      this.ordinal = e;
    }
    V.SQRT2 = 1.4142135623730951, V.FAST_LOG10 = function (e) {
      return d(e);
    }, V.FAST_LOG10_X = function (e, t) {
      return d(e) * t;
    }, Se.short_block_allowed = new Se(0), Se.short_block_coupled = new Se(1), Se.short_block_dispensed = new Se(2), Se.short_block_forced = new Se(3);
    var D = {};
    function Me(e) {
      this.ordinal = e;
    }
    function ye(e) {
      var t = e;
      this.ordinal = function () {
        return t;
      };
    }
    function A() {
      var S = null;
      function v(e) {
        this.bits = 0 | e;
      }
      this.qupvt = null, this.setModules = function (e) {
        this.qupvt = e, S = e;
      };
      var s = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 1], [1, 1], [1, 1], [1, 2], [2, 2], [2, 3], [2, 3], [3, 4], [3, 4], [3, 4], [4, 5], [4, 5], [4, 6], [5, 6], [5, 6], [5, 7], [6, 7], [6, 7]];
      function M(e, t, a, n, s, r) {
        var i = .5946 / t;
        for (e >>= 1; 0 != e--;) s[r++] = i > a[n++] ? 0 : 1, s[r++] = i > a[n++] ? 0 : 1;
      }
      function y(e, t, a, n, s, r) {
        var i = (e >>= 1) % 2;
        for (e >>= 1; 0 != e--;) {
          var o, _, l, f, c, u, h, b;
          o = a[n++] * t, _ = a[n++] * t, c = 0 | o, l = a[n++] * t, u = 0 | _, f = a[n++] * t, h = 0 | l, o += S.adj43[c], b = 0 | f, _ += S.adj43[u], s[r++] = 0 | o, l += S.adj43[h], s[r++] = 0 | _, f += S.adj43[b], s[r++] = 0 | l, s[r++] = 0 | f;
        }
        0 != i && (o = a[n++] * t, _ = a[n++] * t, c = 0 | o, u = 0 | _, o += S.adj43[c], _ += S.adj43[u], s[r++] = 0 | o, s[r++] = 0 | _);
      }
      var o = [1, 2, 5, 7, 7, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13];
      function d(e, t, a, n) {
        var s = function (e, t, a) {
          var n = 0,
            s = 0;
          do {
            var r = e[t++],
              i = e[t++];
            n < r && (n = r), s < i && (s = i);
          } while (t < a);
          return n < s && (n = s), n;
        }(e, t, a);
        switch (s) {
          case 0:
            return s;
          case 1:
            return function (e, t, a, n) {
              var s = 0,
                r = k.ht[1].hlen;
              do {
                var i = 2 * e[t + 0] + e[t + 1];
                t += 2, s += r[i];
              } while (t < a);
              return n.bits += s, 1;
            }(e, t, a, n);
          case 2:
          case 3:
            return function (e, t, a, n, s) {
              var r,
                i,
                o = 0,
                _ = k.ht[n].xlen;
              i = 2 == n ? k.table23 : k.table56;
              do {
                var l = e[t + 0] * _ + e[t + 1];
                t += 2, o += i[l];
              } while (t < a);
              return (r = 65535 & o) < (o >>= 16) && (o = r, n++), s.bits += o, n;
            }(e, t, a, o[s - 1], n);
          case 4:
          case 5:
          case 6:
          case 7:
          case 8:
          case 9:
          case 10:
          case 11:
          case 12:
          case 13:
          case 14:
          case 15:
            return function (e, t, a, n, s) {
              var r = 0,
                i = 0,
                o = 0,
                _ = k.ht[n].xlen,
                l = k.ht[n].hlen,
                f = k.ht[n + 1].hlen,
                c = k.ht[n + 2].hlen;
              do {
                var u = e[t + 0] * _ + e[t + 1];
                t += 2, r += l[u], i += f[u], o += c[u];
              } while (t < a);
              var h = n;
              return i < r && (r = i, h++), o < r && (r = o, h = n + 2), s.bits += r, h;
            }(e, t, a, o[s - 1], n);
          default:
            var r, i;
            for (T.IXMAX_VAL < s && me(), s -= 15, r = 24; r < 32 && !(k.ht[r].linmax >= s); r++);
            for (i = r - 8; i < 24 && !(k.ht[i].linmax >= s); i++);
            return function (e, t, a, n, s, r) {
              var i,
                o = 65536 * k.ht[n].xlen + k.ht[s].xlen,
                _ = 0;
              do {
                var l = e[t++],
                  f = e[t++];
                0 != l && (14 < l && (l = 15, _ += o), l *= 16), 0 != f && (14 < f && (f = 15, _ += o), l += f), _ += k.largetbl[l];
              } while (t < a);
              return (i = 65535 & _) < (_ >>= 16) && (_ = i, n = s), r.bits += _, n;
            }(e, t, a, i, r, n);
        }
      }
      function h(e, t, a, n, s, r, i, o) {
        for (var _ = t.big_values, l = 2; l < Ae.SBMAX_l + 1; l++) {
          var f = e.scalefac_band.l[l];
          if (_ <= f) break;
          var c = s[l - 2] + t.count1bits;
          if (a.part2_3_length <= c) break;
          var u = new v(c),
            h = d(n, f, _, u);
          c = u.bits, a.part2_3_length <= c || (a.assign(t), a.part2_3_length = c, a.region0_count = r[l - 2], a.region1_count = l - 2 - r[l - 2], a.table_select[0] = i[l - 2], a.table_select[1] = o[l - 2], a.table_select[2] = h);
        }
      }
      this.noquant_count_bits = function (e, t, a) {
        var n = t.l3_enc,
          s = Math.min(576, t.max_nonzero_coeff + 2 >> 1 << 1);
        for (null != a && (a.sfb_count1 = 0); 1 < s && 0 == (n[s - 1] | n[s - 2]); s -= 2);
        t.count1 = s;
        for (var r = 0, i = 0; 3 < s; s -= 4) {
          var o;
          if (1 < (2147483647 & (n[s - 1] | n[s - 2] | n[s - 3] | n[s - 4]))) break;
          o = 2 * (2 * (2 * n[s - 4] + n[s - 3]) + n[s - 2]) + n[s - 1], r += k.t32l[o], i += k.t33l[o];
        }
        var _ = r;
        if (t.count1table_select = 0, i < r && (_ = i, t.count1table_select = 1), t.count1bits = _, 0 == (t.big_values = s)) return _;
        if (t.block_type == Ae.SHORT_TYPE) (r = 3 * e.scalefac_band.s[3]) > t.big_values && (r = t.big_values), i = t.big_values;else if (t.block_type == Ae.NORM_TYPE) {
          if (r = t.region0_count = e.bv_scf[s - 2], i = t.region1_count = e.bv_scf[s - 1], i = e.scalefac_band.l[r + i + 2], r = e.scalefac_band.l[r + 1], i < s) {
            var l = new v(_);
            t.table_select[2] = d(n, i, s, l), _ = l.bits;
          }
        } else t.region0_count = 7, t.region1_count = Ae.SBMAX_l - 1 - 7 - 1, r = e.scalefac_band.l[8], (i = s) < r && (r = i);
        if (r = Math.min(r, s), i = Math.min(i, s), 0 < r) {
          var l = new v(_);
          t.table_select[0] = d(n, 0, r, l), _ = l.bits;
        }
        if (r < i) {
          var l = new v(_);
          t.table_select[1] = d(n, r, i, l), _ = l.bits;
        }
        if (2 == e.use_best_huffman && me(), null != a && t.block_type == Ae.NORM_TYPE) {
          for (var f = 0; e.scalefac_band.l[f] < t.big_values;) f++;
          a.sfb_count1 = f;
        }
        return _;
      }, this.count_bits = function (e, t, a, n) {
        var s = a.l3_enc,
          r = T.IXMAX_VAL / S.IPOW20(a.global_gain);
        return a.xrpow_max > r ? T.LARGE_BITS : (function (e, t, a, n, s) {
          var r,
            i,
            o,
            _ = 0,
            l = 0,
            f = 0,
            c = 0,
            u = t,
            h = 0,
            b = u,
            p = 0,
            m = e,
            v = 0;
          for (o = null != s && n.global_gain == s.global_gain, i = n.block_type == Ae.SHORT_TYPE ? 38 : 21, r = 0; r <= i; r++) {
            var d = -1;
            if ((o || n.block_type == Ae.NORM_TYPE) && (d = n.global_gain - (n.scalefac[r] + (0 != n.preflag ? S.pretab[r] : 0) << n.scalefac_scale + 1) - 8 * n.subblock_gain[n.window[r]]), o && s.step[r] == d) 0 != l && (y(l, a, m, v, b, p), l = 0), 0 != f && me();else {
              var g,
                w = n.width[r];
              if (_ + n.width[r] > n.max_nonzero_coeff && (g = n.max_nonzero_coeff - _ + 1, we.fill(t, n.max_nonzero_coeff, 576, 0), (w = g) < 0 && (w = 0), r = i + 1), 0 == l && 0 == f && (b = u, p = h, m = e, v = c), null != s && 0 < s.sfb_count1 && r >= s.sfb_count1 && 0 < s.step[r] && d >= s.step[r] ? (0 != l && (y(l, a, m, v, b, p), l = 0, b = u, p = h, m = e, v = c), f += w) : (0 != f && (M(f, a, m, v, b, p), f = 0, b = u, p = h, m = e, v = c), l += w), w <= 0) {
                0 != f && me(), 0 != l && me();
                break;
              }
            }
            r <= i && (h += n.width[r], c += n.width[r], _ += n.width[r]);
          }
          0 != l && (y(l, a, m, v, b, p), l = 0), 0 != f && me();
        }(t, s, S.IPOW20(a.global_gain), a, n), 0 != (2 & e.substep_shaping) && me(), this.noquant_count_bits(e, a, n));
      }, this.best_huffman_divide = function (e, t) {
        var a = new B(),
          n = t.l3_enc,
          s = ve(23),
          r = ve(23),
          i = ve(23),
          o = ve(23);
        if (t.block_type != Ae.SHORT_TYPE || 1 != e.mode_gr) {
          a.assign(t), t.block_type == Ae.NORM_TYPE && (function (e, t, a, n, s, r, i) {
            for (var o = t.big_values, _ = 0; _ <= 22; _++) n[_] = T.LARGE_BITS;
            for (var _ = 0; _ < 16; _++) {
              var l = e.scalefac_band.l[_ + 1];
              if (o <= l) break;
              var f = 0,
                c = new v(f),
                u = d(a, 0, l, c);
              f = c.bits;
              for (var h = 0; h < 8; h++) {
                var b = e.scalefac_band.l[_ + h + 2];
                if (o <= b) break;
                var p = f;
                c = new v(p);
                var m = d(a, l, b, c);
                p = c.bits, n[_ + h] > p && (n[_ + h] = p, s[_ + h] = _, r[_ + h] = u, i[_ + h] = m);
              }
            }
          }(e, t, n, s, r, i, o), h(e, a, t, n, s, r, i, o));
          var _ = a.big_values;
          if (!(0 == _ || 1 < (n[_ - 2] | n[_ - 1]) || 576 < (_ = t.count1 + 2))) {
            a.assign(t), a.count1 = _;
            for (var l = 0, f = 0; _ > a.big_values; _ -= 4) {
              var c = 2 * (2 * (2 * n[_ - 4] + n[_ - 3]) + n[_ - 2]) + n[_ - 1];
              l += k.t32l[c], f += k.t33l[c];
            }
            if (a.big_values = _, a.count1table_select = 0, f < l && (l = f, a.count1table_select = 1), a.count1bits = l, a.block_type == Ae.NORM_TYPE) h(e, a, t, n, s, r, i, o);else {
              if (a.part2_3_length = l, l = e.scalefac_band.l[8], _ < l && (l = _), 0 < l) {
                var u = new v(a.part2_3_length);
                a.table_select[0] = d(n, 0, l, u), a.part2_3_length = u.bits;
              }
              if (l < _) {
                var u = new v(a.part2_3_length);
                a.table_select[1] = d(n, l, _, u), a.part2_3_length = u.bits;
              }
              t.part2_3_length > a.part2_3_length && t.assign(a);
            }
          }
        }
      };
      var u = [1, 1, 1, 1, 8, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16],
        b = [1, 2, 4, 8, 1, 2, 4, 8, 2, 4, 8, 2, 4, 8, 4, 8],
        p = [0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4],
        m = [0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3];
      A.slen1_tab = p, A.slen2_tab = m, this.best_scalefac_store = function (e, t, a, n) {
        var s,
          r,
          i,
          o,
          _ = n.tt[t][a],
          l = 0;
        for (s = i = 0; s < _.sfbmax; s++) {
          var f = _.width[s];
          for (i += f, o = -f; o < 0 && 0 == _.l3_enc[o + i]; o++);
          0 == o && (_.scalefac[s] = l = -2);
        }
        if (0 == _.scalefac_scale && 0 == _.preflag) {
          var c = 0;
          for (s = 0; s < _.sfbmax; s++) 0 < _.scalefac[s] && (c |= _.scalefac[s]);
          if (0 == (1 & c) && 0 != c) {
            for (s = 0; s < _.sfbmax; s++) 0 < _.scalefac[s] && (_.scalefac[s] >>= 1);
            _.scalefac_scale = l = 1;
          }
        }
        if (0 == _.preflag && _.block_type != Ae.SHORT_TYPE && 2 == e.mode_gr) {
          for (s = 11; s < Ae.SBPSY_l && !(_.scalefac[s] < S.pretab[s] && -2 != _.scalefac[s]); s++);
          if (s == Ae.SBPSY_l) {
            for (s = 11; s < Ae.SBPSY_l; s++) 0 < _.scalefac[s] && (_.scalefac[s] -= S.pretab[s]);
            _.preflag = l = 1;
          }
        }
        for (r = 0; r < 4; r++) n.scfsi[a][r] = 0;
        for (2 == e.mode_gr && 1 == t && n.tt[0][a].block_type != Ae.SHORT_TYPE && n.tt[1][a].block_type != Ae.SHORT_TYPE && (function (e, t) {
          for (var a, n = t.tt[1][e], s = t.tt[0][e], r = 0; r < k.scfsi_band.length - 1; r++) {
            for (a = k.scfsi_band[r]; a < k.scfsi_band[r + 1] && !(s.scalefac[a] != n.scalefac[a] && 0 <= n.scalefac[a]); a++);
            if (a == k.scfsi_band[r + 1]) {
              for (a = k.scfsi_band[r]; a < k.scfsi_band[r + 1]; a++) n.scalefac[a] = -1;
              t.scfsi[e][r] = 1;
            }
          }
          var i = 0,
            o = 0;
          for (a = 0; a < 11; a++) -1 != n.scalefac[a] && (o++, i < n.scalefac[a] && (i = n.scalefac[a]));
          for (var _ = 0, l = 0; a < Ae.SBPSY_l; a++) -1 != n.scalefac[a] && (l++, _ < n.scalefac[a] && (_ = n.scalefac[a]));
          for (var r = 0; r < 16; r++) if (i < u[r] && _ < b[r]) {
            var f = p[r] * o + m[r] * l;
            n.part2_length > f && (n.part2_length = f, n.scalefac_compress = r);
          }
        }(a, n), l = 0), s = 0; s < _.sfbmax; s++) -2 == _.scalefac[s] && (_.scalefac[s] = 0);
        0 != l && (2 == e.mode_gr ? this.scale_bitcount(_) : this.scale_bitcount_lsf(e, _));
      };
      var _ = [0, 18, 36, 54, 54, 36, 54, 72, 54, 72, 90, 72, 90, 108, 108, 126],
        l = [0, 18, 36, 54, 51, 35, 53, 71, 52, 70, 88, 69, 87, 105, 104, 122],
        f = [0, 10, 20, 30, 33, 21, 31, 41, 32, 42, 52, 43, 53, 63, 64, 74];
      this.scale_bitcount = function (e) {
        var t,
          a,
          n,
          s = 0,
          r = 0,
          i = e.scalefac;
        if (e.block_type == Ae.SHORT_TYPE) n = _, 0 != e.mixed_block_flag && (n = l);else if (n = f, 0 == e.preflag) {
          for (a = 11; a < Ae.SBPSY_l && !(i[a] < S.pretab[a]); a++);
          if (a == Ae.SBPSY_l) for (e.preflag = 1, a = 11; a < Ae.SBPSY_l; a++) i[a] -= S.pretab[a];
        }
        for (a = 0; a < e.sfbdivide; a++) s < i[a] && (s = i[a]);
        for (; a < e.sfbmax; a++) r < i[a] && (r = i[a]);
        for (e.part2_length = T.LARGE_BITS, t = 0; t < 16; t++) s < u[t] && r < b[t] && e.part2_length > n[t] && (e.part2_length = n[t], e.scalefac_compress = t);
        return e.part2_length == T.LARGE_BITS;
      };
      var g = [[15, 15, 7, 7], [15, 15, 7, 0], [7, 3, 0, 0], [15, 31, 31, 0], [7, 7, 7, 0], [3, 3, 0, 0]];
      this.scale_bitcount_lsf = function (e, t) {
        var a,
          n,
          s,
          r,
          i,
          o,
          _,
          l,
          f = ve(4),
          c = t.scalefac;
        for (a = 0 != t.preflag ? 2 : 0, _ = 0; _ < 4; _++) f[_] = 0;
        if (t.block_type == Ae.SHORT_TYPE) {
          n = 1;
          var u = S.nr_of_sfb_block[a][n];
          for (s = l = 0; s < 4; s++) for (r = u[s] / 3, _ = 0; _ < r; _++, l++) for (i = 0; i < 3; i++) c[3 * l + i] > f[s] && (f[s] = c[3 * l + i]);
        } else {
          n = 0;
          var u = S.nr_of_sfb_block[a][n];
          for (s = l = 0; s < 4; s++) for (r = u[s], _ = 0; _ < r; _++, l++) c[l] > f[s] && (f[s] = c[l]);
        }
        for (o = !1, s = 0; s < 4; s++) f[s] > g[a][s] && (o = !0);
        if (!o) {
          var h, b, p, m;
          for (t.sfb_partition_table = S.nr_of_sfb_block[a][n], s = 0; s < 4; s++) t.slen[s] = w[f[s]];
          switch (h = t.slen[0], b = t.slen[1], p = t.slen[2], m = t.slen[3], a) {
            case 0:
              t.scalefac_compress = (5 * h + b << 4) + (p << 2) + m;
              break;
            case 1:
              t.scalefac_compress = 400 + (5 * h + b << 2) + p;
              break;
            case 2:
              t.scalefac_compress = 500 + 3 * h + b;
          }
        }
        if (!o) for (t.part2_length = 0, s = 0; s < 4; s++) t.part2_length += t.slen[s] * t.sfb_partition_table[s];
        return o;
      };
      var w = [0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4];
      this.huffman_init = function (e) {
        for (var t = 2; t <= 576; t += 2) {
          for (var a, n = 0; e.scalefac_band.l[++n] < t;);
          for (a = s[n][0]; e.scalefac_band.l[a + 1] > t;) a--;
          for (a < 0 && (a = s[n][0]), e.bv_scf[t - 2] = a, a = s[n][1]; e.scalefac_band.l[a + e.bv_scf[t - 2] + 2] > t;) a--;
          a < 0 && (a = s[n][1]), e.bv_scf[t - 1] = a;
        }
      };
    }
    function O() {}
    function y() {
      this.setModules = function (e, t, a) {};
      var o = [0, 49345, 49537, 320, 49921, 960, 640, 49729, 50689, 1728, 1920, 51009, 1280, 50625, 50305, 1088, 52225, 3264, 3456, 52545, 3840, 53185, 52865, 3648, 2560, 51905, 52097, 2880, 51457, 2496, 2176, 51265, 55297, 6336, 6528, 55617, 6912, 56257, 55937, 6720, 7680, 57025, 57217, 8e3, 56577, 7616, 7296, 56385, 5120, 54465, 54657, 5440, 55041, 6080, 5760, 54849, 53761, 4800, 4992, 54081, 4352, 53697, 53377, 4160, 61441, 12480, 12672, 61761, 13056, 62401, 62081, 12864, 13824, 63169, 63361, 14144, 62721, 13760, 13440, 62529, 15360, 64705, 64897, 15680, 65281, 16320, 16e3, 65089, 64001, 15040, 15232, 64321, 14592, 63937, 63617, 14400, 10240, 59585, 59777, 10560, 60161, 11200, 10880, 59969, 60929, 11968, 12160, 61249, 11520, 60865, 60545, 11328, 58369, 9408, 9600, 58689, 9984, 59329, 59009, 9792, 8704, 58049, 58241, 9024, 57601, 8640, 8320, 57409, 40961, 24768, 24960, 41281, 25344, 41921, 41601, 25152, 26112, 42689, 42881, 26432, 42241, 26048, 25728, 42049, 27648, 44225, 44417, 27968, 44801, 28608, 28288, 44609, 43521, 27328, 27520, 43841, 26880, 43457, 43137, 26688, 30720, 47297, 47489, 31040, 47873, 31680, 31360, 47681, 48641, 32448, 32640, 48961, 32e3, 48577, 48257, 31808, 46081, 29888, 30080, 46401, 30464, 47041, 46721, 30272, 29184, 45761, 45953, 29504, 45313, 29120, 28800, 45121, 20480, 37057, 37249, 20800, 37633, 21440, 21120, 37441, 38401, 22208, 22400, 38721, 21760, 38337, 38017, 21568, 39937, 23744, 23936, 40257, 24320, 40897, 40577, 24128, 23040, 39617, 39809, 23360, 39169, 22976, 22656, 38977, 34817, 18624, 18816, 35137, 19200, 35777, 35457, 19008, 19968, 36545, 36737, 20288, 36097, 19904, 19584, 35905, 17408, 33985, 34177, 17728, 34561, 18368, 18048, 34369, 33281, 17088, 17280, 33601, 16640, 33217, 32897, 16448];
      this.updateMusicCRC = function (e, t, a, n) {
        for (var s = 0; s < n; ++s) e[0] = (r = t[a + s], i = (i = e[0]) >> 8 ^ o[255 & (i ^ r)]);
        var r, i;
      };
    }
    function N() {
      var i = this,
        r = null,
        o = null;
      this.setModules = function (e, t, a, n) {
        r = a, o = n;
      };
      var _ = null,
        l = 0,
        f = 0,
        c = 0;
      function v(e, t, a) {
        for (; 0 < a;) {
          var n;
          0 == c && (c = 8, f++, e.header[e.w_ptr].write_timing == l && (s = e, I.arraycopy(s.header[s.w_ptr].buf, 0, _, f, s.sideinfo_len), f += s.sideinfo_len, l += 8 * s.sideinfo_len, s.w_ptr = s.w_ptr + 1 & j.MAX_HEADER_BUF - 1), _[f] = 0), n = Math.min(a, c), a -= n, c -= n, _[f] |= t >> a << c, l += n;
        }
        var s;
      }
      function u(e, t) {
        var a,
          n = e.internal_flags;
        if (8 <= t && (v(n, 76, 8), t -= 8), 8 <= t && (v(n, 65, 8), t -= 8), 8 <= t && (v(n, 77, 8), t -= 8), 8 <= t && (v(n, 69, 8), t -= 8), 32 <= t) {
          var s = r.getLameShortVersion();
          if (32 <= t) for (a = 0; a < s.length && 8 <= t; ++a) t -= 8, v(n, s.charCodeAt(a), 8);
        }
        for (; 1 <= t; t -= 1) v(n, n.ancillary_flag, 1), n.ancillary_flag ^= e.disable_reservoir ? 0 : 1;
      }
      function h(e, t, a) {
        for (var n = e.header[e.h_ptr].ptr; 0 < a;) {
          var s = Math.min(a, 8 - (7 & n));
          a -= s, e.header[e.h_ptr].buf[n >> 3] |= t >> a << 8 - (7 & n) - s, n += s;
        }
        e.header[e.h_ptr].ptr = n;
      }
      function m(e, t) {
        var a,
          n = k.ht[t.count1table_select + 32],
          s = 0,
          r = t.big_values,
          i = t.big_values;
        for (a = (t.count1 - t.big_values) / 4; 0 < a; --a) {
          var o = 0,
            _ = 0;
          0 != t.l3_enc[r + 0] && (_ += 8, t.xr[i + 0] < 0 && o++), 0 != t.l3_enc[r + 1] && (_ += 4, o *= 2, t.xr[i + 1] < 0 && o++), 0 != t.l3_enc[r + 2] && (_ += 2, o *= 2, t.xr[i + 2] < 0 && o++), 0 != t.l3_enc[r + 3] && (_++, o *= 2, t.xr[i + 3] < 0 && o++), r += 4, i += 4, v(e, o + n.table[_], n.hlen[_]), s += n.hlen[_];
        }
        return s;
      }
      function b(e, t, a, n, s) {
        var r = k.ht[t],
          i = 0;
        if (0 == t) return i;
        for (var o = a; o < n; o += 2) {
          var _ = 0,
            l = 0,
            f = r.xlen,
            c = r.xlen,
            u = 0,
            h = s.l3_enc[o],
            b = s.l3_enc[o + 1];
          if (0 != h && (s.xr[o] < 0 && u++, _--), 15 < t) {
            if (14 < h) {
              var p = h - 15;
              u |= p << 1, l = f, h = 15;
            }
            if (14 < b) {
              var m = b - 15;
              u <<= f, u |= m, l += f, b = 15;
            }
            c = 16;
          }
          0 != b && (u <<= 1, s.xr[o + 1] < 0 && u++, _--), h = h * c + b, l -= _, _ += r.hlen[h], v(e, r.table[h], _), v(e, u, l), i += _ + l;
        }
        return i;
      }
      function d(e, t) {
        var a = 3 * e.scalefac_band.s[3];
        a > t.big_values && (a = t.big_values);
        var n = b(e, t.table_select[0], 0, a, t);
        return n += b(e, t.table_select[1], a, t.big_values, t);
      }
      function g(e, t) {
        var a, n, s, r;
        a = t.big_values;
        var i = t.region0_count + 1;
        return s = e.scalefac_band.l[i], i += t.region1_count + 1, r = e.scalefac_band.l[i], a < s && (s = a), a < r && (r = a), n = b(e, t.table_select[0], 0, s, t), n += b(e, t.table_select[1], s, r, t), n += b(e, t.table_select[2], r, a, t);
      }
      function p() {
        this.total = 0;
      }
      function w(e, t) {
        var a,
          n,
          s,
          r = e.internal_flags;
        return r.w_ptr, -1 == (s = r.h_ptr - 1) && (s = j.MAX_HEADER_BUF - 1), a = r.header[s].write_timing - l, 0 <= (t.total = a) && me(), n = i.getframebits(e), a += n, t.total += n, t.total % 8 != 0 ? t.total = 1 + t.total / 8 : t.total = t.total / 8, t.total += f + 1, a;
      }
      this.getframebits = function (e) {
        var t,
          a = e.internal_flags;
        t = 0 != a.bitrate_index ? k.bitrate_table[e.version][a.bitrate_index] : e.brate;
        var n = 0 | 72e3 * (e.version + 1) * t / e.out_samplerate + a.padding;
        return 8 * n;
      }, this.flush_bitstream = function (e) {
        var t,
          a,
          n = e.internal_flags;
          n.h_ptr - 1;
        t = n.l3_side, (a = w(e, new p())) < 0 || (u(e, a), n.ResvSize = 0, t.main_data_begin = 0, n.findReplayGain && me(), n.findPeakSample && me());
      }, this.format_bitstream = function (e) {
        var t,
          a = e.internal_flags;
        t = a.l3_side;
        var n = this.getframebits(e);
        u(e, t.resvDrain_pre), function (e, t) {
          var a,
            n,
            s,
            r = e.internal_flags;
          if (a = r.l3_side, r.header[r.h_ptr].ptr = 0, we.fill(r.header[r.h_ptr].buf, 0, r.sideinfo_len, 0), e.out_samplerate < 16e3 ? h(r, 4094, 12) : h(r, 4095, 12), h(r, e.version, 1), h(r, 1, 2), h(r, e.error_protection ? 0 : 1, 1), h(r, r.bitrate_index, 4), h(r, r.samplerate_index, 2), h(r, r.padding, 1), h(r, e.extension, 1), h(r, e.mode.ordinal(), 2), h(r, r.mode_ext, 2), h(r, e.copyright, 1), h(r, e.original, 1), h(r, e.emphasis, 2), e.error_protection && h(r, 0, 16), 1 == e.version) {
            for (h(r, a.main_data_begin, 9), 2 == r.channels_out ? h(r, a.private_bits, 3) : h(r, a.private_bits, 5), s = 0; s < r.channels_out; s++) {
              var i;
              for (i = 0; i < 4; i++) h(r, a.scfsi[s][i], 1);
            }
            for (n = 0; n < 2; n++) for (s = 0; s < r.channels_out; s++) {
              var o = a.tt[n][s];
              h(r, o.part2_3_length + o.part2_length, 12), h(r, o.big_values / 2, 9), h(r, o.global_gain, 8), h(r, o.scalefac_compress, 4), o.block_type != Ae.NORM_TYPE ? (h(r, 1, 1), h(r, o.block_type, 2), h(r, o.mixed_block_flag, 1), 14 == o.table_select[0] && (o.table_select[0] = 16), h(r, o.table_select[0], 5), 14 == o.table_select[1] && (o.table_select[1] = 16), h(r, o.table_select[1], 5), h(r, o.subblock_gain[0], 3), h(r, o.subblock_gain[1], 3), h(r, o.subblock_gain[2], 3)) : (h(r, 0, 1), 14 == o.table_select[0] && (o.table_select[0] = 16), h(r, o.table_select[0], 5), 14 == o.table_select[1] && (o.table_select[1] = 16), h(r, o.table_select[1], 5), 14 == o.table_select[2] && (o.table_select[2] = 16), h(r, o.table_select[2], 5), h(r, o.region0_count, 4), h(r, o.region1_count, 3)), h(r, o.preflag, 1), h(r, o.scalefac_scale, 1), h(r, o.count1table_select, 1);
            }
          } else for (h(r, a.main_data_begin, 8), h(r, a.private_bits, r.channels_out), s = n = 0; s < r.channels_out; s++) {
            var o = a.tt[n][s];
            h(r, o.part2_3_length + o.part2_length, 12), h(r, o.big_values / 2, 9), h(r, o.global_gain, 8), h(r, o.scalefac_compress, 9), o.block_type != Ae.NORM_TYPE ? (h(r, 1, 1), h(r, o.block_type, 2), h(r, o.mixed_block_flag, 1), 14 == o.table_select[0] && (o.table_select[0] = 16), h(r, o.table_select[0], 5), 14 == o.table_select[1] && (o.table_select[1] = 16), h(r, o.table_select[1], 5), h(r, o.subblock_gain[0], 3), h(r, o.subblock_gain[1], 3), h(r, o.subblock_gain[2], 3)) : (h(r, 0, 1), 14 == o.table_select[0] && (o.table_select[0] = 16), h(r, o.table_select[0], 5), 14 == o.table_select[1] && (o.table_select[1] = 16), h(r, o.table_select[1], 5), 14 == o.table_select[2] && (o.table_select[2] = 16), h(r, o.table_select[2], 5), h(r, o.region0_count, 4), h(r, o.region1_count, 3)), h(r, o.scalefac_scale, 1), h(r, o.count1table_select, 1);
          }
          e.error_protection && me();
          var _ = r.h_ptr;
          r.h_ptr = _ + 1 & j.MAX_HEADER_BUF - 1, r.header[r.h_ptr].write_timing = r.header[_].write_timing + t, r.h_ptr, r.w_ptr;
        }(e, n);
        var s = 8 * a.sideinfo_len;
        if (s += function (e) {
          var t,
            a,
            n,
            s,
            r = 0,
            i = e.internal_flags,
            o = i.l3_side;
          if (1 == e.version) for (t = 0; t < 2; t++) for (a = 0; a < i.channels_out; a++) {
            var _ = o.tt[t][a],
              l = A.slen1_tab[_.scalefac_compress],
              f = A.slen2_tab[_.scalefac_compress];
            for (n = s = 0; n < _.sfbdivide; n++) -1 != _.scalefac[n] && (v(i, _.scalefac[n], l), s += l);
            for (; n < _.sfbmax; n++) -1 != _.scalefac[n] && (v(i, _.scalefac[n], f), s += f);
            _.block_type == Ae.SHORT_TYPE ? s += d(i, _) : s += g(i, _), s += m(i, _), r += s;
          } else for (a = t = 0; a < i.channels_out; a++) {
            var c,
              u,
              _ = o.tt[t][a],
              h = 0;
            if (u = n = s = 0, _.block_type == Ae.SHORT_TYPE) {
              for (; u < 4; u++) {
                var b = _.sfb_partition_table[u] / 3,
                  p = _.slen[u];
                for (c = 0; c < b; c++, n++) v(i, Math.max(_.scalefac[3 * n + 0], 0), p), v(i, Math.max(_.scalefac[3 * n + 1], 0), p), v(i, Math.max(_.scalefac[3 * n + 2], 0), p), h += 3 * p;
              }
              s += d(i, _);
            } else {
              for (; u < 4; u++) {
                var b = _.sfb_partition_table[u],
                  p = _.slen[u];
                for (c = 0; c < b; c++, n++) v(i, Math.max(_.scalefac[n], 0), p), h += p;
              }
              s += g(i, _);
            }
            s += m(i, _), r += h + s;
          }
          return r;
        }(e), u(e, t.resvDrain_post), s += t.resvDrain_post, t.main_data_begin += (n - s) / 8, w(e, new p()), a.ResvSize, 8 * t.main_data_begin != a.ResvSize && (a.ResvSize = 8 * t.main_data_begin), 1e9 < l) {
          var r;
          for (r = 0; r < j.MAX_HEADER_BUF; ++r) a.header[r].write_timing -= l;
          l = 0;
        }
        return 0;
      }, this.copy_buffer = function (e, t, a, n, s) {
        var r = f + 1;
        if (r <= 0) return 0;
        if (0 != n && n < r) return -1;
        if (I.arraycopy(_, 0, t, a, r), f = -1, (c = 0) != s) {
          var i = ve(1);
          i[0] = e.nMusicCRC, o.updateMusicCRC(i, t, a, r), e.nMusicCRC = i[0], 0 < r && (e.VBR_seek_table.nBytesWritten += r), e.decode_on_the_fly && me();
        }
        return r;
      }, this.init_bit_stream_w = function (e) {
        _ = S(Y.LAME_MAXMP3BUFFER), e.h_ptr = e.w_ptr = 0, e.header[e.h_ptr].write_timing = 0, f = -1, l = c = 0;
      };
    }
    function e(e, t, a, n) {
      this.xlen = e, this.linmax = t, this.table = a, this.hlen = n;
    }
    D.MAX_VALUE = 3.4028235e38, Me.vbr_off = new Me(0), Me.vbr_mt = new Me(1), Me.vbr_rh = new Me(2), Me.vbr_abr = new Me(3), Me.vbr_mtrh = new Me(4), Me.vbr_default = Me.vbr_mtrh, ye.STEREO = new ye(0), ye.JOINT_STEREO = new ye(1), ye.DUAL_CHANNEL = new ye(2), ye.MONO = new ye(3), ye.NOT_SET = new ye(4), O.STEPS_per_dB = 100, O.MAX_dB = 120, O.GAIN_NOT_ENOUGH_SAMPLES = -24601, O.GAIN_ANALYSIS_ERROR = 0, O.GAIN_ANALYSIS_OK = 1, O.INIT_GAIN_ANALYSIS_ERROR = 0, O.INIT_GAIN_ANALYSIS_OK = 1, O.MAX_ORDER = O.YULE_ORDER = 10, O.MAX_SAMPLES_PER_WINDOW = (O.MAX_SAMP_FREQ = 48e3) * (O.RMS_WINDOW_TIME_NUMERATOR = 1) / (O.RMS_WINDOW_TIME_DENOMINATOR = 20) + 1, y.NUMTOCENTRIES = 100, y.MAXFRAMESIZE = 2880, N.EQ = function (e, t) {
      return Math.abs(e) > Math.abs(t) ? Math.abs(e - t) <= 1e-6 * Math.abs(e) : Math.abs(e - t) <= 1e-6 * Math.abs(t);
    }, N.NEQ = function (e, t) {
      return !N.EQ(e, t);
    };
    var k = {};
    function R(e) {
      this.bits = e;
    }
    function x() {
      this.over_noise = 0, this.tot_noise = 0, this.max_noise = 0, this.over_count = 0, this.over_SSD = 0, this.bits = 0;
    }
    function r(e, t, a, n) {
      this.l = ve(1 + Ae.SBMAX_l), this.s = ve(1 + Ae.SBMAX_s), this.psfb21 = ve(1 + Ae.PSFB21), this.psfb12 = ve(1 + Ae.PSFB12);
      var s = this.l,
        r = this.s;
      4 == arguments.length && (this.arrL = e, this.arrS = t, this.arr21 = a, this.arr12 = n, I.arraycopy(this.arrL, 0, s, 0, Math.min(this.arrL.length, this.l.length)), I.arraycopy(this.arrS, 0, r, 0, Math.min(this.arrS.length, this.s.length)), I.arraycopy(this.arr21, 0, this.psfb21, 0, Math.min(this.arr21.length, this.psfb21.length)), I.arraycopy(this.arr12, 0, this.psfb12, 0, Math.min(this.arr12.length, this.psfb12.length)));
    }
    function T() {
      var l = null,
        b = null,
        n = null;
      this.setModules = function (e, t, a) {
        l = e, b = t, n = a;
      }, this.IPOW20 = function (e) {
        return h[e];
      };
      var B = 2.220446049250313e-16,
        e = T.IXMAX_VAL,
        f = e + 2,
        c = T.Q_MAX,
        u = T.Q_MAX2,
        s = 100;
      this.nr_of_sfb_block = [[[6, 5, 5, 5], [9, 9, 9, 9], [6, 9, 9, 9]], [[6, 5, 7, 3], [9, 9, 12, 6], [6, 9, 12, 6]], [[11, 10, 0, 0], [18, 18, 0, 0], [15, 18, 0, 0]], [[7, 7, 7, 0], [12, 12, 12, 0], [6, 15, 12, 0]], [[6, 6, 6, 3], [12, 9, 9, 6], [6, 12, 9, 6]], [[8, 8, 5, 0], [15, 12, 9, 0], [6, 18, 9, 0]]];
      var M = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 2, 0];
      this.pretab = M, this.sfBandIndex = [new r([0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, 464, 522, 576], [0, 4, 8, 12, 18, 24, 32, 42, 56, 74, 100, 132, 174, 192], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]), new r([0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 114, 136, 162, 194, 232, 278, 332, 394, 464, 540, 576], [0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 136, 180, 192], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]), new r([0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, 464, 522, 576], [0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, 174, 192], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]), new r([0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 52, 62, 74, 90, 110, 134, 162, 196, 238, 288, 342, 418, 576], [0, 4, 8, 12, 16, 22, 30, 40, 52, 66, 84, 106, 136, 192], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]), new r([0, 4, 8, 12, 16, 20, 24, 30, 36, 42, 50, 60, 72, 88, 106, 128, 156, 190, 230, 276, 330, 384, 576], [0, 4, 8, 12, 16, 22, 28, 38, 50, 64, 80, 100, 126, 192], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]), new r([0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 54, 66, 82, 102, 126, 156, 194, 240, 296, 364, 448, 550, 576], [0, 4, 8, 12, 16, 22, 30, 42, 58, 78, 104, 138, 180, 192], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]), new r([0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, 464, 522, 576], [0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, 174, 192], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]), new r([0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, 464, 522, 576], [0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, 174, 192], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]), new r([0, 12, 24, 36, 48, 60, 72, 88, 108, 132, 160, 192, 232, 280, 336, 400, 476, 566, 568, 570, 572, 574, 576], [0, 8, 16, 24, 36, 52, 72, 96, 124, 160, 162, 164, 166, 192], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0])];
      var y = de(c + u + 1),
        h = de(c),
        p = de(f),
        m = de(f);
      function v(e, t) {
        var a = n.ATHformula(t, e);
        return a -= s, a = Math.pow(10, a / 10 + e.ATHlower);
      }
      function A(e) {
        this.s = e;
      }
      this.adj43 = m, this.iteration_init = function (e) {
        var t,
          a = e.internal_flags,
          n = a.l3_side;
        if (0 == a.iteration_init_init) {
          for (a.iteration_init_init = 1, n.main_data_begin = 0, function (e) {
            for (var t = e.internal_flags.ATH.l, a = e.internal_flags.ATH.psfb21, n = e.internal_flags.ATH.s, s = e.internal_flags.ATH.psfb12, r = e.internal_flags, i = e.out_samplerate, o = 0; o < Ae.SBMAX_l; o++) {
              var _ = r.scalefac_band.l[o],
                l = r.scalefac_band.l[o + 1];
              t[o] = D.MAX_VALUE;
              for (var f = _; f < l; f++) {
                var c = f * i / 1152,
                  u = v(e, c);
                t[o] = Math.min(t[o], u);
              }
            }
            for (var o = 0; o < Ae.PSFB21; o++) {
              var _ = r.scalefac_band.psfb21[o],
                l = r.scalefac_band.psfb21[o + 1];
              a[o] = D.MAX_VALUE;
              for (var f = _; f < l; f++) {
                var c = f * i / 1152,
                  u = v(e, c);
                a[o] = Math.min(a[o], u);
              }
            }
            for (var o = 0; o < Ae.SBMAX_s; o++) {
              var _ = r.scalefac_band.s[o],
                l = r.scalefac_band.s[o + 1];
              n[o] = D.MAX_VALUE;
              for (var f = _; f < l; f++) {
                var c = f * i / 384,
                  u = v(e, c);
                n[o] = Math.min(n[o], u);
              }
              n[o] *= r.scalefac_band.s[o + 1] - r.scalefac_band.s[o];
            }
            for (var o = 0; o < Ae.PSFB12; o++) {
              var _ = r.scalefac_band.psfb12[o],
                l = r.scalefac_band.psfb12[o + 1];
              s[o] = D.MAX_VALUE;
              for (var f = _; f < l; f++) {
                var c = f * i / 384,
                  u = v(e, c);
                s[o] = Math.min(s[o], u);
              }
              s[o] *= r.scalefac_band.s[13] - r.scalefac_band.s[12];
            }
            e.noATH && me(), r.ATH.floor = 10 * d(v(e, -1));
          }(e), p[0] = 0, t = 1; t < f; t++) p[t] = Math.pow(t, 4 / 3);
          for (t = 0; t < f - 1; t++) m[t] = t + 1 - Math.pow(.5 * (p[t] + p[t + 1]), .75);
          for (m[t] = .5, t = 0; t < c; t++) h[t] = Math.pow(2, -.1875 * (t - 210));
          for (t = 0; t <= c + u; t++) y[t] = Math.pow(2, .25 * (t - 210 - u));
          var s, r, i, o;
          for (l.huffman_init(a), 32 <= (t = e.exp_nspsytune >> 2 & 63) && (t -= 64), s = Math.pow(10, t / 4 / 10), 32 <= (t = e.exp_nspsytune >> 8 & 63) && (t -= 64), r = Math.pow(10, t / 4 / 10), 32 <= (t = e.exp_nspsytune >> 14 & 63) && (t -= 64), i = Math.pow(10, t / 4 / 10), 32 <= (t = e.exp_nspsytune >> 20 & 63) && (t -= 64), o = i * Math.pow(10, t / 4 / 10), t = 0; t < Ae.SBMAX_l; t++) _ = t <= 6 ? s : t <= 13 ? r : t <= 20 ? i : o, a.nsPsy.longfact[t] = _;
          for (t = 0; t < Ae.SBMAX_s; t++) {
            var _;
            _ = t <= 5 ? s : t <= 10 ? r : t <= 11 ? i : o, a.nsPsy.shortfact[t] = _;
          }
        }
      }, this.on_pe = function (e, t, a, n, s, r) {
        var i,
          o,
          _ = e.internal_flags,
          l = 0,
          f = ve(2),
          c = new R(l),
          u = b.ResvMaxBits(e, n, c, r),
          h = (l = c.bits) + u;
        for (j.MAX_BITS_PER_GRANULE < h && (h = j.MAX_BITS_PER_GRANULE), o = i = 0; o < _.channels_out; ++o) a[o] = Math.min(j.MAX_BITS_PER_CHANNEL, l / _.channels_out), f[o] = 0 | a[o] * t[s][o] / 700 - a[o], f[o] > 3 * n / 4 && (f[o] = 3 * n / 4), f[o] < 0 && (f[o] = 0), f[o] + a[o] > j.MAX_BITS_PER_CHANNEL && (f[o] = Math.max(0, j.MAX_BITS_PER_CHANNEL - a[o])), i += f[o];
        if (u < i) for (o = 0; o < _.channels_out; ++o) f[o] = u * f[o] / i;
        for (o = 0; o < _.channels_out; ++o) a[o] += f[o], u -= f[o];
        for (o = i = 0; o < _.channels_out; ++o) i += a[o];
        return j.MAX_BITS_PER_GRANULE < i && me(), h;
      }, this.athAdjust = function (e, t, a) {
        var n = 90.30873362,
          s = V.FAST_LOG10_X(t, 10),
          r = e * e,
          i = 0;
        return s -= a, 1e-20 < r && (i = 1 + V.FAST_LOG10_X(r, 10 / n)), i < 0 && (i = 0), s *= i, s += a + n - 94.82444863, Math.pow(10, .1 * s);
      }, this.calc_xmin = function (e, t, a, n) {
        var s,
          r = 0,
          i = e.internal_flags,
          o = 0,
          _ = 0,
          l = i.ATH,
          f = a.xr,
          c = e.VBR == Me.vbr_mtrh ? 1 : 0,
          u = i.masking_lower;
        for (e.VBR != Me.vbr_mtrh && e.VBR != Me.vbr_mt || (u = 1), s = 0; s < a.psy_lmax; s++) {
          for (w = e.VBR == Me.vbr_rh || e.VBR == Me.vbr_mtrh ? athAdjust(l.adjust, l.l[s], l.floor) : l.adjust * l.l[s], v = a.width[s], S = w / v, M = B, A = v >> 1, y = 0; k = f[o] * f[o], y += k, M += k < S ? k : S, R = f[++o] * f[o], y += R, M += R < S ? R : S, o++, 0 < --A;);
          if (w < y && _++, s == Ae.SBPSY_l && me(), 0 != c && (w = M), !e.ATHonly) {
            var h = t.en.l[s];
            0 < h && (x = y * t.thm.l[s] * u / h, 0 != c && (x *= i.nsPsy.longfact[s]), w < x && (w = x));
          }
          n[r++] = 0 != c ? w : w * i.nsPsy.longfact[s];
        }
        var b = 575;
        if (a.block_type != Ae.SHORT_TYPE) for (var p = 576; 0 != p-- && N.EQ(f[p], 0);) b = p;
        a.max_nonzero_coeff = b;
        for (var m = a.sfb_smin; s < a.psymax; m++, s += 3) {
          var v, d, g;
          for (g = e.VBR == Me.vbr_rh || e.VBR == Me.vbr_mtrh ? athAdjust(l.adjust, l.s[m], l.floor) : l.adjust * l.s[m], v = a.width[s], d = 0; d < 3; d++) {
            var w,
              S,
              M,
              y = 0,
              A = v >> 1;
            S = g / v, M = B;
            do {
              var k, R;
              k = f[o] * f[o], y += k, M += k < S ? k : S, R = f[++o] * f[o], y += R, M += R < S ? R : S, o++;
            } while (0 < --A);
            if (g < y && _++, m == Ae.SBPSY_s && me(), w = 0 != c ? M : g, !e.ATHonly && !e.ATHshort) {
              var x,
                h = t.en.s[m][d];
              0 < h && (x = y * t.thm.s[m][d] * u / h, 0 != c && (x *= i.nsPsy.shortfact[m]), w < x && (w = x));
            }
            n[r++] = 0 != c ? w : w * i.nsPsy.shortfact[m];
          }
          e.useTemporal && (n[r - 3] > n[r - 3 + 1] && (n[r - 3 + 1] += (n[r - 3] - n[r - 3 + 1]) * i.decay), n[r - 3 + 1] > n[r - 3 + 2] && (n[r - 3 + 2] += (n[r - 3 + 1] - n[r - 3 + 2]) * i.decay));
        }
        return _;
      }, this.calc_noise_core = function (e, t, a, n) {
        var s = 0,
          r = t.s,
          i = e.l3_enc;
        if (r > e.count1) for (; 0 != a--;) _ = e.xr[r], r++, s += _ * _, _ = e.xr[r], r++, s += _ * _;else if (r > e.big_values) {
          var o = de(2);
          for (o[0] = 0, o[1] = n; 0 != a--;) _ = Math.abs(e.xr[r]) - o[i[r]], r++, s += _ * _, _ = Math.abs(e.xr[r]) - o[i[r]], r++, s += _ * _;
        } else for (; 0 != a--;) {
          var _;
          _ = Math.abs(e.xr[r]) - p[i[r]] * n, r++, s += _ * _, _ = Math.abs(e.xr[r]) - p[i[r]] * n, r++, s += _ * _;
        }
        return t.s = r, s;
      }, this.calc_noise = function (e, t, a, n, s) {
        var r,
          i,
          o = 0,
          _ = 0,
          l = 0,
          f = 0,
          c = 0,
          u = -20,
          h = 0,
          b = e.scalefac,
          p = 0;
        for (n.over_SSD = 0, r = 0; r < e.psymax; r++) {
          var m,
            v = e.global_gain - (b[p++] + (0 != e.preflag ? M[r] : 0) << e.scalefac_scale + 1) - 8 * e.subblock_gain[e.window[r]],
            d = 0;
          if (null != s && s.step[r] == v) d = s.noise[r], h += e.width[r], a[o++] = d / t[_++], d = s.noise_log[r];else {
            var g,
              w = y[v + T.Q_MAX2];
            i = e.width[r] >> 1, h + e.width[r] > e.max_nonzero_coeff && (g = e.max_nonzero_coeff - h + 1, i = 0 < g ? g >> 1 : 0);
            var S = new A(h);
            d = this.calc_noise_core(e, S, i, w), h = S.s, null != s && (s.step[r] = v, s.noise[r] = d), d = a[o++] = d / t[_++], d = V.FAST_LOG10(Math.max(d, 1e-20)), null != s && (s.noise_log[r] = d);
          }
          null != s && (s.global_gain = e.global_gain), c += d, 0 < d && (m = Math.max(0 | 10 * d + .5, 1), n.over_SSD += m * m, l++, f += d), u = Math.max(u, d);
        }
        return n.over_count = l, n.tot_noise = c, n.over_noise = f, n.max_noise = u, l;
      };
    }
    function B() {
      this.xr = de(576), this.l3_enc = ve(576), this.scalefac = ve(F.SFBMAX), this.xrpow_max = 0, this.part2_3_length = 0, this.big_values = 0, this.count1 = 0, this.global_gain = 0, this.scalefac_compress = 0, this.block_type = 0, this.mixed_block_flag = 0, this.table_select = ve(3), this.subblock_gain = ve(4), this.region0_count = 0, this.region1_count = 0, this.preflag = 0, this.scalefac_scale = 0, this.count1table_select = 0, this.part2_length = 0, this.sfb_lmax = 0, this.sfb_smin = 0, this.psy_lmax = 0, this.sfbmax = 0, this.psymax = 0, this.sfbdivide = 0, this.width = ve(F.SFBMAX), this.window = ve(F.SFBMAX), this.count1bits = 0, this.sfb_partition_table = null, this.slen = ve(4), this.max_nonzero_coeff = 0;
      var a = this;
      function n(e) {
        return new Int32Array(e);
      }
      this.assign = function (e) {
        var t;
        a.xr = (t = e.xr, new Float32Array(t)), a.l3_enc = n(e.l3_enc), a.scalefac = n(e.scalefac), a.xrpow_max = e.xrpow_max, a.part2_3_length = e.part2_3_length, a.big_values = e.big_values, a.count1 = e.count1, a.global_gain = e.global_gain, a.scalefac_compress = e.scalefac_compress, a.block_type = e.block_type, a.mixed_block_flag = e.mixed_block_flag, a.table_select = n(e.table_select), a.subblock_gain = n(e.subblock_gain), a.region0_count = e.region0_count, a.region1_count = e.region1_count, a.preflag = e.preflag, a.scalefac_scale = e.scalefac_scale, a.count1table_select = e.count1table_select, a.part2_length = e.part2_length, a.sfb_lmax = e.sfb_lmax, a.sfb_smin = e.sfb_smin, a.psy_lmax = e.psy_lmax, a.sfbmax = e.sfbmax, a.psymax = e.psymax, a.sfbdivide = e.sfbdivide, a.width = n(e.width), a.window = n(e.window), a.count1bits = e.count1bits, a.sfb_partition_table = e.sfb_partition_table.slice(0), a.slen = n(e.slen), a.max_nonzero_coeff = e.max_nonzero_coeff;
      };
    }
    k.t1HB = [1, 1, 1, 0], k.t2HB = [1, 2, 1, 3, 1, 1, 3, 2, 0], k.t3HB = [3, 2, 1, 1, 1, 1, 3, 2, 0], k.t5HB = [1, 2, 6, 5, 3, 1, 4, 4, 7, 5, 7, 1, 6, 1, 1, 0], k.t6HB = [7, 3, 5, 1, 6, 2, 3, 2, 5, 4, 4, 1, 3, 3, 2, 0], k.t7HB = [1, 2, 10, 19, 16, 10, 3, 3, 7, 10, 5, 3, 11, 4, 13, 17, 8, 4, 12, 11, 18, 15, 11, 2, 7, 6, 9, 14, 3, 1, 6, 4, 5, 3, 2, 0], k.t8HB = [3, 4, 6, 18, 12, 5, 5, 1, 2, 16, 9, 3, 7, 3, 5, 14, 7, 3, 19, 17, 15, 13, 10, 4, 13, 5, 8, 11, 5, 1, 12, 4, 4, 1, 1, 0], k.t9HB = [7, 5, 9, 14, 15, 7, 6, 4, 5, 5, 6, 7, 7, 6, 8, 8, 8, 5, 15, 6, 9, 10, 5, 1, 11, 7, 9, 6, 4, 1, 14, 4, 6, 2, 6, 0], k.t10HB = [1, 2, 10, 23, 35, 30, 12, 17, 3, 3, 8, 12, 18, 21, 12, 7, 11, 9, 15, 21, 32, 40, 19, 6, 14, 13, 22, 34, 46, 23, 18, 7, 20, 19, 33, 47, 27, 22, 9, 3, 31, 22, 41, 26, 21, 20, 5, 3, 14, 13, 10, 11, 16, 6, 5, 1, 9, 8, 7, 8, 4, 4, 2, 0], k.t11HB = [3, 4, 10, 24, 34, 33, 21, 15, 5, 3, 4, 10, 32, 17, 11, 10, 11, 7, 13, 18, 30, 31, 20, 5, 25, 11, 19, 59, 27, 18, 12, 5, 35, 33, 31, 58, 30, 16, 7, 5, 28, 26, 32, 19, 17, 15, 8, 14, 14, 12, 9, 13, 14, 9, 4, 1, 11, 4, 6, 6, 6, 3, 2, 0], k.t12HB = [9, 6, 16, 33, 41, 39, 38, 26, 7, 5, 6, 9, 23, 16, 26, 11, 17, 7, 11, 14, 21, 30, 10, 7, 17, 10, 15, 12, 18, 28, 14, 5, 32, 13, 22, 19, 18, 16, 9, 5, 40, 17, 31, 29, 17, 13, 4, 2, 27, 12, 11, 15, 10, 7, 4, 1, 27, 12, 8, 12, 6, 3, 1, 0], k.t13HB = [1, 5, 14, 21, 34, 51, 46, 71, 42, 52, 68, 52, 67, 44, 43, 19, 3, 4, 12, 19, 31, 26, 44, 33, 31, 24, 32, 24, 31, 35, 22, 14, 15, 13, 23, 36, 59, 49, 77, 65, 29, 40, 30, 40, 27, 33, 42, 16, 22, 20, 37, 61, 56, 79, 73, 64, 43, 76, 56, 37, 26, 31, 25, 14, 35, 16, 60, 57, 97, 75, 114, 91, 54, 73, 55, 41, 48, 53, 23, 24, 58, 27, 50, 96, 76, 70, 93, 84, 77, 58, 79, 29, 74, 49, 41, 17, 47, 45, 78, 74, 115, 94, 90, 79, 69, 83, 71, 50, 59, 38, 36, 15, 72, 34, 56, 95, 92, 85, 91, 90, 86, 73, 77, 65, 51, 44, 43, 42, 43, 20, 30, 44, 55, 78, 72, 87, 78, 61, 46, 54, 37, 30, 20, 16, 53, 25, 41, 37, 44, 59, 54, 81, 66, 76, 57, 54, 37, 18, 39, 11, 35, 33, 31, 57, 42, 82, 72, 80, 47, 58, 55, 21, 22, 26, 38, 22, 53, 25, 23, 38, 70, 60, 51, 36, 55, 26, 34, 23, 27, 14, 9, 7, 34, 32, 28, 39, 49, 75, 30, 52, 48, 40, 52, 28, 18, 17, 9, 5, 45, 21, 34, 64, 56, 50, 49, 45, 31, 19, 12, 15, 10, 7, 6, 3, 48, 23, 20, 39, 36, 35, 53, 21, 16, 23, 13, 10, 6, 1, 4, 2, 16, 15, 17, 27, 25, 20, 29, 11, 17, 12, 16, 8, 1, 1, 0, 1], k.t15HB = [7, 12, 18, 53, 47, 76, 124, 108, 89, 123, 108, 119, 107, 81, 122, 63, 13, 5, 16, 27, 46, 36, 61, 51, 42, 70, 52, 83, 65, 41, 59, 36, 19, 17, 15, 24, 41, 34, 59, 48, 40, 64, 50, 78, 62, 80, 56, 33, 29, 28, 25, 43, 39, 63, 55, 93, 76, 59, 93, 72, 54, 75, 50, 29, 52, 22, 42, 40, 67, 57, 95, 79, 72, 57, 89, 69, 49, 66, 46, 27, 77, 37, 35, 66, 58, 52, 91, 74, 62, 48, 79, 63, 90, 62, 40, 38, 125, 32, 60, 56, 50, 92, 78, 65, 55, 87, 71, 51, 73, 51, 70, 30, 109, 53, 49, 94, 88, 75, 66, 122, 91, 73, 56, 42, 64, 44, 21, 25, 90, 43, 41, 77, 73, 63, 56, 92, 77, 66, 47, 67, 48, 53, 36, 20, 71, 34, 67, 60, 58, 49, 88, 76, 67, 106, 71, 54, 38, 39, 23, 15, 109, 53, 51, 47, 90, 82, 58, 57, 48, 72, 57, 41, 23, 27, 62, 9, 86, 42, 40, 37, 70, 64, 52, 43, 70, 55, 42, 25, 29, 18, 11, 11, 118, 68, 30, 55, 50, 46, 74, 65, 49, 39, 24, 16, 22, 13, 14, 7, 91, 44, 39, 38, 34, 63, 52, 45, 31, 52, 28, 19, 14, 8, 9, 3, 123, 60, 58, 53, 47, 43, 32, 22, 37, 24, 17, 12, 15, 10, 2, 1, 71, 37, 34, 30, 28, 20, 17, 26, 21, 16, 10, 6, 8, 6, 2, 0], k.t16HB = [1, 5, 14, 44, 74, 63, 110, 93, 172, 149, 138, 242, 225, 195, 376, 17, 3, 4, 12, 20, 35, 62, 53, 47, 83, 75, 68, 119, 201, 107, 207, 9, 15, 13, 23, 38, 67, 58, 103, 90, 161, 72, 127, 117, 110, 209, 206, 16, 45, 21, 39, 69, 64, 114, 99, 87, 158, 140, 252, 212, 199, 387, 365, 26, 75, 36, 68, 65, 115, 101, 179, 164, 155, 264, 246, 226, 395, 382, 362, 9, 66, 30, 59, 56, 102, 185, 173, 265, 142, 253, 232, 400, 388, 378, 445, 16, 111, 54, 52, 100, 184, 178, 160, 133, 257, 244, 228, 217, 385, 366, 715, 10, 98, 48, 91, 88, 165, 157, 148, 261, 248, 407, 397, 372, 380, 889, 884, 8, 85, 84, 81, 159, 156, 143, 260, 249, 427, 401, 392, 383, 727, 713, 708, 7, 154, 76, 73, 141, 131, 256, 245, 426, 406, 394, 384, 735, 359, 710, 352, 11, 139, 129, 67, 125, 247, 233, 229, 219, 393, 743, 737, 720, 885, 882, 439, 4, 243, 120, 118, 115, 227, 223, 396, 746, 742, 736, 721, 712, 706, 223, 436, 6, 202, 224, 222, 218, 216, 389, 386, 381, 364, 888, 443, 707, 440, 437, 1728, 4, 747, 211, 210, 208, 370, 379, 734, 723, 714, 1735, 883, 877, 876, 3459, 865, 2, 377, 369, 102, 187, 726, 722, 358, 711, 709, 866, 1734, 871, 3458, 870, 434, 0, 12, 10, 7, 11, 10, 17, 11, 9, 13, 12, 10, 7, 5, 3, 1, 3], k.t24HB = [15, 13, 46, 80, 146, 262, 248, 434, 426, 669, 653, 649, 621, 517, 1032, 88, 14, 12, 21, 38, 71, 130, 122, 216, 209, 198, 327, 345, 319, 297, 279, 42, 47, 22, 41, 74, 68, 128, 120, 221, 207, 194, 182, 340, 315, 295, 541, 18, 81, 39, 75, 70, 134, 125, 116, 220, 204, 190, 178, 325, 311, 293, 271, 16, 147, 72, 69, 135, 127, 118, 112, 210, 200, 188, 352, 323, 306, 285, 540, 14, 263, 66, 129, 126, 119, 114, 214, 202, 192, 180, 341, 317, 301, 281, 262, 12, 249, 123, 121, 117, 113, 215, 206, 195, 185, 347, 330, 308, 291, 272, 520, 10, 435, 115, 111, 109, 211, 203, 196, 187, 353, 332, 313, 298, 283, 531, 381, 17, 427, 212, 208, 205, 201, 193, 186, 177, 169, 320, 303, 286, 268, 514, 377, 16, 335, 199, 197, 191, 189, 181, 174, 333, 321, 305, 289, 275, 521, 379, 371, 11, 668, 184, 183, 179, 175, 344, 331, 314, 304, 290, 277, 530, 383, 373, 366, 10, 652, 346, 171, 168, 164, 318, 309, 299, 287, 276, 263, 513, 375, 368, 362, 6, 648, 322, 316, 312, 307, 302, 292, 284, 269, 261, 512, 376, 370, 364, 359, 4, 620, 300, 296, 294, 288, 282, 273, 266, 515, 380, 374, 369, 365, 361, 357, 2, 1033, 280, 278, 274, 267, 264, 259, 382, 378, 372, 367, 363, 360, 358, 356, 0, 43, 20, 19, 17, 15, 13, 11, 9, 7, 6, 4, 7, 5, 3, 1, 3], k.t32HB = [1, 10, 8, 20, 12, 20, 16, 32, 14, 12, 24, 0, 28, 16, 24, 16], k.t33HB = [15, 28, 26, 48, 22, 40, 36, 64, 14, 24, 20, 32, 12, 16, 8, 0], k.t1l = [1, 4, 3, 5], k.t2l = [1, 4, 7, 4, 5, 7, 6, 7, 8], k.t3l = [2, 3, 7, 4, 4, 7, 6, 7, 8], k.t5l = [1, 4, 7, 8, 4, 5, 8, 9, 7, 8, 9, 10, 8, 8, 9, 10], k.t6l = [3, 4, 6, 8, 4, 4, 6, 7, 5, 6, 7, 8, 7, 7, 8, 9], k.t7l = [1, 4, 7, 9, 9, 10, 4, 6, 8, 9, 9, 10, 7, 7, 9, 10, 10, 11, 8, 9, 10, 11, 11, 11, 8, 9, 10, 11, 11, 12, 9, 10, 11, 12, 12, 12], k.t8l = [2, 4, 7, 9, 9, 10, 4, 4, 6, 10, 10, 10, 7, 6, 8, 10, 10, 11, 9, 10, 10, 11, 11, 12, 9, 9, 10, 11, 12, 12, 10, 10, 11, 11, 13, 13], k.t9l = [3, 4, 6, 7, 9, 10, 4, 5, 6, 7, 8, 10, 5, 6, 7, 8, 9, 10, 7, 7, 8, 9, 9, 10, 8, 8, 9, 9, 10, 11, 9, 9, 10, 10, 11, 11], k.t10l = [1, 4, 7, 9, 10, 10, 10, 11, 4, 6, 8, 9, 10, 11, 10, 10, 7, 8, 9, 10, 11, 12, 11, 11, 8, 9, 10, 11, 12, 12, 11, 12, 9, 10, 11, 12, 12, 12, 12, 12, 10, 11, 12, 12, 13, 13, 12, 13, 9, 10, 11, 12, 12, 12, 13, 13, 10, 10, 11, 12, 12, 13, 13, 13], k.t11l = [2, 4, 6, 8, 9, 10, 9, 10, 4, 5, 6, 8, 10, 10, 9, 10, 6, 7, 8, 9, 10, 11, 10, 10, 8, 8, 9, 11, 10, 12, 10, 11, 9, 10, 10, 11, 11, 12, 11, 12, 9, 10, 11, 12, 12, 13, 12, 13, 9, 9, 9, 10, 11, 12, 12, 12, 9, 9, 10, 11, 12, 12, 12, 12], k.t12l = [4, 4, 6, 8, 9, 10, 10, 10, 4, 5, 6, 7, 9, 9, 10, 10, 6, 6, 7, 8, 9, 10, 9, 10, 7, 7, 8, 8, 9, 10, 10, 10, 8, 8, 9, 9, 10, 10, 10, 11, 9, 9, 10, 10, 10, 11, 10, 11, 9, 9, 9, 10, 10, 11, 11, 12, 10, 10, 10, 11, 11, 11, 11, 12], k.t13l = [1, 5, 7, 8, 9, 10, 10, 11, 10, 11, 12, 12, 13, 13, 14, 14, 4, 6, 8, 9, 10, 10, 11, 11, 11, 11, 12, 12, 13, 14, 14, 14, 7, 8, 9, 10, 11, 11, 12, 12, 11, 12, 12, 13, 13, 14, 15, 15, 8, 9, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 15, 15, 9, 9, 11, 11, 12, 12, 13, 13, 12, 13, 13, 14, 14, 15, 15, 16, 10, 10, 11, 12, 12, 12, 13, 13, 13, 13, 14, 13, 15, 15, 16, 16, 10, 11, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16, 11, 11, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 18, 18, 10, 10, 11, 12, 12, 13, 13, 14, 14, 14, 14, 15, 15, 16, 17, 17, 11, 11, 12, 12, 13, 13, 13, 15, 14, 15, 15, 16, 16, 16, 18, 17, 11, 12, 12, 13, 13, 14, 14, 15, 14, 15, 16, 15, 16, 17, 18, 19, 12, 12, 12, 13, 14, 14, 14, 14, 15, 15, 15, 16, 17, 17, 17, 18, 12, 13, 13, 14, 14, 15, 14, 15, 16, 16, 17, 17, 17, 18, 18, 18, 13, 13, 14, 15, 15, 15, 16, 16, 16, 16, 16, 17, 18, 17, 18, 18, 14, 14, 14, 15, 15, 15, 17, 16, 16, 19, 17, 17, 17, 19, 18, 18, 13, 14, 15, 16, 16, 16, 17, 16, 17, 17, 18, 18, 21, 20, 21, 18], k.t15l = [3, 5, 6, 8, 8, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 14, 5, 5, 7, 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 6, 7, 7, 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 13, 13, 13, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13, 13, 9, 9, 9, 10, 10, 10, 11, 11, 11, 11, 12, 12, 13, 13, 13, 14, 10, 9, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13, 14, 14, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 14, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 14, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 15, 14, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, 12, 12, 11, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 15, 15, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 14, 15, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15], k.t16_5l = [1, 5, 7, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 11, 4, 6, 8, 9, 10, 11, 11, 11, 12, 12, 12, 13, 14, 13, 14, 11, 7, 8, 9, 10, 11, 11, 12, 12, 13, 12, 13, 13, 13, 14, 14, 12, 9, 9, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 13, 10, 10, 11, 11, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 12, 10, 10, 11, 11, 12, 13, 13, 14, 13, 14, 14, 15, 15, 15, 16, 13, 11, 11, 11, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 16, 13, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 15, 17, 17, 13, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 13, 12, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 15, 16, 15, 14, 12, 13, 12, 13, 14, 14, 14, 14, 15, 16, 16, 16, 17, 17, 16, 13, 13, 13, 13, 13, 14, 14, 15, 16, 16, 16, 16, 16, 16, 15, 16, 14, 13, 14, 14, 14, 14, 15, 15, 15, 15, 17, 16, 16, 16, 16, 18, 14, 15, 14, 14, 14, 15, 15, 16, 16, 16, 18, 17, 17, 17, 19, 17, 14, 14, 15, 13, 14, 16, 16, 15, 16, 16, 17, 18, 17, 19, 17, 16, 14, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 12], k.t16l = [1, 5, 7, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 10, 4, 6, 8, 9, 10, 11, 11, 11, 12, 12, 12, 13, 14, 13, 14, 10, 7, 8, 9, 10, 11, 11, 12, 12, 13, 12, 13, 13, 13, 14, 14, 11, 9, 9, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 12, 10, 10, 11, 11, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 11, 10, 10, 11, 11, 12, 13, 13, 14, 13, 14, 14, 15, 15, 15, 16, 12, 11, 11, 11, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 16, 12, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 15, 17, 17, 12, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 12, 12, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 15, 16, 15, 13, 12, 13, 12, 13, 14, 14, 14, 14, 15, 16, 16, 16, 17, 17, 16, 12, 13, 13, 13, 13, 14, 14, 15, 16, 16, 16, 16, 16, 16, 15, 16, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 17, 16, 16, 16, 16, 18, 13, 15, 14, 14, 14, 15, 15, 16, 16, 16, 18, 17, 17, 17, 19, 17, 13, 14, 15, 13, 14, 16, 16, 15, 16, 16, 17, 18, 17, 19, 17, 16, 13, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 10], k.t24l = [4, 5, 7, 8, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 13, 10, 5, 6, 7, 8, 9, 10, 10, 11, 11, 11, 12, 12, 12, 12, 12, 10, 7, 7, 8, 9, 9, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 9, 8, 8, 9, 9, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 12, 13, 9, 10, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 12, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 9, 11, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 10, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 10, 12, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 10, 12, 12, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 10, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 10, 13, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 6], k.t32l = [1, 5, 5, 7, 5, 8, 7, 9, 5, 7, 7, 9, 7, 9, 9, 10], k.t33l = [4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8], k.ht = [new e(0, 0, null, null), new e(2, 0, k.t1HB, k.t1l), new e(3, 0, k.t2HB, k.t2l), new e(3, 0, k.t3HB, k.t3l), new e(0, 0, null, null), new e(4, 0, k.t5HB, k.t5l), new e(4, 0, k.t6HB, k.t6l), new e(6, 0, k.t7HB, k.t7l), new e(6, 0, k.t8HB, k.t8l), new e(6, 0, k.t9HB, k.t9l), new e(8, 0, k.t10HB, k.t10l), new e(8, 0, k.t11HB, k.t11l), new e(8, 0, k.t12HB, k.t12l), new e(16, 0, k.t13HB, k.t13l), new e(0, 0, null, k.t16_5l), new e(16, 0, k.t15HB, k.t15l), new e(1, 1, k.t16HB, k.t16l), new e(2, 3, k.t16HB, k.t16l), new e(3, 7, k.t16HB, k.t16l), new e(4, 15, k.t16HB, k.t16l), new e(6, 63, k.t16HB, k.t16l), new e(8, 255, k.t16HB, k.t16l), new e(10, 1023, k.t16HB, k.t16l), new e(13, 8191, k.t16HB, k.t16l), new e(4, 15, k.t24HB, k.t24l), new e(5, 31, k.t24HB, k.t24l), new e(6, 63, k.t24HB, k.t24l), new e(7, 127, k.t24HB, k.t24l), new e(8, 255, k.t24HB, k.t24l), new e(9, 511, k.t24HB, k.t24l), new e(11, 2047, k.t24HB, k.t24l), new e(13, 8191, k.t24HB, k.t24l), new e(0, 0, k.t32HB, k.t32l), new e(0, 0, k.t33HB, k.t33l)], k.largetbl = [65540, 327685, 458759, 589832, 655369, 655370, 720906, 720907, 786443, 786444, 786444, 851980, 851980, 851980, 917517, 655370, 262149, 393222, 524295, 589832, 655369, 720906, 720906, 720907, 786443, 786443, 786444, 851980, 917516, 851980, 917516, 655370, 458759, 524295, 589832, 655369, 720905, 720906, 786442, 786443, 851979, 786443, 851979, 851980, 851980, 917516, 917517, 720905, 589832, 589832, 655369, 720905, 720906, 786442, 786442, 786443, 851979, 851979, 917515, 917516, 917516, 983052, 983052, 786441, 655369, 655369, 720905, 720906, 786442, 786442, 851978, 851979, 851979, 917515, 917516, 917516, 983052, 983052, 983053, 720905, 655370, 655369, 720906, 720906, 786442, 851978, 851979, 917515, 851979, 917515, 917516, 983052, 983052, 983052, 1048588, 786441, 720906, 720906, 720906, 786442, 851978, 851979, 851979, 851979, 917515, 917516, 917516, 917516, 983052, 983052, 1048589, 786441, 720907, 720906, 786442, 786442, 851979, 851979, 851979, 917515, 917516, 983052, 983052, 983052, 983052, 1114125, 1114125, 786442, 720907, 786443, 786443, 851979, 851979, 851979, 917515, 917515, 983051, 983052, 983052, 983052, 1048588, 1048589, 1048589, 786442, 786443, 786443, 786443, 851979, 851979, 917515, 917515, 983052, 983052, 983052, 983052, 1048588, 983053, 1048589, 983053, 851978, 786444, 851979, 786443, 851979, 917515, 917516, 917516, 917516, 983052, 1048588, 1048588, 1048589, 1114125, 1114125, 1048589, 786442, 851980, 851980, 851979, 851979, 917515, 917516, 983052, 1048588, 1048588, 1048588, 1048588, 1048589, 1048589, 983053, 1048589, 851978, 851980, 917516, 917516, 917516, 917516, 983052, 983052, 983052, 983052, 1114124, 1048589, 1048589, 1048589, 1048589, 1179661, 851978, 983052, 917516, 917516, 917516, 983052, 983052, 1048588, 1048588, 1048589, 1179661, 1114125, 1114125, 1114125, 1245197, 1114125, 851978, 917517, 983052, 851980, 917516, 1048588, 1048588, 983052, 1048589, 1048589, 1114125, 1179661, 1114125, 1245197, 1114125, 1048589, 851978, 655369, 655369, 655369, 720905, 720905, 786441, 786441, 786441, 851977, 851977, 851977, 851978, 851978, 851978, 851978, 655366], k.table23 = [65538, 262147, 458759, 262148, 327684, 458759, 393222, 458759, 524296], k.table56 = [65539, 262148, 458758, 524296, 262148, 327684, 524294, 589831, 458757, 524294, 589831, 655368, 524295, 524295, 589832, 655369], k.bitrate_table = [[0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1], [0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1], [0, 8, 16, 24, 32, 40, 48, 56, 64, -1, -1, -1, -1, -1, -1, -1]], k.samplerate_table = [[22050, 24e3, 16e3, -1], [44100, 48e3, 32e3, -1], [11025, 12e3, 8e3, -1]], k.scfsi_band = [0, 6, 11, 16, 21], T.Q_MAX = 257, T.Q_MAX2 = 116, T.LARGE_BITS = 1e5, T.IXMAX_VAL = 8206;
    var F = {};
    function C() {
      var r, g;
      this.rv = null, this.qupvt = null;
      var w,
        s = new function () {
          this.setModules = function (e, t) {};
        }();
      function S(e) {
        this.ordinal = e;
      }
      function o(e) {
        for (var t = 0; t < e.sfbmax; t++) if (e.scalefac[t] + e.subblock_gain[e.window[t]] == 0) return !1;
        return !0;
      }
      function M(e, t, a, n, s) {
        var r;
        switch (e) {
          default:
          case 9:
            0 < t.over_count ? (r = a.over_SSD <= t.over_SSD, a.over_SSD == t.over_SSD && (r = a.bits < t.bits)) : r = a.max_noise < 0 && 10 * a.max_noise + a.bits <= 10 * t.max_noise + t.bits;
            break;
          case 0:
            r = a.over_count < t.over_count || a.over_count == t.over_count && a.over_noise < t.over_noise || a.over_count == t.over_count && N.EQ(a.over_noise, t.over_noise) && a.tot_noise < t.tot_noise;
            break;
          case 8:
            me();
          case 1:
            r = a.max_noise < t.max_noise;
            break;
          case 2:
            r = a.tot_noise < t.tot_noise;
            break;
          case 3:
            r = a.tot_noise < t.tot_noise && a.max_noise < t.max_noise;
            break;
          case 4:
            r = a.max_noise <= 0 && .2 < t.max_noise || a.max_noise <= 0 && t.max_noise < 0 && t.max_noise > a.max_noise - .2 && a.tot_noise < t.tot_noise || a.max_noise <= 0 && 0 < t.max_noise && t.max_noise > a.max_noise - .2 && a.tot_noise < t.tot_noise + t.over_noise || 0 < a.max_noise && -.05 < t.max_noise && t.max_noise > a.max_noise - .1 && a.tot_noise + a.over_noise < t.tot_noise + t.over_noise || 0 < a.max_noise && -.1 < t.max_noise && t.max_noise > a.max_noise - .15 && a.tot_noise + a.over_noise + a.over_noise < t.tot_noise + t.over_noise + t.over_noise;
            break;
          case 5:
            r = a.over_noise < t.over_noise || N.EQ(a.over_noise, t.over_noise) && a.tot_noise < t.tot_noise;
            break;
          case 6:
            r = a.over_noise < t.over_noise || N.EQ(a.over_noise, t.over_noise) && (a.max_noise < t.max_noise || N.EQ(a.max_noise, t.max_noise) && a.tot_noise <= t.tot_noise);
            break;
          case 7:
            r = a.over_count < t.over_count || a.over_noise < t.over_noise;
        }
        return 0 == t.over_count && (r = r && a.bits < t.bits), r;
      }
      function y(e, t, a, n, s) {
        var r = e.internal_flags;
        !function (e, t, a, n, s) {
          var r,
            i = e.internal_flags;
          r = 0 == t.scalefac_scale ? 1.2968395546510096 : 1.6817928305074292;
          for (var o = 0, _ = 0; _ < t.sfbmax; _++) o < a[_] && (o = a[_]);
          var l = i.noise_shaping_amp;
          switch (3 == l && me(), l) {
            case 2:
              break;
            case 1:
              1 < o ? o = Math.pow(o, .5) : o *= .95;
              break;
            case 0:
            default:
              1 < o ? o = 1 : o *= .95;
          }
          for (var f = 0, _ = 0; _ < t.sfbmax; _++) {
            var c,
              u = t.width[_];
            if (f += u, !(a[_] < o)) {
              for (0 != (2 & i.substep_shaping) && me(), t.scalefac[_]++, c = -u; c < 0; c++) n[f + c] *= r, n[f + c] > t.xrpow_max && (t.xrpow_max = n[f + c]);
              if (2 == i.noise_shaping_amp) return;
            }
          }
        }(e, t, a, n);
        var i = o(t);
        return !(i || (i = 2 == r.mode_gr ? w.scale_bitcount(t) : w.scale_bitcount_lsf(r, t)) && (1 < r.noise_shaping && (we.fill(r.pseudohalf, 0), 0 == t.scalefac_scale ? (function (e, t) {
          for (var a = 0, n = 0; n < e.sfbmax; n++) {
            var s = e.width[n],
              r = e.scalefac[n];
            if (0 != e.preflag && (r += g.pretab[n]), a += s, 0 != (1 & r)) {
              r++;
              for (var i = -s; i < 0; i++) t[a + i] *= 1.2968395546510096, t[a + i] > e.xrpow_max && (e.xrpow_max = t[a + i]);
            }
            e.scalefac[n] = r >> 1;
          }
          e.preflag = 0, e.scalefac_scale = 1;
        }(t, n), i = !1) : t.block_type == Ae.SHORT_TYPE && 0 < r.subblock_gain && (i = function (e, t, a) {
          var n,
            s = t.scalefac;
          for (n = 0; n < t.sfb_lmax; n++) if (16 <= s[n]) return !0;
          for (var r = 0; r < 3; r++) {
            var i = 0,
              o = 0;
            for (n = t.sfb_lmax + r; n < t.sfbdivide; n += 3) i < s[n] && (i = s[n]);
            for (; n < t.sfbmax; n += 3) o < s[n] && (o = s[n]);
            if (!(i < 16 && o < 8)) {
              if (7 <= t.subblock_gain[r]) return !0;
              t.subblock_gain[r]++;
              var _ = e.scalefac_band.l[t.sfb_lmax];
              for (n = t.sfb_lmax + r; n < t.sfbmax; n += 3) {
                var l = t.width[n],
                  f = s[n];
                if (0 <= (f -= 4 >> t.scalefac_scale)) s[n] = f, _ += 3 * l;else {
                  s[n] = 0;
                  var c = 210 + (f << t.scalefac_scale + 1);
                  h = g.IPOW20(c), _ += l * (r + 1);
                  for (var u = -l; u < 0; u++) a[_ + u] *= h, a[_ + u] > t.xrpow_max && (t.xrpow_max = a[_ + u]);
                  _ += l * (3 - r - 1);
                }
              }
              var h = g.IPOW20(202);
              _ += t.width[n] * (r + 1);
              for (var u = -t.width[n]; u < 0; u++) a[_ + u] *= h, a[_ + u] > t.xrpow_max && (t.xrpow_max = a[_ + u]);
            }
          }
          return !1;
        }(r, t, n) || o(t))), i || (i = 2 == r.mode_gr ? w.scale_bitcount(t) : w.scale_bitcount_lsf(r, t)), i));
      }
      this.setModules = function (e, t, a, n) {
        r = t, this.rv = t, g = a, this.qupvt = a, w = n, s.setModules(g, w);
      }, this.init_xrpow = function (e, t, a) {
        var n = 0,
          s = 0 | t.max_nonzero_coeff;
        if (t.xrpow_max = 0, we.fill(a, s, 576, 0), 1e-20 < (n = function (e, t, a, n) {
          for (var s = n = 0; s <= a; ++s) {
            var r = Math.abs(e.xr[s]);
            n += r, t[s] = Math.sqrt(r * Math.sqrt(r)), t[s] > e.xrpow_max && (e.xrpow_max = t[s]);
          }
          return n;
        }(t, a, s, n))) {
          var r = 0;
          0 != (2 & e.substep_shaping) && (r = 1);
          for (var i = 0; i < t.psymax; i++) e.pseudohalf[i] = r;
          return !0;
        }
        return we.fill(t.l3_enc, 0, 576, 0), !1;
      }, this.init_outer_loop = function (e, t) {
        t.part2_3_length = 0, t.big_values = 0, t.count1 = 0, t.global_gain = 210, t.scalefac_compress = 0, t.table_select[0] = 0, t.table_select[1] = 0, t.table_select[2] = 0, t.subblock_gain[0] = 0, t.subblock_gain[1] = 0, t.subblock_gain[2] = 0, t.subblock_gain[3] = 0, t.region0_count = 0, t.region1_count = 0, t.preflag = 0, t.scalefac_scale = 0, t.count1table_select = 0, t.part2_length = 0, t.sfb_lmax = Ae.SBPSY_l, t.sfb_smin = Ae.SBPSY_s, t.psy_lmax = e.sfb21_extra ? Ae.SBMAX_l : Ae.SBPSY_l, t.psymax = t.psy_lmax, t.sfbmax = t.sfb_lmax, t.sfbdivide = 11;
        for (var a = 0; a < Ae.SBMAX_l; a++) t.width[a] = e.scalefac_band.l[a + 1] - e.scalefac_band.l[a], t.window[a] = 3;
        if (t.block_type == Ae.SHORT_TYPE) {
          var n = de(576);
          t.sfb_smin = 0, (t.sfb_lmax = 0) != t.mixed_block_flag && me(), t.psymax = t.sfb_lmax + 3 * ((e.sfb21_extra ? Ae.SBMAX_s : Ae.SBPSY_s) - t.sfb_smin), t.sfbmax = t.sfb_lmax + 3 * (Ae.SBPSY_s - t.sfb_smin), t.sfbdivide = t.sfbmax - 18, t.psy_lmax = t.sfb_lmax;
          var s = e.scalefac_band.l[t.sfb_lmax];
          I.arraycopy(t.xr, 0, n, 0, 576);
          for (var a = t.sfb_smin; a < Ae.SBMAX_s; a++) for (var r = e.scalefac_band.s[a], i = e.scalefac_band.s[a + 1], o = 0; o < 3; o++) for (var _ = r; _ < i; _++) t.xr[s++] = n[3 * _ + o];
          for (var l = t.sfb_lmax, a = t.sfb_smin; a < Ae.SBMAX_s; a++) t.width[l] = t.width[l + 1] = t.width[l + 2] = e.scalefac_band.s[a + 1] - e.scalefac_band.s[a], t.window[l] = 0, t.window[l + 1] = 1, t.window[l + 2] = 2, l += 3;
        }
        t.count1bits = 0, t.sfb_partition_table = g.nr_of_sfb_block[0][0], t.slen[0] = 0, t.slen[1] = 0, t.slen[2] = 0, t.slen[3] = 0, t.max_nonzero_coeff = 575, we.fill(t.scalefac, 0), function (e, t) {
          var a = e.ATH,
            n = t.xr;
          if (t.block_type != Ae.SHORT_TYPE) for (var s = !1, r = Ae.PSFB21 - 1; 0 <= r && !s; r--) {
            var i = e.scalefac_band.psfb21[r],
              o = e.scalefac_band.psfb21[r + 1],
              _ = g.athAdjust(a.adjust, a.psfb21[r], a.floor);
            1e-12 < e.nsPsy.longfact[21] && (_ *= e.nsPsy.longfact[21]);
            for (var l = o - 1; i <= l; l--) {
              if (!(Math.abs(n[l]) < _)) {
                s = !0;
                break;
              }
              n[l] = 0;
            }
          } else for (var f = 0; f < 3; f++) for (var s = !1, r = Ae.PSFB12 - 1; 0 <= r && !s; r--) {
            var i = 3 * e.scalefac_band.s[12] + (e.scalefac_band.s[13] - e.scalefac_band.s[12]) * f + (e.scalefac_band.psfb12[r] - e.scalefac_band.psfb12[0]),
              o = i + (e.scalefac_band.psfb12[r + 1] - e.scalefac_band.psfb12[r]),
              c = g.athAdjust(a.adjust, a.psfb12[r], a.floor);
            1e-12 < e.nsPsy.shortfact[12] && (c *= e.nsPsy.shortfact[12]);
            for (var l = o - 1; i <= l; l--) {
              if (!(Math.abs(n[l]) < c)) {
                s = !0;
                break;
              }
              n[l] = 0;
            }
          }
        }(e, t);
      }, S.BINSEARCH_NONE = new S(0), S.BINSEARCH_UP = new S(1), S.BINSEARCH_DOWN = new S(2), this.outer_loop = function (e, t, a, n, s, r) {
        var i = e.internal_flags,
          o = new B(),
          _ = de(576),
          l = de(F.SFBMAX),
          f = new x(),
          c = new function () {
            this.global_gain = 0, this.sfb_count1 = 0, this.step = ve(39), this.noise = de(39), this.noise_log = de(39);
          }(),
          u = 9999999,
          h = !1;
        if (function (e, t, a, n, s) {
          var r,
            i = e.CurrentStep[n],
            o = !1,
            _ = e.OldValue[n],
            l = S.BINSEARCH_NONE;
          for (t.global_gain = _, a -= t.part2_length;;) {
            var f;
            if (r = w.count_bits(e, s, t, null), 1 == i || r == a) break;
            a < r ? (l == S.BINSEARCH_DOWN && (o = !0), o && (i /= 2), l = S.BINSEARCH_UP, f = i) : (l == S.BINSEARCH_UP && (o = !0), o && (i /= 2), l = S.BINSEARCH_DOWN, f = -i), t.global_gain += f, t.global_gain < 0 && me(), 255 < t.global_gain && me();
          }
          for (; a < r && t.global_gain < 255;) t.global_gain++, r = w.count_bits(e, s, t, null);
          e.CurrentStep[n] = 4 <= _ - t.global_gain ? 4 : 2, e.OldValue[n] = t.global_gain, t.part2_3_length = r;
        }(i, t, r, s, n), 0 == i.noise_shaping) return 100;
        g.calc_noise(t, a, l, f, c), f.bits = t.part2_3_length, o.assign(t);
        var b = 0;
        for (I.arraycopy(n, 0, _, 0, 576); !h;) {
          do {
            var p,
              m = new x(),
              v = 255;
            if (p = 0 != (2 & i.substep_shaping) ? 20 : 3, i.sfb21_extra && me(), !y(e, o, l, n)) break;
            0 != o.scalefac_scale && (v = 254);
            var d = r - o.part2_length;
            if (d <= 0) break;
            for (; (o.part2_3_length = w.count_bits(i, n, o, c)) > d && o.global_gain <= v;) o.global_gain++;
            if (o.global_gain > v) break;
            if (0 == f.over_count) {
              for (; (o.part2_3_length = w.count_bits(i, n, o, c)) > u && o.global_gain <= v;) o.global_gain++;
              if (o.global_gain > v) break;
            }
            if (g.calc_noise(o, a, l, m, c), m.bits = o.part2_3_length, 0 != (M(t.block_type != Ae.SHORT_TYPE ? e.quant_comp : e.quant_comp_short, f, m) ? 1 : 0)) u = t.part2_3_length, f = m, t.assign(o), b = 0, I.arraycopy(n, 0, _, 0, 576);else if (0 == i.full_outer_loop) {
              if (++b > p && 0 == f.over_count) break;
              i.noise_shaping_amp, i.noise_shaping_amp;
            }
          } while (o.global_gain + o.scalefac_scale < 255);
          3 == i.noise_shaping_amp ? me() : h = !0;
        }
        return e.VBR == Me.vbr_rh || e.VBR == Me.vbr_mtrh ? I.arraycopy(_, 0, n, 0, 576) : 0 != (1 & i.substep_shaping) && me(), f.over_count;
      }, this.iteration_finish_one = function (e, t, a) {
        var n = e.l3_side,
          s = n.tt[t][a];
        w.best_scalefac_store(e, t, a, n), 1 == e.use_best_huffman && w.best_huffman_divide(e, s), r.ResvAdjust(e, s);
      };
    }
    function L() {
      this.thm = new i(), this.en = new i();
    }
    function Ae() {
      var k = Ae.MPG_MD_MS_LR,
        R = null,
        x = this.psy = null,
        B = null;
      this.setModules = function (e, t, a, n) {
        R = e, this.psy = t, x = t, B = n;
      };
      var T = new function () {
        var u = [-.1482523854003001, 32.308141959636465, 296.40344946382766, 883.1344870032432, 11113.947376231741, 1057.2713659324597, 305.7402417275812, 30.825928907280012, 3.8533188138216365, 59.42900443849514, 709.5899960123345, 5281.91112291017, -5829.66483675846, -817.6293103748613, -76.91656988279972, -4.594269939176596, .9063471690191471, .1960342806591213, -.15466694054279598, 34.324387823855965, 301.8067566458425, 817.599602898885, 11573.795901679885, 1181.2520595540152, 321.59731579894424, 31.232021761053772, 3.7107095756221318, 53.650946155329365, 684.167428119626, 5224.56624370173, -6366.391851890084, -908.9766368219582, -89.83068876699639, -5.411397422890401, .8206787908286602, .3901806440322567, -.16070888947830023, 36.147034243915876, 304.11815768187864, 732.7429163887613, 11989.60988270091, 1300.012278487897, 335.28490093152146, 31.48816102859945, 3.373875931311736, 47.232241542899175, 652.7371796173471, 5132.414255594984, -6909.087078780055, -1001.9990371107289, -103.62185754286375, -6.104916304710272, .7416505462720353, .5805693545089249, -.16636367662261495, 37.751650073343995, 303.01103387567713, 627.9747488785183, 12358.763425278165, 1412.2779918482834, 346.7496836825721, 31.598286663170416, 3.1598635433980946, 40.57878626349686, 616.1671130880391, 5007.833007176154, -7454.040671756168, -1095.7960341867115, -118.24411666465777, -6.818469345853504, .6681786379192989, .7653668647301797, -.1716176790982088, 39.11551877123304, 298.3413246578966, 503.5259106886539, 12679.589408408976, 1516.5821921214542, 355.9850766329023, 31.395241710249053, 2.9164211881972335, 33.79716964664243, 574.8943997801362, 4853.234992253242, -7997.57021486075, -1189.7624067269965, -133.6444792601766, -7.7202770609839915, .5993769336819237, .9427934736519954, -.17645823955292173, 40.21879108166477, 289.9982036694474, 359.3226160751053, 12950.259102786438, 1612.1013903507662, 362.85067106591504, 31.045922092242872, 2.822222032597987, 26.988862316190684, 529.8996541764288, 4671.371946949588, -8535.899136645805, -1282.5898586244496, -149.58553632943463, -8.643494270763135, .5345111359507916, 1.111140466039205, -.36174739330527045, 41.04429910497807, 277.5463268268618, 195.6386023135583, 13169.43812144731, 1697.6433561479398, 367.40983966190305, 30.557037410382826, 2.531473372857427, 20.070154905927314, 481.50208566532336, 4464.970341588308, -9065.36882077239, -1373.62841526722, -166.1660487028118, -9.58289321133207, .4729647758913199, 1.268786568327291, -.36970682634889585, 41.393213350082036, 261.2935935556502, 12.935476055240873, 13336.131683328815, 1772.508612059496, 369.76534388639965, 29.751323653701338, 2.4023193045459172, 13.304795348228817, 430.5615775526625, 4237.0568611071185, -9581.931701634761, -1461.6913552409758, -183.12733958476446, -10.718010163869403, .41421356237309503, 1.414213562373095, -.37677560326535325, 41.619486213528496, 241.05423794991074, -187.94665032361226, 13450.063605744153, 1836.153896465782, 369.4908799925761, 29.001847876923147, 2.0714759319987186, 6.779591200894186, 377.7767837205709, 3990.386575512536, -10081.709459700915, -1545.947424837898, -200.3762958015653, -11.864482073055006, .3578057213145241, 1.546020906725474, -.3829366947518991, 41.1516456456653, 216.47684307105183, -406.1569483347166, 13511.136535077321, 1887.8076599260432, 367.3025214564151, 28.136213436723654, 1.913880671464418, .3829366947518991, 323.85365704338597, 3728.1472257487526, -10561.233882199509, -1625.2025997821418, -217.62525175416, -13.015432208941645, .3033466836073424, 1.66293922460509, -.5822628872992417, 40.35639251440489, 188.20071124269245, -640.2706748618148, 13519.21490106562, 1927.6022433578062, 362.8197642637487, 26.968821921868447, 1.7463817695935329, -5.62650678237171, 269.3016715297017, 3453.386536448852, -11016.145278780888, -1698.6569643425091, -234.7658734267683, -14.16351421663124, .2504869601913055, 1.76384252869671, -.5887180101749253, 39.23429103868072, 155.76096234403798, -889.2492977967378, 13475.470561874661, 1955.0535223723712, 356.4450994756727, 25.894952980042156, 1.5695032905781554, -11.181939564328772, 214.80884394039484, 3169.1640829158237, -11443.321309975563, -1765.1588461316153, -251.68908574481912, -15.49755935939164, .198912367379658, 1.847759065022573, -.7912582233652842, 37.39369355329111, 119.699486012458, -1151.0956593239027, 13380.446257078214, 1970.3952110853447, 348.01959814116185, 24.731487364283044, 1.3850130831637748, -16.421408865300393, 161.05030052864092, 2878.3322807850063, -11838.991423510031, -1823.985884688674, -268.2854986386903, -16.81724543849939, .1483359875383474, 1.913880671464418, -.7960642926861912, 35.2322109610459, 80.01928065061526, -1424.0212633405113, 13235.794061869668, 1973.804052543835, 337.9908651258184, 23.289159354463873, 1.3934255946442087, -21.099669467133474, 108.48348407242611, 2583.700758091299, -12199.726194855148, -1874.2780658979746, -284.2467154529415, -18.11369784385905, .09849140335716425, 1.961570560806461, -.998795456205172, 32.56307803611191, 36.958364584370486, -1706.075448829146, 13043.287458812016, 1965.3831106103316, 326.43182772364605, 22.175018750622293, 1.198638339011324, -25.371248002043963, 57.53505923036915, 2288.41886619975, -12522.674544337233, -1914.8400385312243, -299.26241273417224, -19.37805630698734, .04912684976946725, 1.990369453344394, .035780907 * V.SQRT2 * .5 / 2384e-9, .017876148 * V.SQRT2 * .5 / 2384e-9, .003134727 * V.SQRT2 * .5 / 2384e-9, .002457142 * V.SQRT2 * .5 / 2384e-9, 971317e-9 * V.SQRT2 * .5 / 2384e-9, 218868e-9 * V.SQRT2 * .5 / 2384e-9, 101566e-9 * V.SQRT2 * .5 / 2384e-9, 13828e-9 * V.SQRT2 * .5 / 2384e-9, 12804.797818791945, 1945.5515939597317, 313.4244966442953, 49591e-9 / 2384e-9, 1995.1556208053692, 21458e-9 / 2384e-9, -69618e-9 / 2384e-9],
          A = [[2.382191739347913e-13, 6.423305872147834e-13, 9.400849094049688e-13, 1.122435026096556e-12, 1.183840321267481e-12, 1.122435026096556e-12, 9.40084909404969e-13, 6.423305872147839e-13, 2.382191739347918e-13, 5.456116108943412e-12, 4.878985199565852e-12, 4.240448995017367e-12, 3.559909094758252e-12, 2.858043359288075e-12, 2.156177623817898e-12, 1.475637723558783e-12, 8.371015190102974e-13, 2.599706096327376e-13, -5.456116108943412e-12, -4.878985199565852e-12, -4.240448995017367e-12, -3.559909094758252e-12, -2.858043359288076e-12, -2.156177623817898e-12, -1.475637723558783e-12, -8.371015190102975e-13, -2.599706096327376e-13, -2.382191739347923e-13, -6.423305872147843e-13, -9.400849094049696e-13, -1.122435026096556e-12, -1.183840321267481e-12, -1.122435026096556e-12, -9.400849094049694e-13, -6.42330587214784e-13, -2.382191739347918e-13], [2.382191739347913e-13, 6.423305872147834e-13, 9.400849094049688e-13, 1.122435026096556e-12, 1.183840321267481e-12, 1.122435026096556e-12, 9.400849094049688e-13, 6.423305872147841e-13, 2.382191739347918e-13, 5.456116108943413e-12, 4.878985199565852e-12, 4.240448995017367e-12, 3.559909094758253e-12, 2.858043359288075e-12, 2.156177623817898e-12, 1.475637723558782e-12, 8.371015190102975e-13, 2.599706096327376e-13, -5.461314069809755e-12, -4.921085770524055e-12, -4.343405037091838e-12, -3.732668368707687e-12, -3.093523840190885e-12, -2.430835727329465e-12, -1.734679010007751e-12, -9.74825365660928e-13, -2.797435120168326e-13, 0, 0, 0, 0, 0, 0, -2.283748241799531e-13, -4.037858874020686e-13, -2.146547464825323e-13], [.1316524975873958, .414213562373095, .7673269879789602, 1.091308501069271, 1.303225372841206, 1.56968557711749, 1.920982126971166, 2.414213562373094, 3.171594802363212, 4.510708503662055, 7.595754112725146, 22.90376554843115, .984807753012208, .6427876096865394, .3420201433256688, .9396926207859084, -.1736481776669303, -.7660444431189779, .8660254037844387, .5, -.5144957554275265, -.4717319685649723, -.3133774542039019, -.1819131996109812, -.09457419252642064, -.04096558288530405, -.01419856857247115, -.003699974673760037, .8574929257125442, .8817419973177052, .9496286491027329, .9833145924917901, .9955178160675857, .9991605581781475, .999899195244447, .9999931550702802], [0, 0, 0, 0, 0, 0, 2.283748241799531e-13, 4.037858874020686e-13, 2.146547464825323e-13, 5.461314069809755e-12, 4.921085770524055e-12, 4.343405037091838e-12, 3.732668368707687e-12, 3.093523840190885e-12, 2.430835727329466e-12, 1.734679010007751e-12, 9.74825365660928e-13, 2.797435120168326e-13, -5.456116108943413e-12, -4.878985199565852e-12, -4.240448995017367e-12, -3.559909094758253e-12, -2.858043359288075e-12, -2.156177623817898e-12, -1.475637723558782e-12, -8.371015190102975e-13, -2.599706096327376e-13, -2.382191739347913e-13, -6.423305872147834e-13, -9.400849094049688e-13, -1.122435026096556e-12, -1.183840321267481e-12, -1.122435026096556e-12, -9.400849094049688e-13, -6.423305872147841e-13, -2.382191739347918e-13]],
          k = A[Ae.SHORT_TYPE],
          S = A[Ae.SHORT_TYPE],
          R = A[Ae.SHORT_TYPE],
          x = A[Ae.SHORT_TYPE],
          B = [0, 1, 16, 17, 8, 9, 24, 25, 4, 5, 20, 21, 12, 13, 28, 29, 2, 3, 18, 19, 10, 11, 26, 27, 6, 7, 22, 23, 14, 15, 30, 31];
        function T(e, t, a) {
          for (var n, s, r, i = 10, o = t + 238 - 14 - 286, _ = -15; _ < 0; _++) {
            var l, f, c;
            l = u[i + -10], f = e[o + -224] * l, c = e[t + 224] * l, l = u[i + -9], f += e[o + -160] * l, c += e[t + 160] * l, l = u[i + -8], f += e[o + -96] * l, c += e[t + 96] * l, l = u[i + -7], f += e[o + -32] * l, c += e[t + 32] * l, l = u[i + -6], f += e[o + 32] * l, c += e[t + -32] * l, l = u[i + -5], f += e[o + 96] * l, c += e[t + -96] * l, l = u[i + -4], f += e[o + 160] * l, c += e[t + -160] * l, l = u[i + -3], f += e[o + 224] * l, c += e[t + -224] * l, l = u[i + -2], f += e[t + -256] * l, c -= e[o + 256] * l, l = u[i + -1], f += e[t + -192] * l, c -= e[o + 192] * l, l = u[i + 0], f += e[t + -128] * l, c -= e[o + 128] * l, l = u[i + 1], f += e[t + -64] * l, c -= e[o + 64] * l, l = u[i + 2], f += e[t + 0] * l, c -= e[o + 0] * l, l = u[i + 3], f += e[t + 64] * l, c -= e[o + -64] * l, l = u[i + 4], f += e[t + 128] * l, c -= e[o + -128] * l, l = u[i + 5], f += e[t + 192] * l, c -= e[o + -192] * l, f *= u[i + 6], l = c - f, a[30 + 2 * _] = c + f, a[31 + 2 * _] = u[i + 7] * l, i += 18, t--, o++;
          }
          c = e[t + -16] * u[i + -10], f = e[t + -32] * u[i + -2], c += (e[t + -48] - e[t + 16]) * u[i + -9], f += e[t + -96] * u[i + -1], c += (e[t + -80] + e[t + 48]) * u[i + -8], f += e[t + -160] * u[i + 0], c += (e[t + -112] - e[t + 80]) * u[i + -7], f += e[t + -224] * u[i + 1], c += (e[t + -144] + e[t + 112]) * u[i + -6], f -= e[t + 32] * u[i + 2], c += (e[t + -176] - e[t + 144]) * u[i + -5], f -= e[t + 96] * u[i + 3], c += (e[t + -208] + e[t + 176]) * u[i + -4], f -= e[t + 160] * u[i + 4], c += (e[t + -240] - e[t + 208]) * u[i + -3], f -= e[t + 224], n = f - c, s = f + c, c = a[14], f = a[15] - c, a[31] = s + c, a[30] = n + f, a[15] = n - f, a[14] = s - c, r = a[28] - a[0], a[0] += a[28], a[28] = r * u[i + -36 + 7], r = a[29] - a[1], a[1] += a[29], a[29] = r * u[i + -36 + 7], r = a[26] - a[2], a[2] += a[26], a[26] = r * u[i + -72 + 7], r = a[27] - a[3], a[3] += a[27], a[27] = r * u[i + -72 + 7], r = a[24] - a[4], a[4] += a[24], a[24] = r * u[i + -108 + 7], r = a[25] - a[5], a[5] += a[25], a[25] = r * u[i + -108 + 7], r = a[22] - a[6], a[6] += a[22], a[22] = r * V.SQRT2, r = a[23] - a[7], a[7] += a[23], a[23] = r * V.SQRT2 - a[7], a[7] -= a[6], a[22] -= a[7], a[23] -= a[22], r = a[6], a[6] = a[31] - r, a[31] = a[31] + r, r = a[7], a[7] = a[30] - r, a[30] = a[30] + r, r = a[22], a[22] = a[15] - r, a[15] = a[15] + r, r = a[23], a[23] = a[14] - r, a[14] = a[14] + r, r = a[20] - a[8], a[8] += a[20], a[20] = r * u[i + -180 + 7], r = a[21] - a[9], a[9] += a[21], a[21] = r * u[i + -180 + 7], r = a[18] - a[10], a[10] += a[18], a[18] = r * u[i + -216 + 7], r = a[19] - a[11], a[11] += a[19], a[19] = r * u[i + -216 + 7], r = a[16] - a[12], a[12] += a[16], a[16] = r * u[i + -252 + 7], r = a[17] - a[13], a[13] += a[17], a[17] = r * u[i + -252 + 7], r = -a[20] + a[24], a[20] += a[24], a[24] = r * u[i + -216 + 7], r = -a[21] + a[25], a[21] += a[25], a[25] = r * u[i + -216 + 7], r = a[4] - a[8], a[4] += a[8], a[8] = r * u[i + -216 + 7], r = a[5] - a[9], a[5] += a[9], a[9] = r * u[i + -216 + 7], r = a[0] - a[12], a[0] += a[12], a[12] = r * u[i + -72 + 7], r = a[1] - a[13], a[1] += a[13], a[13] = r * u[i + -72 + 7], r = a[16] - a[28], a[16] += a[28], a[28] = r * u[i + -72 + 7], r = -a[17] + a[29], a[17] += a[29], a[29] = r * u[i + -72 + 7], r = V.SQRT2 * (a[2] - a[10]), a[2] += a[10], a[10] = r, r = V.SQRT2 * (a[3] - a[11]), a[3] += a[11], a[11] = r, r = V.SQRT2 * (-a[18] + a[26]), a[18] += a[26], a[26] = r - a[18], r = V.SQRT2 * (-a[19] + a[27]), a[19] += a[27], a[27] = r - a[19], r = a[2], a[19] -= a[3], a[3] -= r, a[2] = a[31] - r, a[31] += r, r = a[3], a[11] -= a[19], a[18] -= r, a[3] = a[30] - r, a[30] += r, r = a[18], a[27] -= a[11], a[19] -= r, a[18] = a[15] - r, a[15] += r, r = a[19], a[10] -= r, a[19] = a[14] - r, a[14] += r, r = a[10], a[11] -= r, a[10] = a[23] - r, a[23] += r, r = a[11], a[26] -= r, a[11] = a[22] - r, a[22] += r, r = a[26], a[27] -= r, a[26] = a[7] - r, a[7] += r, r = a[27], a[27] = a[6] - r, a[6] += r, r = V.SQRT2 * (a[0] - a[4]), a[0] += a[4], a[4] = r, r = V.SQRT2 * (a[1] - a[5]), a[1] += a[5], a[5] = r, r = V.SQRT2 * (a[16] - a[20]), a[16] += a[20], a[20] = r, r = V.SQRT2 * (a[17] - a[21]), a[17] += a[21], a[21] = r, r = -V.SQRT2 * (a[8] - a[12]), a[8] += a[12], a[12] = r - a[8], r = -V.SQRT2 * (a[9] - a[13]), a[9] += a[13], a[13] = r - a[9], r = -V.SQRT2 * (a[25] - a[29]), a[25] += a[29], a[29] = r - a[25], r = -V.SQRT2 * (a[24] + a[28]), a[24] -= a[28], a[28] = r - a[24], r = a[24] - a[16], a[24] = r, r = a[20] - r, a[20] = r, r = a[28] - r, a[28] = r, r = a[25] - a[17], a[25] = r, r = a[21] - r, a[21] = r, r = a[29] - r, a[29] = r, r = a[17] - a[1], a[17] = r, r = a[9] - r, a[9] = r, r = a[25] - r, a[25] = r, r = a[5] - r, a[5] = r, r = a[21] - r, a[21] = r, r = a[13] - r, a[13] = r, r = a[29] - r, a[29] = r, r = a[1] - a[0], a[1] = r, r = a[16] - r, a[16] = r, r = a[17] - r, a[17] = r, r = a[8] - r, a[8] = r, r = a[9] - r, a[9] = r, r = a[24] - r, a[24] = r, r = a[25] - r, a[25] = r, r = a[4] - r, a[4] = r, r = a[5] - r, a[5] = r, r = a[20] - r, a[20] = r, r = a[21] - r, a[21] = r, r = a[12] - r, a[12] = r, r = a[13] - r, a[13] = r, r = a[28] - r, a[28] = r, r = a[29] - r, a[29] = r, r = a[0], a[0] += a[31], a[31] -= r, r = a[1], a[1] += a[30], a[30] -= r, r = a[16], a[16] += a[15], a[15] -= r, r = a[17], a[17] += a[14], a[14] -= r, r = a[8], a[8] += a[23], a[23] -= r, r = a[9], a[9] += a[22], a[22] -= r, r = a[24], a[24] += a[7], a[7] -= r, r = a[25], a[25] += a[6], a[6] -= r, r = a[4], a[4] += a[27], a[27] -= r, r = a[5], a[5] += a[26], a[26] -= r, r = a[20], a[20] += a[11], a[11] -= r, r = a[21], a[21] += a[10], a[10] -= r, r = a[12], a[12] += a[19], a[19] -= r, r = a[13], a[13] += a[18], a[18] -= r, r = a[28], a[28] += a[3], a[3] -= r, r = a[29], a[29] += a[2], a[2] -= r;
        }
        function E(e, t) {
          for (var a = 0; a < 3; a++) {
            var n, s, r, i, o, _;
            i = e[t + 6] * A[Ae.SHORT_TYPE][0] - e[t + 15], n = e[t + 0] * A[Ae.SHORT_TYPE][2] - e[t + 9], s = i + n, r = i - n, i = e[t + 15] * A[Ae.SHORT_TYPE][0] + e[t + 6], n = e[t + 9] * A[Ae.SHORT_TYPE][2] + e[t + 0], o = i + n, _ = -i + n, n = 2.069978111953089e-11 * (e[t + 3] * A[Ae.SHORT_TYPE][1] - e[t + 12]), i = 2.069978111953089e-11 * (e[t + 12] * A[Ae.SHORT_TYPE][1] + e[t + 3]), e[t + 0] = 1.90752519173728e-11 * s + n, e[t + 15] = 1.90752519173728e-11 * -o + i, r = .8660254037844387 * r * 1.907525191737281e-11, o = .5 * o * 1.907525191737281e-11 + i, e[t + 3] = r - o, e[t + 6] = r + o, s = .5 * s * 1.907525191737281e-11 - n, _ = .8660254037844387 * _ * 1.907525191737281e-11, e[t + 9] = s + _, e[t + 12] = s - _, t++;
          }
        }
        function C(e, t, a) {
          var n, s, r, i, o, _, l, f, c, u, h, b, p, m, v, d, g, w;
          r = a[17] - a[9], o = a[15] - a[11], _ = a[14] - a[12], l = a[0] + a[8], f = a[1] + a[7], c = a[2] + a[6], u = a[3] + a[5], e[t + 17] = l + c - u - (f - a[4]), s = (l + c - u) * S[19] + (f - a[4]), n = (r - o - _) * S[18], e[t + 5] = n + s, e[t + 6] = n - s, i = (a[16] - a[10]) * S[18], f = f * S[19] + a[4], n = r * S[12] + i + o * S[13] + _ * S[14], s = -l * S[16] + f - c * S[17] + u * S[15], e[t + 1] = n + s, e[t + 2] = n - s, n = r * S[13] - i - o * S[14] + _ * S[12], s = -l * S[17] + f - c * S[15] + u * S[16], e[t + 9] = n + s, e[t + 10] = n - s, n = r * S[14] - i + o * S[12] - _ * S[13], s = l * S[15] - f + c * S[16] - u * S[17], e[t + 13] = n + s, e[t + 14] = n - s, h = a[8] - a[0], p = a[6] - a[2], m = a[5] - a[3], v = a[17] + a[9], d = a[16] + a[10], g = a[15] + a[11], w = a[14] + a[12], e[t + 0] = v + g + w + (d + a[13]), n = (v + g + w) * S[19] - (d + a[13]), s = (h - p + m) * S[18], e[t + 11] = n + s, e[t + 12] = n - s, b = (a[7] - a[1]) * S[18], d = a[13] - d * S[19], n = v * S[15] - d + g * S[16] + w * S[17], s = h * S[14] + b + p * S[12] + m * S[13], e[t + 3] = n + s, e[t + 4] = n - s, n = -v * S[17] + d - g * S[15] - w * S[16], s = h * S[13] + b - p * S[14] - m * S[12], e[t + 7] = n + s, e[t + 8] = n - s, n = -v * S[16] + d - g * S[17] - w * S[15], s = h * S[12] - b + p * S[13] - m * S[14], e[t + 15] = n + s, e[t + 16] = n - s;
        }
        this.mdct_sub48 = function (e, t, a) {
          for (var n = t, s = 286, r = 0; r < e.channels_out; r++) {
            for (var i = 0; i < e.mode_gr; i++) {
              for (var o, _ = e.l3_side.tt[i][r], l = _.xr, f = 0, c = e.sb_sample[r][1 - i], u = 0, h = 0; h < 9; h++) for (T(n, s, c[u]), T(n, s + 32, c[u + 1]), u += 2, s += 64, o = 1; o < 32; o += 2) c[u - 1][o] *= -1;
              for (o = 0; o < 32; o++, f += 18) {
                var b = _.block_type,
                  p = e.sb_sample[r][i],
                  m = e.sb_sample[r][1 - i];
                if (0 != _.mixed_block_flag && o < 2 && (b = 0), e.amp_filter[o] < 1e-12) we.fill(l, f + 0, f + 18, 0);else if (e.amp_filter[o] < 1 && me(), b == Ae.SHORT_TYPE) {
                  for (var h = -3; h < 0; h++) {
                    var v = A[Ae.SHORT_TYPE][h + 3];
                    l[f + 3 * h + 9] = p[9 + h][B[o]] * v - p[8 - h][B[o]], l[f + 3 * h + 18] = p[14 - h][B[o]] * v + p[15 + h][B[o]], l[f + 3 * h + 10] = p[15 + h][B[o]] * v - p[14 - h][B[o]], l[f + 3 * h + 19] = m[2 - h][B[o]] * v + m[3 + h][B[o]], l[f + 3 * h + 11] = m[3 + h][B[o]] * v - m[2 - h][B[o]], l[f + 3 * h + 20] = m[8 - h][B[o]] * v + m[9 + h][B[o]];
                  }
                  E(l, f);
                } else {
                  for (var d = de(18), h = -9; h < 0; h++) {
                    var g, w;
                    g = A[b][h + 27] * m[h + 9][B[o]] + A[b][h + 36] * m[8 - h][B[o]], w = A[b][h + 9] * p[h + 9][B[o]] - A[b][h + 18] * p[8 - h][B[o]], d[h + 9] = g - w * k[3 + h + 9], d[h + 18] = g * k[3 + h + 9] + w;
                  }
                  C(l, f, d);
                }
                if (b != Ae.SHORT_TYPE && 0 != o) for (var h = 7; 0 <= h; --h) {
                  var S, M;
                  S = l[f + h] * R[20 + h] + l[f + -1 - h] * x[28 + h], M = l[f + h] * x[28 + h] - l[f + -1 - h] * R[20 + h], l[f + -1 - h] = S, l[f + h] = M;
                }
              }
            }
            if (n = a, s = 286, 1 == e.mode_gr) for (var y = 0; y < 18; y++) I.arraycopy(e.sb_sample[r][1][y], 0, e.sb_sample[r][0][y], 0, 32);
          }
        };
      }();
      this.lame_encode_mp3_frame = function (e, t, a, n, s, r) {
        var i,
          o = E([2, 2]);
        o[0][0] = new L(), o[0][1] = new L(), o[1][0] = new L(), o[1][1] = new L();
        var _,
          l = E([2, 2]);
        l[0][0] = new L(), l[0][1] = new L(), l[1][0] = new L(), l[1][1] = new L();
        var f,
          c,
          u,
          h = [null, null],
          b = e.internal_flags,
          p = ge([2, 4]),
          m = [[0, 0], [0, 0]],
          v = [[0, 0], [0, 0]];
        if (h[0] = t, h[1] = a, 0 == b.lame_encode_frame_init && function (e, t) {
          var a,
            n,
            s = e.internal_flags;
          if (0 == s.lame_encode_frame_init) {
            var r,
              i,
              o = de(2014),
              _ = de(2014);
            for (s.lame_encode_frame_init = 1, i = r = 0; r < 286 + 576 * (1 + s.mode_gr); ++r) r < 576 * s.mode_gr ? (o[r] = 0, 2 == s.channels_out && (_[r] = 0)) : (o[r] = t[0][i], 2 == s.channels_out && (_[r] = t[1][i]), ++i);
            for (n = 0; n < s.mode_gr; n++) for (a = 0; a < s.channels_out; a++) s.l3_side.tt[n][a].block_type = Ae.SHORT_TYPE;
            T.mdct_sub48(s, o, _);
          }
        }(e, h), b.padding = 0, (b.slot_lag -= b.frac_SpF) < 0 && (b.slot_lag += e.out_samplerate, b.padding = 1), 0 != b.psymodel) {
          var d,
            g = [null, null],
            w = 0,
            S = ve(2);
          for (u = 0; u < b.mode_gr; u++) {
            for (c = 0; c < b.channels_out; c++) g[c] = h[c], w = 576 + 576 * u - Ae.FFTOFFSET;
            if (e.VBR == Me.vbr_mtrh || e.VBR == Me.vbr_mt ? me() : d = x.L3psycho_anal_ns(e, g, w, u, o, l, m[u], v[u], p[u], S), 0 != d) return -4;
            for (e.mode == ye.JOINT_STEREO && me(), c = 0; c < b.channels_out; c++) {
              var M = b.l3_side.tt[u][c];
              M.block_type = S[c], M.mixed_block_flag = 0;
            }
          }
        } else me();
        if (function (e) {
          var t, a;
          if (0 == e.ATH.useAdjust) return e.ATH.adjust = 1;
          if (a = e.loudness_sq[0][0], t = e.loudness_sq[1][0], 2 == e.channels_out ? me() : (a += a, t += t), 2 == e.mode_gr && (a = Math.max(a, t)), a *= .5, .03125 < (a *= e.ATH.aaSensitivityP)) 1 <= e.ATH.adjust ? e.ATH.adjust = 1 : e.ATH.adjust < e.ATH.adjustLimit && (e.ATH.adjust = e.ATH.adjustLimit), e.ATH.adjustLimit = 1;else {
            var n = 31.98 * a + 625e-6;
            e.ATH.adjust >= n ? (e.ATH.adjust *= .075 * n + .925, e.ATH.adjust < n && (e.ATH.adjust = n)) : e.ATH.adjustLimit >= n ? e.ATH.adjust = n : e.ATH.adjust < e.ATH.adjustLimit && (e.ATH.adjust = e.ATH.adjustLimit), e.ATH.adjustLimit = n;
          }
        }(b), T.mdct_sub48(b, h[0], h[1]), b.mode_ext = Ae.MPG_MD_LR_LR, e.force_ms ? b.mode_ext = Ae.MPG_MD_MS_LR : e.mode == ye.JOINT_STEREO && me(), b.mode_ext == k ? (_ = l, f = v) : (_ = o, f = m), e.analysis && null != b.pinfo && me(), e.VBR == Me.vbr_off || e.VBR == Me.vbr_abr) {
          var y, A;
          for (y = 0; y < 18; y++) b.nsPsy.pefirbuf[y] = b.nsPsy.pefirbuf[y + 1];
          for (u = A = 0; u < b.mode_gr; u++) for (c = 0; c < b.channels_out; c++) A += f[u][c];
          for (b.nsPsy.pefirbuf[18] = A, A = b.nsPsy.pefirbuf[9], y = 0; y < 9; y++) A += (b.nsPsy.pefirbuf[y] + b.nsPsy.pefirbuf[18 - y]) * Ae.fircoef[y];
          for (A = 3350 * b.mode_gr * b.channels_out / A, u = 0; u < b.mode_gr; u++) for (c = 0; c < b.channels_out; c++) f[u][c] *= A;
        }
        return b.iteration_loop.iteration_loop(e, f, [.5, .5], _), R.format_bitstream(e), i = R.copy_buffer(b, n, s, r, 1), e.bWriteVbrTag && B.addVbrFrame(e), e.analysis && null != b.pinfo && me(), function (e) {
          var t, a;
          for (e.bitrate_stereoMode_Hist[e.bitrate_index][4]++, e.bitrate_stereoMode_Hist[15][4]++, 2 == e.channels_out && me(), t = 0; t < e.mode_gr; ++t) for (a = 0; a < e.channels_out; ++a) {
            var n = 0 | e.l3_side.tt[t][a].block_type;
            0 != e.l3_side.tt[t][a].mixed_block_flag && (n = 4), e.bitrate_blockType_Hist[e.bitrate_index][n]++, e.bitrate_blockType_Hist[e.bitrate_index][5]++, e.bitrate_blockType_Hist[15][n]++, e.bitrate_blockType_Hist[15][5]++;
          }
        }(b), i;
      };
    }
    function i() {
      this.l = de(Ae.SBMAX_l), this.s = ge([Ae.SBMAX_s, 3]);
      var n = this;
      this.assign = function (e) {
        I.arraycopy(e.l, 0, n.l, 0, Ae.SBMAX_l);
        for (var t = 0; t < Ae.SBMAX_s; t++) for (var a = 0; a < 3; a++) n.s[t][a] = e.s[t][a];
      };
    }
    function j() {
      var e = 40;
      function t() {
        this.write_timing = 0, this.ptr = 0, this.buf = S(e);
      }
      this.Class_ID = 0, this.lame_encode_frame_init = 0, this.iteration_init_init = 0, this.fill_buffer_resample_init = 0, this.mfbuf = ge([2, j.MFSIZE]), this.mode_gr = 0, this.channels_in = 0, this.channels_out = 0, this.resample_ratio = 0, this.mf_samples_to_encode = 0, this.mf_size = 0, this.VBR_min_bitrate = 0, this.VBR_max_bitrate = 0, this.bitrate_index = 0, this.samplerate_index = 0, this.mode_ext = 0, this.lowpass1 = 0, this.lowpass2 = 0, this.highpass1 = 0, this.highpass2 = 0, this.noise_shaping = 0, this.noise_shaping_amp = 0, this.substep_shaping = 0, this.psymodel = 0, this.noise_shaping_stop = 0, this.subblock_gain = 0, this.use_best_huffman = 0, this.full_outer_loop = 0, this.l3_side = new function () {
        this.tt = [[null, null], [null, null]], this.main_data_begin = 0, this.private_bits = 0, this.resvDrain_pre = 0, this.resvDrain_post = 0, this.scfsi = [ve(4), ve(4)];
        for (var e = 0; e < 2; e++) for (var t = 0; t < 2; t++) this.tt[e][t] = new B();
      }(), this.ms_ratio = de(2), this.padding = 0, this.frac_SpF = 0, this.slot_lag = 0, this.tag_spec = null, this.nMusicCRC = 0, this.OldValue = ve(2), this.CurrentStep = ve(2), this.masking_lower = 0, this.bv_scf = ve(576), this.pseudohalf = ve(F.SFBMAX), this.sfb21_extra = !1, this.inbuf_old = new Array(2), this.blackfilt = new Array(2 * j.BPC + 1), this.itime = n(2), this.sideinfo_len = 0, this.sb_sample = ge([2, 2, 18, Ae.SBLIMIT]), this.amp_filter = de(32), this.header = new Array(j.MAX_HEADER_BUF), this.h_ptr = 0, this.w_ptr = 0, this.ancillary_flag = 0, this.ResvSize = 0, this.ResvMax = 0, this.scalefac_band = new r(), this.minval_l = de(Ae.CBANDS), this.minval_s = de(Ae.CBANDS), this.nb_1 = ge([4, Ae.CBANDS]), this.nb_2 = ge([4, Ae.CBANDS]), this.nb_s1 = ge([4, Ae.CBANDS]), this.nb_s2 = ge([4, Ae.CBANDS]), this.s3_ss = null, this.s3_ll = null, this.decay = 0, this.thm = new Array(4), this.en = new Array(4), this.tot_ener = de(4), this.loudness_sq = ge([2, 2]), this.loudness_sq_save = de(2), this.mld_l = de(Ae.SBMAX_l), this.mld_s = de(Ae.SBMAX_s), this.bm_l = ve(Ae.SBMAX_l), this.bo_l = ve(Ae.SBMAX_l), this.bm_s = ve(Ae.SBMAX_s), this.bo_s = ve(Ae.SBMAX_s), this.npart_l = 0, this.npart_s = 0, this.s3ind = w([Ae.CBANDS, 2]), this.s3ind_s = w([Ae.CBANDS, 2]), this.numlines_s = ve(Ae.CBANDS), this.numlines_l = ve(Ae.CBANDS), this.rnumlines_l = de(Ae.CBANDS), this.mld_cb_l = de(Ae.CBANDS), this.mld_cb_s = de(Ae.CBANDS), this.numlines_s_num1 = 0, this.numlines_l_num1 = 0, this.pe = de(4), this.ms_ratio_s_old = 0, this.ms_ratio_l_old = 0, this.ms_ener_ratio_old = 0, this.blocktype_old = ve(2), this.nsPsy = new function () {
        this.last_en_subshort = ge([4, 9]), this.lastAttacks = ve(4), this.pefirbuf = de(19), this.longfact = de(Ae.SBMAX_l), this.shortfact = de(Ae.SBMAX_s), this.attackthre = 0, this.attackthre_s = 0;
      }(), this.VBR_seek_table = new function () {
        this.sum = 0, this.seen = 0, this.want = 0, this.pos = 0, this.size = 0, this.bag = null, this.nVbrNumFrames = 0, this.nBytesWritten = 0, this.TotalFrameSize = 0;
      }(), this.ATH = null, this.PSY = null, this.nogap_total = 0, this.nogap_current = 0, this.decode_on_the_fly = !0, this.findReplayGain = !0, this.findPeakSample = !0, this.PeakSample = 0, this.RadioGain = 0, this.AudiophileGain = 0, this.rgdata = null, this.noclipGainChange = 0, this.noclipScale = 0, this.bitrate_stereoMode_Hist = w([16, 5]), this.bitrate_blockType_Hist = w([16, 6]), this.pinfo = null, this.hip = null, this.in_buffer_nsamples = 0, this.in_buffer_0 = null, this.in_buffer_1 = null, this.iteration_loop = null;
      for (var a = 0; a < this.en.length; a++) this.en[a] = new i();
      for (var a = 0; a < this.thm.length; a++) this.thm[a] = new i();
      for (var a = 0; a < this.header.length; a++) this.header[a] = new t();
    }
    function X() {
      var k = new function () {
          var h = de(Ae.BLKSIZE),
            p = de(Ae.BLKSIZE_s / 2),
            x = [.9238795325112867, .3826834323650898, .9951847266721969, .0980171403295606, .9996988186962042, .02454122852291229, .9999811752826011, .006135884649154475];
          function m(e, t, a) {
            var n,
              s,
              r,
              i = 0,
              o = t + (a <<= 1);
            n = 4;
            do {
              var _, l, f, c, u, h, b;
              for (b = n >> 1, h = (u = (c = n) << 1) + c, n = u << 1, r = (s = t) + b; S = e[s + 0] - e[s + c], w = e[s + 0] + e[s + c], k = e[s + u] - e[s + h], y = e[s + u] + e[s + h], e[s + u] = w - y, e[s + 0] = w + y, e[s + h] = S - k, e[s + c] = S + k, S = e[r + 0] - e[r + c], w = e[r + 0] + e[r + c], k = V.SQRT2 * e[r + h], y = V.SQRT2 * e[r + u], e[r + u] = w - y, e[r + 0] = w + y, e[r + h] = S - k, e[r + c] = S + k, r += n, (s += n) < o;);
              for (l = x[i + 0], _ = x[i + 1], f = 1; f < b; f++) {
                var p, m;
                p = 1 - 2 * _ * _, m = 2 * _ * l, s = t + f, r = t + c - f;
                do {
                  var v, d, g, w, S, M, y, A, k, R;
                  d = m * e[s + c] - p * e[r + c], v = p * e[s + c] + m * e[r + c], S = e[s + 0] - v, w = e[s + 0] + v, M = e[r + 0] - d, g = e[r + 0] + d, d = m * e[s + h] - p * e[r + h], v = p * e[s + h] + m * e[r + h], k = e[s + u] - v, y = e[s + u] + v, R = e[r + u] - d, A = e[r + u] + d, d = _ * y - l * R, v = l * y + _ * R, e[s + u] = w - v, e[s + 0] = w + v, e[r + h] = M - d, e[r + c] = M + d, d = l * A - _ * k, v = _ * A + l * k, e[r + u] = g - v, e[r + 0] = g + v, e[s + h] = S - d, e[s + c] = S + d, r += n, s += n;
                } while (s < o);
                l = (p = l) * x[i + 0] - _ * x[i + 1], _ = p * x[i + 1] + _ * x[i + 0];
              }
              i += 2;
            } while (n < a);
          }
          var v = [0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240, 8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248, 4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244, 12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252, 2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, 178, 114, 242, 10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250, 6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, 182, 118, 246, 14, 142, 78, 206, 46, 174, 110, 238, 30, 158, 94, 222, 62, 190, 126, 254];
          this.fft_short = function (e, t, a, n, s) {
            for (var r = 0; r < 3; r++) {
              var i = Ae.BLKSIZE_s / 2,
                o = 65535 & 192 * (r + 1),
                _ = Ae.BLKSIZE_s / 8 - 1;
              do {
                var l,
                  f,
                  c,
                  u,
                  h,
                  b = 255 & v[_ << 2];
                l = p[b] * n[a][s + b + o], h = p[127 - b] * n[a][s + b + o + 128], f = l - h, l += h, c = p[b + 64] * n[a][s + b + o + 64], h = p[63 - b] * n[a][s + b + o + 192], u = c - h, c += h, i -= 4, t[r][i + 0] = l + c, t[r][i + 2] = l - c, t[r][i + 1] = f + u, t[r][i + 3] = f - u, l = p[b + 1] * n[a][s + b + o + 1], h = p[126 - b] * n[a][s + b + o + 129], f = l - h, l += h, c = p[b + 65] * n[a][s + b + o + 65], h = p[62 - b] * n[a][s + b + o + 193], u = c - h, c += h, t[r][i + Ae.BLKSIZE_s / 2 + 0] = l + c, t[r][i + Ae.BLKSIZE_s / 2 + 2] = l - c, t[r][i + Ae.BLKSIZE_s / 2 + 1] = f + u, t[r][i + Ae.BLKSIZE_s / 2 + 3] = f - u;
              } while (0 <= --_);
              m(t[r], i, Ae.BLKSIZE_s / 2);
            }
          }, this.fft_long = function (e, t, a, n, s) {
            var r = Ae.BLKSIZE / 8 - 1,
              i = Ae.BLKSIZE / 2;
            do {
              var o,
                _,
                l,
                f,
                c,
                u = 255 & v[r];
              o = h[u] * n[a][s + u], c = h[u + 512] * n[a][s + u + 512], _ = o - c, o += c, l = h[u + 256] * n[a][s + u + 256], c = h[u + 768] * n[a][s + u + 768], f = l - c, l += c, t[0 + (i -= 4)] = o + l, t[i + 2] = o - l, t[i + 1] = _ + f, t[i + 3] = _ - f, o = h[u + 1] * n[a][s + u + 1], c = h[u + 513] * n[a][s + u + 513], _ = o - c, o += c, l = h[u + 257] * n[a][s + u + 257], c = h[u + 769] * n[a][s + u + 769], f = l - c, l += c, t[i + Ae.BLKSIZE / 2 + 0] = o + l, t[i + Ae.BLKSIZE / 2 + 2] = o - l, t[i + Ae.BLKSIZE / 2 + 1] = _ + f, t[i + Ae.BLKSIZE / 2 + 3] = _ - f;
            } while (0 <= --r);
            m(t, i, Ae.BLKSIZE / 2);
          }, this.init_fft = function (e) {
            for (var t = 0; t < Ae.BLKSIZE; t++) h[t] = .42 - .5 * Math.cos(2 * Math.PI * (t + .5) / Ae.BLKSIZE) + .08 * Math.cos(4 * Math.PI * (t + .5) / Ae.BLKSIZE);
            for (var t = 0; t < Ae.BLKSIZE_s / 2; t++) p[t] = .5 * (1 - Math.cos(2 * Math.PI * (t + .5) / Ae.BLKSIZE_s));
          };
        }(),
        R = 2.302585092994046,
        d = 2,
        g = 16,
        E = .34,
        v = 1 / 217621504 / (Ae.BLKSIZE / 2),
        w = .2302585093;
      function se(e, t, a, n, s, r, i, o, _, l, f) {
        var c = e.internal_flags;
        _ < 2 ? (k.fft_long(c, n[s], _, l, f), k.fft_short(c, r[i], _, l, f)) : 2 == _ && me(), t[0] = n[s + 0][0], t[0] *= t[0];
        for (var u = Ae.BLKSIZE / 2 - 1; 0 <= u; --u) {
          var h = n[s + 0][Ae.BLKSIZE / 2 - u],
            b = n[s + 0][Ae.BLKSIZE / 2 + u];
          t[Ae.BLKSIZE / 2 - u] = .5 * (h * h + b * b);
        }
        for (var p = 2; 0 <= p; --p) {
          a[p][0] = r[i + 0][p][0], a[p][0] *= a[p][0];
          for (var u = Ae.BLKSIZE_s / 2 - 1; 0 <= u; --u) {
            var h = r[i + 0][p][Ae.BLKSIZE_s / 2 - u],
              b = r[i + 0][p][Ae.BLKSIZE_s / 2 + u];
            a[p][Ae.BLKSIZE_s / 2 - u] = .5 * (h * h + b * b);
          }
        }
        for (var m = 0, u = 11; u < Ae.HBLKSIZE; u++) m += t[u];
        c.tot_ener[_] = m, e.analysis && me(), 2 == e.athaa_loudapprox && _ < 2 && (c.loudness_sq[o][_] = c.loudness_sq_save[_], c.loudness_sq_save[_] = function (e, t) {
          for (var a = 0, n = 0; n < Ae.BLKSIZE / 2; ++n) a += e[n] * t.ATH.eql_w[n];
          return a *= v;
        }(t, c));
      }
      var x,
        B,
        T,
        C = 8,
        I = 23,
        L = 15,
        re = [1, .79433, .63096, .63096, .63096, .63096, .63096, .25119, .11749],
        f = [3.3246 * 3.3246, 3.23837 * 3.23837, 9.9500500969, 9.0247369744, 8.1854926609, 7.0440875649, 2.46209 * 2.46209, 2.284 * 2.284, 4.4892710641, 1.96552 * 1.96552, 1.82335 * 1.82335, 1.69146 * 1.69146, 2.4621061921, 2.1508568964, 1.37074 * 1.37074, 1.31036 * 1.31036, 1.5691069696, 1.4555939904, 1.16203 * 1.16203, 1.2715945225, 1.09428 * 1.09428, 1.0659 * 1.0659, 1.0779838276, 1.0382591025, 1],
        c = [1.7782755904, 1.35879 * 1.35879, 1.38454 * 1.38454, 1.39497 * 1.39497, 1.40548 * 1.40548, 1.3537 * 1.3537, 1.6999465924, 1.22321 * 1.22321, 1.3169398564, 1],
        u = [5.5396212496, 2.29259 * 2.29259, 4.9868695969, 2.12675 * 2.12675, 2.02545 * 2.02545, 1.87894 * 1.87894, 1.74303 * 1.74303, 1.61695 * 1.61695, 2.2499700001, 1.39148 * 1.39148, 1.29083 * 1.29083, 1.19746 * 1.19746, 1.2339655056, 1.0779838276];
      function ie(e, t, a, n, s, r) {
        var i;
        if (e < t) {
          if (!(t < e * B)) return e + t;
          i = t / e;
        } else {
          if (t * B <= e) return e + t;
          i = e / t;
        }
        if (e += t, n + 3 <= 6) {
          if (x <= i) return e;
          var o = 0 | V.FAST_LOG10_X(i, 16);
          return e * c[o];
        }
        var _,
          l,
          o = 0 | V.FAST_LOG10_X(i, 16);
        return t = 0 != r ? s.ATH.cb_s[a] * s.ATH.adjust : s.ATH.cb_l[a] * s.ATH.adjust, e < T * t ? t < e ? (_ = 1, o <= 13 && (_ = u[o]), l = V.FAST_LOG10_X(e / t, 10 / 15), e * ((f[o] - _) * l + _)) : 13 < o ? e : e * u[o] : e * f[o];
      }
      function oe(e, t, a, n, s) {
        var r,
          i,
          o = 0,
          _ = 0;
        for (r = i = 0; r < Ae.SBMAX_s; ++i, ++r) {
          for (var l = e.bo_s[r], f = e.npart_s, c = l < f ? l : f; i < c;) o += t[i], _ += a[i], i++;
          if (e.en[n].s[r][s] = o, e.thm[n].s[r][s] = _, f <= i) {
            ++r;
            break;
          }
          var u = e.PSY.bo_s_weight[r],
            h = 1 - u;
          o = u * t[i], _ = u * a[i], e.en[n].s[r][s] += o, e.thm[n].s[r][s] += _, o = h * t[i], _ = h * a[i];
        }
        for (; r < Ae.SBMAX_s; ++r) e.en[n].s[r][s] = 0, e.thm[n].s[r][s] = 0;
      }
      function _e(e, t, a, n) {
        var s,
          r,
          i = 0,
          o = 0;
        for (s = r = 0; s < Ae.SBMAX_l; ++r, ++s) {
          for (var _ = e.bo_l[s], l = e.npart_l, f = _ < l ? _ : l; r < f;) i += t[r], o += a[r], r++;
          if (e.en[n].l[s] = i, e.thm[n].l[s] = o, l <= r) {
            ++s;
            break;
          }
          var c = e.PSY.bo_l_weight[s],
            u = 1 - c;
          i = c * t[r], o = c * a[r], e.en[n].l[s] += i, e.thm[n].l[s] += o, i = u * t[r], o = u * a[r];
        }
        for (; s < Ae.SBMAX_l; ++s) e.en[n].l[s] = 0, e.thm[n].l[s] = 0;
      }
      function le(e, t, a, n, s, r) {
        var i,
          o,
          _ = e.internal_flags;
        for (o = i = 0; o < _.npart_s; ++o) {
          for (var l = 0, f = 0, c = _.numlines_s[o], u = 0; u < c; ++u, ++i) {
            var h = t[r][i];
            l += h, f < h && (f = h);
          }
          a[o] = l;
        }
        for (i = o = 0; o < _.npart_s; o++) {
          var b = _.s3ind_s[o][0],
            p = _.s3_ss[i++] * a[b];
          for (++b; b <= _.s3ind_s[o][1];) p += _.s3_ss[i] * a[b], ++i, ++b;
          var m = d * _.nb_s1[s][o];
          if (n[o] = Math.min(p, m), _.blocktype_old[1 & s] == Ae.SHORT_TYPE) {
            var m = g * _.nb_s2[s][o],
              v = n[o];
            n[o] = Math.min(m, v);
          }
          _.nb_s2[s][o] = _.nb_s1[s][o], _.nb_s1[s][o] = p;
        }
        for (; o <= Ae.CBANDS; ++o) a[o] = 0, n[o] = 0;
      }
      function fe(e, t, a) {
        return 1 <= a ? e : a <= 0 ? t : 0 < t ? Math.pow(e / t, a) * t : 0;
      }
      var _ = [11.8, 13.6, 17.2, 32, 46.5, 51.3, 57.5, 67.1, 71.5, 84.6, 97.6, 130];
      function ce(e, t) {
        for (var a = 309.07, n = 0; n < Ae.SBMAX_s - 1; n++) for (var s = 0; s < 3; s++) {
          var r = e.thm.s[n][s];
          if (0 < r) {
            var i = r * t,
              o = e.en.s[n][s];
            i < o && (a += 1e10 * i < o ? _[n] * (10 * R) : _[n] * V.FAST_LOG10(o / i));
          }
        }
        return a;
      }
      var o = [6.8, 5.8, 5.8, 6.4, 6.5, 9.9, 12.1, 14.4, 15, 18.9, 21.6, 26.9, 34.2, 40.2, 46.8, 56.5, 60.7, 73.9, 85.7, 93.4, 126.1];
      function ue(e, t) {
        for (var a = 281.0575, n = 0; n < Ae.SBMAX_l - 1; n++) {
          var s = e.thm.l[n];
          if (0 < s) {
            var r = s * t,
              i = e.en.l[n];
            r < i && (a += 1e10 * r < i ? o[n] * (10 * R) : o[n] * V.FAST_LOG10(i / r));
          }
        }
        return a;
      }
      function he(e, t, a, n, s) {
        var r, i;
        for (r = i = 0; r < e.npart_l; ++r) {
          var o,
            _ = 0,
            l = 0;
          for (o = 0; o < e.numlines_l[r]; ++o, ++i) {
            var f = t[i];
            _ += f, l < f && (l = f);
          }
          a[r] = _, n[r] = l, s[r] = _ * e.rnumlines_l[r];
        }
      }
      function be(e, t, a, n) {
        var s = re.length - 1,
          r = 0,
          i = a[r] + a[r + 1];
        if (0 < i) {
          var o = t[r];
          o < t[r + 1] && (o = t[r + 1]);
          var _ = 0 | (i = 20 * (2 * o - i) / (i * (e.numlines_l[r] + e.numlines_l[r + 1] - 1)));
          s < _ && (_ = s), n[r] = _;
        } else n[r] = 0;
        for (r = 1; r < e.npart_l - 1; r++) if (0 < (i = a[r - 1] + a[r] + a[r + 1])) {
          var o = t[r - 1];
          o < t[r] && (o = t[r]), o < t[r + 1] && (o = t[r + 1]);
          var _ = 0 | (i = 20 * (3 * o - i) / (i * (e.numlines_l[r - 1] + e.numlines_l[r] + e.numlines_l[r + 1] - 1)));
          s < _ && (_ = s), n[r] = _;
        } else n[r] = 0;
        if (0 < (i = a[r - 1] + a[r])) {
          var o = t[r - 1];
          o < t[r] && (o = t[r]);
          var _ = 0 | (i = 20 * (2 * o - i) / (i * (e.numlines_l[r - 1] + e.numlines_l[r] - 1)));
          s < _ && (_ = s), n[r] = _;
        } else n[r] = 0;
      }
      var pe = [-1.730326e-17, -.01703172, -1.349528e-17, .0418072, -6.73278e-17, -.0876324, -3.0835e-17, .1863476, -1.104424e-16, -.627638];
      function P(e) {
        return e < 0 && (e = 0), e *= .001, 13 * Math.atan(.76 * e) + 3.5 * Math.atan(e * e / 56.25);
      }
      function H(e, t, a, n, s, r, i, o, _, l, f, c) {
        var u,
          h = de(Ae.CBANDS + 1),
          b = o / (15 < c ? 1152 : 384),
          p = ve(Ae.HBLKSIZE);
        o /= _;
        var m = 0,
          v = 0;
        for (u = 0; u < Ae.CBANDS; u++) {
          var d;
          for (x = P(o * m), h[u] = o * m, d = m; P(o * d) - x < E && d <= _ / 2; d++);
          for (e[u] = d - m, v = u + 1; m < d;) p[m++] = u;
          if (_ / 2 < m) {
            m = _ / 2, ++u;
            break;
          }
        }
        h[u] = o * m;
        for (var g = 0; g < c; g++) {
          var w, S, M, y, A;
          M = l[g], y = l[g + 1], (w = 0 | Math.floor(.5 + f * (M - .5))) < 0 && (w = 0), S = 0 | Math.floor(.5 + f * (y - .5)), _ / 2 < S && (S = _ / 2), a[g] = (p[w] + p[S]) / 2, t[g] = p[S];
          var k = b * y;
          i[g] = (k - h[t[g]]) / (h[t[g] + 1] - h[t[g]]), i[g] < 0 ? i[g] = 0 : 1 < i[g] && (i[g] = 1), A = P(o * l[g] * f), A = Math.min(A, 15.5) / 15.5, r[g] = Math.pow(10, 1.25 * (1 - Math.cos(Math.PI * A)) - 2.5);
        }
        for (var R = m = 0; R < v; R++) {
          var x,
            B,
            T = e[R];
          x = P(o * m), B = P(o * (m + T - 1)), n[R] = .5 * (x + B), x = P(o * (m - .5)), B = P(o * (m + T - .5)), s[R] = B - x, m += T;
        }
        return v;
      }
      function O(e, t, a, n, s, r) {
        var i,
          o,
          _,
          l,
          f,
          c,
          u = ge([Ae.CBANDS, Ae.CBANDS]),
          h = 0;
        if (r) for (var b = 0; b < t; b++) for (i = 0; i < t; i++) {
          var p = (o = a[b] - a[i], c = f = l = _ = void 0, _ = o, l = .5 <= (_ *= 0 <= _ ? 3 : 1.5) && _ <= 2.5 ? 8 * ((c = _ - .5) * c - 2 * c) : 0, ((f = 15.811389 + 7.5 * (_ += .474) - 17.5 * Math.sqrt(1 + _ * _)) <= -60 ? 0 : (_ = Math.exp((l + f) * w), _ /= .6609193)) * n[i]);
          u[b][i] = p * s[b];
        } else me();
        for (var b = 0; b < t; b++) {
          for (i = 0; i < t && !(0 < u[b][i]); i++);
          for (e[b][0] = i, i = t - 1; 0 < i && !(0 < u[b][i]); i--);
          e[b][1] = i, h += e[b][1] - e[b][0] + 1;
        }
        for (var m = de(h), v = 0, b = 0; b < t; b++) for (i = e[b][0]; i <= e[b][1]; i++) m[v++] = u[b][i];
        return m;
      }
      function N(e) {
        var t = P(e);
        return t = Math.min(t, 15.5) / 15.5, Math.pow(10, 1.25 * (1 - Math.cos(Math.PI * t)) - 2.5);
      }
      function n(e, t) {
        e < -.3 && (e = 3410), e /= 1e3, e = Math.max(.1, e);
        var a = 3.64 * Math.pow(e, -.8) - 6.8 * Math.exp(-.6 * Math.pow(e - 3.4, 2)) + 6 * Math.exp(-.15 * Math.pow(e - 8.7, 2)) + .001 * (.6 + .04 * t) * Math.pow(e, 4);
        return a;
      }
      this.L3psycho_anal_ns = function (e, t, a, n, s, r, i, o, _, l) {
        var f,
          c,
          u,
          h,
          b,
          p,
          m,
          v,
          d,
          g = e.internal_flags,
          w = ge([2, Ae.BLKSIZE]),
          S = ge([2, 3, Ae.BLKSIZE_s]),
          M = de(Ae.CBANDS + 1),
          y = de(Ae.CBANDS + 1),
          A = de(Ae.CBANDS + 2),
          k = ve(2),
          R = ve(2),
          x = ge([2, 576]),
          B = ve(Ae.CBANDS + 2),
          T = ve(Ae.CBANDS + 2);
        for (we.fill(T, 0), f = g.channels_out, e.mode == ye.JOINT_STEREO && (f = 4), d = e.VBR == Me.vbr_off ? 0 == g.ResvMax ? 0 : g.ResvSize / g.ResvMax * .5 : e.VBR == Me.vbr_rh || e.VBR == Me.vbr_mtrh || e.VBR == Me.vbr_mt ? .6 : 1, c = 0; c < g.channels_out; c++) {
          var E = t[c],
            C = a + 576 - 350 - 21 + 192;
          for (h = 0; h < 576; h++) {
            var I, L;
            for (I = E[C + h + 10], b = L = 0; b < 9; b += 2) I += pe[b] * (E[C + h + b] + E[C + h + 21 - b]), L += pe[b + 1] * (E[C + h + b + 1] + E[C + h + 21 - b - 1]);
            x[c][h] = I + L;
          }
          s[n][c].en.assign(g.en[c]), s[n][c].thm.assign(g.thm[c]), 2 < f && me();
        }
        for (c = 0; c < f; c++) {
          var P,
            H = de(12),
            O = [0, 0, 0, 0],
            N = de(12),
            V = 1,
            D = de(Ae.CBANDS),
            F = de(Ae.CBANDS),
            j = [0, 0, 0, 0],
            X = de(Ae.HBLKSIZE),
            Y = ge([3, Ae.HBLKSIZE_s]);
          for (h = 0; h < 3; h++) H[h] = g.nsPsy.last_en_subshort[c][h + 6], N[h] = H[h] / g.nsPsy.last_en_subshort[c][h + 4], O[0] += H[h];
          2 == c && me();
          var z = x[1 & c],
            q = 0;
          for (h = 0; h < 9; h++) {
            for (var G = q + 64, U = 1; q < G; q++) U < Math.abs(z[q]) && (U = Math.abs(z[q]));
            g.nsPsy.last_en_subshort[c][h] = H[h + 3] = U, O[1 + h / 3] += U, U > H[h + 3 - 2] ? U /= H[h + 3 - 2] : U = H[h + 3 - 2] > 10 * U ? H[h + 3 - 2] / (10 * U) : 0, N[h + 3] = U;
          }
          for (e.analysis && me(), P = 3 == c ? g.nsPsy.attackthre_s : g.nsPsy.attackthre, h = 0; h < 12; h++) 0 == j[h / 3] && N[h] > P && (j[h / 3] = h % 3 + 1);
          for (h = 1; h < 4; h++) (O[h - 1] > O[h] ? O[h - 1] / O[h] : O[h] / O[h - 1]) < 1.7 && (j[h] = 0, 1 == h && (j[0] = 0));
          for (0 != j[0] && 0 != g.nsPsy.lastAttacks[c] && (j[0] = 0), 3 != g.nsPsy.lastAttacks[c] && j[0] + j[1] + j[2] + j[3] == 0 || ((V = 0) != j[1] && 0 != j[0] && (j[1] = 0), 0 != j[2] && 0 != j[1] && (j[2] = 0), 0 != j[3] && 0 != j[2] && (j[3] = 0)), c < 2 ? R[c] = V : me(), _[c] = g.tot_ener[c], se(e, X, Y, w, 1 & c, S, 1 & c, n, c, t, a), he(g, X, M, D, F), be(g, D, F, B), v = 0; v < 3; v++) {
            var K, Z;
            for (le(e, Y, y, A, c, v), oe(g, y, A, c, v), m = 0; m < Ae.SBMAX_s; m++) {
              if (Z = g.thm[c].s[m][v], Z *= .8, 2 <= j[v] || 1 == j[v + 1]) {
                var W = 0 != v ? v - 1 : 2,
                  U = fe(g.thm[c].s[m][W], Z, .6 * d);
                Z = Math.min(Z, U);
              }
              if (1 == j[v]) {
                var W = 0 != v ? v - 1 : 2,
                  U = fe(g.thm[c].s[m][W], Z, .3 * d);
                Z = Math.min(Z, U);
              } else if (0 != v && 3 == j[v - 1] || 0 == v && 3 == g.nsPsy.lastAttacks[c]) {
                var W = 2 != v ? v + 1 : 0,
                  U = fe(g.thm[c].s[m][W], Z, .3 * d);
                Z = Math.min(Z, U);
              }
              K = H[3 * v + 3] + H[3 * v + 4] + H[3 * v + 5], 6 * H[3 * v + 5] < K && (Z *= .5, 6 * H[3 * v + 4] < K && (Z *= .5)), g.thm[c].s[m][v] = Z;
            }
          }
          for (g.nsPsy.lastAttacks[c] = j[2], u = p = 0; u < g.npart_l; u++) {
            for (var Q = g.s3ind[u][0], $ = M[Q] * re[B[Q]], J = g.s3_ll[p++] * $; ++Q <= g.s3ind[u][1];) $ = M[Q] * re[B[Q]], J = ie(J, g.s3_ll[p++] * $, Q, Q - u, g, 0);
            J *= .158489319246111, g.blocktype_old[1 & c] == Ae.SHORT_TYPE ? A[u] = J : A[u] = fe(Math.min(J, Math.min(2 * g.nb_1[c][u], 16 * g.nb_2[c][u])), J, d), g.nb_2[c][u] = g.nb_1[c][u], g.nb_1[c][u] = J;
          }
          for (; u <= Ae.CBANDS; ++u) M[u] = 0, A[u] = 0;
          _e(g, M, A, c);
        }
        for (e.mode != ye.STEREO && e.mode != ye.JOINT_STEREO || me(), e.mode == ye.JOINT_STEREO && me(), function (e, t, a, n) {
          var s = e.internal_flags;
          e.short_blocks != Se.short_block_coupled || 0 != t[0] && 0 != t[1] || (t[0] = t[1] = 0);
          for (var r = 0; r < s.channels_out; r++) n[r] = Ae.NORM_TYPE, e.short_blocks == Se.short_block_dispensed && (t[r] = 1), e.short_blocks == Se.short_block_forced && (t[r] = 0), 0 != t[r] ? s.blocktype_old[r] == Ae.SHORT_TYPE && (n[r] = Ae.STOP_TYPE) : (n[r] = Ae.SHORT_TYPE, s.blocktype_old[r] == Ae.NORM_TYPE && (s.blocktype_old[r] = Ae.START_TYPE), s.blocktype_old[r] == Ae.STOP_TYPE && (s.blocktype_old[r] = Ae.SHORT_TYPE)), a[r] = s.blocktype_old[r], s.blocktype_old[r] = n[r];
        }(e, R, l, k), c = 0; c < f; c++) {
          var ee,
            te,
            ae,
            ne = 0;
          1 < c ? me() : (ee = i, ne = 0, te = l[c], ae = s[n][c]), ee[ne + c] = te == Ae.SHORT_TYPE ? ce(ae, g.masking_lower) : ue(ae, g.masking_lower), e.analysis && (g.pinfo.pe[n][c] = ee[ne + c]);
        }
        return 0;
      }, this.psymodel_init = function (e) {
        var t,
          a = e.internal_flags,
          n = !0,
          s = 13,
          r = 0,
          i = 0,
          o = -8.25,
          _ = -4.5,
          l = de(Ae.CBANDS),
          f = de(Ae.CBANDS),
          c = de(Ae.CBANDS),
          u = e.out_samplerate;
        switch (e.experimentalZ) {
          default:
          case 0:
            n = !0;
            break;
          case 1:
            n = e.VBR != Me.vbr_mtrh && e.VBR != Me.vbr_mt;
            break;
          case 2:
            n = !1;
            break;
          case 3:
            s = 8, r = -1.75, i = -.0125, o = -8.25, _ = -2.25;
        }
        for (a.ms_ener_ratio_old = .25, a.blocktype_old[0] = a.blocktype_old[1] = Ae.NORM_TYPE, t = 0; t < 4; ++t) {
          for (var h = 0; h < Ae.CBANDS; ++h) a.nb_1[t][h] = 1e20, a.nb_2[t][h] = 1e20, a.nb_s1[t][h] = a.nb_s2[t][h] = 1;
          for (var b = 0; b < Ae.SBMAX_l; b++) a.en[t].l[b] = 1e20, a.thm[t].l[b] = 1e20;
          for (var h = 0; h < 3; ++h) {
            for (var b = 0; b < Ae.SBMAX_s; b++) a.en[t].s[b][h] = 1e20, a.thm[t].s[b][h] = 1e20;
            a.nsPsy.lastAttacks[t] = 0;
          }
          for (var h = 0; h < 9; h++) a.nsPsy.last_en_subshort[t][h] = 10;
        }
        for (a.loudness_sq_save[0] = a.loudness_sq_save[1] = 0, a.npart_l = H(a.numlines_l, a.bo_l, a.bm_l, l, f, a.mld_l, a.PSY.bo_l_weight, u, Ae.BLKSIZE, a.scalefac_band.l, Ae.BLKSIZE / 1152, Ae.SBMAX_l), t = 0; t < a.npart_l; t++) {
          var p = r;
          l[t] >= s && (p = i * (l[t] - s) / (24 - s) + r * (24 - l[t]) / (24 - s)), c[t] = Math.pow(10, p / 10), 0 < a.numlines_l[t] ? a.rnumlines_l[t] = 1 / a.numlines_l[t] : a.rnumlines_l[t] = 0;
        }
        a.s3_ll = O(a.s3ind, a.npart_l, l, f, c, n);
        var m,
          h = 0;
        for (t = 0; t < a.npart_l; t++) {
          g = D.MAX_VALUE;
          for (var v = 0; v < a.numlines_l[t]; v++, h++) {
            var d = u * h / (1e3 * Ae.BLKSIZE);
            w = this.ATHformula(1e3 * d, e) - 20, w = Math.pow(10, .1 * w), (w *= a.numlines_l[t]) < g && (g = w);
          }
          a.ATH.cb_l[t] = g, 6 < (g = 20 * l[t] / 10 - 20) && (g = 100), g < -15 && (g = -15), g -= 8, a.minval_l[t] = Math.pow(10, g / 10) * a.numlines_l[t];
        }
        for (a.npart_s = H(a.numlines_s, a.bo_s, a.bm_s, l, f, a.mld_s, a.PSY.bo_s_weight, u, Ae.BLKSIZE_s, a.scalefac_band.s, Ae.BLKSIZE_s / 384, Ae.SBMAX_s), t = h = 0; t < a.npart_s; t++) {
          var g,
            p = o;
          l[t] >= s && (p = _ * (l[t] - s) / (24 - s) + o * (24 - l[t]) / (24 - s)), c[t] = Math.pow(10, p / 10), g = D.MAX_VALUE;
          for (var v = 0; v < a.numlines_s[t]; v++, h++) {
            var w,
              d = u * h / (1e3 * Ae.BLKSIZE_s);
            w = this.ATHformula(1e3 * d, e) - 20, w = Math.pow(10, .1 * w), (w *= a.numlines_s[t]) < g && (g = w);
          }
          a.ATH.cb_s[t] = g, g = 7 * l[t] / 12 - 7, 12 < l[t] && (g *= 1 + 3.1 * Math.log(1 + g)), l[t] < 12 && (g *= 1 + 2.3 * Math.log(1 - g)), g < -15 && (g = -15), g -= 8, a.minval_s[t] = Math.pow(10, g / 10) * a.numlines_s[t];
        }
        a.s3_ss = O(a.s3ind_s, a.npart_s, l, f, c, n), x = Math.pow(10, (C + 1) / 16), B = Math.pow(10, (I + 1) / 16), T = Math.pow(10, L / 10), k.init_fft(a), a.decay = Math.exp(-1 * R / (.01 * u / 192)), m = 3.5, 0 != (2 & e.exp_nspsytune) && (m = 1), 0 < Math.abs(e.msfix) && (m = e.msfix), e.msfix = m;
        for (var S = 0; S < a.npart_l; S++) a.s3ind[S][1] > a.npart_l - 1 && (a.s3ind[S][1] = a.npart_l - 1);
        var M = 576 * a.mode_gr / u;
        if (a.ATH.decay = Math.pow(10, -1.2 * M), a.ATH.adjust = .01, -(a.ATH.adjustLimit = 1) != e.ATHtype) {
          var y = e.out_samplerate / Ae.BLKSIZE,
            A = 0;
          for (t = d = 0; t < Ae.BLKSIZE / 2; ++t) d += y, a.ATH.eql_w[t] = 1 / Math.pow(10, this.ATHformula(d, e) / 10), A += a.ATH.eql_w[t];
          for (A = 1 / A, t = Ae.BLKSIZE / 2; 0 <= --t;) a.ATH.eql_w[t] *= A;
        }
        for (var S = h = 0; S < a.npart_s; ++S) for (t = 0; t < a.numlines_s[S]; ++t) ++h;
        for (var S = h = 0; S < a.npart_l; ++S) for (t = 0; t < a.numlines_l[S]; ++t) ++h;
        for (t = h = 0; t < a.npart_l; t++) {
          var d = u * (h + a.numlines_l[t] / 2) / (1 * Ae.BLKSIZE);
          a.mld_cb_l[t] = N(d), h += a.numlines_l[t];
        }
        for (; t < Ae.CBANDS; ++t) a.mld_cb_l[t] = 1;
        for (t = h = 0; t < a.npart_s; t++) {
          var d = u * (h + a.numlines_s[t] / 2) / (1 * Ae.BLKSIZE_s);
          a.mld_cb_s[t] = N(d), h += a.numlines_s[t];
        }
        for (; t < Ae.CBANDS; ++t) a.mld_cb_s[t] = 1;
        return 0;
      }, this.ATHformula = function (e, t) {
        var a;
        switch (t.ATHtype) {
          case 0:
            a = n(e, 9);
            break;
          case 1:
            a = n(e, -1);
            break;
          case 2:
            a = n(e, 0);
            break;
          case 3:
            a = n(e, 1) + 6;
            break;
          case 4:
            a = n(e, t.ATHcurve);
            break;
          default:
            a = n(e, 0);
        }
        return a;
      };
    }
    function Y() {
      var T,
        E,
        u,
        h,
        b,
        C = this;
      Y.V9 = 410, Y.V8 = 420, Y.V7 = 430, Y.V6 = 440, Y.V5 = 450, Y.V4 = 460, Y.V3 = 470, Y.V2 = 480, Y.V1 = 490, Y.V0 = 500, Y.R3MIX = 1e3, Y.STANDARD = 1001, Y.EXTREME = 1002, Y.INSANE = 1003, Y.STANDARD_FAST = 1004, Y.EXTREME_FAST = 1005, Y.MEDIUM = 1006, Y.MEDIUM_FAST = 1007, Y.LAME_MAXMP3BUFFER = 147456;
      var p,
        m,
        v = new X();
      function d() {
        this.lowerlimit = 0;
      }
      function s(e, t) {
        this.lowpass = t;
      }
      this.enc = new Ae(), this.setModules = function (e, t, a, n, s, r, i, o, _) {
        T = e, E = t, u = a, h = n, b = s, p = r, m = o, this.enc.setModules(E, v, h, p);
      };
      var I = 4294479419;
      function g(e, t) {
        var a = [new s(8, 2e3), new s(16, 3700), new s(24, 3900), new s(32, 5500), new s(40, 7e3), new s(48, 7500), new s(56, 1e4), new s(64, 11e3), new s(80, 13500), new s(96, 15100), new s(112, 15600), new s(128, 17e3), new s(160, 17500), new s(192, 18600), new s(224, 19400), new s(256, 19700), new s(320, 20500)],
          n = C.nearestBitrateFullIndex(t);
        e.lowerlimit = a[n].lowpass;
      }
      function L(e) {
        var t = Ae.BLKSIZE + e.framesize - Ae.FFTOFFSET;
        return t = Math.max(t, 512 + e.framesize - 32);
      }
      function P() {
        this.n_in = 0, this.n_out = 0;
      }
      function H(e, t, a, n, s, r) {
        var i = e.internal_flags;
        if (i.resample_ratio < .9999 || 1.0001 < i.resample_ratio) me();else {
          r.n_out = Math.min(e.framesize, s), r.n_in = r.n_out;
          for (var o = 0; o < r.n_out; ++o) t[0][i.mf_size + o] = a[0][n + o], 2 == i.channels_out && (t[1][i.mf_size + o] = a[1][n + o]);
        }
      }
      this.lame_init = function () {
        var e,
          t,
          a = new function () {
            this.class_id = 0, this.num_samples = 0, this.num_channels = 0, this.in_samplerate = 0, this.out_samplerate = 0, this.scale = 0, this.scale_left = 0, this.scale_right = 0, this.analysis = !1, this.bWriteVbrTag = !1, this.decode_only = !1, this.quality = 0, this.mode = ye.STEREO, this.force_ms = !1, this.free_format = !1, this.findReplayGain = !1, this.decode_on_the_fly = !1, this.write_id3tag_automatic = !1, this.brate = 0, this.compression_ratio = 0, this.copyright = 0, this.original = 0, this.extension = 0, this.emphasis = 0, this.error_protection = 0, this.strict_ISO = !1, this.disable_reservoir = !1, this.quant_comp = 0, this.quant_comp_short = 0, this.experimentalY = !1, this.experimentalZ = 0, this.exp_nspsytune = 0, this.preset = 0, this.VBR = null, this.VBR_q_frac = 0, this.VBR_q = 0, this.VBR_mean_bitrate_kbps = 0, this.VBR_min_bitrate_kbps = 0, this.VBR_max_bitrate_kbps = 0, this.VBR_hard_min = 0, this.lowpassfreq = 0, this.highpassfreq = 0, this.lowpasswidth = 0, this.highpasswidth = 0, this.maskingadjust = 0, this.maskingadjust_short = 0, this.ATHonly = !1, this.ATHshort = !1, this.noATH = !1, this.ATHtype = 0, this.ATHcurve = 0, this.ATHlower = 0, this.athaa_type = 0, this.athaa_loudapprox = 0, this.athaa_sensitivity = 0, this.short_blocks = null, this.useTemporal = !1, this.interChRatio = 0, this.msfix = 0, this.tune = !1, this.tune_value_a = 0, this.version = 0, this.encoder_delay = 0, this.encoder_padding = 0, this.framesize = 0, this.frameNum = 0, this.lame_allocated_gfp = 0, this.internal_flags = null;
          }(),
          n = ((e = a).class_id = I, t = e.internal_flags = new j(), e.mode = ye.NOT_SET, e.original = 1, e.in_samplerate = 44100, e.num_channels = 2, e.num_samples = -1, e.bWriteVbrTag = !0, e.quality = -1, e.short_blocks = null, t.subblock_gain = -1, e.lowpassfreq = 0, e.highpassfreq = 0, e.lowpasswidth = -1, e.highpasswidth = -1, e.VBR = Me.vbr_off, e.VBR_q = 4, e.ATHcurve = -1, e.VBR_mean_bitrate_kbps = 128, e.VBR_min_bitrate_kbps = 0, e.VBR_max_bitrate_kbps = 0, e.VBR_hard_min = 0, t.VBR_min_bitrate = 1, t.VBR_max_bitrate = 13, e.quant_comp = -1, e.quant_comp_short = -1, e.msfix = -1, t.resample_ratio = 1, t.OldValue[0] = 180, t.OldValue[1] = 180, t.CurrentStep[0] = 4, t.CurrentStep[1] = 4, t.masking_lower = 1, t.nsPsy.attackthre = -1, t.nsPsy.attackthre_s = -1, e.scale = -1, e.athaa_type = -1, e.ATHtype = -1, e.athaa_loudapprox = -1, e.athaa_sensitivity = 0, e.useTemporal = null, e.interChRatio = -1, t.mf_samples_to_encode = Ae.ENCDELAY + Ae.POSTDELAY, e.encoder_padding = 0, t.mf_size = Ae.ENCDELAY - Ae.MDCTDELAY, e.findReplayGain = !1, e.decode_on_the_fly = !1, t.decode_on_the_fly = !1, t.findReplayGain = !1, t.findPeakSample = !1, t.RadioGain = 0, t.AudiophileGain = 0, t.noclipGainChange = 0, t.noclipScale = -1, e.preset = 0, e.write_id3tag_automatic = !0, 0);
        return 0 != n ? null : (a.lame_allocated_gfp = 1, a);
      }, this.nearestBitrateFullIndex = function (e) {
        var t = [8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320],
          a = 0,
          n = 0,
          s = 0,
          r = 0;
        r = t[16], n = t[s = 16], a = 16;
        for (var i = 0; i < 16; i++) if (Math.max(e, t[i + 1]) != e) {
          r = t[i + 1], s = i + 1, n = t[i], a = i;
          break;
        }
        return e - n < r - e ? a : s;
      }, this.lame_init_params = function (e) {
        var t,
          a,
          n = e.internal_flags;
        if (n.Class_ID = 0, null == n.ATH && (n.ATH = new function () {
          this.useAdjust = 0, this.aaSensitivityP = 0, this.adjust = 0, this.adjustLimit = 0, this.decay = 0, this.floor = 0, this.l = de(Ae.SBMAX_l), this.s = de(Ae.SBMAX_s), this.psfb21 = de(Ae.PSFB21), this.psfb12 = de(Ae.PSFB12), this.cb_l = de(Ae.CBANDS), this.cb_s = de(Ae.CBANDS), this.eql_w = de(Ae.BLKSIZE / 2);
        }()), null == n.PSY && (n.PSY = new function () {
          this.mask_adjust = 0, this.mask_adjust_short = 0, this.bo_l_weight = de(Ae.SBMAX_l), this.bo_s_weight = de(Ae.SBMAX_s);
        }()), null == n.rgdata && (n.rgdata = new function () {}()), n.channels_in = e.num_channels, 1 == n.channels_in && (e.mode = ye.MONO), n.channels_out = e.mode == ye.MONO ? 1 : 2, n.mode_ext = Ae.MPG_MD_MS_LR, e.mode == ye.MONO && (e.force_ms = !1), e.VBR == Me.vbr_off && 128 != e.VBR_mean_bitrate_kbps && 0 == e.brate && (e.brate = e.VBR_mean_bitrate_kbps), e.VBR == Me.vbr_off || e.VBR == Me.vbr_mtrh || e.VBR == Me.vbr_mt || (e.free_format = !1), e.VBR == Me.vbr_off && 0 == e.brate && me(), e.VBR == Me.vbr_off && 0 < e.compression_ratio && me(), 0 != e.out_samplerate && (e.out_samplerate < 16e3 ? (e.VBR_mean_bitrate_kbps = Math.max(e.VBR_mean_bitrate_kbps, 8), e.VBR_mean_bitrate_kbps = Math.min(e.VBR_mean_bitrate_kbps, 64)) : e.out_samplerate < 32e3 ? (e.VBR_mean_bitrate_kbps = Math.max(e.VBR_mean_bitrate_kbps, 8), e.VBR_mean_bitrate_kbps = Math.min(e.VBR_mean_bitrate_kbps, 160)) : (e.VBR_mean_bitrate_kbps = Math.max(e.VBR_mean_bitrate_kbps, 32), e.VBR_mean_bitrate_kbps = Math.min(e.VBR_mean_bitrate_kbps, 320))), 0 == e.lowpassfreq) {
          var s = 16e3;
          switch (e.VBR) {
            case Me.vbr_off:
              var r = new d();
              g(r, e.brate), s = r.lowerlimit;
              break;
            case Me.vbr_abr:
              var r = new d();
              g(r, e.VBR_mean_bitrate_kbps), s = r.lowerlimit;
              break;
            case Me.vbr_rh:
              me();
            default:
              me();
          }
          e.mode != ye.MONO || e.VBR != Me.vbr_off && e.VBR != Me.vbr_abr || (s *= 1.5), e.lowpassfreq = 0 | s;
        }
        switch (0 == e.out_samplerate && me(), e.lowpassfreq = Math.min(20500, e.lowpassfreq), e.lowpassfreq = Math.min(e.out_samplerate / 2, e.lowpassfreq), e.VBR == Me.vbr_off && (e.compression_ratio = 16 * e.out_samplerate * n.channels_out / (1e3 * e.brate)), e.VBR == Me.vbr_abr && me(), e.bWriteVbrTag || (e.findReplayGain = !1, e.decode_on_the_fly = !1, n.findPeakSample = !1), n.findReplayGain = e.findReplayGain, n.decode_on_the_fly = e.decode_on_the_fly, n.decode_on_the_fly && (n.findPeakSample = !0), n.findReplayGain && me(), n.decode_on_the_fly && !e.decode_only && me(), n.mode_gr = e.out_samplerate <= 24e3 ? 1 : 2, e.framesize = 576 * n.mode_gr, e.encoder_delay = Ae.ENCDELAY, n.resample_ratio = e.in_samplerate / e.out_samplerate, e.VBR) {
          case Me.vbr_mt:
          case Me.vbr_rh:
          case Me.vbr_mtrh:
            e.compression_ratio = [5.7, 6.5, 7.3, 8.2, 10, 11.9, 13, 14, 15, 16.5][e.VBR_q];
            break;
          case Me.vbr_abr:
            e.compression_ratio = 16 * e.out_samplerate * n.channels_out / (1e3 * e.VBR_mean_bitrate_kbps);
            break;
          default:
            e.compression_ratio = 16 * e.out_samplerate * n.channels_out / (1e3 * e.brate);
        }
        e.mode == ye.NOT_SET && (e.mode = ye.JOINT_STEREO), 0 < e.highpassfreq ? me() : (n.highpass1 = 0, n.highpass2 = 0), 0 < e.lowpassfreq ? (n.lowpass2 = 2 * e.lowpassfreq, 0 <= e.lowpasswidth ? me() : n.lowpass1 = 2 * e.lowpassfreq, n.lowpass1 /= e.out_samplerate, n.lowpass2 /= e.out_samplerate) : me(), function (e) {
          var t,
            a = e.internal_flags,
            n = 32;
          if (0 < a.lowpass1) {
            for (var s = 999, r = 0; r <= 31; r++) {
              var i = r / 31;
              i >= a.lowpass2 && (n = Math.min(n, r)), a.lowpass1 < i && i < a.lowpass2 && (s = Math.min(s, r));
            }
            a.lowpass1 = 999 == s ? (n - .75) / 31 : (s - .75) / 31, a.lowpass2 = n / 31;
          }
          0 < a.highpass2 && me(), 0 < a.highpass2 && me();
          for (var r = 0; r < 32; r++) {
            var o,
              _,
              i = r / 31;
            a.highpass2 > a.highpass1 ? me() : o = 1, _ = a.lowpass2 > a.lowpass1 ? 1 < (t = (i - a.lowpass1) / (a.lowpass2 - a.lowpass1 + 1e-20)) ? 0 : t <= 0 ? 1 : Math.cos(Math.PI / 2 * t) : 1, a.amp_filter[r] = o * _;
          }
        }(e), n.samplerate_index = function (e, t) {
          switch (e) {
            case 44100:
              return t.version = 1, 0;
            case 48e3:
              return t.version = 1;
            case 32e3:
              return t.version = 1, 2;
            case 22050:
              return t.version = 0;
            case 24e3:
              return t.version = 0, 1;
            case 16e3:
              return t.version = 0, 2;
            case 11025:
              return t.version = 0;
            case 12e3:
              return t.version = 0, 1;
            case 8e3:
              return t.version = 0, 2;
            default:
              return t.version = 0, -1;
          }
        }(e.out_samplerate, e), n.samplerate_index < 0 && me(), e.VBR == Me.vbr_off ? e.free_format ? n.bitrate_index = 0 : (e.brate = function (e, t, a) {
          a < 16e3 && (t = 2);
          for (var n = k.bitrate_table[t][1], s = 2; s <= 14; s++) 0 < k.bitrate_table[t][s] && Math.abs(k.bitrate_table[t][s] - e) < Math.abs(n - e) && (n = k.bitrate_table[t][s]);
          return n;
        }(e.brate, e.version, e.out_samplerate), n.bitrate_index = function (e, t, a) {
          a < 16e3 && (t = 2);
          for (var n = 0; n <= 14; n++) if (0 < k.bitrate_table[t][n] && k.bitrate_table[t][n] == e) return n;
          return -1;
        }(e.brate, e.version, e.out_samplerate), n.bitrate_index <= 0 && me()) : n.bitrate_index = 1, e.analysis && (e.bWriteVbrTag = !1), null != n.pinfo && (e.bWriteVbrTag = !1), E.init_bit_stream_w(n);
        for (var i, o = n.samplerate_index + 3 * e.version + 6 * (e.out_samplerate < 16e3 ? 1 : 0), _ = 0; _ < Ae.SBMAX_l + 1; _++) n.scalefac_band.l[_] = h.sfBandIndex[o].l[_];
        for (var _ = 0; _ < Ae.PSFB21 + 1; _++) {
          var l = (n.scalefac_band.l[22] - n.scalefac_band.l[21]) / Ae.PSFB21,
            f = n.scalefac_band.l[21] + _ * l;
          n.scalefac_band.psfb21[_] = f;
        }
        n.scalefac_band.psfb21[Ae.PSFB21] = 576;
        for (var _ = 0; _ < Ae.SBMAX_s + 1; _++) n.scalefac_band.s[_] = h.sfBandIndex[o].s[_];
        for (var _ = 0; _ < Ae.PSFB12 + 1; _++) {
          var l = (n.scalefac_band.s[13] - n.scalefac_band.s[12]) / Ae.PSFB12,
            f = n.scalefac_band.s[12] + _ * l;
          n.scalefac_band.psfb12[_] = f;
        }
        for (n.scalefac_band.psfb12[Ae.PSFB12] = 192, 1 == e.version ? n.sideinfo_len = 1 == n.channels_out ? 21 : 36 : n.sideinfo_len = 1 == n.channels_out ? 13 : 21, e.error_protection && (n.sideinfo_len += 2), a = void 0, a = (t = e).internal_flags, t.frameNum = 0, t.write_id3tag_automatic && m.id3tag_write_v2(t), a.bitrate_stereoMode_Hist = w([16, 5]), a.bitrate_blockType_Hist = w([16, 6]), a.PeakSample = 0, t.bWriteVbrTag && p.InitVbrTag(t), n.Class_ID = I, i = 0; i < 19; i++) n.nsPsy.pefirbuf[i] = 700 * n.mode_gr * n.channels_out;
        switch (-1 == e.ATHtype && (e.ATHtype = 4), e.VBR) {
          case Me.vbr_mt:
            e.VBR = Me.vbr_mtrh;
          case Me.vbr_mtrh:
            null == e.useTemporal && (e.useTemporal = !1), u.apply_preset(e, 500 - 10 * e.VBR_q, 0), e.quality < 0 && (e.quality = LAME_DEFAULT_QUALITY), e.quality < 5 && (e.quality = 0), 5 < e.quality && (e.quality = 5), n.PSY.mask_adjust = e.maskingadjust, n.PSY.mask_adjust_short = e.maskingadjust_short, e.experimentalY ? n.sfb21_extra = !1 : n.sfb21_extra = 44e3 < e.out_samplerate, n.iteration_loop = new VBRNewIterationLoop(b);
            break;
          case Me.vbr_rh:
            u.apply_preset(e, 500 - 10 * e.VBR_q, 0), n.PSY.mask_adjust = e.maskingadjust, n.PSY.mask_adjust_short = e.maskingadjust_short, e.experimentalY ? n.sfb21_extra = !1 : n.sfb21_extra = 44e3 < e.out_samplerate, 6 < e.quality && (e.quality = 6), e.quality < 0 && (e.quality = LAME_DEFAULT_QUALITY), n.iteration_loop = new VBROldIterationLoop(b);
            break;
          default:
            var c;
            n.sfb21_extra = !1, e.quality < 0 && (e.quality = LAME_DEFAULT_QUALITY), (c = e.VBR) == Me.vbr_off && (e.VBR_mean_bitrate_kbps = e.brate), u.apply_preset(e, e.VBR_mean_bitrate_kbps, 0), e.VBR = c, n.PSY.mask_adjust = e.maskingadjust, n.PSY.mask_adjust_short = e.maskingadjust_short, c == Me.vbr_off ? n.iteration_loop = new function (e) {
              var t = e;
              this.quantize = t, this.iteration_loop = function (e, t, a, n) {
                var s = e.internal_flags,
                  r = de(F.SFBMAX),
                  i = de(576),
                  o = ve(2),
                  _ = 0,
                  l = s.l3_side,
                  f = new R(_);
                this.quantize.rv.ResvFrameBegin(e, f), _ = f.bits;
                for (var c = 0; c < s.mode_gr; c++) {
                  this.quantize.qupvt.on_pe(e, t, o, _, c, c), s.mode_ext == Ae.MPG_MD_MS_LR && me();
                  for (var u = 0; u < s.channels_out; u++) {
                    var h,
                      b,
                      p = l.tt[c][u];
                    p.block_type != Ae.SHORT_TYPE ? (h = 0, b = s.PSY.mask_adjust - h) : (h = 0, b = s.PSY.mask_adjust_short - h), s.masking_lower = Math.pow(10, .1 * b), this.quantize.init_outer_loop(s, p), this.quantize.init_xrpow(s, p, i) && (this.quantize.qupvt.calc_xmin(e, n[c][u], p, r), this.quantize.outer_loop(e, p, r, i, u, o[u])), this.quantize.iteration_finish_one(s, c, u);
                  }
                }
                this.quantize.rv.ResvFrameEnd(s, _);
              };
            }(b) : me();
        }
        return e.VBR != Me.vbr_off && me(), e.tune && me(), function (e) {
          var t = e.internal_flags;
          switch (e.quality) {
            default:
            case 9:
              t.psymodel = 0, t.noise_shaping = 0, t.noise_shaping_amp = 0, t.noise_shaping_stop = 0, t.use_best_huffman = 0, t.full_outer_loop = 0;
              break;
            case 8:
              e.quality = 7;
            case 7:
              t.psymodel = 1, t.noise_shaping = 0, t.noise_shaping_amp = 0, t.noise_shaping_stop = 0, t.use_best_huffman = 0, t.full_outer_loop = 0;
              break;
            case 6:
            case 5:
              t.psymodel = 1, 0 == t.noise_shaping && (t.noise_shaping = 1), t.noise_shaping_amp = 0, t.noise_shaping_stop = 0, -1 == t.subblock_gain && (t.subblock_gain = 1), t.use_best_huffman = 0, t.full_outer_loop = 0;
              break;
            case 4:
              t.psymodel = 1, 0 == t.noise_shaping && (t.noise_shaping = 1), t.noise_shaping_amp = 0, t.noise_shaping_stop = 0, -1 == t.subblock_gain && (t.subblock_gain = 1), t.use_best_huffman = 1, t.full_outer_loop = 0;
              break;
            case 3:
              t.psymodel = 1, 0 == t.noise_shaping && (t.noise_shaping = 1), t.noise_shaping_amp = 1, -(t.noise_shaping_stop = 1) == t.subblock_gain && (t.subblock_gain = 1), t.use_best_huffman = 1, t.full_outer_loop = 0;
              break;
            case 2:
              t.psymodel = 1, 0 == t.noise_shaping && (t.noise_shaping = 1), 0 == t.substep_shaping && (t.substep_shaping = 2), t.noise_shaping_amp = 1, -(t.noise_shaping_stop = 1) == t.subblock_gain && (t.subblock_gain = 1), t.use_best_huffman = 1, t.full_outer_loop = 0;
              break;
            case 1:
            case 0:
              t.psymodel = 1, 0 == t.noise_shaping && (t.noise_shaping = 1), 0 == t.substep_shaping && (t.substep_shaping = 2), t.noise_shaping_amp = 2, -(t.noise_shaping_stop = 1) == t.subblock_gain && (t.subblock_gain = 1), t.use_best_huffman = 1, t.full_outer_loop = 0;
          }
        }(e), e.athaa_type < 0 ? n.ATH.useAdjust = 3 : n.ATH.useAdjust = e.athaa_type, n.ATH.aaSensitivityP = Math.pow(10, e.athaa_sensitivity / -10), null == e.short_blocks && (e.short_blocks = Se.short_block_allowed), e.short_blocks != Se.short_block_allowed || e.mode != ye.JOINT_STEREO && e.mode != ye.STEREO || (e.short_blocks = Se.short_block_coupled), e.quant_comp < 0 && (e.quant_comp = 1), e.quant_comp_short < 0 && (e.quant_comp_short = 0), e.msfix < 0 && (e.msfix = 0), e.exp_nspsytune = 1 | e.exp_nspsytune, e.internal_flags.nsPsy.attackthre < 0 && (e.internal_flags.nsPsy.attackthre = X.NSATTACKTHRE), e.internal_flags.nsPsy.attackthre_s < 0 && (e.internal_flags.nsPsy.attackthre_s = X.NSATTACKTHRE_S), e.scale < 0 && (e.scale = 1), e.ATHtype < 0 && (e.ATHtype = 4), e.ATHcurve < 0 && (e.ATHcurve = 4), e.athaa_loudapprox < 0 && (e.athaa_loudapprox = 2), e.interChRatio < 0 && (e.interChRatio = 0), null == e.useTemporal && (e.useTemporal = !0), n.slot_lag = n.frac_SpF = 0, e.VBR == Me.vbr_off && (n.slot_lag = n.frac_SpF = 72e3 * (e.version + 1) * e.brate % e.out_samplerate | 0), h.iteration_init(e), v.psymodel_init(e), 0;
      }, this.lame_encode_flush = function (e, t, a, n) {
        var s,
          r,
          i,
          o,
          _ = e.internal_flags,
          l = M([2, 1152]),
          f = 0,
          c = _.mf_samples_to_encode - Ae.POSTDELAY,
          u = L(e);
        if (_.mf_samples_to_encode < 1) return 0;
        for (s = 0, e.in_samplerate != e.out_samplerate && me(), (i = e.framesize - c % e.framesize) < 576 && (i += e.framesize), e.encoder_padding = i, o = (c + i) / e.framesize; 0 < o && 0 <= f;) {
          var h = u - _.mf_size,
            b = e.frameNum;
          h *= e.in_samplerate, 1152 < (h /= e.out_samplerate) && (h = 1152), h < 1 && (h = 1), r = n - s, 0 == n && (r = 0), f = this.lame_encode_buffer(e, l[0], l[1], h, t, a, r), a += f, s += f, o -= b != e.frameNum ? 1 : 0;
        }
        return _.mf_samples_to_encode = 0, f < 0 ? f : (r = n - s, 0 == n && (r = 0), E.flush_bitstream(e), (f = E.copy_buffer(_, t, a, r, 1)) < 0 ? f : (a += f, r = n - (s += f), 0 == n && (r = 0), e.write_id3tag_automatic && me(), s));
      }, this.lame_encode_buffer = function (e, t, a, n, s, r, i) {
        var o,
          _,
          l = e.internal_flags,
          f = [null, null];
        if (l.Class_ID != I) return -3;
        if (0 == n) return 0;
        _ = n, (null == (o = l).in_buffer_0 || o.in_buffer_nsamples < _) && (o.in_buffer_0 = de(_), o.in_buffer_1 = de(_), o.in_buffer_nsamples = _), f[0] = l.in_buffer_0, f[1] = l.in_buffer_1;
        for (var c = 0; c < n; c++) f[0][c] = t[c], 1 < l.channels_in && (f[1][c] = a[c]);
        return function (e, t, a, n, s, r, i) {
          var o,
            _,
            l,
            f,
            c,
            u = e.internal_flags,
            h = 0,
            b = [null, null],
            p = [null, null];
          if (u.Class_ID != I) return -3;
          if (0 == n) return 0;
          if ((c = E.copy_buffer(u, s, r, i, 0)) < 0) return c;
          if (r += c, h += c, p[0] = t, p[1] = a, N.NEQ(e.scale, 0) && N.NEQ(e.scale, 1)) for (_ = 0; _ < n; ++_) p[0][_] *= e.scale, 2 == u.channels_out && (p[1][_] *= e.scale);
          if (N.NEQ(e.scale_left, 0) && N.NEQ(e.scale_left, 1)) for (_ = 0; _ < n; ++_) p[0][_] *= e.scale_left;
          if (N.NEQ(e.scale_right, 0) && N.NEQ(e.scale_right, 1)) for (_ = 0; _ < n; ++_) p[1][_] *= e.scale_right;
          2 == e.num_channels && 1 == u.channels_out && me(), f = L(e), b[0] = u.mfbuf[0], b[1] = u.mfbuf[1];
          for (var m, v, d, g, w, S, M, y = 0; 0 < n;) {
            var A = [null, null],
              k = 0,
              R = 0;
            A[0] = p[0], A[1] = p[1];
            var x = new P();
            if (H(e, b, A, y, n, x), k = x.n_in, R = x.n_out, u.findReplayGain && !u.decode_on_the_fly && T.AnalyzeSamples(u.rgdata, b[0], u.mf_size, b[1], u.mf_size, R, u.channels_out) == O.GAIN_ANALYSIS_ERROR) return -6;
            if (n -= k, y += k, u.channels_out, u.mf_size += R, u.mf_samples_to_encode < 1 && me(), u.mf_samples_to_encode += R, u.mf_size >= f) {
              var B = i - h;
              if (0 == i && (B = 0), m = e, v = b[0], d = b[1], g = s, w = r, S = B, M = C.enc.lame_encode_mp3_frame(m, v, d, g, w, S), m.frameNum++, (o = M) < 0) return o;
              for (r += o, h += o, u.mf_size -= e.framesize, u.mf_samples_to_encode -= e.framesize, l = 0; l < u.channels_out; l++) for (_ = 0; _ < u.mf_size; _++) b[l][_] = b[l][_ + e.framesize];
            }
          }
          return h;
        }(e, f[0], f[1], n, s, r, i);
      };
    }
    F.SFBMAX = 3 * Ae.SBMAX_s, Ae.ENCDELAY = 576, Ae.POSTDELAY = 1152, Ae.FFTOFFSET = 224 + (Ae.MDCTDELAY = 48), Ae.DECDELAY = 528, Ae.SBLIMIT = 32, Ae.CBANDS = 64, Ae.SBPSY_l = 21, Ae.SBPSY_s = 12, Ae.SBMAX_l = 22, Ae.SBMAX_s = 13, Ae.PSFB21 = 6, Ae.PSFB12 = 6, Ae.HBLKSIZE = (Ae.BLKSIZE = 1024) / 2 + 1, Ae.HBLKSIZE_s = (Ae.BLKSIZE_s = 256) / 2 + 1, Ae.NORM_TYPE = 0, Ae.START_TYPE = 1, Ae.SHORT_TYPE = 2, Ae.STOP_TYPE = 3, Ae.MPG_MD_LR_LR = 0, Ae.MPG_MD_LR_I = 1, Ae.MPG_MD_MS_LR = 2, Ae.MPG_MD_MS_I = 3, Ae.fircoef = [-.1039435, -.1892065, 5 * -.0432472, -.155915, 3.898045e-17, .0467745 * 5, .50455, .756825, .187098 * 5], j.MFSIZE = 3456 + Ae.ENCDELAY - Ae.MDCTDELAY, j.MAX_HEADER_BUF = 256, j.MAX_BITS_PER_CHANNEL = 4095, j.MAX_BITS_PER_GRANULE = 7680, j.BPC = 320, F.SFBMAX = 3 * Ae.SBMAX_s, t.Mp3Encoder = function (n, e, t) {
      1 != n && me("fix cc: only supports mono");
      var s = new Y(),
        a = new function () {
          this.setModules = function (e, t) {};
        }(),
        r = new O(),
        i = new N(),
        o = new function () {
          function e(e, t, a, n, s, r, i, o, _, l, f, c, u, h) {
            this.quant_comp = t, this.quant_comp_s = a, this.safejoint = n, this.nsmsfix = s, this.st_lrm = r, this.st_s = i, this.nsbass = o, this.scale = _, this.masking_adj = l, this.ath_lower = f, this.ath_curve = c, this.interch = u, this.sfscale = h;
          }
          var i;
          function n(e, t, a) {
            me();
          }
          this.setModules = function (e) {
            i = e;
          };
          var o = [new e(8, 9, 9, 0, 0, 6.6, 145, 0, .95, 0, -30, 11, .0012, 1), new e(16, 9, 9, 0, 0, 6.6, 145, 0, .95, 0, -25, 11, .001, 1), new e(24, 9, 9, 0, 0, 6.6, 145, 0, .95, 0, -20, 11, .001, 1), new e(32, 9, 9, 0, 0, 6.6, 145, 0, .95, 0, -15, 11, .001, 1), new e(40, 9, 9, 0, 0, 6.6, 145, 0, .95, 0, -10, 11, 9e-4, 1), new e(48, 9, 9, 0, 0, 6.6, 145, 0, .95, 0, -10, 11, 9e-4, 1), new e(56, 9, 9, 0, 0, 6.6, 145, 0, .95, 0, -6, 11, 8e-4, 1), new e(64, 9, 9, 0, 0, 6.6, 145, 0, .95, 0, -2, 11, 8e-4, 1), new e(80, 9, 9, 0, 0, 6.6, 145, 0, .95, 0, 0, 8, 7e-4, 1), new e(96, 9, 9, 0, 2.5, 6.6, 145, 0, .95, 0, 1, 5.5, 6e-4, 1), new e(112, 9, 9, 0, 2.25, 6.6, 145, 0, .95, 0, 2, 4.5, 5e-4, 1), new e(128, 9, 9, 0, 1.95, 6.4, 140, 0, .95, 0, 3, 4, 2e-4, 1), new e(160, 9, 9, 1, 1.79, 6, 135, 0, .95, -2, 5, 3.5, 0, 1), new e(192, 9, 9, 1, 1.49, 5.6, 125, 0, .97, -4, 7, 3, 0, 0), new e(224, 9, 9, 1, 1.25, 5.2, 125, 0, .98, -6, 9, 2, 0, 0), new e(256, 9, 9, 1, .97, 5.2, 125, 0, 1, -8, 10, 1, 0, 0), new e(320, 9, 9, 1, .9, 5.2, 125, 0, 1, -10, 12, 0, 0, 0)];
          function s(e, t, a) {
            var n = t,
              s = i.nearestBitrateFullIndex(t);
            if (e.VBR = Me.vbr_abr, e.VBR_mean_bitrate_kbps = n, e.VBR_mean_bitrate_kbps = Math.min(e.VBR_mean_bitrate_kbps, 320), e.VBR_mean_bitrate_kbps = Math.max(e.VBR_mean_bitrate_kbps, 8), e.brate = e.VBR_mean_bitrate_kbps, 320 < e.VBR_mean_bitrate_kbps && (e.disable_reservoir = !0), 0 < o[s].safejoint && (e.exp_nspsytune = 2 | e.exp_nspsytune), 0 < o[s].sfscale && (e.internal_flags.noise_shaping = 2), 0 < Math.abs(o[s].nsbass)) {
              var r = int(4 * o[s].nsbass);
              r < 0 && (r += 64), e.exp_nspsytune = e.exp_nspsytune | r << 2;
            }
            return 0 != a ? e.quant_comp = o[s].quant_comp : 0 < Math.abs(e.quant_comp - -1) || (e.quant_comp = o[s].quant_comp), 0 != a ? e.quant_comp_short = o[s].quant_comp_s : 0 < Math.abs(e.quant_comp_short - -1) || (e.quant_comp_short = o[s].quant_comp_s), 0 != a ? e.msfix = o[s].nsmsfix : 0 < Math.abs(e.msfix - -1) || (e.msfix = o[s].nsmsfix), 0 != a ? e.internal_flags.nsPsy.attackthre = o[s].st_lrm : 0 < Math.abs(e.internal_flags.nsPsy.attackthre - -1) || (e.internal_flags.nsPsy.attackthre = o[s].st_lrm), 0 != a ? e.internal_flags.nsPsy.attackthre_s = o[s].st_s : 0 < Math.abs(e.internal_flags.nsPsy.attackthre_s - -1) || (e.internal_flags.nsPsy.attackthre_s = o[s].st_s), 0 != a ? e.scale = o[s].scale : 0 < Math.abs(e.scale - -1) || (e.scale = o[s].scale), 0 != a ? e.maskingadjust = o[s].masking_adj : 0 < Math.abs(e.maskingadjust - 0) || (e.maskingadjust = o[s].masking_adj), 0 < o[s].masking_adj ? 0 != a ? e.maskingadjust_short = .9 * o[s].masking_adj : 0 < Math.abs(e.maskingadjust_short - 0) || (e.maskingadjust_short = .9 * o[s].masking_adj) : 0 != a ? e.maskingadjust_short = 1.1 * o[s].masking_adj : 0 < Math.abs(e.maskingadjust_short - 0) || (e.maskingadjust_short = 1.1 * o[s].masking_adj), 0 != a ? e.ATHlower = -o[s].ath_lower / 10 : 0 < Math.abs(10 * -e.ATHlower - 0) || (e.ATHlower = -o[s].ath_lower / 10), 0 != a ? e.ATHcurve = o[s].ath_curve : 0 < Math.abs(e.ATHcurve - -1) || (e.ATHcurve = o[s].ath_curve), 0 != a ? e.interChRatio = o[s].interch : 0 < Math.abs(e.interChRatio - -1) || (e.interChRatio = o[s].interch), t;
          }
          this.apply_preset = function (e, t, a) {
            switch (t) {
              case Y.R3MIX:
                t = Y.V3, e.VBR = Me.vbr_mtrh;
                break;
              case Y.MEDIUM:
                t = Y.V4, e.VBR = Me.vbr_rh;
                break;
              case Y.MEDIUM_FAST:
                t = Y.V4, e.VBR = Me.vbr_mtrh;
                break;
              case Y.STANDARD:
                t = Y.V2, e.VBR = Me.vbr_rh;
                break;
              case Y.STANDARD_FAST:
                t = Y.V2, e.VBR = Me.vbr_mtrh;
                break;
              case Y.EXTREME:
                t = Y.V0, e.VBR = Me.vbr_rh;
                break;
              case Y.EXTREME_FAST:
                t = Y.V0, e.VBR = Me.vbr_mtrh;
                break;
              case Y.INSANE:
                return t = 320, e.preset = t, s(e, t, a), e.VBR = Me.vbr_off, t;
            }
            switch (e.preset = t) {
              case Y.V9:
                return n(), t;
              case Y.V8:
                return n(), t;
              case Y.V7:
                return n(), t;
              case Y.V6:
                return n(), t;
              case Y.V5:
                return n(), t;
              case Y.V4:
                return n(), t;
              case Y.V3:
                return n(), t;
              case Y.V2:
                return n(), t;
              case Y.V1:
                return n(), t;
              case Y.V0:
                return n(), t;
            }
            return 8 <= t && t <= 320 ? s(e, t, a) : (e.preset = 0, t);
          };
        }(),
        _ = new T(),
        l = new C(),
        f = new y(),
        c = new function () {
          this.getLameShortVersion = function () {
            return "3.98.4";
          };
        }(),
        u = new function () {
          this.setModules = function (e, t) {};
        }(),
        h = new function () {
          var _;
          this.setModules = function (e) {
            _ = e;
          }, this.ResvFrameBegin = function (e, t) {
            var a,
              n = e.internal_flags,
              s = n.l3_side,
              r = _.getframebits(e);
            t.bits = (r - 8 * n.sideinfo_len) / n.mode_gr;
            var i = 2048 * n.mode_gr - 8;
            320 < e.brate ? me() : (a = 11520, e.strict_ISO && me()), n.ResvMax = a - r, n.ResvMax > i && (n.ResvMax = i), (n.ResvMax < 0 || e.disable_reservoir) && (n.ResvMax = 0);
            var o = t.bits * n.mode_gr + Math.min(n.ResvSize, n.ResvMax);
            return a < o && (o = a), s.resvDrain_pre = 0, null != n.pinfo && me(), o;
          }, this.ResvMaxBits = function (e, t, a, n) {
            var s,
              r = e.internal_flags,
              i = r.ResvSize,
              o = r.ResvMax;
            0 != n && (i += t), 0 != (1 & r.substep_shaping) && (o *= .9), a.bits = t, 9 * o < 10 * i ? (s = i - 9 * o / 10, a.bits += s, r.substep_shaping |= 128) : (s = 0, r.substep_shaping &= 127, e.disable_reservoir || 0 != (1 & r.substep_shaping) || (a.bits -= .1 * t));
            var _ = i < 6 * r.ResvMax / 10 ? i : 6 * r.ResvMax / 10;
            return (_ -= s) < 0 && (_ = 0), _;
          }, this.ResvAdjust = function (e, t) {
            e.ResvSize -= t.part2_3_length + t.part2_length;
          }, this.ResvFrameEnd = function (e, t) {
            var a,
              n = e.l3_side;
            e.ResvSize += t * e.mode_gr;
            var s = 0;
            n.resvDrain_post = 0, (n.resvDrain_pre = 0) != (a = e.ResvSize % 8) && (s += a), 0 < (a = e.ResvSize - s - e.ResvMax) && (s += a);
            var r = Math.min(8 * n.main_data_begin, s) / 8;
            n.resvDrain_pre += 8 * r, s -= 8 * r, e.ResvSize -= 8 * r, n.main_data_begin -= r, n.resvDrain_post += s, e.ResvSize -= s;
          };
        }(),
        b = new A(),
        p = new function () {
          this.setModules = function (e, t, a) {};
        }(),
        m = new function () {}();
      s.setModules(r, i, o, _, l, f, c, u, m), i.setModules(r, m, c, f), u.setModules(i, c), o.setModules(s), l.setModules(i, h, _, b), _.setModules(b, h, s.enc.psy), h.setModules(i), b.setModules(_), f.setModules(s, i, c), a.setModules(p, m), p.setModules(c, u, o);
      var v = s.lame_init();
      v.num_channels = n, v.in_samplerate = e, v.out_samplerate = e, v.brate = t, v.mode = ye.STEREO, v.quality = 3, v.bWriteVbrTag = !1, v.disable_reservoir = !0, v.write_id3tag_automatic = !1, s.lame_init_params(v);
      var d = 1152,
        g = 0 | 1.25 * d + 7200,
        w = S(g);
      this.encodeBuffer = function (e, t) {
        1 == n && (t = e), e.length > d && (d = e.length, w = S(g = 0 | 1.25 * d + 7200));
        var a = s.lame_encode_buffer(v, e, t, e.length, w, 0, g);
        return new Int8Array(w.subarray(0, a));
      }, this.flush = function () {
        var e = s.lame_encode_flush(v, w, 0, g);
        return new Int8Array(w.subarray(0, e));
      };
    };
  }
  t(), e.lamejs = t;
}(("object" == typeof window && window.document ? window : Object).Recorder);
});

/*
录音 Recorder扩展，动态波形显示
https://github.com/xiangyuecn/Recorder
*/
(function (factory) {
  var browser = typeof window == "object" && !!window.document;
  var win = browser ? window : Object; //非浏览器环境，Recorder挂载在Object下面
  var rec = win.Recorder,
    ni = rec.i18n;
  factory(rec, ni, ni.$T, browser);
})(function (Recorder, i18n, $T, isBrowser) {

  var WaveView = function (set) {
    return new fn(set);
  };
  var ViewTxt = "WaveView";
  var fn = function (set) {
    var This = this;
    var o = {
      /*
      elem:"css selector" //自动显示到dom，并以此dom大小为显示大小
      	//或者配置显示大小，手动把waveviewObj.elem显示到别的地方
      ,width:0 //显示宽度
      ,height:0 //显示高度
      
      H5环境以上配置二选一
      
      compatibleCanvas: CanvasObject //提供一个兼容H5的canvas对象，需支持getContext("2d")，支持设置width、height，支持drawImage(canvas,...)
      ,width:0 //canvas显示宽度
      ,height:0 //canvas显示高度
      非H5环境使用以上配置
      */

      scale: 2 //缩放系数，应为正整数，使用2(3? no!)倍宽高进行绘制，避免移动端绘制模糊
      ,
      speed: 9 //移动速度系数，越大越快
      ,
      phase: 21.8 //相位，调整了速度后，调整这个值得到一个看起来舒服的波形
      ,

      fps: 20 //绘制帧率，调整后也需调整phase值
      ,
      keep: true //当停止了input输入时，是否保持波形，设为false停止后将变成一条线
      ,

      lineWidth: 3 //线条基础粗细

      //渐变色配置：[位置，css颜色，...] 位置: 取值0.0-1.0之间
      ,
      linear1: [0, "rgba(150,96,238,1)", 0.2, "rgba(170,79,249,1)", 1, "rgba(53,199,253,1)"] //线条渐变色1，从左到右
      ,
      linear2: [0, "rgba(209,130,255,0.6)", 1, "rgba(53,199,255,0.6)"] //线条渐变色2，从左到右
      ,
      linearBg: [0, "rgba(255,255,255,0.2)", 1, "rgba(54,197,252,0.2)"] //背景渐变色，从上到下
    };
    for (var k in set) {
      o[k] = set[k];
    }
    This.set = set = o;
    var cCanvas = "compatibleCanvas";
    if (set[cCanvas]) {
      var canvas = This.canvas = set[cCanvas];
    } else {
      if (!isBrowser) throw new Error($T.G("NonBrowser-1", [ViewTxt]));
      var elem = set.elem;
      if (elem) {
        if (typeof elem == "string") {
          elem = document.querySelector(elem);
        } else if (elem.length) {
          elem = elem[0];
        }
      }
      if (elem) {
        set.width = elem.offsetWidth;
        set.height = elem.offsetHeight;
      }
      var thisElem = This.elem = document.createElement("div");
      thisElem.style.fontSize = 0;
      thisElem.innerHTML = '<canvas style="width:100%;height:100%;"/>';
      var canvas = This.canvas = thisElem.querySelector("canvas");
      if (elem) {
        elem.innerHTML = "";
        elem.appendChild(thisElem);
      }
    }
    var scale = set.scale;
    var width = set.width * scale;
    var height = set.height * scale;
    if (!width || !height) {
      throw new Error($T.G("IllegalArgs-1", [ViewTxt + " width=0 height=0"]));
    }
    canvas.width = width;
    canvas.height = height;
    var ctx = This.ctx = canvas.getContext("2d");
    This.linear1 = This.genLinear(ctx, width, set.linear1);
    This.linear2 = This.genLinear(ctx, width, set.linear2);
    This.linearBg = This.genLinear(ctx, height, set.linearBg, true);
    This._phase = 0;
  };
  fn.prototype = WaveView.prototype = {
    genLinear: function (ctx, size, colors, top) {
      var rtv = ctx.createLinearGradient(0, 0, top ? 0 : size, top ? size : 0);
      for (var i = 0; i < colors.length;) {
        rtv.addColorStop(colors[i++], colors[i++]);
      }
      return rtv;
    },
    genPath: function (frequency, amplitude, phase) {
      //曲线生成算法参考 https://github.com/HaloMartin/MCVoiceWave/blob/f6dc28975fbe0f7fc6cc4dbc2e61b0aa5574e9bc/MCVoiceWave/MCVoiceWaveView.m#L268
      var rtv = [];
      var This = this,
        set = This.set;
      var scale = set.scale;
      var width = set.width * scale;
      var maxAmplitude = set.height * scale / 2;
      for (var x = 0; x <= width; x += scale) {
        var scaling = (1 + Math.cos(Math.PI + x / width * 2 * Math.PI)) / 2;
        var y = scaling * maxAmplitude * amplitude * Math.sin(2 * Math.PI * (x / width) * frequency + phase) + maxAmplitude;
        rtv.push(y);
      }
      return rtv;
    },
    input: function (pcmData, powerLevel, sampleRate) {
      var This = this;
      This.sampleRate = sampleRate;
      This.pcmData = pcmData;
      This.pcmPos = 0;
      This.inputTime = Date.now();
      This.schedule();
    },
    schedule: function () {
      var This = this,
        set = This.set;
      var interval = Math.floor(1000 / set.fps);
      if (!This.timer) {
        This.timer = setInterval(function () {
          This.schedule();
        }, interval);
      }
      var now = Date.now();
      var drawTime = This.drawTime || 0;
      if (now - drawTime < interval) {
        //没到间隔时间，不绘制
        return;
      }
      This.drawTime = now;

      //切分当前需要的绘制数据
      var bufferSize = This.sampleRate / set.fps;
      var pcm = This.pcmData;
      var pos = This.pcmPos;
      var len = Math.max(0, Math.min(bufferSize, pcm.length - pos));
      var sum = 0;
      for (var i = 0; i < len; i++, pos++) {
        sum += Math.abs(pcm[pos]);
      }
      This.pcmPos = pos;

      //推入绘制
      if (len || !set.keep) {
        This.draw(Recorder.PowerLevel(sum, len));
      }
      if (!len && now - This.inputTime > 1300) {
        //超时没有输入，干掉定时器
        clearInterval(This.timer);
        This.timer = 0;
      }
    },
    draw: function (powerLevel) {
      var This = this,
        set = This.set;
      var ctx = This.ctx;
      var scale = set.scale;
      var width = set.width * scale;
      var height = set.height * scale;
      var speedx = set.speed / set.fps;
      var phase = This._phase -= speedx; //位移速度
      var phase2 = phase + speedx * set.phase;
      var amplitude = powerLevel / 100;
      var path1 = This.genPath(2, amplitude, phase);
      var path2 = This.genPath(1.8, amplitude, phase2);

      //开始绘制图形
      ctx.clearRect(0, 0, width, height);

      //绘制包围背景
      ctx.beginPath();
      for (var i = 0, x = 0; x <= width; i++, x += scale) {
        if (x == 0) {
          ctx.moveTo(x, path1[i]);
        } else {
          ctx.lineTo(x, path1[i]);
        }
      }
      i--;
      for (var x = width - 1; x >= 0; i--, x -= scale) {
        ctx.lineTo(x, path2[i]);
      }
      ctx.closePath();
      ctx.fillStyle = This.linearBg;
      ctx.fill();

      //绘制线
      This.drawPath(path2, This.linear2);
      This.drawPath(path1, This.linear1);
    },
    drawPath: function (path, linear) {
      var This = this,
        set = This.set;
      var ctx = This.ctx;
      var scale = set.scale;
      var width = set.width * scale;
      ctx.beginPath();
      for (var i = 0, x = 0; x <= width; i++, x += scale) {
        if (x == 0) {
          ctx.moveTo(x, path[i]);
        } else {
          ctx.lineTo(x, path[i]);
        }
      }
      ctx.lineWidth = set.lineWidth * scale;
      ctx.strokeStyle = linear;
      ctx.stroke();
    }
  };
  Recorder[ViewTxt] = WaveView;
});

/*
录音 Recorder扩展，频率直方图显示
使用本扩展需要引入src/extensions/lib.fft.js支持，直方图特意优化主要显示0-5khz语音部分（线性），其他高频显示区域较小，不适合用来展示音乐频谱，可通过配置fullFreq来恢复成完整的线性频谱，或自行修改源码修改成倍频程频谱（伯德图、对数频谱）；本可视化插件可以移植到其他语言环境，如需定制可联系作者

https://github.com/xiangyuecn/Recorder

本扩展核心算法主要参考了Java开源库jmp123 版本0.3 的代码：
https://www.iteye.com/topic/851459
https://sourceforge.net/projects/jmp123/files/
*/
(function (factory) {
  var browser = typeof window == "object" && !!window.document;
  var win = browser ? window : Object; //非浏览器环境，Recorder挂载在Object下面
  var rec = win.Recorder,
    ni = rec.i18n;
  factory(rec, ni, ni.$T, browser);
})(function (Recorder, i18n, $T, isBrowser) {

  var FrequencyHistogramView = function (set) {
    return new fn(set);
  };
  var ViewTxt = "FrequencyHistogramView";
  var fn = function (set) {
    var This = this;
    var o = {
      /*
      elem:"css selector" //自动显示到dom，并以此dom大小为显示大小
      	//或者配置显示大小，手动把frequencyObj.elem显示到别的地方
      ,width:0 //显示宽度
      ,height:0 //显示高度
      
      H5环境以上配置二选一
      
      compatibleCanvas: CanvasObject //提供一个兼容H5的canvas对象，需支持getContext("2d")，支持设置width、height，支持drawImage(canvas,...)
      ,width:0 //canvas显示宽度
      ,height:0 //canvas显示高度
      非H5环境使用以上配置
      */

      scale: 2 //缩放系数，应为正整数，使用2(3? no!)倍宽高进行绘制，避免移动端绘制模糊
      ,

      fps: 20 //绘制帧率，不可过高
      ,

      lineCount: 30 //直方图柱子数量，数量的多少对性能影响不大，密集运算集中在FFT算法中
      ,
      widthRatio: 0.6 //柱子线条宽度占比，为所有柱子占用整个视图宽度的比例，剩下的空白区域均匀插入柱子中间；默认值也基本相当于一根柱子占0.6，一根空白占0.4；设为1不留空白，当视图不足容下所有柱子时也不留空白
      ,
      spaceWidth: 0 //柱子间空白固定基础宽度，柱子宽度自适应，当不为0时widthRatio无效，当视图不足容下所有柱子时将不会留空白，允许为负数，让柱子发生重叠
      ,
      minHeight: 0 //柱子保留基础高度，position不为±1时应该保留点高度
      ,
      position: -1 //绘制位置，取值-1到1，-1为最底下，0为中间，1为最顶上，小数为百分比
      ,
      mirrorEnable: false //是否启用镜像，如果启用，视图宽度会分成左右两块，右边这块进行绘制，左边这块进行镜像（以中间这根柱子的中心进行镜像）
      ,

      stripeEnable: true //是否启用柱子顶上的峰值小横条，position不是-1时应当关闭，否则会很丑
      ,
      stripeHeight: 3 //峰值小横条基础高度
      ,
      stripeMargin: 6 //峰值小横条和柱子保持的基础距离
      ,

      fallDuration: 1000 //柱子从最顶上下降到最底部最长时间ms
      ,
      stripeFallDuration: 3500 //峰值小横条从最顶上下降到底部最长时间ms

      //柱子颜色配置：[位置，css颜色，...] 位置: 取值0.0-1.0之间
      ,
      linear: [0, "rgba(0,187,17,1)", 0.5, "rgba(255,215,0,1)", 1, "rgba(255,102,0,1)"]
      //峰值小横条渐变颜色配置，取值格式和linear一致，留空为柱子的渐变颜色
      ,
      stripeLinear: null,
      shadowBlur: 0 //柱子阴影基础大小，设为0不显示阴影，如果柱子数量太多时请勿开启，非常影响性能
      ,
      shadowColor: "#bbb" //柱子阴影颜色
      ,
      stripeShadowBlur: -1 //峰值小横条阴影基础大小，设为0不显示阴影，-1为柱子的大小，如果柱子数量太多时请勿开启，非常影响性能
      ,
      stripeShadowColor: "" //峰值小横条阴影颜色，留空为柱子的阴影颜色
      ,

      fullFreq: false //是否要绘制所有频率；默认false主要绘制5khz以下的频率，高频部分占比很少，此时不同的采样率对频谱显示几乎没有影响；设为true后不同采样率下显示的频谱是不一样的，因为 最大频率=采样率/2 会有差异
      //当发生绘制时会回调此方法，参数为当前绘制的频率数据和采样率，可实现多个直方图同时绘制，只消耗一个input输入和计算时间
      ,
      onDraw: function (frequencyData, sampleRate) {}
    };
    for (var k in set) {
      o[k] = set[k];
    }
    This.set = set = o;
    var cCanvas = "compatibleCanvas";
    if (set[cCanvas]) {
      var canvas = This.canvas = set[cCanvas];
    } else {
      if (!isBrowser) throw new Error($T.G("NonBrowser-1", [ViewTxt]));
      var elem = set.elem;
      if (elem) {
        if (typeof elem == "string") {
          elem = document.querySelector(elem);
        } else if (elem.length) {
          elem = elem[0];
        }
      }
      if (elem) {
        set.width = elem.offsetWidth;
        set.height = elem.offsetHeight;
      }
      var thisElem = This.elem = document.createElement("div");
      thisElem.style.fontSize = 0;
      thisElem.innerHTML = '<canvas style="width:100%;height:100%;"/>';
      var canvas = This.canvas = thisElem.querySelector("canvas");
      if (elem) {
        elem.innerHTML = "";
        elem.appendChild(thisElem);
      }
    }
    var scale = set.scale;
    var width = set.width * scale;
    var height = set.height * scale;
    if (!width || !height) {
      throw new Error($T.G("IllegalArgs-1", [ViewTxt + " width=0 height=0"]));
    }
    canvas.width = width;
    canvas.height = height;
    This.ctx = canvas.getContext("2d");
    if (!Recorder.LibFFT) {
      throw new Error($T.G("NeedImport-2", [ViewTxt, "src/extensions/lib.fft.js"]));
    }
    This.fft = Recorder.LibFFT(1024);

    //柱子所在高度
    This.lastH = [];
    //峰值小横条所在高度
    This.stripesH = [];
  };
  fn.prototype = FrequencyHistogramView.prototype = {
    genLinear: function (ctx, colors, from, to) {
      var rtv = ctx.createLinearGradient(0, from, 0, to);
      for (var i = 0; i < colors.length;) {
        rtv.addColorStop(colors[i++], colors[i++]);
      }
      return rtv;
    },
    input: function (pcmData, powerLevel, sampleRate) {
      var This = this;
      This.sampleRate = sampleRate;
      This.pcmData = pcmData;
      This.pcmPos = 0;
      This.inputTime = Date.now();
      This.schedule();
    },
    schedule: function () {
      var This = this,
        set = This.set;
      var interval = Math.floor(1000 / set.fps);
      if (!This.timer) {
        This.timer = setInterval(function () {
          This.schedule();
        }, interval);
      }
      var now = Date.now();
      var drawTime = This.drawTime || 0;
      if (now - This.inputTime > set.stripeFallDuration * 1.3) {
        //超时没有输入，顶部横条已全部落下，干掉定时器
        clearInterval(This.timer);
        This.timer = 0;
        This.lastH = []; //重置高度再绘制一次，避免定时不准没到底就停了
        This.stripesH = [];
        This.draw(null, This.sampleRate);
        return;
      }
      if (now - drawTime < interval) {
        //没到间隔时间，不绘制
        return;
      }
      This.drawTime = now;

      //调用FFT计算频率数据
      var bufferSize = This.fft.bufferSize;
      var pcm = This.pcmData;
      var pos = This.pcmPos;
      var arr = new Int16Array(bufferSize);
      for (var i = 0; i < bufferSize && pos < pcm.length; i++, pos++) {
        arr[i] = pcm[pos];
      }
      This.pcmPos = pos;
      var frequencyData = This.fft.transform(arr);

      //推入绘制
      This.draw(frequencyData, This.sampleRate);
    },
    draw: function (frequencyData, sampleRate) {
      var This = this,
        set = This.set;
      var ctx = This.ctx;
      var scale = set.scale;
      var width = set.width * scale;
      var height = set.height * scale;
      var lineCount = set.lineCount;
      var bufferSize = This.fft.bufferSize;

      //计算高度位置
      var position = set.position;
      var posAbs = Math.abs(set.position);
      var originY = position == 1 ? 0 : height; //y轴原点
      var heightY = height; //最高的一边高度
      if (posAbs < 1) {
        heightY = heightY / 2;
        originY = heightY;
        heightY = Math.floor(heightY * (1 + posAbs));
        originY = Math.floor(position > 0 ? originY * (1 - posAbs) : originY * (1 + posAbs));
      }
      var lastH = This.lastH;
      var stripesH = This.stripesH;
      var speed = Math.ceil(heightY / (set.fallDuration / (1000 / set.fps)));
      var stripeSpeed = Math.ceil(heightY / (set.stripeFallDuration / (1000 / set.fps)));
      var stripeMargin = set.stripeMargin * scale;
      var Y0 = 1 << (Math.round(Math.log(bufferSize) / Math.log(2) + 3) << 1);
      var logY0 = Math.log(Y0) / Math.log(10);
      var dBmax = 20 * Math.log(0x7fff) / Math.log(10);
      var fftSize = bufferSize / 2,
        fftSize5k = fftSize;
      if (!set.fullFreq) {
        //非绘制所有频率时，计算5khz所在位置，8000采样率及以下最高只有4khz
        fftSize5k = Math.min(fftSize, Math.floor(fftSize * 5000 / (sampleRate / 2)));
      }
      var isFullFreq = fftSize5k == fftSize;
      var line80 = isFullFreq ? lineCount : Math.round(lineCount * 0.8); //80%的柱子位置
      var fftSizeStep1 = fftSize5k / line80;
      var fftSizeStep2 = isFullFreq ? 0 : (fftSize - fftSize5k) / (lineCount - line80);
      var fftIdx = 0;
      for (var i = 0; i < lineCount; i++) {
        // !fullFreq 时不采用jmp123的非线性划分频段，录音语音并不适用于音乐的频率，应当弱化高频部分
        //80%关注0-5khz主要人声部分 20%关注剩下的高频，这样不管什么采样率都能做到大部分频率显示一致。
        var start = Math.ceil(fftIdx);
        if (i < line80) {
          //5khz以下
          fftIdx += fftSizeStep1;
        } else {
          //5khz以上
          fftIdx += fftSizeStep2;
        }
        var end = Math.ceil(fftIdx);
        if (end == start) end++;
        end = Math.min(end, fftSize);

        //参考AudioGUI.java .drawHistogram方法

        //查找当前频段的最大"幅值"
        var maxAmp = 0;
        if (frequencyData) {
          for (var j = start; j < end; j++) {
            maxAmp = Math.max(maxAmp, Math.abs(frequencyData[j]));
          }
        }

        //计算音量
        var dB = maxAmp > Y0 ? Math.floor((Math.log(maxAmp) / Math.log(10) - logY0) * 17) : 0;
        var h = heightY * Math.min(dB / dBmax, 1);

        //使柱子匀速下降
        lastH[i] = (lastH[i] || 0) - speed;
        if (h < lastH[i]) {
          h = lastH[i];
        }
        if (h < 0) {
          h = 0;
        }
        lastH[i] = h;
        var shi = stripesH[i] || 0;
        if (h && h + stripeMargin > shi) {
          stripesH[i] = h + stripeMargin;
        } else {
          //使峰值小横条匀速度下落
          var sh = shi - stripeSpeed;
          if (sh < 0) {
            sh = 0;
          }
          stripesH[i] = sh;
        }
      }

      //开始绘制图形
      ctx.clearRect(0, 0, width, height);
      var linear1 = This.genLinear(ctx, set.linear, originY, originY - heightY); //上半部分的填充
      var stripeLinear1 = set.stripeLinear && This.genLinear(ctx, set.stripeLinear, originY, originY - heightY) || linear1; //上半部分的峰值小横条填充

      var linear2 = This.genLinear(ctx, set.linear, originY, originY + heightY); //下半部分的填充
      var stripeLinear2 = set.stripeLinear && This.genLinear(ctx, set.stripeLinear, originY, originY + heightY) || linear2; //上半部分的峰值小横条填充

      //计算柱子间距
      var mirrorEnable = set.mirrorEnable;
      var mirrorCount = mirrorEnable ? lineCount * 2 - 1 : lineCount; //镜像柱子数量翻一倍-1根

      var widthRatio = set.widthRatio;
      var spaceWidth = set.spaceWidth * scale;
      if (spaceWidth != 0) {
        widthRatio = (width - spaceWidth * (mirrorCount + 1)) / width;
      }
      for (var i = 0; i < 2; i++) {
        var lineFloat = Math.max(1 * scale, width * widthRatio / mirrorCount); //柱子宽度至少1个单位
        var lineWN = Math.floor(lineFloat),
          lineWF = lineFloat - lineWN; //提取出小数部分
        var spaceFloat = (width - mirrorCount * lineFloat) / (mirrorCount + 1); //均匀间隔，首尾都留空，可能为负数，柱子将发生重叠
        if (spaceFloat > 0 && spaceFloat < 1) {
          widthRatio = 1;
          spaceFloat = 0; //不够一个像素，丢弃不绘制间隔，重新计算
        } else break;
      }

      //绘制
      var minHeight = set.minHeight * scale;
      var XFloat = mirrorEnable ? (width - lineWN) / 2 - spaceFloat : 0; //镜像时，中间柱子位于正中心
      for (var iMirror = 0; iMirror < 2; iMirror++) {
        if (iMirror) {
          ctx.save();
          ctx.scale(-1, 1);
        }
        var xMirror = iMirror ? width : 0; //绘制镜像部分，不用drawImage(canvas)进行镜像绘制，提升兼容性（iOS微信小程序bug https://developers.weixin.qq.com/community/develop/doc/000aaca2148dc8a235a0fb8c66b000）

        //绘制柱子
        ctx.shadowBlur = set.shadowBlur * scale;
        ctx.shadowColor = set.shadowColor;
        for (var i = 0, xFloat = XFloat, wFloat = 0, x, y, w, h; i < lineCount; i++) {
          xFloat += spaceFloat;
          x = Math.floor(xFloat) - xMirror;
          w = lineWN;
          wFloat += lineWF;
          if (wFloat >= 1) {
            w++;
            wFloat--;
          } //小数凑够1像素
          h = Math.max(lastH[i], minHeight);

          //绘制上半部分
          if (originY != 0) {
            y = originY - h;
            ctx.fillStyle = linear1;
            ctx.fillRect(x, y, w, h);
          }
          //绘制下半部分
          if (originY != height) {
            ctx.fillStyle = linear2;
            ctx.fillRect(x, originY, w, h);
          }
          xFloat += w;
        }

        //绘制柱子顶上峰值小横条
        if (set.stripeEnable) {
          var stripeShadowBlur = set.stripeShadowBlur;
          ctx.shadowBlur = (stripeShadowBlur == -1 ? set.shadowBlur : stripeShadowBlur) * scale;
          ctx.shadowColor = set.stripeShadowColor || set.shadowColor;
          var stripeHeight = set.stripeHeight * scale;
          for (var i = 0, xFloat = XFloat, wFloat = 0, x, y, w, h; i < lineCount; i++) {
            xFloat += spaceFloat;
            x = Math.floor(xFloat) - xMirror;
            w = lineWN;
            wFloat += lineWF;
            if (wFloat >= 1) {
              w++;
              wFloat--;
            } //小数凑够1像素
            h = stripesH[i];

            //绘制上半部分
            if (originY != 0) {
              y = originY - h - stripeHeight;
              if (y < 0) {
                y = 0;
              }
              ctx.fillStyle = stripeLinear1;
              ctx.fillRect(x, y, w, stripeHeight);
            }
            //绘制下半部分
            if (originY != height) {
              y = originY + h;
              if (y + stripeHeight > height) {
                y = height - stripeHeight;
              }
              ctx.fillStyle = stripeLinear2;
              ctx.fillRect(x, y, w, stripeHeight);
            }
            xFloat += w;
          }
        }
        if (iMirror) {
          ctx.restore();
        }
        if (!mirrorEnable) break;
      }
      if (frequencyData) {
        set.onDraw(frequencyData, sampleRate);
      }
    }
  };
  Recorder[ViewTxt] = FrequencyHistogramView;
});

/*
时域转频域，快速傅里叶变换(FFT)
https://github.com/xiangyuecn/Recorder

var fft=Recorder.LibFFT(bufferSize)
	bufferSize取值2的n次方

fft.bufferSize 实际采用的bufferSize
fft.transform(inBuffer)
	inBuffer:[Int16,...] 数组长度必须是bufferSize
	返回[Float64(Long),...]，长度为bufferSize/2
*/
(function (factory) {
  var browser = typeof window == "object" && !!window.document;
  var win = browser ? window : Object; //非浏览器环境，Recorder挂载在Object下面
  var rec = win.Recorder,
    ni = rec.i18n;
  factory(rec, ni, ni.$T, browser);
})(function (Recorder, i18n, $T, isBrowser) {

  /*
  从FFT.java 移植，Java开源库：jmp123 版本0.3
  https://www.iteye.com/topic/851459
  https://sourceforge.net/projects/jmp123/files/
  */
  Recorder.LibFFT = function (bufferSize) {
    var FFT_N_LOG, FFT_N, MINY;
    var real, imag, sintable, costable;
    var bitReverse;
    var FFT_Fn = function (bufferSize) {
      //bufferSize只能取值2的n次方
      FFT_N_LOG = Math.round(Math.log(bufferSize) / Math.log(2));
      FFT_N = 1 << FFT_N_LOG;
      MINY = (FFT_N << 2) * Math.sqrt(2);
      real = [];
      imag = [];
      sintable = [0];
      costable = [0];
      bitReverse = [];
      var i, j, k, reve;
      for (i = 0; i < FFT_N; i++) {
        k = i;
        for (j = 0, reve = 0; j != FFT_N_LOG; j++) {
          reve <<= 1;
          reve |= k & 1;
          k >>>= 1;
        }
        bitReverse[i] = reve;
      }
      var theta,
        dt = 2 * Math.PI / FFT_N;
      for (i = (FFT_N >> 1) - 1; i > 0; i--) {
        theta = i * dt;
        costable[i] = Math.cos(theta);
        sintable[i] = Math.sin(theta);
      }
    };

    /*
    用于频谱显示的快速傅里叶变换 
       inBuffer 输入FFT_N个实数，返回 FFT_N/2个输出值(复数模的平方)。 
    */
    var getModulus = function (inBuffer) {
      var i,
        j,
        k,
        ir,
        j0 = 1,
        idx = FFT_N_LOG - 1;
      var cosv, sinv, tmpr, tmpi;
      for (i = 0; i != FFT_N; i++) {
        real[i] = inBuffer[bitReverse[i]];
        imag[i] = 0;
      }
      for (i = FFT_N_LOG; i != 0; i--) {
        for (j = 0; j != j0; j++) {
          cosv = costable[j << idx];
          sinv = sintable[j << idx];
          for (k = j; k < FFT_N; k += j0 << 1) {
            ir = k + j0;
            tmpr = cosv * real[ir] - sinv * imag[ir];
            tmpi = cosv * imag[ir] + sinv * real[ir];
            real[ir] = real[k] - tmpr;
            imag[ir] = imag[k] - tmpi;
            real[k] += tmpr;
            imag[k] += tmpi;
          }
        }
        j0 <<= 1;
        idx--;
      }
      j = FFT_N >> 1;
      var outBuffer = new Float64Array(j);
      /*
       * 输出模的平方:
       * for(i = 1; i <= j; i++)
       * 	inBuffer[i-1] = real[i] * real[i] +  imag[i] * imag[i];
       * 
       * 如果FFT只用于频谱显示,可以"淘汰"幅值较小的而减少浮点乘法运算. MINY的值
       * 和Spectrum.Y0,Spectrum.logY0对应.
       */
      sinv = MINY;
      cosv = -MINY;
      for (i = j; i != 0; i--) {
        tmpr = real[i];
        tmpi = imag[i];
        if (tmpr > cosv && tmpr < sinv && tmpi > cosv && tmpi < sinv) outBuffer[i - 1] = 0;else outBuffer[i - 1] = Math.round(tmpr * tmpr + tmpi * tmpi);
      }
      return outBuffer;
    };
    FFT_Fn(bufferSize);
    return {
      transform: getModulus,
      bufferSize: FFT_N
    };
  };
});

var playIcon$5 = "data:image/png;base64, ";

var pauseIcon$4 = "data:image/png;base64, ";

var audioIcon$3 = "data:image/png;base64, ";

var coverLocal$3 = "data:image/png;base64, ";

var playRepeat$3 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFu2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4wLWMwMDAgNzkuMTcxYzI3ZiwgMjAyMi8wOC8xNi0xODowMjo0MyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDI0LjAgKFdpbmRvd3MpIiB4bXA6Q3JlYXRlRGF0ZT0iMjAyNC0wMS0wOFQxNTowNToyNyswODowMCIgeG1wOk1vZGlmeURhdGU9IjIwMjQtMDQtMjhUMTM6NDA6MDYrMDg6MDAiIHhtcDpNZXRhZGF0YURhdGU9IjIwMjQtMDQtMjhUMTM6NDA6MDYrMDg6MDAiIGRjOmZvcm1hdD0iaW1hZ2UvcG5nIiBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjFkNmU3NmMwLTE5NWEtY2U0OS1iNGE4LTQ5NzZlY2FiMmRhNSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo5ZWQ4M2Q3Ny1hMDJjLTA3NGUtYWEyOC0xMWFkMzg3Yzg0ZjAiIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo5ZWQ4M2Q3Ny1hMDJjLTA3NGUtYWEyOC0xMWFkMzg3Yzg0ZjAiPiA8eG1wTU06SGlzdG9yeT4gPHJkZjpTZXE+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJjcmVhdGVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjllZDgzZDc3LWEwMmMtMDc0ZS1hYTI4LTExYWQzODdjODRmMCIgc3RFdnQ6d2hlbj0iMjAyNC0wMS0wOFQxNTowNToyNyswODowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDI0LjAgKFdpbmRvd3MpIi8+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJzYXZlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDoxZDZlNzZjMC0xOTVhLWNlNDktYjRhOC00OTc2ZWNhYjJkYTUiIHN0RXZ0OndoZW49IjIwMjQtMDQtMjhUMTM6NDA6MDYrMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCAyNC4wIChXaW5kb3dzKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz77PGlAAAAEZElEQVRYhe3YW0ybZRgH8P/zfv06pOHQopuYRRdnDCMzUYeHYIAPtrHp2LLEK4270ZndOMZhCVcmaDKicmjBzbnEwyQxzmji5hKJiKPgYS6RgcbDhZuZ0YSpbaEwCm2/93m82KYECy1rp1zwT3rRL0/f75ce3ud9SiKCpRz1fwOSZRmYbpaB6WbJAx2JLhJRygtUtQdLmWS7At3BRKsAuQGCMAl+FgNnWKN3sLHg11TWSrTlUcKLKQBLD4d3ZV2K10HRvTKrnCAQEEAABAAEhjLfsUm3+Pd5vrvuQKsztJ60vAbCAyRXDEAvREZE0U/E6g9S+jYRVQTAAqRYREAEGHHy9TUV1F834COdwa0Rph6DGSIAO432aLZ69fTuvHPz3bTCG3pYidQRpBoCzDipN+r01AztoXhGgWsPTFYWuSKnptkAk+NHSGyHv2HlvLC5sXzhZyD2y0aMAYfj608b3fdlDLi9WbKnckMTAjGU4CunWWD11FI0VdzVVDeHakyxT07lAYDjoL/BszcjwE3toQ9E2Tu1mKP+Bvcti4XNTvEnU0/e/O2l14lNsGFa/Q05AwsBk+6DVZ3BUlayUxjQwGPp4ADgh82uN4SzThA0hGK+ZPVJgfGoMSPCE2Ks+PCzBvdAsvpUIpS7WzsIBNxttYbWL1ws8q/HfxGrI3SquiUgG96deGEhS8JOMjsVbWO7bG0f/6LppslMwMoO/FloZKuHiMhvO1GZE5Ai682xfArpHQC659Yv+BFX+UJvK6W7V5jGBasruDoTQGeuOkQs74G5VgwCTdt3UYC/AdFbiernBW70BU6C+fErzctDNkYs79iadIE6ktUtikFAAQSAwu0w5FYAl1IGlrWFj4KlRkDAlW5GQAEJj6T7TvqbXMeZ9TbQ7O86AWxYKQOdxOUaBM3yMQAGKAAgBiBPx5CbDhAABhsLP7LZ3EaXTxQabJT0788fSlSbcKMub4kUUvZ0vpPUFDP/osUYi5Ha6hKO9zW6h9MFXs2WjrAnSpzrr3dfAK6hk2w4Imbe9HhQtJ0TV+bmz+vz+zKFq+oI3B92FQzPPjQsupMM7aE4mI8RAU7hrozhusbXCnAmLxL6LVlt0k4y43C9KFBwkr3untappzIBJK2PAQIRJD1pJwV+WZt1XqAOxoTgMSOHH/TKmnRwle3h50WkRBFhxpH1dNpAAPA3uPcyZBQsZhaPny33Tq67FpzVEWwE2c8KANaq6XStK+kPLuWpzrRzKxjmtFJxtyHR4UpfcEvKsGZxWN6gV4m0KRYQjPf793teSuW1izryl3VFiw09MaBE3SgABNRDGof6p9w9aCaeW7/R9/sqzY4nCKhTkNWaCGzAN1ibeC7JyNBU2npxpVOZrxDhUZK/J7hpAN8DOCukIiK00oAuEeDOf4Y7GtWmem6wNv/IfGtndOy0vIFNILWPRCohcM26zdVVLj8jOm8LHb3oyG89l2RMSBm4lLLk//pYBqabZWC6WQamm78AEV4zMhfNvWEAAAAASUVORK5CYII=";

var playOnce$3 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAgCAMAAAA2a+hwAAAAAXNSR0IArs4c6QAAAlJQTFRFAAAAgID/QID/QID/OY7jRovoO4nrSZLtRIjuPIfwQIzyQJnySZLzRpfzQ4X0QIrqQo7sPo3tEN73RI/wPI3yQZDrPo/sQ4ztQ4zzO4jtQY7tPo7uPYvuQI/vOY3vPo3vPIzrQZHwNqL1QI7wRYTrK4b2QY/uP47uR47yQIvvP43rQI/wP5DwSXz0QozuPYvxQY/uQI3uQY3vQI/yQZDzQpDwQ472QI3uPIn3P4vqQo7vQo3tQI3uQJDuQI7uQI3uQI7sQo7sQpHxQY3sPo7vQI7tQI/xQY7tQY3tQY3vPo7vQo/rP5HuQY3uQJDxQorsQo7sQo7vOI3xQovrQo3rQY7tQY3tQI7tQI3sPY/wN5vvQo7vNKPyQY7tQ43tQY/uQorsQI7sQY3uPJfwQI7wPpPuP4/vQY7tTnTsRJPxP47vQYzsPZDvP43uQo7sO5jvQY3uPZDwQ4ftQI7tQo3uQY7uQo7uQY7tQY7tQ43wQY7tQI3tQI7uQI7tQI/wP4zuQ5DtQY7tRJHsQI7tQY7tQI7tQY7uQI7uQY3uQo7tPpHtQI7tQY/sQY7sQY/tQY7tQY7tQY3sQY/uQI7tQY7tQo7uQo/uSY7tQY/tTXnqQY3tQY7tQY7tQY7tQY7tQY7uQY7tPZXtQY3tQY7tQY7tQY7tQo/tP5LqQI/rQI/sQY3sQY7rQY7sQY7tQY/rQY/sQY/tQZDtQozsQo3rQo3sQo3tQo7qQo7rQo7sQo7tQo/tQ4vsQ4zrQ47qQ47sRIfrRInsRI/rRI/sRYnsR4TqR4fqvnKd/wAAAKd0Uk5TAAIECAkLDQ4PERQUFRYXGBsdHyImJykqKisrLS4wMTEzMzQ0NDs7PT1AQURFRklLS0xOUFNVWFxdYWFlZ2doa2xsbW5vb3BxcnJzdHl5fHx8fH+AgIGCg4iJjIyOjpGSkpOUlZeZm56goaKio6OjpKaqqq6vsLO0t7i5vL7GxsfHyMjLy8zN0tTW2trc4ubn6erq7Ozs7Ozu7vHz9Pb3+Pn6+/v9/v6utNnsAAABnklEQVQYGY3BhVsTcQDH4c8QRbCwu7tbVFQsPLu7u3t2YRfYXRhg7r4GMnYzMPm/nLf7nTjkeXxf/lv7I3OoVP+IllCpvg80l39rNiTrkrQymQpqTD4rV7QriabkRx3tnXdP9tQqkDGAP1IPKXw6qy7ZciYCqbLnY6RdkDKBUVI2MUlL39jr8eQV3elATKdTI4kb+6FsMa7NZY/rkWDw8589ielS8qU3FWwquRoAcu0N+Opg3AxNgFalr2rhSd/3qBuece8vwszvOXjGFEiz8dQOC46GRuNK3iMVaDzG+TBct3vgSpGGrpOFse0rPH3blLhGrdkqC2P5OyhUQ3y7ZWEs/AG31RlfUBbGmiLIdQbiC8rC2P8SNkaW4QvKwrgfhkGhu/h2aRKedsVhqGnb/TAOazqend8OAit0BWP4ycbEdXxR2hJIeRJZS6LArc87+K2Xo2n8Len46xsBXAs+fVxFeU3OhJ61wTNL0XPdMarOkPOwLb7M/GIdGNE8rVr1+n1WX3OcYw0oJ32LnKhcjvKGkaDFohOFirm8PQPPL6EvjEOwGD5qAAAAAElFTkSuQmCC";

var recStartIcon$1 = "data:image/png;base64, ";

var recStopIcon$1 = "data:image/png;base64, ";

var recDelete$1 = "data:image/png;base64, ";

var recMockWave$1 = "data:image/png;base64, ";

//
const uuid$2 = prefix => {
  const s = [];
  const hexDigits = '0123456789abcdef';
  for (let i = 0; i < 36; i += 1) {
    s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
  }
  s[14] = '4';
  s[19] = hexDigits.substr(s[19] & 0x3 | 0x8, 1);
  const id = s.join('');
  return prefix ? prefix + '__' + id : id;
};
var script$4O = {
  name: 'RecordPlayer',
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    playStyle: {
      type: String,
      default: 'yuan-wen'
    },
    styleMode: {
      type: String,
      default: 'A'
    },
    url: {
      type: String,
      default: '',
      require: true
    },
    title: {
      type: String,
      default: '音频文件'
    },
    content: {
      type: String,
      default: '暂无简介'
    },
    coverImageUrl: {
      type: String,
      default: ''
    },
    //进度是否能控制
    scheduleControl: {
      type: String,
      default: ''
    },
    loop: {
      type: Boolean,
      default: true
    },
    playMode: {
      type: String,
      default: 'xun-huan'
    },
    targerLink: {
      type: String,
      default: ''
    },
    playerIndex: {
      type: Number,
      default: -1
    }
  },
  data() {
    return {
      playIcon: playIcon$5,
      pauseIcon: pauseIcon$4,
      audioIcon: audioIcon$3,
      coverLocal: coverLocal$3,
      recStartIcon: recStartIcon$1,
      recStopIcon: recStopIcon$1,
      recDelete: recDelete$1,
      recMockWave: recMockWave$1,
      isPlay: false,
      playTime: 0,
      playDuration: '00:00',
      playCurrentTime: '00:00',
      totalDuration: 0,
      link: {
        type: String,
        default: ''
      },
      //链接地址
      lastOperateTimeStamp: '',
      recordAudio: null,
      permissionDialogVisible: false,
      Rec: recorder_mp3_min,
      type: 'mp3',
      bitRate: 16,
      sampleRate: 16000,
      rec: null,
      recDuration: 0,
      powerLevel: 0,
      logs: [],
      recBolb: null,
      isRecing: false,
      hasInitSuccess: false,
      waveStore: {
        selected: 'Histogram2',
        WaveView: {},
        Histogram2: {},
        Histogram3: {}
      },
      recordDataUrl: '',
      lastAudioStamp: null,
      lastPlayStamp: null,
      waveBoxKey: uuid$2('wave'),
      recTimestamp: null
    };
  },
  computed: {
    videoAndMusicStop() {
      let playState = sessionStorage.getItem('SET_PLAY_STATE');
      return playState;
    },
    playModeIconSrc() {
      let srcMap = {
        'xun-huan': playRepeat$3,
        'dan-ci': playOnce$3
      };
      return srcMap[this.playMode];
    },
    controlStatusText() {
      let text = '';
      if (this.recBolb) {
        text = this.isPlay ? '' : '';
      } else {
        text = this.isRecing ? '结束录音' : '开始录音';
      }
      return text;
    }
  },
  watch: {
    url: {
      handler(newVal) {
        let _this = this;
        this.isPlay = false;
        let ua = navigator.userAgent;
        console.log('浏览器 UA', ua);
        /micromessenger/.test(ua.toLowerCase());
        let isIOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        // isWeixin && isIOS && newVal && this.$message({
        //   message: `当前UA为${ua}`,
        //   duration: 3000
        // })
        if (isIOS && newVal) {
          try {
            this.$nextTick(() => {
              _this.$refs.recordAudio.muted = true;
              const playPromise = _this.$refs.recordAudio.play();
              _this.$refs.recordAudio.muted = false;
              if (playPromise) {
                playPromise.then(() => {
                  _this.$refs.recordAudio.pause();
                }).catch(error => {
                  _this.$refs.recordAudio.pause();
                  console.log(error);
                });
              }
            });
          } catch (error) {
            console.log(error);
            this.$message({
              type: 'warning',
              message: error,
              duration: 5000
            });
          }
        }
      },
      immediate: true
    },
    videoAndMusicStop(val) {
      console.log('watch', val);
      let currentPlayStamp = val || '--';
      if (`${this.url}__playTimeStamp__${this.lastOperateTimeStamp}` !== currentPlayStamp) {
        this.recordAudio.pause();
      }
    }
  },
  mounted() {
    // 加载完毕后，先获取<video>标签DOM对象
    this.recordAudio = this.$refs.recordAudio;
    // let _this = this;
    // if(!this.recBolb && !this.isRecing) {
    //   let rec = this.rec = Recorder({
    //       type:_this.type,
    //       bitRate:_this.bitRate,
    //       sampleRate:_this.sampleRate,
    //       onProcess:function(buffers,powerLevel,duration,sampleRate){
    //           _this.recDuration = duration;
    //           _this.powerLevel = powerLevel;
    //           // _this.wave.input(buffers[buffers.length-1],powerLevel,sampleRate);
    //           //可视化图形绘制
    //           $(".recwave").html("").append(_this.waveStore[_this.waveStore.selected].elem);
    //           _this.waveStore[_this.waveStore.selected].input(buffers[buffers.length-1],powerLevel,sampleRate);
    //       }
    //   });

    //   _this.dialogInt=setTimeout(function(){//定时8秒后打开弹窗，用于监测浏览器没有发起权限请求的情况
    //       _this.showDialog();
    //   },8000);

    //   rec.open(function(){
    //       _this.dialogCancel();
    //       // _this.reclog("已打开:"+_this.type+" "+_this.sampleRate+"hz "+_this.bitRate+"kbps",2);

    //       _this.initWaveStore(".recwave");
    //       // rec.start();
    //       _this.hasInitSuccess = true
    //       // _this.isRecing = true
    //   },function(msg,isUserNotAllow){
    //       _this.dialogCancel();
    //       isUserNotAllow && _this.$message.error('启动录音失败，用户拒绝了授权')
    //       // _this.reclog((isUserNotAllow?"UserNotAllow，":"")+"打开失败："+msg,1);
    //   });

    //   _this.waitDialogClickFn=function(){
    //       _this.dialogCancel();
    //       _this.$message.error('启动录音失败，用户忽略了权限请求')
    //       // _this.reclog("打开失败：权限请求被忽略，用户主动点击的弹窗",1);
    //   };
    // }
  },
  methods: {
    changeDuration() {
      this.$nextTick(() => {
        this.playDuration = this.timeFormat(this.$refs.recordAudio.duration);
        this.totalDuration = this.$refs.recordAudio.duration;
      });
    },
    //将单位为秒的的时间转换成mm:ss的形式
    timeFormat(num) {
      let minute = parseInt(num / 60);
      let second = parseInt(num % 60);
      minute = minute >= 10 ? minute : `0${minute}`;
      second = second >= 10 ? second : `0${second}`;
      return `${minute}:${second}`;
    },
    resetRecorder() {
      let audio = this.$refs.recordAudio;
      if (!audio.paused) {
        audio.pause();
      }
      this.recBolb = null;
      this.isPlay = false;
      this.isRecing = false;
      this.playTime = 0;
      this.playDuration = '00:00';
      this.playCurrentTime = '00:00';
      this.totalDuration = 0;
      this.recDuration = 0;
      this.recordDataUrl = '';
      this.lastAudioStamp = null;
      this.lastPlayStamp = null;
    },
    setRecedDuration(ms) {
      this.playDuration = this.timeFormat(ms / 1000);
      this.totalDuration = ms / 1000;
    },
    initWaveStore(elem) {
      this.waveStore.WaveView = recorder_mp3_min.WaveView({
        elem: elem,
        width: 300,
        height: 100
      });
      this.waveStore.Histogram2 = recorder_mp3_min.FrequencyHistogramView({
        elem: elem,
        lineCount: 30,
        position: 0,
        minHeight: 12,
        mirrorEnable: true,
        stripeEnable: false,
        linear: [0, '#8FC1FD', 1, '#8FC1FD']
      });
      this.waveStore.Histogram3 = recorder_mp3_min.FrequencyHistogramView({
        elem: elem,
        lineCount: 20,
        position: 0,
        minHeight: 1,
        fallDuration: 400,
        stripeEnable: false,
        mirrorEnable: true,
        linear: [0, '#0ac', 1, '#0ac']
      });
    },
    toggleRec() {
      let _this = this;
      // if(!this.hasInitSuccess) {
      //   this.$message.warning('当前浏览器不支持或用户未进行授权，组件功能暂无法使用')
      //   return
      // }
      let waveBoxSelector = '#' + _this.waveBoxKey;
      if (!this.recBolb && !this.isRecing) {
        // _this.rec.start();
        // _this.isRecing = true
        if (recorder_mp3_min.IsOpen()) {
          _this.$message.warning('当前存在进行中的录制任务');
          return;
        }
        let rec = this.rec = recorder_mp3_min({
          type: _this.type,
          bitRate: _this.bitRate,
          sampleRate: _this.sampleRate,
          onProcess: function (buffers, powerLevel, duration, sampleRate) {
            _this.recDuration = duration;
            _this.powerLevel = powerLevel;
            // _this.wave.input(buffers[buffers.length-1],powerLevel,sampleRate);
            //可视化图形绘制
            jquery(waveBoxSelector).html('').append(_this.waveStore[_this.waveStore.selected].elem);
            _this.waveStore[_this.waveStore.selected].input(buffers[buffers.length - 1], powerLevel, sampleRate);
          }
        });
        _this.dialogInt = setTimeout(function () {
          //定时8秒后打开弹窗，用于监测浏览器没有发起权限请求的情况
          _this.showDialog();
        }, 15000);
        rec.open(function () {
          _this.dialogCancel();
          // _this.reclog("已打开:"+_this.type+" "+_this.sampleRate+"hz "+_this.bitRate+"kbps",2);

          // _this.wave=Recorder.WaveView({elem:".ctrlProcessWave"});
          _this.initWaveStore(waveBoxSelector);
          rec.start();
          _this.isRecing = true;
          _this.recTimestamp = new Date().getTime();
        }, function (msg, isUserNotAllow) {
          _this.dialogCancel();
          console.log('启动录音错误信息', msg);
          let errMsg = '启动录音失败，当前浏览器不支持';
          if (isUserNotAllow) {
            errMsg = '启动录音失败，用户拒绝了授权';
          }
          if (msg.includes('麦克风')) {
            errMsg = '启动录音失败，无可用 MIC 设备';
          }
          _this.$message.error(errMsg);
          // _this.reclog((isUserNotAllow?"UserNotAllow，":"")+"打开失败："+msg,1);
        });
        _this.waitDialogClickFn = function () {
          _this.dialogCancel();
          _this.$message.error('启动录音失败，用户忽略了权限请求');
          // _this.reclog("打开失败：权限请求被忽略，用户主动点击的弹窗",1);
        };
        // _this.$nextTick(() => {
        //   if(!Recorder.IsOpen()){
        //     _this.$message.error('未获取录音权限')
        //     // this.reclog("未打开录音",1);
        //     return;
        //   }
        //   console.log('当前录音实例配置',_this.rec.set);
        //   rec.start();
        // })
      } else {
        if (!(_this.rec && recorder_mp3_min.IsOpen())) {
          _this.$message.error('录音未启动');
          return;
        }
        let doneTimestamp = new Date().getTime();
        if (!_this.recTimestamp || doneTimestamp - _this.recTimestamp < 5000) {
          _this.$message.warning('至少录制 5s 方可进行保存，请稍候');
          return;
        }
        let rec = _this.rec;
        rec.stop(function (blob, duration) {
          _this.$message.success('录制完成');
          _this.setAudioPath(blob, duration);
          jquery(waveBoxSelector).html('');
          _this.$emit('resData', {
            blob: blob,
            duration: duration
          });
        }, function (msg) {
          _this.recTimestamp = null;
          _this.$message.error(`录音失败：${msg}`);
        }, true); //录音结束时自动调用rec.close方法丢弃所有数据
      }
    },
    // 销毁录音实例
    destruction() {
      this.rec.close();
      this.isRecing = false;
      let waveBoxSelector = '#' + this.waveBoxKey;
      jquery(waveBoxSelector).html('');
    },
    setAudioPath(blob, duration) {
      this.recDuration = duration;
      this.setRecedDuration(duration);
      this.$nextTick(() => {
        this.recBolb = blob;
        this.isRecing = false;
        this.lastAudioStamp = new Date().getTime();
        this.recTimestamp = null;
      });
    },
    play() {
      if (!this.recBolb) {
        this.toggleRec();
      } else {
        // if (this.playStyle === 'yuan-wen') {
        //   this.doPlay()
        // }
        // if (this.playStyle === 'tan-chuang') {
        //   this.$emit('showDialog', { url: this.url, title: this.title, coverFileUrl: this.coverImageUrl, content: this.content, playerIndex: this.playerIndex })
        // }
        this.togglePlay();
      }
    },
    togglePlay() {
      let _this = this;
      let audios = document.querySelectorAll('audio');
      audios.forEach(i => i.pause());
      let video = document.querySelectorAll('video');
      if (video && video.length) {
        video.forEach(i => i.pause());
      }
      let audio = this.$refs.recordAudio;
      if (this.isPlay) {
        !(audio.ended || audio.paused) && audio.pause();
      } else {
        if (!this.lastPlayStamp || this.lastPlayStamp !== this.lastAudioStamp) {
          audio.onerror = function (e) {
            _this.$message.error(audio.error.message);
          };
          audio.currentTime = 0;
          audio.src = typeof _this.recBolb == 'object' ? (window.URL || webkitURL).createObjectURL(_this.recBolb) : _this.recBolb;
          audio.play();
          this.lastPlayStamp = this.lastAudioStamp;
        } else {
          audio.paused && audio.play();
        }
      }
      this.isPlay = !this.isPlay;
    },
    doPlay() {
      let _this = this;
      let rec = this.rec;
      let audio = this.$refs.LogAudioPlayer;
      audio.controls = true;
      if (!(audio.ended || audio.paused)) {
        audio.pause();
      }
      audio.onerror = function (e) {
        _this.$message.error(audio.error.message);
      };
      audio.src = (window.URL || webkitURL).createObjectURL(rec.blob);
      audio.play();
      // console.log('暂停')
      // let audio = document.querySelectorAll('audio')
      // audio.forEach((i) => i.pause())
      // let video = document.querySelectorAll('video')
      // if (video && video.length) {
      //   video.forEach((i) => i.pause())
      // }

      // this.isPlay ? this.$refs.recordAudio.pause() : this.$refs.recordAudio.play()
      // this.isPlay = !this.isPlay
      // let timeStamp = new Date().getTime()
      // this.lastOperateTimeStamp = timeStamp
      // let playStamp = `${this.url}__playTimeStamp__${timeStamp}`
      // // !this.isPlay && this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // // this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // sessionStorage.setItem('SET_PLAY_STATE', playStamp) //存储
    },
    updateTime(e) {
      this.playTime = this.$refs.recordAudio.currentTime;
      this.playCurrentTime = this.timeFormat(this.$refs.recordAudio.currentTime);
      if (!this.loop && this.playTime >= this.totalDuration) {
        this.isPlay = false;
      }
      // this.$emit('timeUpdate', {event:e, time: this.$refs.recordAudio.currentTime })
    },
    changeTime(val) {
      this.$refs.recordAudio.currentTime = val;
    },
    showDialog: function () {
      //选择性的弹一个对话框：为了防止移动端浏览器存在第三种情况：用户忽略，并且（或者国产系统UC系）浏览器没有任何回调
      if (!/mobile/i.test(navigator.userAgent)) {
        return; //只在移动端开启没有权限请求的检测
      }
      this.permissionDialogVisible = true;
    },
    dialogCancel: function () {
      clearTimeout(this.dialogInt);
      this.permissionDialogVisible = false;
    },
    waitDialogClick: function () {
      this.dialogCancel();
      this.waitDialogClickFn();
    }
  }
};

/* script */
const __vue_script__$4O = script$4O;

/* template */
var __vue_render__$4O = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { class: ["xml-audio-player", _vm.mode] },
    [
      _vm.recBolb
        ? _c("div", { staticClass: "play-mode-wrap" }, [
            _c("img", {
              staticClass: "play-control-image",
              attrs: { src: _vm.playModeIconSrc },
              on: {
                click: function ($event) {
                  _vm.$refs.recordAudio.currentTime = 0;
                },
              },
            }),
            _vm._v(" "),
            _c("img", {
              staticClass: "play-control-image",
              attrs: { src: _vm.recDelete },
              on: { click: _vm.resetRecorder },
            }),
          ])
        : _vm._e(),
      _vm._v(" "),
      _vm.styleMode !== "C"
        ? _c("div", { staticClass: "audio-cover" }, [
            _vm.styleMode === "A"
              ? _c("div", { staticClass: "play-button style-a" }, [
                  _c("img", {
                    staticClass: "button-image",
                    attrs: {
                      src: _vm.recBolb
                        ? _vm.isPlay
                          ? _vm.pauseIcon
                          : _vm.playIcon
                        : _vm.isRecing
                        ? _vm.recStopIcon
                        : _vm.recStartIcon,
                    },
                    on: {
                      click: function ($event) {
                        $event.stopPropagation();
                        return _vm.play.apply(null, arguments)
                      },
                    },
                  }),
                ])
              : _vm._e(),
            _vm._v(" "),
            _vm.controlStatusText
              ? _c("div", { staticClass: "play-text" }, [
                  _vm._v(_vm._s(_vm.controlStatusText)),
                ])
              : _vm._e(),
          ])
        : _vm._e(),
      _vm._v(" "),
      !_vm.recBolb
        ? _c("div", { staticClass: "record-player-control" }, [
            !_vm.recBolb
              ? _c("div", {
                  staticClass: "recwave",
                  staticStyle: { height: "75%", width: "100%" },
                  attrs: { id: _vm.waveBoxKey },
                })
              : _vm._e(),
            _vm._v(" "),
            !_vm.isRecing
              ? _c("div", { staticClass: "mock-wave" }, [
                  _c("img", {
                    staticClass: "button-image",
                    attrs: { src: _vm.recMockWave },
                  }),
                ])
              : _vm._e(),
          ])
        : _c("div", { staticClass: "audio-player-control" }, [
            _c("div", { staticClass: "audio-controls" }, [
              _vm.styleMode !== "A"
                ? _c(
                    "div",
                    { staticClass: "audio-controls__play-button-wrapper" },
                    [
                      _c("div", { staticClass: "play-button" }, [
                        _c("img", {
                          staticClass: "button-image",
                          attrs: {
                            src: _vm.isPlay ? _vm.pauseIcon : _vm.playIcon,
                          },
                          on: {
                            click: function ($event) {
                              $event.stopPropagation();
                              return _vm.play.apply(null, arguments)
                            },
                          },
                        }),
                      ]),
                    ]
                  )
                : _vm._e(),
              _vm._v(" "),
              _c("div", { staticClass: "audio-controls__handler" }, [
                _c(
                  "div",
                  { staticClass: "progress" },
                  [
                    _c("el-slider", {
                      attrs: {
                        max: _vm.totalDuration,
                        disabled: _vm.scheduleControl !== "yes",
                        "show-tooltip": false,
                      },
                      on: { change: _vm.changeTime },
                      model: {
                        value: _vm.playTime,
                        callback: function ($$v) {
                          _vm.playTime = $$v;
                        },
                        expression: "playTime",
                      },
                    }),
                  ],
                  1
                ),
                _vm._v(" "),
                _c("div", { staticClass: "play-times" }, [
                  _c("div", { staticClass: "current-time" }, [
                    _vm._v(_vm._s(_vm.playCurrentTime)),
                  ]),
                  _vm._v(" "),
                  _c("div", { staticClass: "total-time" }, [
                    _vm._v(_vm._s(_vm.playDuration)),
                  ]),
                ]),
              ]),
            ]),
          ]),
      _vm._v(" "),
      _c("audio", {
        ref: "recordAudio",
        staticClass: "audio-component",
        attrs: {
          controls: "",
          preload: "auto",
          src: _vm.recordDataUrl,
          loop: _vm.loop,
          link: _vm.link,
        },
        on: {
          canplay: _vm.changeDuration,
          timeupdate: _vm.updateTime,
          pause: function ($event) {
            _vm.isPlay = false;
          },
        },
      }),
      _vm._v(" "),
      _c(
        "el-dialog",
        {
          attrs: {
            title: "权限请求提醒",
            width: "320px",
            visible: _vm.permissionDialogVisible,
            "custom-class": "info-dialog",
            "append-to-body": "",
          },
          on: {
            "update:visible": function ($event) {
              _vm.permissionDialogVisible = $event;
            },
          },
        },
        [
          _c("div", [
            _c("p", { staticClass: "version-number" }, [
              _vm._v(
                "录音功能需要麦克风权限，请允许；如果未看到任何请求，请点击忽略"
              ),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticStyle: { "text-align": "right" } },
              [
                _c(
                  "el-button",
                  { attrs: { plain: "" }, on: { click: _vm.waitDialogClick } },
                  [_vm._v("忽略")]
                ),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$4O = [];
__vue_render__$4O._withStripped = true;

  /* style */
  const __vue_inject_styles__$4O = undefined;
  /* scoped */
  const __vue_scope_id__$4O = undefined;
  /* module identifier */
  const __vue_module_identifier__$4O = undefined;
  /* functional template */
  const __vue_is_functional_template__$4O = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4O = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4O, staticRenderFns: __vue_staticRenderFns__$4O },
    __vue_inject_styles__$4O,
    __vue_script__$4O,
    __vue_scope_id__$4O,
    __vue_is_functional_template__$4O,
    __vue_module_identifier__$4O,
    false,
    undefined,
    undefined,
    undefined
  );

//
const _image = '.jpg,.png,.jpeg,.gif,';
const _audio = '.mp3,';
const _video = '.mp4,.MP4';
const _resources = 'application/x-zip-compressed,.zip,';
const _office = '.ppt,.xlsx,.xls,.doc,.docx,.pptx';
var script$4N = {
  components: {
    RecordPlayer: __vue_component__$4O
  },
  name: 'addFile',
  props: {
    actionUrl: {
      type: String,
      default: ''
    },
    headers: {
      type: Object,
      default: () => {}
    },
    data: {
      // 上传文件附带的额外参数
      type: Object,
      default: () => {}
    },
    fileSize: {
      // 最大上传文件大小
      type: Number,
      default: 10
    }
  },
  data() {
    return {
      Accept: _image + _audio + _video + _resources + _office,
      fileRules: {
        resourcesName: [{
          required: true,
          message: '请输入资源名称',
          trigger: 'blur'
        }, {
          min: 2,
          max: 30,
          message: '长度在 2 到 30 个字符',
          trigger: 'blur'
        }],
        isDownload: [{
          required: true,
          message: '请选择是否允许下载',
          trigger: 'change'
        }],
        fileUrl: [{
          required: true,
          message: '请上传资源文件',
          trigger: 'change'
        }],
        isStudentShow: [{
          required: true,
          message: '请选择是否对学生可见',
          trigger: 'change'
        }]
      },
      recordedRules: {
        isStudentShow: [{
          required: true,
          message: '请选择是否对学生可见',
          trigger: 'change'
        }]
      },
      noteRules: {
        noteContent: [{
          required: true,
          message: '请输入笔记内容',
          trigger: 'blur'
        }, {
          min: 2,
          max: 1000,
          message: '长度在 2 到 1000 个字符',
          trigger: 'blur'
        }],
        isStudentShow: [{
          required: true,
          message: '请选择是否对学生可见',
          trigger: 'change'
        }]
      },
      fileList: [
        // {
        //   name: 'food.jpeg',
        //   url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
        // },
        // {
        //   name: 'food2.jpeg',
        //   // url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
        //   url:'../../../static/images/defaultCover/audio.png'
        // }
      ],
      fileData: {
        resourcesName: '',
        noteContent: '',
        isDownload: [0],
        fileUrl: '',
        id: '',
        resourcesType: '',
        fileExt: '',
        creationTime: '',
        textBookId: '',
        chapterId: '',
        orderNum: '',
        firstLevelId: '',
        firstLevelLabel: '',
        locationChapterId: '',
        isStudentShow: [0],
        location: '',
        duration: 0
      },
      recordedData: {
        resourcesName: '',
        noteContent: '',
        isDownload: [0],
        fileUrl: '',
        id: '',
        resourcesType: '',
        fileExt: '',
        creationTime: '',
        textBookId: '',
        chapterId: '',
        orderNum: '',
        firstLevelId: '',
        firstLevelLabel: '',
        locationChapterId: '',
        isStudentShow: [0],
        location: '',
        duration: 0
      },
      noteData: {
        resourcesName: '',
        noteContent: '',
        isDownload: [0],
        fileUrl: '',
        id: '',
        resourcesType: '',
        fileExt: '',
        creationTime: '',
        textBookId: '',
        chapterId: '',
        orderNum: '',
        firstLevelId: '',
        firstLevelLabel: '',
        locationChapterId: '',
        isStudentShow: [0],
        location: '',
        duration: 0
      },
      dialogImageUrl: '',
      dialogVisible: false,
      disabled: false,
      show: false,
      isEdit: false,
      chapterOrderNum: 1,
      isSwhoUpload: false,
      activeName: 'resource',
      recordedBlob: null,
      loadingInstance: null,
      limit: 1
    };
  },
  methods: {
    open(e) {
      console.log('e', e);
      this.show = true;
      this.recordedBlob = null;
      let fileData = e;
      // fileData.textBookId = e.textBookId
      // fileData.creationTime = e.creationTime
      // fileData.resourcesName = e.resourcesName
      // fileData.noteContent = e.noteContent
      fileData.isDownload = [e.isDownload];
      fileData.isStudentShow = [e.isStudentShow];
      // fileData.id = e.id
      // fileData.resourcesType = e.resourcesType
      // fileData.fileExt = e.fileExt
      // fileData.fileUrl = e.fileUrl
      // fileData.location = e.location
      // fileData.chapterId = e.chapterId
      // fileData.orderNum = e.orderNum
      // fileData.firstLevelId = e.firstLevelId
      // fileData.firstLevelLabel = e.firstLevelLabel
      // fileData.chapterOrderNum = e.chapterOrderNum
      // fileData.locationChapterId = e.locationChapterId
      // fileData.duration = e.duration
      this.isEdit = e.isEdit ? true : false;
      if (!this.isEdit) {
        fileData.id = new Date().getTime();
        fileData.creationTime = new Date();
        fileData.duration = 0;
        fileData.noteContent = '';
      } else {
        if (e.resourcesType == 'recorded') {
          this.activeName = 'recorded';
          this.$nextTick(() => {
            this.$refs.xmlRecordPlayer.setAudioPath(fileData.fileUrl, fileData.duration);
          });
        } else if (e.resourcesType == 'notes') {
          this.activeName = 'notes';
        } else {
          this.activeName = 'resource';
        }
        this.getFileList();
      }
      this.fileData = JSON.parse(JSON.stringify(fileData));
      this.recordedData = JSON.parse(JSON.stringify(fileData));
      this.noteData = JSON.parse(JSON.stringify(fileData));
    },
    setSingleCheckedValue(e, item, value) {
      item.isDownload = [value];
    },
    setSingleCheckedShowValue(e, item, value) {
      item.isStudentShow = [value];
      if (value == 1) {
        // 不显示添加资源
        console.log('不显示添加资源');
      }
    },
    //
    handleBeforeUpload(file) {
      const isPass = file.size / 1024 / 1024 > this.fileSize;
      if (isPass) {
        this.$message.error(`上传文件大小不能超过 ${this.fileSize}MB!`);
        return false;
      }
      let fileType = '';
      let fileExt = file.name.slice(file.name.lastIndexOf('.') + 1).toLowerCase();
      console.log(fileExt);
      if (this.Accept.indexOf('.' + fileExt) === -1) {
        this.$message.error('请上传指定类型文件');
        return false;
      }
      this.loadingInstance = this.$loading({
        lock: true,
        text: 'Loading'
      });
      this.fileData.resourcesName = file.name;
      if (_image.indexOf(fileExt) !== -1) {
        fileType = 'image';
      } else if (_audio.indexOf(fileExt) !== -1) {
        fileType = 'audio';
      } else if (_video.indexOf(fileExt) !== -1) {
        fileType = 'video';
      } else if (_resources.indexOf(fileExt) !== -1) {
        fileType = 'resources';
      } else if (_office.indexOf(fileExt) !== -1) {
        fileType = 'office';
      }
      this.fileData.resourcesType = fileType;
      this.fileData.fileExt = fileExt;
      this.fileData.resourcesName = this.fileData.resourcesName.length > 30 ? this.fileData.resourcesName.slice(0, 30) : this.fileData.resourcesName;
    },
    // 上传成功
    handleSuccess(file, item) {
      item.fileUrl = file.data;
      this.getFileList();
      this.loadingInstance.close();
      console.log(item, 'item'); //有值
      console.log(this.fileData, 'this.fileData1111'); //有值
    },
    getFileList() {
      console.log(this.fileData, 'fileData'); //有值 再次编辑就无值，因为触发了close
      this.fileList = [{
        name: this.fileData.resourcesName,
        url: this.fileData.resourcesType == 'image' ? this.fileData.fileUrl : 'data:image/png;base64, '
      }];
      this.fileList.length > 0 ? this.isSwhoUpload = true : this.isSwhoUpload = false;
    },
    handleRemove(file) {
      this.fileData.fileUrl = '';
      this.fileList = [];
      this.fileList.length > 0 ? this.isSwhoUpload = true : this.isSwhoUpload = false;
      console.log(file);
    },
    handlePictureCardPreview(file) {
      this.fileData.fileUrl = file.url;
      this.dialogVisible = true;
    },
    handleDownload(file) {
      console.log(file);
    },
    submit(type) {
      // if(this.activeName == 'resource' && !this.fileData.fileUrl){
      //   this.$message.error('请上传文件')
      //   return
      // }
      this.$refs[this.activeName + 'RuleForm'].validate(valid => {
        if (valid) {
          if (this.activeName == 'resource') {
            // 添加资源文件
            let fileData = JSON.parse(JSON.stringify(this.fileData)) || {};
            let data = {
              chapterOrderNum: this.chapterOrderNum,
              ...fileData
            };
            data.isDownload = this.fileData.isDownload[0];
            data.isStudentShow = this.fileData.isStudentShow[0];
            // 发送数据
            if (!this.isEdit) {
              this.$emit('addResources', data);
            } else {
              this.$emit('editResources', data);
            }
            setTimeout(() => {
              this.close();
              this.show = false;
            }, 200);
          } else if (this.activeName == 'recorded') {
            // 录音
            if (this.recordedData.duration < 100) {
              this.$message.error('请先录制音频');
              return;
            }
            if (this.recordedBlob) {
              this.addRecorder();
            } else {
              let recordedData = JSON.parse(JSON.stringify(this.recordedData)) || {};
              let data = {
                chapterOrderNum: this.chapterOrderNum,
                ...recordedData
              };
              data.isDownload = this.recordedData.isDownload[0];
              data.isStudentShow = this.recordedData.isStudentShow[0];
              data.resourcesType = 'recorded';
              // 发送数据
              if (!this.isEdit) {
                this.$emit('addResources', data);
              } else {
                this.$emit('editResources', data);
              }
              setTimeout(() => {
                this.close();
                this.show = false;
              }, 800);
            }
          } else if (this.activeName == 'notes') {
            // 教师笔记
            let noteData = JSON.parse(JSON.stringify(this.noteData)) || {};
            let data = {
              chapterOrderNum: this.chapterOrderNum,
              ...noteData
            };
            data.isDownload = this.noteData.isDownload[0];
            data.isStudentShow = this.noteData.isStudentShow[0];
            data.resourcesType = 'notes';
            // 发送数据
            if (!this.isEdit) {
              this.$emit('addTeacherNote', data);
            } else {
              this.$emit('editResources', data);
            }
            setTimeout(() => {
              this.close();
              this.show = false;
            }, 200);
          }

          // if (type === 'continue') {
          //   // 若是点击“保存并继续添加”
          //   // 提示保存成功
          //   this.$message({
          //     message: '保存成功',
          //     type: 'success',
          //     duration: 1500
          //   })

          //   // 清空表单
          //   this.$refs[this.activeName + 'RuleForm'].resetFields()
          //   this.fileData.fileUrl = ''
          //   this.fileList = []
          //   this.isSwhoUpload = false

          //   // 不关闭弹窗
          //   this.show = true
          // } else {
          //   setTimeout(() => {
          //     this.close()
          //     this.show = false
          //   }, 200)
          // }
        }
      });
    },
    close() {
      this.fileData.resourcesName = '';
      this.fileData.isDownload = [0];
      if (this.fileData.resourcesType !== 'image') {
        this.fileData.fileUrl = '';
      }
      this.fileList = [];
      this.show = false;
      // 等待200毫秒，显示添加文件按钮
      setTimeout(() => this.isSwhoUpload = false, 200);
      if (this.activeName == 'recorded') {
        this.$refs.xmlRecordPlayer.destruction();
        this.$refs.xmlRecordPlayer.resetRecorder();
      }
    },
    getresdata({
      blob,
      duration
    }) {
      this.recordedData.duration = duration;
      this.recordedBlob = blob;
    },
    addRecorder() {
      const loading = this.$loading({
        lock: true,
        text: 'Loading'
      });
      let formData = new FormData();
      formData.append('file', this.recordedBlob, new Date().getTime() + '.mp3');
      fetch(this.actionUrl, {
        method: 'post',
        body: formData,
        headers: this.headers
      }).then(data => {
        return data.text();
      }).then(res => {
        let urlData = JSON.parse(res);
        this.recordedData.fileUrl = urlData.data;
        let recordedData = JSON.parse(JSON.stringify(this.recordedData)) || {};
        let data = {
          chapterOrderNum: this.chapterOrderNum,
          ...recordedData
        };
        data.isDownload = this.recordedData.isDownload[0];
        data.isStudentShow = this.recordedData.isStudentShow[0];
        data.resourcesType = 'recorded';
        // 发送数据
        if (!this.isEdit) {
          this.$emit('addResources', data);
        } else {
          this.$emit('editResources', data);
        }
        setTimeout(() => {
          loading.close();
          this.close();
          this.show = false;
        }, 800);
      });
    },
    carriageReturn(event) {
      event.preventDefault(); // 更推荐使用preventDefault来阻止默认行为，适用于现代浏览器
      if (event.keyCode === 13 || event.key === 'Enter' || event.code === 'Enter') {
        this.noteData.noteContent += '\n';
      }
    }
  },
  computed: {
    currentLength() {
      return this.noteData.noteContent.length;
    },
    maxLength() {
      return 1000;
    }
  },
  created() {},
  mounted() {}
};

/* script */
const __vue_script__$4N = script$4N;
/* template */
var __vue_render__$4N = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "el-dialog",
    {
      staticClass: "add-teacher-resources-dialog",
      attrs: { "append-to-body": "", visible: _vm.show, width: "665px" },
      on: {
        "update:visible": function ($event) {
          _vm.show = $event;
        },
        close: _vm.close,
      },
    },
    [
      _c("div", { attrs: { slot: "title" }, slot: "title" }, [
        _vm._v(_vm._s(_vm.isEdit ? "编辑" : "添加") + "授课资源"),
      ]),
      _vm._v(" "),
      _c(
        "div",
        [
          _c(
            "el-tabs",
            {
              model: {
                value: _vm.activeName,
                callback: function ($$v) {
                  _vm.activeName = $$v;
                },
                expression: "activeName",
              },
            },
            [
              _c(
                "el-tab-pane",
                {
                  attrs: {
                    disabled: _vm.isEdit,
                    label: "资源上传",
                    name: "resource",
                  },
                },
                [
                  _c(
                    "div",
                    { staticClass: "add-teacher-container" },
                    [
                      _c(
                        "el-form",
                        {
                          ref: "resourceRuleForm",
                          attrs: {
                            "label-position": "left",
                            model: _vm.fileData,
                            rules: _vm.fileRules,
                          },
                        },
                        [
                          _c(
                            "el-form-item",
                            {
                              staticClass: "resouceName addOne",
                              attrs: {
                                "label-width": "96px",
                                label: "资源名称：",
                                prop: "resourcesName",
                              },
                            },
                            [
                              _c("el-input", {
                                staticClass: "inputresource",
                                attrs: { maxlength: "30" },
                                model: {
                                  value: _vm.fileData.resourcesName,
                                  callback: function ($$v) {
                                    _vm.$set(
                                      _vm.fileData,
                                      "resourcesName",
                                      typeof $$v === "string" ? $$v.trim() : $$v
                                    );
                                  },
                                  expression: "fileData.resourcesName",
                                },
                              }),
                            ],
                            1
                          ),
                          _vm._v(" "),
                          _c(
                            "el-form-item",
                            {
                              attrs: {
                                "label-width": "96px",
                                label: "下载设置：",
                                prop: "isDownload",
                              },
                            },
                            [
                              _c(
                                "el-checkbox-group",
                                {
                                  model: {
                                    value: _vm.fileData.isDownload,
                                    callback: function ($$v) {
                                      _vm.$set(_vm.fileData, "isDownload", $$v);
                                    },
                                    expression: "fileData.isDownload",
                                  },
                                },
                                [
                                  _c(
                                    "el-checkbox",
                                    {
                                      attrs: { label: 1 },
                                      on: {
                                        change: function (v) {
                                          return _vm.setSingleCheckedValue(
                                            v,
                                            _vm.fileData,
                                            1
                                          )
                                        },
                                      },
                                    },
                                    [_vm._v("允许学生下载")]
                                  ),
                                  _vm._v(" "),
                                  _c(
                                    "el-checkbox",
                                    {
                                      attrs: { label: 0 },
                                      on: {
                                        change: function (v) {
                                          return _vm.setSingleCheckedValue(
                                            v,
                                            _vm.fileData,
                                            0
                                          )
                                        },
                                      },
                                    },
                                    [_vm._v("不允许学生下载")]
                                  ),
                                ],
                                1
                              ),
                            ],
                            1
                          ),
                          _vm._v(" "),
                          _c(
                            "el-form-item",
                            {
                              attrs: {
                                "label-width": "96px",
                                label: "显示设置：",
                                prop: "isStudentShow",
                              },
                            },
                            [
                              _c(
                                "el-checkbox-group",
                                {
                                  model: {
                                    value: _vm.fileData.isStudentShow,
                                    callback: function ($$v) {
                                      _vm.$set(
                                        _vm.fileData,
                                        "isStudentShow",
                                        $$v
                                      );
                                    },
                                    expression: "fileData.isStudentShow",
                                  },
                                },
                                [
                                  _c(
                                    "el-checkbox",
                                    {
                                      attrs: { label: 0 },
                                      on: {
                                        change: function (v) {
                                          return _vm.setSingleCheckedShowValue(
                                            v,
                                            _vm.fileData,
                                            0
                                          )
                                        },
                                      },
                                    },
                                    [_vm._v("学生可见")]
                                  ),
                                  _vm._v(" "),
                                  _c(
                                    "el-checkbox",
                                    {
                                      attrs: { label: 1 },
                                      on: {
                                        change: function (v) {
                                          return _vm.setSingleCheckedShowValue(
                                            v,
                                            _vm.fileData,
                                            1
                                          )
                                        },
                                      },
                                    },
                                    [_vm._v("学生不可见")]
                                  ),
                                ],
                                1
                              ),
                            ],
                            1
                          ),
                          _vm._v(" "),
                          _c(
                            "el-form-item",
                            { attrs: { label: "文件上传：", prop: "fileUrl" } },
                            [
                              _c(
                                "el-upload",
                                {
                                  staticClass: "upload-demo",
                                  class: _vm.isSwhoUpload ? "disUoloadSty" : "",
                                  attrs: {
                                    action: _vm.actionUrl,
                                    headers: _vm.headers,
                                    data: _vm.data,
                                    "list-type": "picture-card",
                                    multiple: false,
                                    limit: _vm.limit,
                                    "file-list": _vm.fileList,
                                    playMode: "xun-huan",
                                    scheduleControl: "yes",
                                    accept: _vm.Accept,
                                    "on-success": function (e) {
                                      return _vm.handleSuccess(e, _vm.fileData)
                                    },
                                    "before-upload": _vm.handleBeforeUpload,
                                    "on-remove": _vm.handleRemove,
                                  },
                                },
                                [
                                  _c("i", {
                                    staticClass: "el-icon-plus",
                                    attrs: { slot: "default" },
                                    slot: "default",
                                  }),
                                ]
                              ),
                            ],
                            1
                          ),
                        ],
                        1
                      ),
                    ],
                    1
                  ),
                ]
              ),
              _vm._v(" "),
              _c(
                "el-tab-pane",
                {
                  attrs: {
                    disabled: _vm.isEdit,
                    label: "录音",
                    name: "recorded",
                  },
                },
                [
                  _c(
                    "div",
                    { staticClass: "add-teacher-container" },
                    [
                      _c(
                        "el-form",
                        {
                          ref: "recordedRuleForm",
                          attrs: {
                            "label-position": "left",
                            model: _vm.recordedData,
                            rules: _vm.recordedRules,
                          },
                        },
                        [
                          _c("el-form-item", [
                            _c(
                              "div",
                              {
                                staticClass:
                                  "parent-group xml-single-recorder-group",
                              },
                              [
                                _c(
                                  "div",
                                  { staticClass: "xml-recorder-container" },
                                  [
                                    _c(
                                      "div",
                                      {
                                        staticClass: "xml-recorder-player-box",
                                      },
                                      [
                                        _c("record-player", {
                                          ref: "xmlRecordPlayer",
                                          attrs: {
                                            mode: "preview",
                                            loop: false,
                                            "play-mode": "xun-huan",
                                            "play-style": "A",
                                            scheduleControl: "yes",
                                          },
                                          on: { resData: _vm.getresdata },
                                        }),
                                      ],
                                      1
                                    ),
                                  ]
                                ),
                              ]
                            ),
                          ]),
                          _vm._v(" "),
                          _c(
                            "el-form-item",
                            {
                              attrs: {
                                "label-width": "96px",
                                label: "显示设置：",
                                prop: "isStudentShow",
                              },
                            },
                            [
                              _c(
                                "el-checkbox-group",
                                {
                                  model: {
                                    value: _vm.recordedData.isStudentShow,
                                    callback: function ($$v) {
                                      _vm.$set(
                                        _vm.recordedData,
                                        "isStudentShow",
                                        $$v
                                      );
                                    },
                                    expression: "recordedData.isStudentShow",
                                  },
                                },
                                [
                                  _c(
                                    "el-checkbox",
                                    {
                                      attrs: { label: 0 },
                                      on: {
                                        change: function (v) {
                                          return _vm.setSingleCheckedShowValue(
                                            v,
                                            _vm.recordedData,
                                            0
                                          )
                                        },
                                      },
                                    },
                                    [_vm._v("学生可见")]
                                  ),
                                  _vm._v(" "),
                                  _c(
                                    "el-checkbox",
                                    {
                                      attrs: { label: 1 },
                                      on: {
                                        change: function (v) {
                                          return _vm.setSingleCheckedShowValue(
                                            v,
                                            _vm.recordedData,
                                            1
                                          )
                                        },
                                      },
                                    },
                                    [_vm._v("学生不可见")]
                                  ),
                                ],
                                1
                              ),
                            ],
                            1
                          ),
                        ],
                        1
                      ),
                    ],
                    1
                  ),
                ]
              ),
              _vm._v(" "),
              _c(
                "el-tab-pane",
                {
                  attrs: {
                    disabled: _vm.isEdit,
                    label: "教师笔记",
                    name: "notes",
                  },
                },
                [
                  _c(
                    "div",
                    { staticClass: "add-teacher-container" },
                    [
                      _c(
                        "el-form",
                        {
                          ref: "notesRuleForm",
                          attrs: {
                            "label-position": "left",
                            model: _vm.noteData,
                            rules: _vm.noteRules,
                          },
                        },
                        [
                          _c(
                            "el-form-item",
                            {
                              attrs: { label: "笔记内容", prop: "noteContent" },
                            },
                            [
                              _c("el-input", {
                                attrs: {
                                  type: "textarea",
                                  rows: 6,
                                  placeholder: "请输入内容",
                                  maxlength: "1000",
                                },
                                nativeOn: {
                                  keydown: function ($event) {
                                    if (
                                      !$event.type.indexOf("key") &&
                                      _vm._k(
                                        $event.keyCode,
                                        "enter",
                                        13,
                                        $event.key,
                                        "Enter"
                                      )
                                    ) {
                                      return null
                                    }
                                    return _vm.carriageReturn($event)
                                  },
                                },
                                model: {
                                  value: _vm.noteData.noteContent,
                                  callback: function ($$v) {
                                    _vm.$set(
                                      _vm.noteData,
                                      "noteContent",
                                      typeof $$v === "string" ? $$v.trim() : $$v
                                    );
                                  },
                                  expression: "noteData.noteContent",
                                },
                              }),
                              _vm._v(" "),
                              _c("span", { staticClass: "character-count" }, [
                                _vm._v(
                                  _vm._s(_vm.currentLength) +
                                    " / " +
                                    _vm._s(_vm.maxLength)
                                ),
                              ]),
                            ],
                            1
                          ),
                          _vm._v(" "),
                          _c(
                            "el-form-item",
                            {
                              attrs: {
                                "label-width": "96px",
                                label: "显示设置",
                                prop: "isStudentShow",
                              },
                            },
                            [
                              _c(
                                "el-checkbox-group",
                                {
                                  model: {
                                    value: _vm.noteData.isStudentShow,
                                    callback: function ($$v) {
                                      _vm.$set(
                                        _vm.noteData,
                                        "isStudentShow",
                                        $$v
                                      );
                                    },
                                    expression: "noteData.isStudentShow",
                                  },
                                },
                                [
                                  _c(
                                    "el-checkbox",
                                    {
                                      attrs: { label: 0 },
                                      on: {
                                        change: function (v) {
                                          return _vm.setSingleCheckedShowValue(
                                            v,
                                            _vm.noteData,
                                            0
                                          )
                                        },
                                      },
                                    },
                                    [_vm._v("学生可见")]
                                  ),
                                  _vm._v(" "),
                                  _c(
                                    "el-checkbox",
                                    {
                                      attrs: { label: 1 },
                                      on: {
                                        change: function (v) {
                                          return _vm.setSingleCheckedShowValue(
                                            v,
                                            _vm.noteData,
                                            1
                                          )
                                        },
                                      },
                                    },
                                    [_vm._v("学生不可见")]
                                  ),
                                ],
                                1
                              ),
                            ],
                            1
                          ),
                        ],
                        1
                      ),
                    ],
                    1
                  ),
                ]
              ),
            ],
            1
          ),
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "bottom" },
            [
              _c(
                "el-button",
                {
                  attrs: { size: "small" },
                  on: {
                    click: function ($event) {
                      return _vm.close()
                    },
                  },
                },
                [_vm._v("取消")]
              ),
              _vm._v(" "),
              _c(
                "el-button",
                {
                  attrs: { size: "small", type: "primary" },
                  on: {
                    click: function ($event) {
                      return _vm.submit("")
                    },
                  },
                },
                [_vm._v("确认")]
              ),
            ],
            1
          ),
        ],
        1
      ),
    ]
  )
};
var __vue_staticRenderFns__$4N = [];
__vue_render__$4N._withStripped = true;

  /* style */
  const __vue_inject_styles__$4N = undefined;
  /* scoped */
  const __vue_scope_id__$4N = undefined;
  /* module identifier */
  const __vue_module_identifier__$4N = undefined;
  /* functional template */
  const __vue_is_functional_template__$4N = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4N = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4N, staticRenderFns: __vue_staticRenderFns__$4N },
    __vue_inject_styles__$4N,
    __vue_script__$4N,
    __vue_scope_id__$4N,
    __vue_is_functional_template__$4N,
    __vue_module_identifier__$4N,
    false,
    undefined,
    undefined,
    undefined
  );

var setupDefaults = {
  cookies: {
    path: '/'
  },
  treeOptions: {
    parentKey: 'parentId',
    key: 'id',
    children: 'children'
  },
  parseDateFormat: 'yyyy-MM-dd HH:mm:ss',
  firstDayOfWeek: 1
};
var setupDefaults_1 = setupDefaults;

function arrayEach(list, iterate, context) {
  if (list) {
    if (list.forEach) {
      list.forEach(iterate, context);
    } else {
      for (var index = 0, len = list.length; index < len; index++) {
        iterate.call(context, list[index], index, list);
      }
    }
  }
}
var arrayEach_1 = arrayEach;

var objectToString = Object.prototype.toString;
var staticObjectToString = objectToString;

function helperCreateInInObjectString(type) {
  return function (obj) {
    return '[object ' + type + ']' === staticObjectToString.call(obj);
  };
}
var helperCreateInInObjectString_1 = helperCreateInInObjectString;

/**
  * 判断是否数组
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
var isArray$1 = Array.isArray || helperCreateInInObjectString_1('Array');
var isArray_1 = isArray$1;

/**
  * 判断对象自身属性中是否具有指定的属性
  *
  * @param {Object} obj 对象
  * @param {String/Number} key 键值
  * @return {Boolean}
  */
function hasOwnProp(obj, key) {
  return obj && obj.hasOwnProperty ? obj.hasOwnProperty(key) : false;
}
var hasOwnProp_1 = hasOwnProp;

function objectEach(obj, iterate, context) {
  if (obj) {
    for (var key in obj) {
      if (hasOwnProp_1(obj, key)) {
        iterate.call(context, obj[key], key, obj);
      }
    }
  }
}
var objectEach_1 = objectEach;

/**
  * 迭代器
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, obj) 回调
  * @param {Object} context 上下文
  * @return {Object}
  */
function each$1(obj, iterate, context) {
  if (obj) {
    return (isArray_1(obj) ? arrayEach_1 : objectEach_1)(obj, iterate, context);
  }
  return obj;
}
var each_1 = each$1;

/* eslint-disable valid-typeof */
function helperCreateInTypeof(type) {
  return function (obj) {
    return typeof obj === type;
  };
}
var helperCreateInTypeof_1 = helperCreateInTypeof;

/**
  * 判断是否方法
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
var isFunction$1 = helperCreateInTypeof_1('function');
var isFunction_1$1 = isFunction$1;

function helperCreateGetObjects(name, getIndex) {
  var proMethod = Object[name];
  return function (obj) {
    var result = [];
    if (obj) {
      if (proMethod) {
        return proMethod(obj);
      }
      each_1(obj, getIndex > 1 ? function (key) {
        result.push(['' + key, obj[key]]);
      } : function () {
        result.push(arguments[getIndex]);
      });
    }
    return result;
  };
}
var helperCreateGetObjects_1 = helperCreateGetObjects;

/**
  * 获取对象所有属性
  *
  * @param {Object} obj 对象/数组
  * @return {Array}
  */
var keys$1 = helperCreateGetObjects_1('keys', 1);
var keys_1 = keys$1;

function getCativeCtor(val, args) {
  var Ctor = val.__proto__.constructor;
  return args ? new Ctor(args) : new Ctor();
}
function handleValueClone(item, isDeep) {
  return isDeep ? copyValue(item, isDeep) : item;
}
function copyValue(val, isDeep) {
  if (val) {
    switch (staticObjectToString.call(val)) {
      case "[object Object]":
        {
          var restObj = Object.create(Object.getPrototypeOf(val));
          objectEach_1(val, function (item, key) {
            restObj[key] = handleValueClone(item, isDeep);
          });
          return restObj;
        }
      case "[object Date]":
      case "[object RegExp]":
        {
          return getCativeCtor(val, val.valueOf());
        }
      case "[object Array]":
      case "[object Arguments]":
        {
          var restArr = [];
          arrayEach_1(val, function (item) {
            restArr.push(handleValueClone(item, isDeep));
          });
          return restArr;
        }
      case "[object Set]":
        {
          var restSet = getCativeCtor(val);
          restSet.forEach(function (item) {
            restSet.add(handleValueClone(item, isDeep));
          });
          return restSet;
        }
      case "[object Map]":
        {
          var restMap = getCativeCtor(val);
          restMap.forEach(function (item, key) {
            restMap.set(key, handleValueClone(item, isDeep));
          });
          return restMap;
        }
    }
  }
  return val;
}

/**
  * 浅拷贝/深拷贝
  *
  * @param {Object} obj 对象/数组
  * @param {Boolean} deep 是否深拷贝
  * @return {Object}
  */
function clone(obj, deep) {
  if (obj) {
    return copyValue(obj, deep);
  }
  return obj;
}
var clone_1 = clone;

var objectAssignFns = Object.assign;
function handleAssign(destination, args, isClone) {
  var len = args.length;
  for (var source, index = 1; index < len; index++) {
    source = args[index];
    arrayEach_1(keys_1(args[index]), isClone ? function (key) {
      destination[key] = clone_1(source[key], isClone);
    } : function (key) {
      destination[key] = source[key];
    });
  }
  return destination;
}

/**
  * 将一个或多个源对象复制到目标对象中
  *
  * @param {Object} target 目标对象
  * @param {...Object}
  * @return {Boolean}
  */
var assign$1 = function (target) {
  if (target) {
    var args = arguments;
    if (target === true) {
      if (args.length > 1) {
        target = isArray_1(target[1]) ? [] : {};
        return handleAssign(target, args, true);
      }
    } else {
      return objectAssignFns ? objectAssignFns.apply(Object, args) : handleAssign(target, args);
    }
  }
  return target;
};
var assign_1 = assign$1;

var XEUtils = function () {};
function mixin() {
  arrayEach_1(arguments, function (methods) {
    each_1(methods, function (fn, name) {
      XEUtils[name] = isFunction_1$1(fn) ? function () {
        var result = fn.apply(XEUtils.$context, arguments);
        XEUtils.$context = null;
        return result;
      } : fn;
    });
  });
}
function setup(options) {
  return assign_1(setupDefaults_1, options);
}
XEUtils.VERSION = '3.5.25';
XEUtils.mixin = mixin;
XEUtils.setup = setup;
var ctor = XEUtils;

function lastArrayEach(obj, iterate, context) {
  for (var len = obj.length - 1; len >= 0; len--) {
    iterate.call(context, obj[len], len, obj);
  }
}
var lastArrayEach_1 = lastArrayEach;

function lastObjectEach(obj, iterate, context) {
  lastArrayEach_1(keys_1(obj), function (key) {
    iterate.call(context, obj[key], key, obj);
  });
}
var lastObjectEach_1 = lastObjectEach;

/**
  * 判断是否为Null
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
function isNull(obj) {
  return obj === null;
}
var isNull_1 = isNull;

/**
 * 返回一个获取对象属性的函数
 *
 * @param {String} name 属性名
 * @param {Object} defs 空值
 */
function property(name, defs) {
  return function (obj) {
    return isNull_1(obj) ? defs : obj[name];
  };
}
var property_1 = property;

/**
  * 指定方法后的返回值组成的新对象
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, obj) 回调
  * @param {Object} context 上下文
  * @return {Object}
  */
function objectMap(obj, iterate, context) {
  var result = {};
  if (obj) {
    if (iterate) {
      if (!isFunction_1$1(iterate)) {
        iterate = property_1(iterate);
      }
      each_1(obj, function (val, index) {
        result[index] = iterate.call(context, val, index, obj);
      });
    } else {
      return obj;
    }
  }
  return result;
}
var objectMap_1 = objectMap;

/**
  * 判断是否对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
function isPlainObject(obj) {
  return obj ? obj.constructor === Object : false;
}
var isPlainObject_1 = isPlainObject;

function handleMerge(target, source) {
  if (isPlainObject_1(target) && isPlainObject_1(source) || isArray_1(target) && isArray_1(source)) {
    each_1(source, function (obj, key) {
      target[key] = handleMerge(target[key], obj);
    });
    return target;
  }
  return source;
}

/**
  * 将一个或多个源对象合并到目标对象中
  *
  * @param {Object} target 目标对象
  * @param {...Object}
  * @return {Boolean}
  */
var merge = function (target) {
  if (!target) {
    target = {};
  }
  var args = arguments;
  var len = args.length;
  for (var source, index = 1; index < len; index++) {
    source = args[index];
    if (source) {
      handleMerge(target, source);
    }
  }
  return target;
};
var merge_1 = merge;

/**
  * 指定方法后的返回值组成的新数组
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, obj) 回调
  * @param {Object} context 上下文
  * @return {Array}
  */
function map(obj, iterate, context) {
  var result = [];
  if (obj && arguments.length > 1) {
    if (obj.map) {
      return obj.map(iterate, context);
    } else {
      each_1(obj, function () {
        result.push(iterate.apply(context, arguments));
      });
    }
  }
  return result;
}
var map_1 = map;

function helperCreateIterateHandle(prop, useArray, restIndex, matchValue, defaultValue) {
  return function (obj, iterate, context) {
    if (obj && iterate) {
      if (prop && obj[prop]) {
        return obj[prop](iterate, context);
      } else {
        if (useArray && isArray_1(obj)) {
          for (var index = 0, len = obj.length; index < len; index++) {
            if (!!iterate.call(context, obj[index], index, obj) === matchValue) {
              return [true, false, index, obj[index]][restIndex];
            }
          }
        } else {
          for (var key in obj) {
            if (hasOwnProp_1(obj, key)) {
              if (!!iterate.call(context, obj[key], key, obj) === matchValue) {
                return [true, false, key, obj[key]][restIndex];
              }
            }
          }
        }
      }
    }
    return defaultValue;
  };
}
var helperCreateIterateHandle_1 = helperCreateIterateHandle;

/**
  * 对象中的值中的每一项运行给定函数,如果函数对任一项返回true,则返回true,否则返回false
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, obj) 回调
  * @param {Object} context 上下文
  * @return {Boolean}
  */
var some = helperCreateIterateHandle_1('some', 1, 0, true, false);
var some_1 = some;

/**
  * 对象中的值中的每一项运行给定函数,如果该函数对每一项都返回true,则返回true,否则返回false
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, obj) 回调
  * @param {Object} context 上下文
  * @return {Boolean}
  */
var every = helperCreateIterateHandle_1('every', 1, 1, false, true);
var every_1 = every;

/**
  * 判断对象是否包含该值,成功返回true否则false
  *
  * @param {Object} obj 对象
  * @param {Object} val 值
  * @return {Boolean}
  */
function includes(obj, val) {
  if (obj) {
    if (obj.includes) {
      return obj.includes(val);
    }
    for (var key in obj) {
      if (hasOwnProp_1(obj, key)) {
        if (val === obj[key]) {
          return true;
        }
      }
    }
  }
  return false;
}
var includes_1 = includes;

/**
  * 判断数组是否包含另一数组
  *
  * @param {Array} array1 数组
  * @param {Array} array2 被包含数组
  * @return {Boolean}
  */
function includeArrays(array1, array2) {
  var len;
  var index = 0;
  if (isArray_1(array1) && isArray_1(array2)) {
    for (len = array2.length; index < len; index++) {
      if (!includes_1(array1, array2[index])) {
        return false;
      }
    }
    return true;
  }
  return includes_1(array1, array2);
}
var includeArrays_1 = includeArrays;

/**
 * 数组去重
 * 
 * @param {*} array  数组
 * @param {*} iterate 字段或回调
 * @param {*} context 
 * @returns 
 */
function uniq(array, iterate, context) {
  var result = [];
  if (iterate) {
    if (!isFunction_1$1(iterate)) {
      iterate = property_1(iterate);
    }
    var val,
      valMap = {};
    each_1(array, function (item, key) {
      val = iterate.call(context, item, key, array);
      if (!valMap[val]) {
        valMap[val] = 1;
        result.push(item);
      }
    });
  } else {
    each_1(array, function (value) {
      if (!includes_1(result, value)) {
        result.push(value);
      }
    });
  }
  return result;
}
var uniq_1 = uniq;

/**
 * 将对象或者伪数组转为新数组
 *
 * @param {Array} list 数组
 * @return {Array}
 */
function toArray(list) {
  return map_1(list, function (item) {
    return item;
  });
}
var toArray_1 = toArray;

/**
  * 将多个数的值返回唯一的并集数组
  *
  * @param {...Array} 数组
  * @return {Array}
  */
function union() {
  var args = arguments;
  var result = [];
  var index = 0;
  var len = args.length;
  for (; index < len; index++) {
    result = result.concat(toArray_1(args[index]));
  }
  return uniq_1(result);
}
var union_1 = union;

var staticStrUndefined = 'undefined';
var staticStrUndefined_1 = staticStrUndefined;

/**
  * 判断是否Undefined
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
var isUndefined = helperCreateInTypeof_1(staticStrUndefined_1);
var isUndefined_1 = isUndefined;

/**
 * 判断是否 undefined 和 null
 * @param {Object} obj 对象
 * @return {Boolean}
 */
function eqNull(obj) {
  return isNull_1(obj) || isUndefined_1(obj);
}
var eqNull_1 = eqNull;

var staticHGKeyRE = /(.+)?\[(\d+)\]$/;
var staticHGKeyRE_1 = staticHGKeyRE;

function helperGetHGSKeys(property) {
  // 以最快的方式判断数组，可忽略准确性
  return property ? property.splice && property.join ? property : ('' + property).replace(/(\[\d+\])\.?/g, '$1.').replace(/\.$/, '').split('.') : [];
}
var helperGetHGSKeys_1 = helperGetHGSKeys;

/**
 * 获取对象的属性的值，如果值为 undefined，则返回默认值
 * @param {Object/Array} obj 对象
 * @param {String/Function} property 键、路径
 * @param {Object} defaultValue 默认值
 * @return {Object}
 */
function get(obj, property, defaultValue) {
  if (eqNull_1(obj)) {
    return defaultValue;
  }
  var result = getValueByPath(obj, property);
  return isUndefined_1(result) ? defaultValue : result;
}
function getDeepProps(obj, key) {
  var matchs = key ? key.match(staticHGKeyRE_1) : '';
  return matchs ? matchs[1] ? obj[matchs[1]] ? obj[matchs[1]][matchs[2]] : undefined : obj[matchs[2]] : obj[key];
}
function getValueByPath(obj, property) {
  if (obj) {
    var rest, props, len;
    var index = 0;
    if (obj[property] || hasOwnProp_1(obj, property)) {
      return obj[property];
    } else {
      props = helperGetHGSKeys_1(property);
      len = props.length;
      if (len) {
        for (rest = obj; index < len; index++) {
          rest = getDeepProps(rest, props[index]);
          if (eqNull_1(rest)) {
            if (index === len - 1) {
              return rest;
            }
            return;
          }
        }
      }
      return rest;
    }
  }
}
var get_1 = get;

var ORDER_PROP_ASC = 'asc';
var ORDER_PROP_DESC = 'desc';

// function handleSort (v1, v2) {
//   return v1 > v2 ? 1 : -1
// }

// '' < 数字 < 字符 < null < undefined
function handleSort(v1, v2) {
  if (isUndefined_1(v1)) {
    return 1;
  }
  if (isNull_1(v1)) {
    return isUndefined_1(v2) ? -1 : 1;
  }
  return v1 && v1.localeCompare ? v1.localeCompare(v2) : v1 > v2 ? 1 : -1;
}
function buildMultiOrders(name, confs, compares) {
  return function (item1, item2) {
    var v1 = item1[name];
    var v2 = item2[name];
    if (v1 === v2) {
      return compares ? compares(item1, item2) : 0;
    }
    return confs.order === ORDER_PROP_DESC ? handleSort(v2, v1) : handleSort(v1, v2);
  };
}
function getSortConfs(arr, list, fieldConfs, context) {
  var sortConfs = [];
  fieldConfs = isArray_1(fieldConfs) ? fieldConfs : [fieldConfs];
  arrayEach_1(fieldConfs, function (handle, index) {
    if (handle) {
      var field = handle;
      var order;
      if (isArray_1(handle)) {
        field = handle[0];
        order = handle[1];
      } else if (isPlainObject_1(handle)) {
        field = handle.field;
        order = handle.order;
      }
      sortConfs.push({
        field: field,
        order: order || ORDER_PROP_ASC
      });
      arrayEach_1(list, isFunction_1$1(field) ? function (item, key) {
        item[index] = field.call(context, item.data, key, arr);
      } : function (item) {
        item[index] = field ? get_1(item.data, field) : item.data;
      });
    }
  });
  return sortConfs;
}

/**
  * 将数组进行排序
  *
  * @param {Array} arr 数组
  * @param {Function/String/Array} fieldConfs 方法或属性
  * @param {Object} context 上下文
  * @return {Array}
  */
function orderBy(arr, fieldConfs, context) {
  if (arr) {
    if (eqNull_1(fieldConfs)) {
      return toArray_1(arr).sort(handleSort);
    }
    var compares;
    var list = map_1(arr, function (item) {
      return {
        data: item
      };
    });
    var sortConfs = getSortConfs(arr, list, fieldConfs, context);
    var len = sortConfs.length - 1;
    while (len >= 0) {
      compares = buildMultiOrders(len, sortConfs[len], compares);
      len--;
    }
    if (compares) {
      list = list.sort(compares);
    }
    return map_1(list, property_1('data'));
  }
  return [];
}
var orderBy_1 = orderBy;

var sortBy = orderBy_1;
var sortBy_1 = sortBy;

/**
  * 获取一个指定范围内随机数
  *
  * @param {Number} minVal 最小值
  * @param {Number} maxVal 最大值
  * @return {Number}
  */
function random(minVal, maxVal) {
  return minVal >= maxVal ? minVal : (minVal = minVal >> 0) + Math.round(Math.random() * ((maxVal || 9) - minVal));
}
var random_1 = random;

/**
  * 获取对象所有值
  *
  * @param {Object} obj 对象/数组
  * @return {Array}
  */
var values = helperCreateGetObjects_1('values', 0);
var values_1 = values;

/**
  * 将一个数组随机打乱，返回一个新的数组
  *
  * @param {Array} array 数组
  * @return {Array}
  */
function shuffle(array) {
  var index;
  var result = [];
  var list = values_1(array);
  var len = list.length - 1;
  for (; len >= 0; len--) {
    index = len > 0 ? random_1(0, len) : 0;
    result.push(list[index]);
    list.splice(index, 1);
  }
  return result;
}
var shuffle_1 = shuffle;

/**
  * 从一个数组中随机返回几个元素
  *
  * @param {Array} array 数组
  * @param {Number} number 个数
  * @return {Array}
  */
function sample(array, number) {
  var result = shuffle_1(array);
  if (arguments.length <= 1) {
    return result[0];
  }
  if (number < result.length) {
    result.length = number || 0;
  }
  return result;
}
var sample_1 = sample;

function helperCreateToNumber(handle) {
  return function (str) {
    if (str) {
      var num = handle(str && str.replace ? str.replace(/,/g, '') : str);
      if (!isNaN(num)) {
        return num;
      }
    }
    return 0;
  };
}
var helperCreateToNumber_1 = helperCreateToNumber;

/**
 * 转数值
 * @param { String/Number } str 数值
 *
 * @return {Number}
 */
var toNumber = helperCreateToNumber_1(parseFloat);
var toNumber_1 = toNumber;

/**
 * 裁剪 Arguments 或数组 array，从 start 位置开始到 end 结束，但不包括 end 本身的位置
 * @param {Array/Arguments} array 数组或Arguments
 * @param {Number} startIndex 开始索引
 * @param {Number} endIndex 结束索引
 */
function slice$1(array, startIndex, endIndex) {
  var result = [];
  var argsSize = arguments.length;
  if (array) {
    startIndex = argsSize >= 2 ? toNumber_1(startIndex) : 0;
    endIndex = argsSize >= 3 ? toNumber_1(endIndex) : array.length;
    if (array.slice) {
      return array.slice(startIndex, endIndex);
    }
    for (; startIndex < endIndex; startIndex++) {
      result.push(array[startIndex]);
    }
  }
  return result;
}
var slice_1 = slice$1;

/**
  * 根据回调过滤数据
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, obj) 回调
  * @param {Object} context 上下文
  * @return {Object}
  */
function filter(obj, iterate, context) {
  var result = [];
  if (obj && iterate) {
    if (obj.filter) {
      return obj.filter(iterate, context);
    }
    each_1(obj, function (val, key) {
      if (iterate.call(context, val, key, obj)) {
        result.push(val);
      }
    });
  }
  return result;
}
var filter_1 = filter;

/**
  * 查找匹配第一条数据的键
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, obj) 回调
  * @param {Object} context 上下文
  * @return {Object}
  */
var findKey = helperCreateIterateHandle_1('', 0, 2, true);
var findKey_1 = findKey;

/**
  * 从左至右遍历，匹配最近的一条数据
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, obj) 回调
  * @param {Object} context 上下文
  * @return {Object}
  */
var find = helperCreateIterateHandle_1('find', 1, 3, true);
var find_1 = find;

/**
  * 从右至左遍历，匹配最近的一条数据
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, obj) 回调
  * @param {Object} context 上下文
  * @return {Object}
  */
function findLast(obj, iterate, context) {
  if (obj) {
    if (!isArray_1(obj)) {
      obj = values_1(obj);
    }
    for (var len = obj.length - 1; len >= 0; len--) {
      if (iterate.call(context, obj[len], len, obj)) {
        return obj[len];
      }
    }
  }
}
var findLast_1 = findLast;

/**
  * 接收一个函数作为累加器，数组中的每个值（从左到右）开始合并，最终为一个值。
  *
  * @param {Array} array 数组
  * @param {Function} callback 方法
  * @param {Object} initialValue 初始值
  * @return {Number}
  */
function reduce$1(array, callback, initialValue) {
  if (array) {
    var len, reduceMethod;
    var index = 0;
    var context = null;
    var previous = initialValue;
    var isInitialVal = arguments.length > 2;
    var keyList = keys_1(array);
    if (array.length && array.reduce) {
      reduceMethod = function () {
        return callback.apply(context, arguments);
      };
      if (isInitialVal) {
        return array.reduce(reduceMethod, previous);
      }
      return array.reduce(reduceMethod);
    }
    if (isInitialVal) {
      index = 1;
      previous = array[keyList[0]];
    }
    for (len = keyList.length; index < len; index++) {
      previous = callback.call(context, previous, array[keyList[index]], index, array);
    }
    return previous;
  }
}
var reduce_1 = reduce$1;

/**
  * 浅复制数组的一部分到同一数组中的另一个位置,数组大小不变
  *
  * @param {Array} array 数组
  * @param {Number} target 从该位置开始替换数据
  * @param {Number} start 从该位置开始读取数据，默认为 0 。如果为负值，表示倒数
  * @param {Number} end 到该位置前停止读取数据，默认等于数组长度。如果为负值，表示倒数
  * @return {Array}
  */
function copyWithin(array, target, start, end) {
  if (isArray_1(array) && array.copyWithin) {
    return array.copyWithin(target, start, end);
  }
  var replaceIndex, replaceArray;
  var targetIndex = target >> 0;
  var startIndex = start >> 0;
  var len = array.length;
  var endIndex = arguments.length > 3 ? end >> 0 : len;
  if (targetIndex < len) {
    targetIndex = targetIndex >= 0 ? targetIndex : len + targetIndex;
    if (targetIndex >= 0) {
      startIndex = startIndex >= 0 ? startIndex : len + startIndex;
      endIndex = endIndex >= 0 ? endIndex : len + endIndex;
      if (startIndex < endIndex) {
        for (replaceIndex = 0, replaceArray = array.slice(startIndex, endIndex); targetIndex < len; targetIndex++) {
          if (replaceArray.length <= replaceIndex) {
            break;
          }
          array[targetIndex] = replaceArray[replaceIndex++];
        }
      }
    }
  }
  return array;
}
var copyWithin_1 = copyWithin;

/**
  * 将一个数组分割成大小的组。如果数组不能被平均分配，那么最后一块将是剩下的元素
  *
  * @param {Array} array 数组
  * @param {Number} size 每组大小
  * @return {Array}
  */
function chunk(array, size) {
  var index;
  var result = [];
  var arrLen = size >> 0 || 1;
  if (isArray_1(array)) {
    if (arrLen >= 0 && array.length > arrLen) {
      index = 0;
      while (index < array.length) {
        result.push(array.slice(index, index + arrLen));
        index += arrLen;
      }
    } else {
      result = array.length ? [array] : array;
    }
  }
  return result;
}
var chunk_1 = chunk;

/**
  * 获取数组对象中某属性值，返回一个数组
  *
  * @param {Array} array 数组
  * @param {String} key 属性值
  * @return {Array}
  */
function pluck(obj, key) {
  return map_1(obj, property_1(key));
}
var pluck_1 = pluck;

function helperCreateMinMax(handle) {
  return function (arr, iterate) {
    if (arr && arr.length) {
      var rest, itemIndex;
      arrayEach_1(arr, function (itemVal, index) {
        if (iterate) {
          itemVal = isFunction_1$1(iterate) ? iterate(itemVal, index, arr) : get_1(itemVal, iterate);
        }
        if (!eqNull_1(itemVal) && (eqNull_1(rest) || handle(rest, itemVal))) {
          itemIndex = index;
          rest = itemVal;
        }
      });
      return arr[itemIndex];
    }
    return rest;
  };
}
var helperCreateMinMax_1 = helperCreateMinMax;

/**
  * 获取最大值
  *
  * @param {Array} arr 数组
  * @param {Function} iterate(item, index, obj) 回调
  * @return {Number}
  */
var max$1 = helperCreateMinMax_1(function (rest, itemVal) {
  return rest < itemVal;
});
var max_1 = max$1;

/**
 * 与 zip 相反
 *
 * @param {Array} arrays 数组集合
 */
function unzip(arrays) {
  var index, maxItem, len;
  var result = [];
  if (arrays && arrays.length) {
    index = 0;
    maxItem = max_1(arrays, function (item) {
      return item ? item.length : 0;
    });
    for (len = maxItem ? maxItem.length : 0; index < len; index++) {
      result.push(pluck_1(arrays, index));
    }
  }
  return result;
}
var unzip_1 = unzip;

/**
 * 将每个数组中相应位置的值合并在一起
 *
 * @param {Array*} array 数组
 */
function zip() {
  return unzip_1(arguments);
}
var zip_1 = zip;

/**
 * 根据键数组、值数组对转换为对象
 *
 * @param {Array} props 键数组
 * @param {Number} arr 值数组
 * @return {Object}
 */
function zipObject(props, arr) {
  var result = {};
  arr = arr || [];
  each_1(values_1(props), function (val, key) {
    result[val] = arr[key];
  });
  return result;
}
var zipObject_1 = zipObject;

function flattenDeep(array, deep) {
  var result = [];
  arrayEach_1(array, function (vals) {
    result = result.concat(isArray_1(vals) ? deep ? flattenDeep(vals, deep) : vals : [vals]);
  });
  return result;
}

/**
  * 将一个多维数组铺平
  * @param {Array} array 数组
  * @param {Boolean} deep 是否深层
  * @return {Array}
  */
function flatten(array, deep) {
  if (isArray_1(array)) {
    return flattenDeep(array, deep);
  }
  return [];
}
var flatten_1 = flatten;

function deepGetObj(obj, path) {
  var index = 0;
  var len = path.length;
  while (obj && index < len) {
    obj = obj[path[index++]];
  }
  return len && obj ? obj : 0;
}

/**
 * 在list的每个元素上执行方法,任何传递的额外参数都会在调用方法的时候传递给它
 *
 * @param {Array} list
 * @param {Array/String/Function} path
 * @param {...Object} arguments
 * @return {Array}
 */
function invoke(list, path) {
  var func;
  var args = arguments;
  var params = [];
  var paths = [];
  var index = 2;
  var len = args.length;
  for (; index < len; index++) {
    params.push(args[index]);
  }
  if (isArray_1(path)) {
    len = path.length - 1;
    for (index = 0; index < len; index++) {
      paths.push(path[index]);
    }
    path = path[len];
  }
  return map_1(list, function (context) {
    if (paths.length) {
      context = deepGetObj(context, paths);
    }
    func = context[path] || path;
    if (func && func.apply) {
      return func.apply(context, params);
    }
  });
}
var invoke_1 = invoke;

function helperDeleteProperty(obj, property) {
  try {
    delete obj[property];
  } catch (e) {
    obj[property] = undefined;
  }
}
var helperDeleteProperty_1 = helperDeleteProperty;

/**
  * 迭代器,从最后开始迭代
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, obj) 回调
  * @param {Object} context 上下文
  * @return {Object}
  */
function lastEach(obj, iterate, context) {
  if (obj) {
    return (isArray_1(obj) ? lastArrayEach_1 : lastObjectEach_1)(obj, iterate, context);
  }
  return obj;
}
var lastEach_1 = lastEach;

/**
  * 判断是否Object对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
var isObject$1 = helperCreateInTypeof_1('object');
var isObject_1 = isObject$1;

/**
  * 清空对象
  *
  * @param {Object} obj 对象
  * @param {*} defs 默认值,如果不传（清空所有属性）、如果传对象（清空并继承)、如果传值(给所有赋值)
  * @param {Object/Array} assigns 默认值
  * @return {Object}
  */
function clear(obj, defs, assigns) {
  if (obj) {
    var len;
    var isDefs = arguments.length > 1 && (isNull_1(defs) || !isObject_1(defs));
    var extds = isDefs ? assigns : defs;
    if (isPlainObject_1(obj)) {
      objectEach_1(obj, isDefs ? function (val, key) {
        obj[key] = defs;
      } : function (val, key) {
        helperDeleteProperty_1(obj, key);
      });
      if (extds) {
        assign_1(obj, extds);
      }
    } else if (isArray_1(obj)) {
      if (isDefs) {
        len = obj.length;
        while (len > 0) {
          len--;
          obj[len] = defs;
        }
      } else {
        obj.length = 0;
      }
      if (extds) {
        obj.push.apply(obj, extds);
      }
    }
  }
  return obj;
}
var clear_1 = clear;

function pluckProperty(name) {
  return function (obj, key) {
    return key === name;
  };
}

/**
  * 移除对象属性
  *
  * @param {Object/Array} obj 对象/数组
  * @param {Function/String} iterate 方法或属性
  * @param {Object} context 上下文
  * @return {Object/Array}
  */
function remove(obj, iterate, context) {
  if (obj) {
    if (!eqNull_1(iterate)) {
      var removeKeys = [];
      var rest = [];
      if (!isFunction_1$1(iterate)) {
        iterate = pluckProperty(iterate);
      }
      each_1(obj, function (item, index, rest) {
        if (iterate.call(context, item, index, rest)) {
          removeKeys.push(index);
        }
      });
      if (isArray_1(obj)) {
        lastEach_1(removeKeys, function (item, key) {
          rest.push(obj[item]);
          obj.splice(item, 1);
        });
      } else {
        rest = {};
        arrayEach_1(removeKeys, function (key) {
          rest[key] = obj[key];
          helperDeleteProperty_1(obj, key);
        });
      }
      return rest;
    }
    return clear_1(obj);
  }
  return obj;
}
var remove_1 = remove;

function strictTree(array, optChildren) {
  each_1(array, function (item) {
    if (item[optChildren] && !item[optChildren].length) {
      remove_1(item, optChildren);
    }
  });
}

/**
  * 将一个带层级的数据列表转成树结构
  *
  * @param {Array} array 数组
  * @param {Object} options {strict: false, parentKey: 'parentId', key: 'id', children: 'children', mapChildren: 'children', data: 'data'}
  * @return {Array}
  */
function toArrayTree(array, options) {
  var opts = assign_1({}, setupDefaults_1.treeOptions, options);
  var optStrict = opts.strict;
  var optKey = opts.key;
  var optParentKey = opts.parentKey;
  var optChildren = opts.children;
  var optMapChildren = opts.mapChildren;
  var optSortKey = opts.sortKey;
  var optReverse = opts.reverse;
  var optData = opts.data;
  var result = [];
  var treeMap = {};
  var idsMap = {};
  var id, treeData, parentId;
  if (optSortKey) {
    array = orderBy_1(clone_1(array), optSortKey);
    if (optReverse) {
      array = array.reverse();
    }
  }
  each_1(array, function (item) {
    id = item[optKey];
    idsMap[id] = true;
  });
  each_1(array, function (item) {
    id = item[optKey];
    if (optData) {
      treeData = {};
      treeData[optData] = item;
    } else {
      treeData = item;
    }
    parentId = item[optParentKey];
    treeMap[id] = treeMap[id] || [];
    treeMap[parentId] = treeMap[parentId] || [];
    treeMap[parentId].push(treeData);
    treeData[optKey] = id;
    treeData[optParentKey] = parentId;
    treeData[optChildren] = treeMap[id];
    if (optMapChildren) {
      treeData[optMapChildren] = treeMap[id];
    }
    if (!optStrict || optStrict && eqNull_1(parentId)) {
      if (!idsMap[parentId]) {
        result.push(treeData);
      }
    }
  });
  if (optStrict) {
    strictTree(array, optChildren);
  }
  return result;
}
var toArrayTree_1 = toArrayTree;

function unTreeList(result, array, opts) {
  var optChildren = opts.children;
  var optData = opts.data;
  var optClear = opts.clear;
  each_1(array, function (item) {
    var children = item[optChildren];
    if (optData) {
      item = item[optData];
    }
    result.push(item);
    if (children && children.length) {
      unTreeList(result, children, opts);
    }
    if (optClear) {
      delete item[optChildren];
    }
  });
  return result;
}

/**
  * 将一个树结构转成数组列表
  *
  * @param {Array} array 数组
  * @param {Object} options { children: 'children', data: 'data', clear: false }
  * @return {Array}
  */
function toTreeArray(array, options) {
  return unTreeList([], array, assign_1({}, setupDefaults_1.treeOptions, options));
}
var toTreeArray_1 = toTreeArray;

function helperCreateTreeFunc(handle) {
  return function (obj, iterate, options, context) {
    var opts = options || {};
    var optChildren = opts.children || 'children';
    return handle(null, obj, iterate, context, [], [], optChildren, opts);
  };
}
var helperCreateTreeFunc_1 = helperCreateTreeFunc;

function findTreeItem(parent, obj, iterate, context, path, node, parseChildren, opts) {
  if (obj) {
    var item, index, len, paths, nodes, match;
    for (index = 0, len = obj.length; index < len; index++) {
      item = obj[index];
      paths = path.concat(['' + index]);
      nodes = node.concat([item]);
      if (iterate.call(context, item, index, obj, paths, parent, nodes)) {
        return {
          index: index,
          item: item,
          path: paths,
          items: obj,
          parent: parent,
          nodes: nodes
        };
      }
      if (parseChildren && item) {
        match = findTreeItem(item, item[parseChildren], iterate, context, paths.concat([parseChildren]), nodes, parseChildren);
        if (match) {
          return match;
        }
      }
    }
  }
}

/**
  * 从树结构中查找匹配第一条数据的键、值、路径
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, items, path, parent, nodes) 回调
  * @param {Object} options {children: 'children'}
  * @param {Object} context 上下文
  * @return {Object} { item, index, items, path, parent, nodes }
  */
var findTree = helperCreateTreeFunc_1(findTreeItem);
var findTree_1 = findTree;

function eachTreeItem(parent, obj, iterate, context, path, node, parseChildren, opts) {
  var paths, nodes;
  each_1(obj, function (item, index) {
    paths = path.concat(['' + index]);
    nodes = node.concat([item]);
    iterate.call(context, item, index, obj, paths, parent, nodes);
    if (item && parseChildren) {
      paths.push(parseChildren);
      eachTreeItem(item, item[parseChildren], iterate, context, paths, nodes, parseChildren);
    }
  });
}

/**
  * 从树结构中遍历数据的键、值、路径
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, items, path, parent, nodes) 回调
  * @param {Object} options {children: 'children', mapChildren: 'children}
  * @param {Object} context 上下文
  */
var eachTree = helperCreateTreeFunc_1(eachTreeItem);
var eachTree_1 = eachTree;

function mapTreeItem(parent, obj, iterate, context, path, node, parseChildren, opts) {
  var paths, nodes, rest;
  var mapChildren = opts.mapChildren || parseChildren;
  return map_1(obj, function (item, index) {
    paths = path.concat(['' + index]);
    nodes = node.concat([item]);
    rest = iterate.call(context, item, index, obj, paths, parent, nodes);
    if (rest && item && parseChildren && item[parseChildren]) {
      rest[mapChildren] = mapTreeItem(item, item[parseChildren], iterate, context, paths, nodes, parseChildren, opts);
    }
    return rest;
  });
}

/**
  * 从树结构中指定方法后的返回值组成的新数组
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, items, path, parent, nodes) 回调
  * @param {Object} options {children: 'children'}
  * @param {Object} context 上下文
  * @return {Object/Array}
  */
var mapTree = helperCreateTreeFunc_1(mapTreeItem);
var mapTree_1 = mapTree;

/**
  * 从树结构中根据回调过滤数据
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, items, path, parent) 回调
  * @param {Object} options {children: 'children'}
  * @param {Object} context 上下文
  * @return {Array}
  */
function filterTree(obj, iterate, options, context) {
  var result = [];
  if (obj && iterate) {
    eachTree_1(obj, function (item, index, items, path, parent, nodes) {
      if (iterate.call(context, item, index, items, path, parent, nodes)) {
        result.push(item);
      }
    }, options);
  }
  return result;
}
var filterTree_1 = filterTree;

function searchTreeItem(matchParent, parent, obj, iterate, context, path, node, parseChildren, opts) {
  var paths, nodes, rest, isMatch, hasChild;
  var rests = [];
  var hasOriginal = opts.original;
  var sourceData = opts.data;
  var mapChildren = opts.mapChildren || parseChildren;
  var isEvery = opts.isEvery;
  arrayEach_1(obj, function (item, index) {
    paths = path.concat(['' + index]);
    nodes = node.concat([item]);
    isMatch = matchParent && !isEvery || iterate.call(context, item, index, obj, paths, parent, nodes);
    hasChild = parseChildren && item[parseChildren];
    if (isMatch || hasChild) {
      if (hasOriginal) {
        rest = item;
      } else {
        rest = assign_1({}, item);
        if (sourceData) {
          rest[sourceData] = item;
        }
      }
      rest[mapChildren] = searchTreeItem(isMatch, item, item[parseChildren], iterate, context, paths, nodes, parseChildren, opts);
      if (isMatch || rest[mapChildren].length) {
        rests.push(rest);
      }
    } else if (isMatch) {
      rests.push(rest);
    }
  });
  return rests;
}

/**
  * 从树结构中根据回调查找数据
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, items, path, parent, nodes) 回调
  * @param {Object} options {children: 'children'}
  * @param {Object} context 上下文
  * @return {Array}
  */
var searchTree = helperCreateTreeFunc_1(function (parent, obj, iterate, context, path, nodes, parseChildren, opts) {
  return searchTreeItem(0, parent, obj, iterate, context, path, nodes, parseChildren, opts);
});
var searchTree_1 = searchTree;

function arrayIndexOf(list, val) {
  if (list.indexOf) {
    return list.indexOf(val);
  }
  for (var index = 0, len = list.length; index < len; index++) {
    if (val === list[index]) {
      return index;
    }
  }
}
var arrayIndexOf_1 = arrayIndexOf;

function arrayLastIndexOf(list, val) {
  if (list.lastIndexOf) {
    return list.lastIndexOf(val);
  }
  for (var len = list.length - 1; len >= 0; len--) {
    if (val === list[len]) {
      return len;
    }
  }
  return -1;
}
var arrayLastIndexOf_1 = arrayLastIndexOf;

/**
  * 判断是否Number对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
var isNumber = helperCreateInTypeof_1('number');
var isNumber_1 = isNumber;

/* eslint-disable eqeqeq */
function isNumberNaN(obj) {
  return isNumber_1(obj) && isNaN(obj);
}
var _isNaN = isNumberNaN;

/**
  * 判断是否String对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
var isString = helperCreateInTypeof_1('string');
var isString_1 = isString;

/**
  * 判断是否Date对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
var isDate = helperCreateInInObjectString_1('Date');
var isDate_1 = isDate;

var staticParseInt = parseInt;
var staticParseInt_1 = staticParseInt;

function helperGetUTCDateTime(resMaps) {
  return Date.UTC(resMaps.y, resMaps.M || 0, resMaps.d || 1, resMaps.H || 0, resMaps.m || 0, resMaps.s || 0, resMaps.S || 0);
}
var helperGetUTCDateTime_1 = helperGetUTCDateTime;

function helperGetDateTime(date) {
  return date.getTime();
}
var helperGetDateTime_1 = helperGetDateTime;

function getParseRule(txt) {
  return '(\\d{' + txt + '})';
}
function toParseMs(num) {
  if (num < 10) {
    return num * 100;
  } else if (num < 100) {
    return num * 10;
  }
  return num;
}
function toParseNum(num) {
  return isNaN(num) ? num : staticParseInt_1(num);
}
var d2 = getParseRule(2);
var d1or2 = getParseRule('1,2');
var d1or7 = getParseRule('1,7');
var d3or4 = getParseRule('3,4');
var place = '.{1}';
var d1Or2RE = place + d1or2;
var dzZ = '(([zZ])|([-+]\\d{2}:?\\d{2}))';
var defaulParseStrs = [d3or4, d1Or2RE, d1Or2RE, d1Or2RE, d1Or2RE, d1Or2RE, place + d1or7, dzZ];
var defaulParseREs = [];
for (var len = defaulParseStrs.length - 1; len >= 0; len--) {
  var rule = '';
  for (var i$1 = 0; i$1 < len + 1; i$1++) {
    rule += defaulParseStrs[i$1];
  }
  defaulParseREs.push(new RegExp('^' + rule + '$'));
}

/**
 * 解析默认格式
 */
function parseDefaultRules(str) {
  var matchRest,
    resMaps = {};
  for (var i = 0, dfrLen = defaulParseREs.length; i < dfrLen; i++) {
    matchRest = str.match(defaulParseREs[i]);
    if (matchRest) {
      resMaps.y = matchRest[1];
      resMaps.M = matchRest[2];
      resMaps.d = matchRest[3];
      resMaps.H = matchRest[4];
      resMaps.m = matchRest[5];
      resMaps.s = matchRest[6];
      resMaps.S = matchRest[7];
      resMaps.Z = matchRest[8];
      break;
    }
  }
  return resMaps;
}
var customParseStrs = [['yyyy', d3or4], ['yy', d2], ['MM', d2], ['M', d1or2], ['dd', d2], ['d', d1or2], ['HH', d2], ['H', d1or2], ['mm', d2], ['m', d1or2], ['ss', d2], ['s', d1or2], ['SSS', getParseRule(3)], ['S', d1or7], ['Z', dzZ]];
var parseRuleMaps = {};
var parseRuleKeys = ['\\[([^\\]]+)\\]'];
for (var i$1 = 0; i$1 < customParseStrs.length; i$1++) {
  var itemRule = customParseStrs[i$1];
  parseRuleMaps[itemRule[0]] = itemRule[1] + '?';
  parseRuleKeys.push(itemRule[0]);
}
var customParseRes = new RegExp(parseRuleKeys.join('|'), 'g');
var cacheFormatMaps = {};

/**
 * 解析自定义格式
 */
function parseCustomRules(str, format) {
  var cacheItem = cacheFormatMaps[format];
  if (!cacheItem) {
    var posIndexs = [];
    var re = format.replace(/([$(){}*+.?\\^|])/g, "\\$1").replace(customParseRes, function (text, val) {
      var firstChar = text.charAt(0);
      // 如果为转义符号:[关键字]
      if (firstChar === '[') {
        return val;
      }
      posIndexs.push(firstChar);
      return parseRuleMaps[text];
    });
    cacheItem = cacheFormatMaps[format] = {
      _i: posIndexs,
      _r: new RegExp(re)
    };
  }
  var resMaps = {};
  var matchRest = str.match(cacheItem._r);
  if (matchRest) {
    var _i = cacheItem._i;
    for (var i = 1, len = matchRest.length; i < len; i++) {
      resMaps[_i[i - 1]] = matchRest[i];
    }
    return resMaps;
  }
  return resMaps;
}

/**
 * 解析时区
 */
function parseTimeZone(resMaps) {
  // 如果为UTC 时间
  if (/^[zZ]/.test(resMaps.Z)) {
    return new Date(helperGetUTCDateTime_1(resMaps));
  } else {
    // 如果指定时区，时区转换
    var matchRest = resMaps.Z.match(/([-+])(\d{2}):?(\d{2})/);
    if (matchRest) {
      return new Date(helperGetUTCDateTime_1(resMaps) - (matchRest[1] === '-' ? -1 : 1) * staticParseInt_1(matchRest[2]) * 3600000 + staticParseInt_1(matchRest[3]) * 60000);
    }
  }
  return new Date('');
}

/**
  * 字符串转为日期
  *
  * @param {String/Number/Date} str 日期或数字
  * @param {String} format 解析日期格式(yyyy年份、MM月份、dd天、hh(12)HH(24)小时、mm分钟、ss秒、SSS毫秒、Z时区)
  * @return {Date}
  */
function toStringDate(str, format) {
  if (str) {
    var isDType = isDate_1(str);
    if (isDType || !format && /^[0-9]{11,15}$/.test(str)) {
      return new Date(isDType ? helperGetDateTime_1(str) : staticParseInt_1(str));
    }
    if (isString_1(str)) {
      var resMaps = format ? parseCustomRules(str, format) : parseDefaultRules(str);
      if (resMaps.y) {
        if (resMaps.M) {
          resMaps.M = toParseNum(resMaps.M) - 1;
        }
        if (resMaps.S) {
          // 如果7位则是微秒，只精确到3位毫秒
          resMaps.S = toParseMs(toParseNum(resMaps.S.substring(0, 3)));
        }
        if (resMaps.Z) {
          return parseTimeZone(resMaps);
        } else {
          return new Date(resMaps.y, resMaps.M || 0, resMaps.d || 1, resMaps.H || 0, resMaps.m || 0, resMaps.s || 0, resMaps.S || 0);
        }
      }
    }
  }
  return new Date('');
}
var toStringDate_1 = toStringDate;

function helperNewDate() {
  return new Date();
}
var helperNewDate_1 = helperNewDate;

/**
  * 判断是否闰年
  *
  * @param {Date} date 日期或数字
  * @return {Boolean}
  */
function isLeapYear(date) {
  var year;
  var currentDate = date ? toStringDate_1(date) : helperNewDate_1();
  if (isDate_1(currentDate)) {
    year = currentDate.getFullYear();
    return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
  }
  return false;
}
var isLeapYear_1 = isLeapYear;

/**
  * 已废弃，被 some, every 替换
  * @deprecated
  */
function forOf(obj, iterate, context) {
  if (obj) {
    if (isArray_1(obj)) {
      for (var index = 0, len = obj.length; index < len; index++) {
        if (iterate.call(context, obj[index], index, obj) === false) {
          break;
        }
      }
    } else {
      for (var key in obj) {
        if (hasOwnProp_1(obj, key)) {
          if (iterate.call(context, obj[key], key, obj) === false) {
            break;
          }
        }
      }
    }
  }
}
var forOf_1 = forOf;

/**
  * 已废弃
  * @deprecated
  */
function lastForOf(obj, iterate, context) {
  if (obj) {
    var len, list;
    if (isArray_1(obj)) {
      for (len = obj.length - 1; len >= 0; len--) {
        if (iterate.call(context, obj[len], len, obj) === false) {
          break;
        }
      }
    } else {
      list = hasOwnProp_1(obj);
      for (len = list.length - 1; len >= 0; len--) {
        if (iterate.call(context, obj[list[len]], list[len], obj) === false) {
          break;
        }
      }
    }
  }
}
var lastForOf_1 = lastForOf;

function helperCreateIndexOf(name, callback) {
  return function (obj, val) {
    if (obj) {
      if (obj[name]) {
        return obj[name](val);
      }
      if (isString_1(obj) || isArray_1(obj)) {
        return callback(obj, val);
      }
      for (var key in obj) {
        if (hasOwnProp_1(obj, key)) {
          if (val === obj[key]) {
            return key;
          }
        }
      }
    }
    return -1;
  };
}
var helperCreateIndexOf_1 = helperCreateIndexOf;

/**
  * 返回对象第一个索引值
  *
  * @param {Object} obj 对象
  * @param {Object} val 值
  * @return {Number}
  */
var indexOf = helperCreateIndexOf_1('indexOf', arrayIndexOf_1);
var indexOf_1 = indexOf;

/**
  * 从最后开始的索引值,返回对象第一个索引值
  *
  * @param {Object} array 对象
  * @param {Object} val 值
  * @return {Number}
  */
var lastIndexOf = helperCreateIndexOf_1('lastIndexOf', arrayLastIndexOf_1);
var lastIndexOf_1 = lastIndexOf;

/**
  * 返回对象的长度
  *
  * @param {Object} obj 对象
  * @return {Number}
  */
function getSize(obj) {
  var len = 0;
  if (isString_1(obj) || isArray_1(obj)) {
    return obj.length;
  }
  each_1(obj, function () {
    len++;
  });
  return len;
}
var getSize_1 = getSize;

function isNumberFinite(obj) {
  return isNumber_1(obj) && isFinite(obj);
}
var _isFinite = isNumberFinite;

/**
  * 判断是否整数
  *
  * @param {Number, String} number 数值
  * @return {Boolean}
  */
var isInteger = function (obj) {
  return !isNull_1(obj) && !isNaN(obj) && !isArray_1(obj) && obj % 1 === 0;
};
var isInteger_1 = isInteger;

/**
  * 判断是否小数
  *
  * @param {Number} obj 数值
  * @return {Boolean}
  */
function isFloat(obj) {
  return !isNull_1(obj) && !isNaN(obj) && !isArray_1(obj) && !isInteger_1(obj);
}
var isFloat_1 = isFloat;

/**
  * 判断是否Boolean对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
var isBoolean = helperCreateInTypeof_1('boolean');
var isBoolean_1 = isBoolean;

/**
  * 判断是否RegExp对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
var isRegExp = helperCreateInInObjectString_1('RegExp');
var isRegExp_1 = isRegExp;

/**
  * 判断是否Error对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
var isError = helperCreateInInObjectString_1('Error');
var isError_1 = isError;

/**
  * 判断是否TypeError对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
function isTypeError(obj) {
  return obj ? obj.constructor === TypeError : false;
}
var isTypeError_1 = isTypeError;

/**
  * 判断是否为空对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
function isEmpty$1(obj) {
  for (var key in obj) {
    return false;
  }
  return true;
}
var isEmpty_1 = isEmpty$1;

/* eslint-disable valid-typeof */


/**
  * 判断是否Symbol对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
var supportSymbol = typeof Symbol !== staticStrUndefined_1;
function isSymbol(obj) {
  return supportSymbol && Symbol.isSymbol ? Symbol.isSymbol(obj) : typeof obj === 'symbol';
}
var isSymbol_1 = isSymbol;

/**
  * 判断是否Arguments对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
var isArguments = helperCreateInInObjectString_1('Arguments');
var isArguments_1 = isArguments;

/**
  * 判断是否Element对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
function isElement$2(obj) {
  return !!(obj && isString_1(obj.nodeName) && isNumber_1(obj.nodeType));
}
var isElement_1 = isElement$2;

/* eslint-disable valid-typeof */
var staticDocument = typeof document === staticStrUndefined_1 ? 0 : document;
var staticDocument_1 = staticDocument;

/**
  * 判断是否Document对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
function isDocument(obj) {
  return !!(obj && staticDocument_1 && obj.nodeType === 9);
}
var isDocument_1 = isDocument;

/* eslint-disable valid-typeof */
var staticWindow = typeof window === staticStrUndefined_1 ? 0 : window;
var staticWindow_1 = staticWindow;

/**
  * 判断是否Window对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
function isWindow(obj) {
  return !!(staticWindow_1 && !!(obj && obj === obj.window));
}
var isWindow_1 = isWindow;

/* eslint-disable valid-typeof */


/**
  * 判断是否FormData对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
  */
var supportFormData = typeof FormData !== staticStrUndefined_1;
function isFormData(obj) {
  return supportFormData && obj instanceof FormData;
}
var isFormData_1 = isFormData;

/* eslint-disable valid-typeof */


/**
  * 判断是否Map对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
 */
var supportMap = typeof Map !== staticStrUndefined_1;
function isMap(obj) {
  return supportMap && obj instanceof Map;
}
var isMap_1 = isMap;

/* eslint-disable valid-typeof */


/**
  * 判断是否WeakMap对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
 */
var supportWeakMap = typeof WeakMap !== staticStrUndefined_1;
function isWeakMap(obj) {
  return supportWeakMap && obj instanceof WeakMap;
}
var isWeakMap_1 = isWeakMap;

/* eslint-disable valid-typeof */


/**
  * 判断是否Set对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
 */
var supportSet = typeof Set !== staticStrUndefined_1;
function isSet(obj) {
  return supportSet && obj instanceof Set;
}
var isSet_1 = isSet;

/* eslint-disable valid-typeof */


/**
  * 判断是否WeakSet对象
  *
  * @param {Object} obj 对象
  * @return {Boolean}
 */
var supportWeakSet = typeof WeakSet !== staticStrUndefined_1;
function isWeakSet(obj) {
  return supportWeakSet && obj instanceof WeakSet;
}
var isWeakSet_1 = isWeakSet;

function helperCreateiterateIndexOf(callback) {
  return function (obj, iterate, context) {
    if (obj && isFunction_1$1(iterate)) {
      if (isArray_1(obj) || isString_1(obj)) {
        return callback(obj, iterate, context);
      }
      for (var key in obj) {
        if (hasOwnProp_1(obj, key)) {
          if (iterate.call(context, obj[key], key, obj)) {
            return key;
          }
        }
      }
    }
    return -1;
  };
}
var helperCreateiterateIndexOf_1 = helperCreateiterateIndexOf;

/**
  * 返回对象第一个索引值
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, obj) 回调
  * @param {Object} context 上下文
  * @return {Object}
  */
var findIndexOf = helperCreateiterateIndexOf_1(function (obj, iterate, context) {
  for (var index = 0, len = obj.length; index < len; index++) {
    if (iterate.call(context, obj[index], index, obj)) {
      return index;
    }
  }
  return -1;
});
var findIndexOf_1 = findIndexOf;

function helperEqualCompare(val1, val2, compare, func, key, obj1, obj2) {
  if (val1 === val2) {
    return true;
  }
  if (val1 && val2 && !isNumber_1(val1) && !isNumber_1(val2) && !isString_1(val1) && !isString_1(val2)) {
    if (isRegExp_1(val1)) {
      return compare('' + val1, '' + val2, key, obj1, obj2);
    }
    if (isDate_1(val1) || isBoolean_1(val1)) {
      return compare(+val1, +val2, key, obj1, obj2);
    } else {
      var result, val1Keys, val2Keys;
      var isObj1Arr = isArray_1(val1);
      var isObj2Arr = isArray_1(val2);
      if (isObj1Arr || isObj2Arr ? isObj1Arr && isObj2Arr : val1.constructor === val2.constructor) {
        val1Keys = keys_1(val1);
        val2Keys = keys_1(val2);
        if (func) {
          result = func(val1, val2, key);
        }
        if (val1Keys.length === val2Keys.length) {
          return isUndefined_1(result) ? every_1(val1Keys, function (key, index) {
            return key === val2Keys[index] && helperEqualCompare(val1[key], val2[val2Keys[index]], compare, func, isObj1Arr || isObj2Arr ? index : key, val1, val2);
          }) : !!result;
        }
        return false;
      }
    }
  }
  return compare(val1, val2, key, obj1, obj2);
}
var helperEqualCompare_1 = helperEqualCompare;

function helperDefaultCompare(v1, v2) {
  return v1 === v2;
}
var helperDefaultCompare_1 = helperDefaultCompare;

/**
 * 深度比较两个对象之间的值是否相等
 *
 * @param {Object} obj1 值1
 * @param {Object} obj2 值2
 * @return {Boolean}
 */
function isEqual(obj1, obj2) {
  return helperEqualCompare_1(obj1, obj2, helperDefaultCompare_1);
}
var isEqual_1 = isEqual;

/**
 * 判断属性中的键和值是否包含在对象中
 *
 * @param {Object/Array} obj 对象
 * @param {Object} source 值
 * @return {Boolean}
 */
function isMatch(obj, source) {
  var objKeys = keys_1(obj);
  var sourceKeys = keys_1(source);
  if (sourceKeys.length) {
    if (includeArrays_1(objKeys, sourceKeys)) {
      return some_1(sourceKeys, function (key2) {
        return findIndexOf_1(objKeys, function (key1) {
          return key1 === key2 && isEqual_1(obj[key1], source[key2]);
        }) > -1;
      });
    }
  } else {
    return true;
  }
  return isEqual_1(obj, source);
}
var isMatch_1 = isMatch;

/**
 * 深度比较两个对象之间的值是否相等，使用自定义比较函数
 *
 * @param {Object} obj1 值1
 * @param {Object} obj2 值2
 * @param {Function} func 自定义函数
 * @return {Boolean}
 */
function isEqualWith(obj1, obj2, func) {
  if (isFunction_1$1(func)) {
    return helperEqualCompare_1(obj1, obj2, function (v1, v2, key, obj1, obj2) {
      var result = func(v1, v2, key, obj1, obj2);
      return isUndefined_1(result) ? helperDefaultCompare_1(v1, v2) : !!result;
    }, func);
  }
  return helperEqualCompare_1(obj1, obj2, helperDefaultCompare_1);
}
var isEqualWith_1 = isEqualWith;

/**
  * 获取对象类型
  *
  * @param {Object} obj 对象
  * @return {String}
  */
function getType(obj) {
  if (isNull_1(obj)) {
    return 'null';
  }
  if (isSymbol_1(obj)) {
    return 'symbol';
  }
  if (isDate_1(obj)) {
    return 'date';
  }
  if (isArray_1(obj)) {
    return 'array';
  }
  if (isRegExp_1(obj)) {
    return 'regexp';
  }
  if (isError_1(obj)) {
    return 'error';
  }
  return typeof obj;
}
var getType_1 = getType;

/**
  * 获取一个全局唯一标识
  *
  * @param {String} prefix 前缀
  * @return {Number}
  */
var __uniqueId = 0;
function uniqueId(prefix) {
  return [prefix, ++__uniqueId].join('');
}
var uniqueId_1 = uniqueId;

/**
  * 从最后开始的索引值,返回对象第一个索引值
  *
  * @param {Object} obj 对象/数组
  * @param {Function} iterate(item, index, obj) 回调
  * @param {Object} context 上下文
  * @return {Object}
  */
var findLastIndexOf = helperCreateiterateIndexOf_1(function (obj, iterate, context) {
  for (var len = obj.length - 1; len >= 0; len--) {
    if (iterate.call(context, obj[len], len, obj)) {
      return len;
    }
  }
  return -1;
});
var findLastIndexOf_1 = findLastIndexOf;

/**
  * 字符串转JSON
  *
  * @param {String} str 字符串
  * @return {Object} 返回转换后对象
  */
function toStringJSON(str) {
  if (isPlainObject_1(str)) {
    return str;
  } else if (isString_1(str)) {
    try {
      return JSON.parse(str);
    } catch (e) {}
  }
  return {};
}
var toStringJSON_1 = toStringJSON;

/**
  * JSON转字符串
  *
  * @param {Object} obj 对象
  * @return {String} 返回字符串
  */
function toJSONString(obj) {
  return eqNull_1(obj) ? '' : JSON.stringify(obj);
}
var toJSONString_1 = toJSONString;

/**
  * 获取对象所有属性、值
  *
  * @param {Object} obj 对象/数组
  * @return {Array}
  */
var entries = helperCreateGetObjects_1('entries', 2);
var entries_1 = entries;

function helperCreatePickOmit(case1, case2) {
  return function (obj, callback) {
    var item, index;
    var rest = {};
    var result = [];
    var context = this;
    var args = arguments;
    var len = args.length;
    if (!isFunction_1$1(callback)) {
      for (index = 1; index < len; index++) {
        item = args[index];
        result.push.apply(result, isArray_1(item) ? item : [item]);
      }
      callback = 0;
    }
    each_1(obj, function (val, key) {
      if ((callback ? callback.call(context, val, key, obj) : findIndexOf_1(result, function (name) {
        return name === key;
      }) > -1) ? case1 : case2) {
        rest[key] = val;
      }
    });
    return rest;
  };
}
var helperCreatePickOmit_1 = helperCreatePickOmit;

/**
 * 根据 key 过滤指定的属性值，返回一个新的对象
 *
 * @param {Object} obj 对象
 * @param {String/Array} key 键数组
 * @return {Object}
 */
var pick$1 = helperCreatePickOmit_1(1, 0);
var pick_1 = pick$1;

/**
 * 根据 key 排除指定的属性值，返回一个新的对象
 *
 * @param {Object} obj 对象
 * @param {String/Array} key 键数组
 * @return {Object}
 */
var omit = helperCreatePickOmit_1(0, 1);
var omit_1 = omit;

/**
  * 获取对象第一个值
  *
  * @param {Object} obj 对象/数组
  * @return {Object}
  */
function first(obj) {
  return values_1(obj)[0];
}
var first_1 = first;

/**
  * 获取对象最后一个值
  *
  * @param {Object} obj 对象/数组
  * @return {Object}
  */
function last(obj) {
  var list = values_1(obj);
  return list[list.length - 1];
}
var last_1 = last;

/**
 * 检查键、路径是否是该对象的属性
 *
 * @param {Object/Array} data 对象
 * @param {String/Function} property 键、路径
 * @return {Boolean}
 */
function has(obj, property) {
  if (obj) {
    if (hasOwnProp_1(obj, property)) {
      return true;
    } else {
      var prop, arrIndex, objProp, matchs, rest, isHas;
      var props = helperGetHGSKeys_1(property);
      var index = 0;
      var len = props.length;
      for (rest = obj; index < len; index++) {
        isHas = false;
        prop = props[index];
        matchs = prop ? prop.match(staticHGKeyRE_1) : '';
        if (matchs) {
          arrIndex = matchs[1];
          objProp = matchs[2];
          if (arrIndex) {
            if (rest[arrIndex]) {
              if (hasOwnProp_1(rest[arrIndex], objProp)) {
                isHas = true;
                rest = rest[arrIndex][objProp];
              }
            }
          } else {
            if (hasOwnProp_1(rest, objProp)) {
              isHas = true;
              rest = rest[objProp];
            }
          }
        } else {
          if (hasOwnProp_1(rest, prop)) {
            isHas = true;
            rest = rest[prop];
          }
        }
        if (isHas) {
          if (index === len - 1) {
            return true;
          }
        } else {
          break;
        }
      }
    }
  }
  return false;
}
var has_1 = has;

var sKeyRE = /(.+)?\[(\d+)\]$/;
function setDeepProps(obj, key, isEnd, nextKey, value) {
  if (obj[key]) {
    if (isEnd) {
      obj[key] = value;
    }
  } else {
    var index;
    var rest;
    var currMatchs = key ? key.match(sKeyRE) : null;
    if (isEnd) {
      rest = value;
    } else {
      var nextMatchs = nextKey ? nextKey.match(sKeyRE) : null;
      if (nextMatchs && !nextMatchs[1]) {
        // 如果下一个属性为数组类型
        rest = new Array(staticParseInt_1(nextMatchs[2]) + 1);
      } else {
        rest = {};
      }
    }
    if (currMatchs) {
      if (currMatchs[1]) {
        // 如果为对象中数组
        index = staticParseInt_1(currMatchs[2]);
        if (obj[currMatchs[1]]) {
          if (isEnd) {
            obj[currMatchs[1]][index] = rest;
          } else {
            if (obj[currMatchs[1]][index]) {
              rest = obj[currMatchs[1]][index];
            } else {
              obj[currMatchs[1]][index] = rest;
            }
          }
        } else {
          obj[currMatchs[1]] = new Array(index + 1);
          obj[currMatchs[1]][index] = rest;
        }
      } else {
        // 如果为数组
        obj[currMatchs[2]] = rest;
      }
    } else {
      // 如果为对象
      obj[key] = rest;
    }
    return rest;
  }
  return obj[key];
}

/**
 * 设置对象属性上的值。如果属性不存在则创建它
 * @param {Object/Array} obj 对象
 * @param {String/Function} property 键、路径
 * @param {Object} value 值
 */
function set(obj, property, value) {
  if (obj) {
    if ((obj[property] || hasOwnProp_1(obj, property)) && !isPrototypePolluted(property)) {
      obj[property] = value;
    } else {
      var rest = obj;
      var props = helperGetHGSKeys_1(property);
      var len = props.length;
      for (var index = 0; index < len; index++) {
        if (isPrototypePolluted(props[index])) {
          continue;
        }
        var isEnd = index === len - 1;
        rest = setDeepProps(rest, props[index], isEnd, isEnd ? null : props[index + 1], value);
      }
    }
  }
  return obj;
}

/**
 * Blacklist certain keys to prevent Prototype Pollution
 * @param {string} key
 */
function isPrototypePolluted(key) {
  return key === '__proto__' || key === 'constructor' || key === 'prototype';
}
var set_1 = set;

function createiterateEmpty(iterate) {
  return function () {
    return isEmpty_1(iterate);
  };
}

/**
  * 集合分组,默认使用键值分组,如果有iterate则使用结果进行分组
  *
  * @param {Array} obj 对象
  * @param {Function} iterate 回调/对象属性
  * @param {Object} context 上下文
  * @return {Object}
  */
function groupBy(obj, iterate, context) {
  var groupKey;
  var result = {};
  if (obj) {
    if (iterate && isObject_1(iterate)) {
      iterate = createiterateEmpty(iterate);
    } else if (!isFunction_1$1(iterate)) {
      iterate = property_1(iterate);
    }
    each_1(obj, function (val, key) {
      groupKey = iterate ? iterate.call(context, val, key, obj) : val;
      if (result[groupKey]) {
        result[groupKey].push(val);
      } else {
        result[groupKey] = [val];
      }
    });
  }
  return result;
}
var groupBy_1 = groupBy;

/**
  * 集合分组统计,返回各组中对象的数量统计
  *
  * @param {Array} obj 对象
  * @param {Function} iterate 回调/对象属性
  * @param {Object} context 上下文
  * @return {Object}
  */
function countBy(obj, iterate, context) {
  var result = groupBy_1(obj, iterate, context || this);
  objectEach_1(result, function (item, key) {
    result[key] = item.length;
  });
  return result;
}
var countBy_1 = countBy;

/**
  * 序号列表生成函数
  *
  * @param {Number} start 起始值
  * @param {Number} stop 结束值
  * @param {Number} step 自增值
  * @return {Array}
  */
function range(start, stop, step) {
  var index, len;
  var result = [];
  var args = arguments;
  if (args.length < 2) {
    stop = args[0];
    start = 0;
  }
  index = start >> 0;
  len = stop >> 0;
  if (index < stop) {
    step = step >> 0 || 1;
    for (; index < len; index += step) {
      result.push(index);
    }
  }
  return result;
}
var range_1 = range;

/**
  * 将一个或者多个对象值解构到目标对象
  *
  * @param {Object} destination 目标对象
  * @param {...Object}
  * @return {Boolean}
  */
function destructuring(destination, sources) {
  if (destination && sources) {
    var rest = assign_1.apply(this, [{}].concat(slice_1(arguments, 1)));
    var restKeys = keys_1(rest);
    arrayEach_1(keys_1(destination), function (key) {
      if (includes_1(restKeys, key)) {
        destination[key] = rest[key];
      }
    });
  }
  return destination;
}
var destructuring_1 = destructuring;

/**
  * 获取最小值
  *
  * @param {Array} arr 数组
  * @param {Function} iterate(item, index, obj) 回调
  * @return {Number}
  */
var min$1 = helperCreateMinMax_1(function (rest, itemVal) {
  return rest > itemVal;
});
var min_1 = min$1;

function helperNumberDecimal(numStr) {
  return (numStr.split('.')[1] || '').length;
}
var helperNumberDecimal_1 = helperNumberDecimal;

function helperStringRepeat(str, count) {
  if (str.repeat) {
    return str.repeat(count);
  }
  var list = isNaN(count) ? [] : new Array(staticParseInt_1(count));
  return list.join(str) + (list.length > 0 ? str : '');
}
var helperStringRepeat_1 = helperStringRepeat;

function helperNumberOffsetPoint(str, offsetIndex) {
  return str.substring(0, offsetIndex) + '.' + str.substring(offsetIndex, str.length);
}
var helperNumberOffsetPoint_1 = helperNumberOffsetPoint;

/**
 * 数值转字符串，科学计数转字符串
 * @param { Number } num 数值
 *
 * @return {Number}
 */
function toNumberString(num) {
  var rest = '' + num;
  var scienceMatchs = rest.match(/^([-+]?)((\d+)|((\d+)?[.](\d+)?))e([-+]{1})([0-9]+)$/);
  if (scienceMatchs) {
    var isNegative = num < 0;
    var absFlag = isNegative ? '-' : '';
    var intNumStr = scienceMatchs[3] || '';
    var dIntNumStr = scienceMatchs[5] || '';
    var dFloatNumStr = scienceMatchs[6] || '';
    var sciencFlag = scienceMatchs[7];
    var scienceNumStr = scienceMatchs[8];
    var floatOffsetIndex = scienceNumStr - dFloatNumStr.length;
    var intOffsetIndex = scienceNumStr - intNumStr.length;
    var dIntOffsetIndex = scienceNumStr - dIntNumStr.length;
    if (sciencFlag === '+') {
      if (intNumStr) {
        return absFlag + intNumStr + helperStringRepeat_1('0', scienceNumStr);
      }
      if (floatOffsetIndex > 0) {
        return absFlag + dIntNumStr + dFloatNumStr + helperStringRepeat_1('0', floatOffsetIndex);
      }
      return absFlag + dIntNumStr + helperNumberOffsetPoint_1(dFloatNumStr, scienceNumStr);
    }
    if (intNumStr) {
      if (intOffsetIndex > 0) {
        return absFlag + '0.' + helperStringRepeat_1('0', Math.abs(intOffsetIndex)) + intNumStr;
      }
      return absFlag + helperNumberOffsetPoint_1(intNumStr, intOffsetIndex);
    }
    if (dIntOffsetIndex > 0) {
      return absFlag + '0.' + helperStringRepeat_1('0', Math.abs(dIntOffsetIndex)) + dIntNumStr + dFloatNumStr;
    }
    return absFlag + helperNumberOffsetPoint_1(dIntNumStr, dIntOffsetIndex) + dFloatNumStr;
  }
  return rest;
}
var toNumberString_1 = toNumberString;

function helperMultiply(multiplier, multiplicand) {
  var str1 = toNumberString_1(multiplier);
  var str2 = toNumberString_1(multiplicand);
  return parseInt(str1.replace('.', '')) * parseInt(str2.replace('.', '')) / Math.pow(10, helperNumberDecimal_1(str1) + helperNumberDecimal_1(str2));
}
var helperMultiply_1 = helperMultiply;

function helperCreateMathNumber(name) {
  return function (num, digits) {
    var numRest = toNumber_1(num);
    var rest = numRest;
    if (numRest) {
      digits = digits >> 0;
      var numStr = toNumberString_1(numRest);
      var nums = numStr.split('.');
      var intStr = nums[0];
      var floatStr = nums[1] || '';
      var fStr = floatStr.substring(0, digits + 1);
      var subRest = intStr + (fStr ? '.' + fStr : '');
      if (digits >= floatStr.length) {
        return toNumber_1(subRest);
      }
      subRest = numRest;
      if (digits > 0) {
        var ratio = Math.pow(10, digits);
        rest = Math[name](helperMultiply_1(subRest, ratio)) / ratio;
      } else {
        rest = Math[name](subRest);
      }
    }
    return rest;
  };
}
var helperCreateMathNumber_1 = helperCreateMathNumber;

/**
 * 将数值四舍五入
 *
 * @param {string|number} num 数值
 * @param {number} digits 小数保留位数
 * @return {number}
 */
var round$1 = helperCreateMathNumber_1('round');
var round_1 = round$1;

/**
 * 将数值向上舍入
 *
 * @param {string|number} num 数值
 * @param {number} digits 小数保留位数
 * @return {number}
 */
var ceil = helperCreateMathNumber_1('ceil');
var ceil_1 = ceil;

/**
 * 将数值向下舍入
 *
 * @param {string|number} num 数值
 * @param {number} digits 小数保留位数
 * @return {number}
 */
var floor = helperCreateMathNumber_1('floor');
var floor_1 = floor;

function toValueString(obj) {
  if (isNumber_1(obj)) {
    return toNumberString_1(obj);
  }
  return '' + (eqNull_1(obj) ? '' : obj);
}
var toValueString_1 = toValueString;

/**
  * 将数值四舍五入并格式化为固定小数位的字符串
  *
 * @param {string|number} num 数值
 * @param {number} digits 小数保留位数
  * @return {String}
  */
function toFixed(num, digits) {
  digits = digits >> 0;
  var str = toValueString_1(round_1(num, digits));
  var nums = str.split('.');
  var intStr = nums[0];
  var floatStr = nums[1] || '';
  var digitOffsetIndex = digits - floatStr.length;
  if (digits) {
    if (digitOffsetIndex > 0) {
      return intStr + '.' + floatStr + helperStringRepeat_1('0', digitOffsetIndex);
    }
    return intStr + helperNumberOffsetPoint_1(floatStr, Math.abs(digitOffsetIndex));
  }
  return intStr;
}
var toFixed_1 = toFixed;

/**
  * 千分位分隔符、小数点
  *
  * @param {String/Number} num 数值
  * @param {CommafyOptions} options 参数
  * @return {String}
 */
function commafy(num, options) {
  var opts = assign_1({}, setupDefaults_1.commafyOptions, options);
  var optDigits = opts.digits;
  var isNum = isNumber_1(num);
  var rest, result, isNegative, intStr, floatStr;
  if (isNum) {
    rest = (opts.ceil ? ceil_1 : opts.floor ? floor_1 : round_1)(num, optDigits);
    result = toNumberString_1(optDigits ? toFixed_1(rest, optDigits) : rest).split('.');
    intStr = result[0];
    floatStr = result[1];
    isNegative = intStr && rest < 0;
    if (isNegative) {
      intStr = intStr.substring(1, intStr.length);
    }
  } else {
    rest = toValueString_1(num).replace(/,/g, '');
    result = rest ? [rest] : [];
    intStr = result[0];
  }
  if (result.length) {
    return (isNegative ? '-' : '') + intStr.replace(new RegExp('(?=(?!(\\b))(.{' + (opts.spaceNumber || 3) + '})+$)', 'g'), opts.separator || ',') + (floatStr ? '.' + floatStr : '');
  }
  return rest;
}
var commafy_1 = commafy;

/**
 * 转整数
 * @param { String/Number } str 数值
 *
 * @return {Number}
 */
var toInteger = helperCreateToNumber_1(staticParseInt_1);
var toInteger_1 = toInteger;

/**
 * 乘法运算
 *
 * @param { Number } num1 数值1
 * @param { Number } num2 数值2
 * @return {Number}
 */
function multiply(num1, num2) {
  var multiplier = toNumber_1(num1);
  var multiplicand = toNumber_1(num2);
  return helperMultiply_1(multiplier, multiplicand);
}
var multiply_1 = multiply;

function helperNumberAdd(addend, augend) {
  var str1 = toNumberString_1(addend);
  var str2 = toNumberString_1(augend);
  var ratio = Math.pow(10, Math.max(helperNumberDecimal_1(str1), helperNumberDecimal_1(str2)));
  return (multiply_1(addend, ratio) + multiply_1(augend, ratio)) / ratio;
}
var helperNumberAdd_1 = helperNumberAdd;

/**
 * 加法运算
 *
 * @param { Number } num1 被加数
 * @param { Number } num2 加数
 * @return {Number}
 */
function add(num1, num2) {
  return helperNumberAdd_1(toNumber_1(num1), toNumber_1(num2));
}
var add_1 = add;

/**
 * 减法运算
 *
 * @param { Number } num1 被减数
 * @param { Number } num2 减数
 * @return {Number}
 */
function subtract(num1, num2) {
  var subtrahend = toNumber_1(num1);
  var minuend = toNumber_1(num2);
  var str1 = toNumberString_1(subtrahend);
  var str2 = toNumberString_1(minuend);
  var digit1 = helperNumberDecimal_1(str1);
  var digit2 = helperNumberDecimal_1(str2);
  var ratio = Math.pow(10, Math.max(digit1, digit2));
  var precision = digit1 >= digit2 ? digit1 : digit2;
  return parseFloat(toFixed_1((subtrahend * ratio - minuend * ratio) / ratio, precision));
}
var subtract_1 = subtract;

function helperNumberDivide(divisor, dividend) {
  var str1 = toNumberString_1(divisor);
  var str2 = toNumberString_1(dividend);
  var divisorDecimal = helperNumberDecimal_1(str1);
  var dividendDecimal = helperNumberDecimal_1(str2);
  var powY = dividendDecimal - divisorDecimal;
  var isMinus = powY < 0;
  var multiplicand = Math.pow(10, isMinus ? Math.abs(powY) : powY);
  return multiply_1(str1.replace('.', '') / str2.replace('.', ''), isMinus ? 1 / multiplicand : multiplicand);
}
var helperNumberDivide_1 = helperNumberDivide;

/**
 * 除法运算
 *
 * @param { Number } num1 数值1
 * @param { Number } num2 数值2
 * @return {Number}
 */
function divide(num1, num2) {
  return helperNumberDivide_1(toNumber_1(num1), toNumber_1(num2));
}
var divide_1 = divide;

/**
  * 求和函数，将数值相加
  *
  * @param {Array} array 数组
  * @param {Function/String} iterate 方法或属性
  * @param {Object} context 上下文
  * @return {Number}
  */
function sum(array, iterate, context) {
  var result = 0;
  each_1(array, iterate ? isFunction_1$1(iterate) ? function () {
    result = helperNumberAdd_1(result, iterate.apply(context, arguments));
  } : function (val) {
    result = helperNumberAdd_1(result, get_1(val, iterate));
  } : function (val) {
    result = helperNumberAdd_1(result, val);
  });
  return result;
}
var sum_1 = sum;

/**
  * 求平均值函数
  *
  * @param {Array} array 数组
  * @param {Function/String} iterate 方法或属性
  * @param {Object} context 上下文
  * @return {Number}
  */
function mean(array, iterate, context) {
  return helperNumberDivide_1(sum_1(array, iterate, context), getSize_1(array));
}
var mean_1 = mean;

var staticStrFirst = 'first';
var staticStrFirst_1 = staticStrFirst;

var staticStrLast = 'last';
var staticStrLast_1 = staticStrLast;

function helperGetDateFullYear(date) {
  return date.getFullYear();
}
var helperGetDateFullYear_1 = helperGetDateFullYear;

var staticDayTime = 86400000;
var staticDayTime_1 = staticDayTime;

function helperGetDateMonth(date) {
  return date.getMonth();
}
var helperGetDateMonth_1 = helperGetDateMonth;

/**
  * 判断是否有效的Date对象
  *
  * @param {any} val 对象
  * @return {boolean}
  */
function isValidDate(val) {
  return isDate_1(val) && !isNaN(helperGetDateTime_1(val));
}
var isValidDate_1 = isValidDate;

/**
  * 返回前几月或后几月的日期
  *
  * @param {Date} date 日期或数字
  * @param {Number} offsetMonth 月(默认当前月)、前几个月、后几个月
  * @param {Number/String} offsetDay 获取哪天：月初(first)、月末(last)、指定天数(数值)，如果为空，但超过指定月份的天数时，则默认单月最后一天
  * @return {Date}
  */
function getWhatMonth(date, offsetMonth, offsetDay) {
  var monthNum = offsetMonth && !isNaN(offsetMonth) ? offsetMonth : 0;
  date = toStringDate_1(date);
  if (isValidDate_1(date)) {
    if (offsetDay === staticStrFirst_1) {
      return new Date(helperGetDateFullYear_1(date), helperGetDateMonth_1(date) + monthNum, 1);
    } else if (offsetDay === staticStrLast_1) {
      return new Date(helperGetDateTime_1(getWhatMonth(date, monthNum + 1, staticStrFirst_1)) - 1);
    } else if (isNumber_1(offsetDay)) {
      date.setDate(offsetDay);
    }
    if (monthNum) {
      var currDate = date.getDate();
      date.setMonth(helperGetDateMonth_1(date) + monthNum);
      if (currDate !== date.getDate()) {
        // 当为指定天数，且被跨月了，则默认单月最后一天
        date.setDate(1);
        return new Date(helperGetDateTime_1(date) - staticDayTime_1);
      }
    }
  }
  return date;
}
var getWhatMonth_1 = getWhatMonth;

/**
  * 返回前几年或后几年的日期
  *
  * @param {Date} date 日期或数字
  * @param {Number} offset 年(默认当前年)、前几个年(数值)、后几个年(数值)
  * @param {Number/String} month 获取哪月(null默认当前年)、年初(first)、年末(last)、指定月份（0-11）
  * @return {Date}
  */
function getWhatYear(date, offset, month) {
  var number;
  date = toStringDate_1(date);
  if (isValidDate_1(date)) {
    if (offset) {
      number = offset && !isNaN(offset) ? offset : 0;
      date.setFullYear(helperGetDateFullYear_1(date) + number);
    }
    if (month || !isNaN(month)) {
      if (month === staticStrFirst_1) {
        return new Date(helperGetDateFullYear_1(date), 0, 1);
      } else if (month === staticStrLast_1) {
        date.setMonth(11);
        return getWhatMonth_1(date, 0, staticStrLast_1);
      } else {
        date.setMonth(month);
      }
    }
  }
  return date;
}
var getWhatYear_1 = getWhatYear;

function getQuarterNumber(date) {
  var month = date.getMonth();
  if (month < 3) {
    return 1;
  } else if (month < 6) {
    return 2;
  } else if (month < 9) {
    return 3;
  }
  return 4;
}

/**
  * 返回前几季度或后几季度的日期
  *
  * @param {Date} date 日期
  * @param {Number} offset 季度(默认当前季度)、前几季度、后几季度
  * @param {Number} day 获取哪天：月初(first)、月末(last)、指定天数(数值)，如果为空，但超过指定月份的天数时，则默认单月最后一天
  * @return {Date}
  */
function getWhatQuarter(date, offset, day) {
  var currMonth,
    monthOffset = offset && !isNaN(offset) ? offset * 3 : 0;
  date = toStringDate_1(date);
  if (isValidDate_1(date)) {
    currMonth = (getQuarterNumber(date) - 1) * 3;
    date.setMonth(currMonth);
    return getWhatMonth_1(date, monthOffset, day);
  }
  return date;
}
var getWhatQuarter_1 = getWhatQuarter;

/**
  * 返回前几天或后几天的日期
  *
  * @param {Date} date 日期或数字
  * @param {Number} offset 天(默认当天)、前几天、后几天
  * @param {String} mode 获取时分秒(null默认当前时分秒)、日初(first)、日末(last)
  * @return {Date}
  */
function getWhatDay(date, offset, mode) {
  date = toStringDate_1(date);
  if (isValidDate_1(date) && !isNaN(offset)) {
    date.setDate(date.getDate() + staticParseInt_1(offset));
    if (mode === staticStrFirst_1) {
      return new Date(helperGetDateFullYear_1(date), helperGetDateMonth_1(date), date.getDate());
    } else if (mode === staticStrLast_1) {
      return new Date(helperGetDateTime_1(getWhatDay(date, 1, staticStrFirst_1)) - 1);
    }
  }
  return date;
}
var getWhatDay_1 = getWhatDay;

function helperStringUpperCase(str) {
  return str.toUpperCase();
}
var helperStringUpperCase_1 = helperStringUpperCase;

var staticWeekTime = staticDayTime_1 * 7;
var staticWeekTime_1 = staticWeekTime;

/**
  * 返回前几周或后几周的星期几
  *
  * @param {Date} date 日期
  * @param {Number} offsetWeek 周(默认当前周)、前几周、后几周
  * @param {Number} offsetDay 星期天(默认0)、星期一(1)、星期二(2)、星期三(3)、星期四(4)、星期五(5)、星期六(6)
  * @param {Number} firstDay 周视图的起始天，默认星期一
  * @return {Date}
  */
function getWhatWeek(date, offsetWeek, offsetDay, firstDay) {
  date = toStringDate_1(date);
  if (isValidDate_1(date)) {
    var hasCustomDay = isNumber_1(offsetDay);
    var hasStartDay = isNumber_1(firstDay);
    var whatDayTime = helperGetDateTime_1(date);
    // 如果指定了天或周视图起始天
    if (hasCustomDay || hasStartDay) {
      var viewStartDay = hasStartDay ? firstDay : setupDefaults_1.firstDayOfWeek;
      var currentDay = date.getDay();
      var customDay = hasCustomDay ? offsetDay : currentDay;
      if (currentDay !== customDay) {
        var offsetNum = 0;
        if (viewStartDay > currentDay) {
          offsetNum = -(7 - viewStartDay + currentDay);
        } else if (viewStartDay < currentDay) {
          offsetNum = viewStartDay - currentDay;
        }
        if (customDay > viewStartDay) {
          whatDayTime += ((customDay === 0 ? 7 : customDay) - viewStartDay + offsetNum) * staticDayTime_1;
        } else if (customDay < viewStartDay) {
          whatDayTime += (7 - viewStartDay + customDay + offsetNum) * staticDayTime_1;
        } else {
          whatDayTime += offsetNum * staticDayTime_1;
        }
      }
    }
    if (offsetWeek && !isNaN(offsetWeek)) {
      whatDayTime += offsetWeek * staticWeekTime_1;
    }
    return new Date(whatDayTime);
  }
  return date;
}
var getWhatWeek_1 = getWhatWeek;

function helperCreateGetDateWeek(getStartDate) {
  return function (date, firstDay) {
    var viewStartDay = isNumber_1(firstDay) ? firstDay : setupDefaults_1.firstDayOfWeek;
    var targetDate = getWhatWeek_1(date, 0, viewStartDay, viewStartDay);
    if (isValidDate_1(targetDate)) {
      var targetOffsetDate = new Date(targetDate.getFullYear(), targetDate.getMonth(), targetDate.getDate());
      var targerStartDate = getStartDate(targetDate);
      var targetFirstDay = targerStartDate.getDay();
      if (targetFirstDay > viewStartDay) {
        targerStartDate.setDate(7 - targetFirstDay + viewStartDay + 1);
      }
      if (targetFirstDay < viewStartDay) {
        targerStartDate.setDate(viewStartDay - targetFirstDay + 1);
      }
      return Math.floor((helperGetDateTime_1(targetOffsetDate) - helperGetDateTime_1(targerStartDate)) / staticWeekTime_1 + 1);
    }
    return NaN;
  };
}
var helperCreateGetDateWeek_1 = helperCreateGetDateWeek;

/**
  * 返回某个年份的第几周
  *
  * @param {Date} date 日期或数字
  * @param {Number} firstDay 从年初的星期几为起始开始周开始算，默认星期一
  * @return {Number}
  */
var getYearWeek = helperCreateGetDateWeek_1(function (targetDate) {
  return new Date(targetDate.getFullYear(), 0, 1);
});
var getYearWeek_1 = getYearWeek;

function helperGetYMD(date) {
  return new Date(helperGetDateFullYear_1(date), helperGetDateMonth_1(date), date.getDate());
}
var helperGetYMD_1 = helperGetYMD;

function helperGetYMDTime(date) {
  return helperGetDateTime_1(helperGetYMD_1(date));
}
var helperGetYMDTime_1 = helperGetYMDTime;

/**
  * 返回某个年份的第几天
  *
  * @param {Date} date 日期或数字
  * @return {Number}
  */
function getYearDay(date) {
  date = toStringDate_1(date);
  if (isValidDate_1(date)) {
    return Math.floor((helperGetYMDTime_1(date) - helperGetYMDTime_1(getWhatYear_1(date, 0, staticStrFirst_1))) / staticDayTime_1) + 1;
  }
  return NaN;
}
var getYearDay_1 = getYearDay;

/**
  * 用指定字符从前面开始补全字符串
  *
  * @param {String} str 字符串
  * @param {Number} targetLength 结果长度
  * @param {Number} padString 补全字符
  * @return {String}
  */
function padStart(str, targetLength, padString) {
  var rest = toValueString_1(str);
  targetLength = targetLength >> 0;
  padString = isUndefined_1(padString) ? ' ' : '' + padString;
  if (rest.padStart) {
    return rest.padStart(targetLength, padString);
  }
  if (targetLength > rest.length) {
    targetLength -= rest.length;
    if (targetLength > padString.length) {
      padString += helperStringRepeat_1(padString, targetLength / padString.length);
    }
    return padString.slice(0, targetLength) + rest;
  }
  return rest;
}
var padStart_1 = padStart;

function handleCustomTemplate(date, formats, match, value) {
  var format = formats[match];
  if (format) {
    if (isFunction_1$1(format)) {
      return format(value, match, date);
    } else {
      return format[value];
    }
  }
  return value;
}
var dateFormatRE = /\[([^\]]+)]|y{2,4}|M{1,2}|d{1,2}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|S{1,3}|Z{1,2}|W{1,2}|D{1,3}|[aAeEq]/g;

/**
  * 日期格式化为字符串，转义符号 []
  *
  * @param {Date} date 日期或数字
  * @param {String} format 输出日期格式(年份(yy|yyyy)、月份(M|MM自动补0)、天(d|dd自动补0)、12小时制(h|hh自动补0)、24小时制(H|HH自动补0)、分钟(m|mm自动补0)、秒(s|ss自动补0)、毫秒(S|SSS自动补0)、D当年的第几天、a/A上午下午、e/E星期几、w当年的第几周、W当月的第几周、q当年第几个季度、Z时区)
  * @param {Object} options {formats: {q: ['日', '一', '二', '三', '四', '五', '六'], E: function (value, match, date) {return '三'}, }} 自定义格式化模板
  * @return {String}
  */
function toDateString(date, format, options) {
  if (date) {
    date = toStringDate_1(date);
    if (isValidDate_1(date)) {
      var result = format || setupDefaults_1.parseDateFormat || setupDefaults_1.formatString;
      var hours = date.getHours();
      var apm = hours < 12 ? 'am' : 'pm';
      var formats = assign_1({}, setupDefaults_1.parseDateRules || setupDefaults_1.formatStringMatchs, options ? options.formats : null);
      var fy = function (match, length) {
        return ('' + helperGetDateFullYear_1(date)).substr(4 - length);
      };
      var fM = function (match, length) {
        return padStart_1(helperGetDateMonth_1(date) + 1, length, '0');
      };
      var fd = function (match, length) {
        return padStart_1(date.getDate(), length, '0');
      };
      var fH = function (match, length) {
        return padStart_1(hours, length, '0');
      };
      var fh = function (match, length) {
        return padStart_1(hours <= 12 ? hours : hours - 12, length, '0');
      };
      var fm = function (match, length) {
        return padStart_1(date.getMinutes(), length, '0');
      };
      var fs = function (match, length) {
        return padStart_1(date.getSeconds(), length, '0');
      };
      var fS = function (match, length) {
        return padStart_1(date.getMilliseconds(), length, '0');
      };
      var fZ = function (match, length) {
        var zoneHours = date.getTimezoneOffset() / 60 * -1;
        return handleCustomTemplate(date, formats, match, (zoneHours >= 0 ? '+' : '-') + padStart_1(zoneHours, 2, '0') + (length === 1 ? ':' : '') + '00');
      };
      var fW = function (match, length) {
        return padStart_1(handleCustomTemplate(date, formats, match, getYearWeek_1(date, (options ? options.firstDay : null) || setupDefaults_1.firstDayOfWeek)), length, '0');
      };
      var fD = function (match, length) {
        return padStart_1(handleCustomTemplate(date, formats, match, getYearDay_1(date)), length, '0');
      };
      var parseDates = {
        yyyy: fy,
        yy: fy,
        MM: fM,
        M: fM,
        dd: fd,
        d: fd,
        HH: fH,
        H: fH,
        hh: fh,
        h: fh,
        mm: fm,
        m: fm,
        ss: fs,
        s: fs,
        SSS: fS,
        S: fS,
        ZZ: fZ,
        Z: fZ,
        WW: fW,
        W: fW,
        DDD: fD,
        D: fD,
        a: function (match) {
          return handleCustomTemplate(date, formats, match, apm);
        },
        A: function (match) {
          return handleCustomTemplate(date, formats, match, helperStringUpperCase_1(apm));
        },
        e: function (match) {
          return handleCustomTemplate(date, formats, match, date.getDay());
        },
        E: function (match) {
          return handleCustomTemplate(date, formats, match, date.getDay());
        },
        q: function (match) {
          return handleCustomTemplate(date, formats, match, Math.floor((helperGetDateMonth_1(date) + 3) / 3));
        }
      };
      return result.replace(dateFormatRE, function (match, skip) {
        return skip || (parseDates[match] ? parseDates[match](match, match.length) : match);
      });
    }
    return 'Invalid Date';
  }
  return '';
}
var toDateString_1 = toDateString;

/**
 * 返回当前时间戳
 *
 * @returns Number
 */
var now$1 = Date.now || function () {
  return helperGetDateTime_1(helperNewDate_1());
};
var now_1 = now$1;

/**
 * 将日期格式化为时间戳
 *
  * @param {String/Number/Date} str 日期或数字
  * @param {String} format 解析日期格式
 * @returns Number
 */
var timestamp = function (str, format) {
  if (str) {
    var date = toStringDate_1(str, format);
    return isDate_1(date) ? helperGetDateTime_1(date) : date;
  }
  return now_1();
};
var timestamp_1 = timestamp;

/**
 * 比较两个日期
 *
 * @param {Number/String/Date} date1 日期
 * @param {Number/String/Date} date2 日期
 * @param {String} format 对比格式
 */
function isDateSame(date1, date2, format) {
  if (date1 && date2) {
    date1 = toDateString_1(date1, format);
    return date1 !== 'Invalid Date' && date1 === toDateString_1(date2, format);
  }
  return false;
}
var isDateSame_1 = isDateSame;

/**
  * 返回某个月的第几周
  *
  * @param {Date} date 日期或数字
  * @param {Number} firstDay 周视图的起始天，默认星期一
  * @return {Number}
  */
var getMonthWeek = helperCreateGetDateWeek_1(function (targetDate) {
  return new Date(targetDate.getFullYear(), targetDate.getMonth(), 1);
});
var getMonthWeek_1 = getMonthWeek;

/**
  * 返回某个年份的天数
  *
  * @param {Date} date 日期或数字
  * @param {Number} offset 年(默认当年)、前几个年、后几个年
  * @return {Number}
  */
function getDayOfYear(date, year) {
  date = toStringDate_1(date);
  if (isValidDate_1(date)) {
    return isLeapYear_1(getWhatYear_1(date, year)) ? 366 : 365;
  }
  return NaN;
}
var getDayOfYear_1 = getDayOfYear;

/**
  * 返回某个月份的天数
  *
  * @param {Date} date 日期或数字
  * @param {Number} offset 月(默认当月)、前几个月、后几个月
  * @return {Number}
  */
function getDayOfMonth(date, month) {
  date = toStringDate_1(date);
  if (isValidDate_1(date)) {
    return Math.floor((helperGetDateTime_1(getWhatMonth_1(date, month, staticStrLast_1)) - helperGetDateTime_1(getWhatMonth_1(date, month, staticStrFirst_1))) / staticDayTime_1) + 1;
  }
  return NaN;
}
var getDayOfMonth_1 = getDayOfMonth;

var dateDiffRules = [['yyyy', 31536000000], ['MM', 2592000000], ['dd', 86400000], ['HH', 3600000], ['mm', 60000], ['ss', 1000], ['S', 0]];

/**
  * 返回两个日期之间差距,如果结束日期小于开始日期done为fasle
  *
  * @param {Date} startDate 开始日期
  * @param {Date} endDate 结束日期或当期日期
  * @return {Object}
  */
function getDateDiff(startDate, endDate) {
  var startTime, endTime, item, diffTime, len, index;
  var result = {
    done: false,
    time: 0
  };
  startDate = toStringDate_1(startDate);
  endDate = endDate ? toStringDate_1(endDate) : helperNewDate_1();
  if (isValidDate_1(startDate) && isValidDate_1(endDate)) {
    startTime = helperGetDateTime_1(startDate);
    endTime = helperGetDateTime_1(endDate);
    if (startTime < endTime) {
      diffTime = result.time = endTime - startTime;
      result.done = true;
      for (index = 0, len = dateDiffRules.length; index < len; index++) {
        item = dateDiffRules[index];
        if (diffTime >= item[1]) {
          if (index === len - 1) {
            result[item[0]] = diffTime || 0;
          } else {
            result[item[0]] = Math.floor(diffTime / item[1]);
            diffTime -= result[item[0]] * item[1];
          }
        } else {
          result[item[0]] = 0;
        }
      }
    }
  }
  return result;
}
var getDateDiff_1 = getDateDiff;

/**
  * 用指定字符从后面开始补全字符串
  *
  * @param {String} str 字符串
  * @param {Number} targetLength 结果长度
  * @param {Number} padString 补全字符
  * @return {String}
  */
function padEnd(str, targetLength, padString) {
  var rest = toValueString_1(str);
  targetLength = targetLength >> 0;
  padString = isUndefined_1(padString) ? ' ' : '' + padString;
  if (rest.padEnd) {
    return rest.padEnd(targetLength, padString);
  }
  if (targetLength > rest.length) {
    targetLength -= rest.length;
    if (targetLength > padString.length) {
      padString += helperStringRepeat_1(padString, targetLength / padString.length);
    }
    return rest + padString.slice(0, targetLength);
  }
  return rest;
}
var padEnd_1 = padEnd;

/**
  * 将字符串重复 n 次
  *
  * @param {String} str 字符串
  * @param {Number} count 次数
  * @return {String}
  */
function repeat(str, count) {
  return helperStringRepeat_1(toValueString_1(str), count);
}
var repeat_1 = repeat;

/**
  * 去除字符串右边的空格
  *
  * @param {String} str 字符串
  * @return {String}
  */
function trimRight$1(str) {
  return str && str.trimRight ? str.trimRight() : toValueString_1(str).replace(/[\s\uFEFF\xA0]+$/g, '');
}
var trimRight_1 = trimRight$1;

/**
  * 去除字符串左边的空格
  *
  * @param {String} str 字符串
  * @return {String}
  */
function trimLeft$1(str) {
  return str && str.trimLeft ? str.trimLeft() : toValueString_1(str).replace(/^[\s\uFEFF\xA0]+/g, '');
}
var trimLeft_1 = trimLeft$1;

/**
  * 去除字符串左右两边的空格
  *
  * @param {String} str 字符串
  * @return {String}
  */
function trim$1(str) {
  return str && str.trim ? str.trim() : trimRight_1(trimLeft_1(str));
}
var trim_1 = trim$1;

var staticEscapeMap = {
  '&': '&amp;',
  '<': '&lt;',
  '>': '&gt;',
  '"': '&quot;',
  "'": '&#x27;',
  '`': '&#x60;'
};
var staticEscapeMap_1 = staticEscapeMap;

function helperFormatEscaper(dataMap) {
  var replaceRegexp = new RegExp('(?:' + keys_1(dataMap).join('|') + ')', 'g');
  return function (str) {
    return toValueString_1(str).replace(replaceRegexp, function (match) {
      return dataMap[match];
    });
  };
}
var helperFormatEscaper_1 = helperFormatEscaper;

/**
  * 转义HTML字符串，替换&, <, >, ", ', `字符
  *
  * @param {String} str 字符串
  * @return {String}
  */
var escape$1 = helperFormatEscaper_1(staticEscapeMap_1);
var _escape = escape$1;

var unescapeMap = {};
each_1(staticEscapeMap_1, function (item, key) {
  unescapeMap[staticEscapeMap_1[key]] = key;
});

/**
  * 反转escape
  *
  * @param {String} str 字符串
  * @return {String}
  */
var unescape$1 = helperFormatEscaper_1(unescapeMap);
var _unescape = unescape$1;

function helperStringSubstring(str, start, end) {
  return str.substring(start, end);
}
var helperStringSubstring_1 = helperStringSubstring;

function helperStringLowerCase(str) {
  return str.toLowerCase();
}
var helperStringLowerCase_1 = helperStringLowerCase;

var camelCacheMaps = {};

/**
  * 将带字符串转成驼峰字符串,例如： project-name 转为 projectName
  *
  * @param {String} str 字符串
  * @return {String}
  */
function camelCase(str) {
  str = toValueString_1(str);
  if (camelCacheMaps[str]) {
    return camelCacheMaps[str];
  }
  var strLen = str.length;
  var rest = str.replace(/([-]+)/g, function (text, flag, index) {
    return index && index + flag.length < strLen ? '-' : '';
  });
  strLen = rest.length;
  rest = rest.replace(/([A-Z]+)/g, function (text, upper, index) {
    var upperLen = upper.length;
    upper = helperStringLowerCase_1(upper);
    if (index) {
      if (upperLen > 2 && index + upperLen < strLen) {
        return helperStringUpperCase_1(helperStringSubstring_1(upper, 0, 1)) + helperStringSubstring_1(upper, 1, upperLen - 1) + helperStringUpperCase_1(helperStringSubstring_1(upper, upperLen - 1, upperLen));
      }
      return helperStringUpperCase_1(helperStringSubstring_1(upper, 0, 1)) + helperStringSubstring_1(upper, 1, upperLen);
    } else {
      if (upperLen > 1 && index + upperLen < strLen) {
        return helperStringSubstring_1(upper, 0, upperLen - 1) + helperStringUpperCase_1(helperStringSubstring_1(upper, upperLen - 1, upperLen));
      }
    }
    return upper;
  }).replace(/(-[a-zA-Z])/g, function (text, upper) {
    return helperStringUpperCase_1(helperStringSubstring_1(upper, 1, upper.length));
  });
  camelCacheMaps[str] = rest;
  return rest;
}
var camelCase_1 = camelCase;

var kebabCacheMaps = {};

/**
  * 将带驼峰字符串转成字符串,例如： projectName 转为 project-name
  *
  * @param {String} str 字符串
  * @return {String}
  */
function kebabCase(str) {
  str = toValueString_1(str);
  if (kebabCacheMaps[str]) {
    return kebabCacheMaps[str];
  }
  if (/^[A-Z]+$/.test(str)) {
    return helperStringLowerCase_1(str);
  }
  var rest = str.replace(/^([a-z])([A-Z]+)([a-z]+)$/, function (text, prevLower, upper, nextLower) {
    var upperLen = upper.length;
    if (upperLen > 1) {
      return prevLower + '-' + helperStringLowerCase_1(helperStringSubstring_1(upper, 0, upperLen - 1)) + '-' + helperStringLowerCase_1(helperStringSubstring_1(upper, upperLen - 1, upperLen)) + nextLower;
    }
    return helperStringLowerCase_1(prevLower + '-' + upper + nextLower);
  }).replace(/^([A-Z]+)([a-z]+)?$/, function (text, upper, nextLower) {
    var upperLen = upper.length;
    return helperStringLowerCase_1(helperStringSubstring_1(upper, 0, upperLen - 1) + '-' + helperStringSubstring_1(upper, upperLen - 1, upperLen) + (nextLower || ''));
  }).replace(/([a-z]?)([A-Z]+)([a-z]?)/g, function (text, prevLower, upper, nextLower, index) {
    var upperLen = upper.length;
    if (upperLen > 1) {
      if (prevLower) {
        prevLower += '-';
      }
      if (nextLower) {
        return (prevLower || '') + helperStringLowerCase_1(helperStringSubstring_1(upper, 0, upperLen - 1)) + '-' + helperStringLowerCase_1(helperStringSubstring_1(upper, upperLen - 1, upperLen)) + nextLower;
      }
    }
    return (prevLower || '') + (index ? '-' : '') + helperStringLowerCase_1(upper) + (nextLower || '');
  });
  rest = rest.replace(/([-]+)/g, function (text, flag, index) {
    return index && index + flag.length < rest.length ? '-' : '';
  });
  kebabCacheMaps[str] = rest;
  return rest;
}
var kebabCase_1 = kebabCase;

/**
  * 判断字符串是否在源字符串的头部
  *
  * @param {String} str 字符串
  * @param {String/Number} val 值
  * @param {Number} startIndex 开始索引
  * @return {String}
  */
function startsWith$1(str, val, startIndex) {
  var rest = toValueString_1(str);
  return (arguments.length === 1 ? rest : rest.substring(startIndex)).indexOf(val) === 0;
}
var startsWith_1 = startsWith$1;

/**
  * 判断字符串是否在源字符串的尾部
  *
  * @param {String} str 字符串
  * @param {String/Number} val 值
  * @param {Number} startIndex 开始索引
  * @return {String}
  */
function endsWith(str, val, startIndex) {
  var rest = toValueString_1(str);
  var argsLen = arguments.length;
  return argsLen > 1 && (argsLen > 2 ? rest.substring(0, startIndex).indexOf(val) === startIndex - 1 : rest.indexOf(val) === rest.length - 1);
}
var endsWith_1 = endsWith;

/**
 * 解析动态字符串模板
 * @param {atring} str 字符串模板
 * @param {any | any[]} args 对象
 * @param {any} options 
 */
function template(str, args, options) {
  return toValueString_1(str).replace((options || setupDefaults_1).tmplRE || /\{{2}([.\w[\]\s]+)\}{2}/g, function (match, key) {
    return get_1(args, trim_1(key));
  });
}
var template_1 = template;

/**
 * 字符串格式化占位符
 * @param { string } str 
 * @param { object | any[] } obj 
 */
function toFormatString(str, obj) {
  return template_1(str, obj, {
    tmplRE: /\{([.\w[\]\s]+)\}/g
  });
}
var toFormatString_1 = toFormatString;

/**
 * 一个空的方法，始终返回 undefined，可用于初始化值
 */
function noop$4() {}
var noop_1 = noop$4;

/**
  * 创建一个绑定上下文的函数
  *
  * @param {Function} callback 函数
  * @param {Object} context 上下文
  * @param {*} args 额外的参数
  * @return {Object}
  */
function bind$1(callback, context) {
  var args = slice_1(arguments, 2);
  return function () {
    return callback.apply(context, slice_1(arguments).concat(args));
  };
}
var bind_1 = bind$1;

/**
  * 创建一个只能调用一次的函数,只会返回第一次执行后的结果
  *
  * @param {Function} callback 函数
  * @param {Object} context 上下文
  * @param {*} args 额外的参数
  * @return {Object}
  */
function once(callback, context) {
  var done = false;
  var rest = null;
  var args = slice_1(arguments, 2);
  return function () {
    if (done) {
      return rest;
    }
    rest = callback.apply(context, slice_1(arguments).concat(args));
    done = true;
    return rest;
  };
}
var once_1 = once;

/**
  * 创建一个函数, 调用次数超过 count 次之后执行回调并将所有结果记住后返回
  *
  * @param {Number} count 调用次数
  * @param {Function} callback 完成回调
  * @return {Object}
  */
function after(count, callback, context) {
  var runCount = 0;
  var rests = [];
  return function () {
    var args = arguments;
    runCount++;
    if (runCount <= count) {
      rests.push(args[0]);
    }
    if (runCount >= count) {
      callback.apply(context, [rests].concat(slice_1(args)));
    }
  };
}
var after_1 = after;

/**
  * 创建一个函数, 调用次数不超过 count 次之前执行回调并将所有结果记住后返回
  *
  * @param {Number} count 调用次数
  * @param {Function} callback 完成回调
  * @return {Object}
  */
function before$1(count, callback, context) {
  var runCount = 0;
  var rests = [];
  context = context || this;
  return function () {
    var args = arguments;
    runCount++;
    if (runCount < count) {
      rests.push(args[0]);
      callback.apply(context, [rests].concat(slice_1(args)));
    }
  };
}
var before_1 = before$1;

/**
  * 节流函数；当被调用 n 毫秒后才会执行，如果在这时间内又被调用则至少每隔 n 秒毫秒调用一次该函数
  *
  * @param {Function} callback 回调
  * @param {Number} wait 多少秒毫
  * @param {Object} options 参数{leading: 是否在之前执行, trailing: 是否在之后执行}
  * @return {Function}
  */
function throttle$1(callback, wait, options) {
  var args = null;
  var context = null;
  var opts = options || {};
  var runFlag = false;
  var timeout = null;
  var optLeading = 'leading' in opts ? opts.leading : true;
  var optTrailing = 'trailing' in opts ? opts.trailing : false;
  var gcFn = function () {
    args = null;
    context = null;
  };
  var runFn = function () {
    runFlag = true;
    callback.apply(context, args);
    timeout = setTimeout(endFn, wait);
    gcFn();
  };
  var endFn = function () {
    timeout = null;
    if (!runFlag && optTrailing === true) {
      runFn();
    }
  };
  var cancelFn = function () {
    var rest = timeout !== null;
    if (rest) {
      clearTimeout(timeout);
    }
    gcFn();
    timeout = null;
    runFlag = false;
    return rest;
  };
  var throttled = function () {
    args = arguments;
    context = this;
    runFlag = false;
    if (timeout === null) {
      if (optLeading === true) {
        runFn();
      } else if (optTrailing === true) {
        timeout = setTimeout(endFn, wait);
      }
    }
  };
  throttled.cancel = cancelFn;
  return throttled;
}
var throttle_1 = throttle$1;

/**
  * 函数去抖；当被调用 n 毫秒后才会执行，如果在这时间内又被调用则将重新计算执行时间
  *
  * @param {Function} callback 回调
  * @param {Number} wait 多少秒毫
  * @param {Object} options 参数{leading: 是否在之前执行, trailing: 是否在之后执行}
  * @return {Function}
  */
function debounce$3(callback, wait, options) {
  var args = null;
  var context = null;
  var opts = options || {};
  var runFlag = false;
  var timeout = null;
  var isLeading = typeof options === 'boolean';
  var optLeading = 'leading' in opts ? opts.leading : isLeading;
  var optTrailing = 'trailing' in opts ? opts.trailing : !isLeading;
  var gcFn = function () {
    args = null;
    context = null;
  };
  var runFn = function () {
    runFlag = true;
    callback.apply(context, args);
    gcFn();
  };
  var endFn = function () {
    if (optLeading === true) {
      timeout = null;
    }
    if (!runFlag && optTrailing === true) {
      runFn();
    }
  };
  var cancelFn = function () {
    var rest = timeout !== null;
    if (rest) {
      clearTimeout(timeout);
    }
    gcFn();
    timeout = null;
    runFlag = false;
    return rest;
  };
  var debounced = function () {
    runFlag = false;
    args = arguments;
    context = this;
    if (timeout === null) {
      if (optLeading === true) {
        runFn();
      }
    } else {
      clearTimeout(timeout);
    }
    timeout = setTimeout(endFn, wait);
  };
  debounced.cancel = cancelFn;
  return debounced;
}
var debounce_1 = debounce$3;

/**
  * 该方法和 setTimeout 一样的效果，区别就是支持上下文和额外参数
  *
  * @param {Function} callback 函数
  * @param {Number} wait 延迟毫秒
  * @param {*} args 额外的参数
  * @return {Number}
 */
function delay(callback, wait) {
  var args = slice_1(arguments, 2);
  var context = this;
  return setTimeout(function () {
    callback.apply(context, args);
  }, wait);
}
var delay_1 = delay;

var staticDecodeURIComponent = decodeURIComponent;
var staticDecodeURIComponent_1 = staticDecodeURIComponent;

/**
 * 反序列化查询参数
 * @param {String} query 字符串
 */
function unserialize(str) {
  var items;
  var result = {};
  if (str && isString_1(str)) {
    arrayEach_1(str.split('&'), function (param) {
      items = param.split('=');
      result[staticDecodeURIComponent_1(items[0])] = staticDecodeURIComponent_1(items[1] || '');
    });
  }
  return result;
}
var unserialize_1 = unserialize;

var staticEncodeURIComponent = encodeURIComponent;
var staticEncodeURIComponent_1 = staticEncodeURIComponent;

function stringifyParams(resultVal, resultKey, isArr) {
  var _arr;
  var result = [];
  each_1(resultVal, function (item, key) {
    _arr = isArray_1(item);
    if (isPlainObject_1(item) || _arr) {
      result = result.concat(stringifyParams(item, resultKey + '[' + key + ']', _arr));
    } else {
      result.push(staticEncodeURIComponent_1(resultKey + '[' + (isArr ? '' : key) + ']') + '=' + staticEncodeURIComponent_1(isNull_1(item) ? '' : item));
    }
  });
  return result;
}

/**
 * 序列化查询参数
 *
 * @param {Object} query 查询参数
 */
function serialize$1(query) {
  var _arr;
  var params = [];
  each_1(query, function (item, key) {
    if (!isUndefined_1(item)) {
      _arr = isArray_1(item);
      if (isPlainObject_1(item) || _arr) {
        params = params.concat(stringifyParams(item, key, _arr));
      } else {
        params.push(staticEncodeURIComponent_1(key) + '=' + staticEncodeURIComponent_1(isNull_1(item) ? '' : item));
      }
    }
  });
  return params.join('&').replace(/%20/g, '+');
}
var serialize_1 = serialize$1;

/* eslint-disable valid-typeof */
var staticLocation = typeof location === staticStrUndefined_1 ? 0 : location;
var staticLocation_1 = staticLocation;

function helperGetLocatOrigin() {
  return staticLocation_1 ? staticLocation_1.origin || staticLocation_1.protocol + '//' + staticLocation_1.host : '';
}
var helperGetLocatOrigin_1 = helperGetLocatOrigin;

function parseURLQuery(uri) {
  return unserialize_1(uri.split('?')[1] || '');
}
function parseUrl$1(url) {
  var hashs, portText, searchs, parsed;
  var href = '' + url;
  if (href.indexOf('//') === 0) {
    href = (staticLocation_1 ? staticLocation_1.protocol : '') + href;
  } else if (href.indexOf('/') === 0) {
    href = helperGetLocatOrigin_1() + href;
  }
  searchs = href.replace(/#.*/, '').match(/(\?.*)/);
  parsed = {
    href: href,
    hash: '',
    host: '',
    hostname: '',
    protocol: '',
    port: '',
    search: searchs && searchs[1] && searchs[1].length > 1 ? searchs[1] : ''
  };
  parsed.path = href.replace(/^([a-z0-9.+-]*:)\/\//, function (text, protocol) {
    parsed.protocol = protocol;
    return '';
  }).replace(/^([a-z0-9.+-]*)(:\d+)?\/?/, function (text, hostname, port) {
    portText = port || '';
    parsed.port = portText.replace(':', '');
    parsed.hostname = hostname;
    parsed.host = hostname + portText;
    return '/';
  }).replace(/(#.*)/, function (text, hash) {
    parsed.hash = hash.length > 1 ? hash : '';
    return '';
  });
  hashs = parsed.hash.match(/#((.*)\?|(.*))/);
  parsed.pathname = parsed.path.replace(/(\?|#.*).*/, '');
  parsed.origin = parsed.protocol + '//' + parsed.host;
  parsed.hashKey = hashs ? hashs[2] || hashs[1] || '' : '';
  parsed.hashQuery = parseURLQuery(parsed.hash);
  parsed.searchQuery = parseURLQuery(parsed.search);
  return parsed;
}
var parseUrl_1 = parseUrl$1;

function getBaseURL() {
  if (staticLocation_1) {
    var pathname = staticLocation_1.pathname;
    var lastIndex = lastIndexOf_1(pathname, '/') + 1;
    return helperGetLocatOrigin_1() + (lastIndex === pathname.length ? pathname : pathname.substring(0, lastIndex));
  }
  return '';
}
var getBaseURL_1 = getBaseURL;

/**
  * 获取地址栏信息
  *
  * @return Object
  */
function locat() {
  return staticLocation_1 ? parseUrl_1(staticLocation_1.href) : {};
}
var locat_1 = locat;

function toCookieUnitTime(unit, expires) {
  var num = parseFloat(expires);
  var nowdate = helperNewDate_1();
  var time = helperGetDateTime_1(nowdate);
  switch (unit) {
    case 'y':
      return helperGetDateTime_1(getWhatYear_1(nowdate, num));
    case 'M':
      return helperGetDateTime_1(getWhatMonth_1(nowdate, num));
    case 'd':
      return helperGetDateTime_1(getWhatDay_1(nowdate, num));
    case 'h':
    case 'H':
      return time + num * 60 * 60 * 1000;
    case 'm':
      return time + num * 60 * 1000;
    case 's':
      return time + num * 1000;
  }
  return time;
}
function toCookieUTCString(date) {
  return (isDate_1(date) ? date : new Date(date)).toUTCString();
}

/**
  * cookie操作函数
  * @param {String/Array/Object} name 键/数组/对象
  * @param {String} value 值
  * @param {Object} options 参数
  *   @param {String} name: 键
  *   @param {Object} value: 值
  *   @param {String} path: 路径
  *   @param {String} domain: 作用域
  *   @param {Boolean} secure: 设置为安全的,只能用https协议
  *   @param {Number} expires: 过期时间,可以指定日期或者字符串，默认天
  */
function cookie(name, value, options) {
  if (staticDocument_1) {
    var opts, expires, values, result, cookies, keyIndex;
    var inserts = [];
    var args = arguments;
    if (isArray_1(name)) {
      inserts = name;
    } else if (args.length > 1) {
      inserts = [assign_1({
        name: name,
        value: value
      }, options)];
    } else if (isObject_1(name)) {
      inserts = [name];
    }
    if (inserts.length > 0) {
      arrayEach_1(inserts, function (obj) {
        opts = assign_1({}, setupDefaults_1.cookies, obj);
        values = [];
        if (opts.name) {
          expires = opts.expires;
          values.push(staticEncodeURIComponent_1(opts.name) + '=' + staticEncodeURIComponent_1(isObject_1(opts.value) ? JSON.stringify(opts.value) : opts.value));
          if (expires) {
            if (isNaN(expires)) {
              // UTCString || Unit
              expires = expires.replace(/^([0-9]+)(y|M|d|H|h|m|s)$/, function (text, num, unit) {
                return toCookieUTCString(toCookieUnitTime(unit, num));
              });
            } else if (/^[0-9]{11,13}$/.test(expires) || isDate_1(expires)) {
              // Date || now
              expires = toCookieUTCString(expires);
            } else {
              // day
              expires = toCookieUTCString(toCookieUnitTime('d', expires));
            }
            opts.expires = expires;
          }
          arrayEach_1(['expires', 'path', 'domain', 'secure'], function (key) {
            if (!isUndefined_1(opts[key])) {
              values.push(opts[key] && key === 'secure' ? key : key + '=' + opts[key]);
            }
          });
        }
        staticDocument_1.cookie = values.join('; ');
      });
      return true;
    } else {
      result = {};
      cookies = staticDocument_1.cookie;
      if (cookies) {
        arrayEach_1(cookies.split('; '), function (val) {
          keyIndex = val.indexOf('=');
          result[staticDecodeURIComponent_1(val.substring(0, keyIndex))] = staticDecodeURIComponent_1(val.substring(keyIndex + 1) || '');
        });
      }
      return args.length === 1 ? result[name] : result;
    }
  }
  return false;
}
function hasCookieItem(value) {
  return includes_1(cookieKeys(), value);
}
function getCookieItem(name) {
  return cookie(name);
}
function setCookieItem(name, value, options) {
  cookie(name, value, options);
  return cookie;
}
function removeCookieItem(name, options) {
  cookie(name, '', assign_1({
    expires: -1
  }, setupDefaults_1.cookies, options));
}
function cookieKeys() {
  return keys_1(cookie());
}
function cookieJson() {
  return cookie();
}
assign_1(cookie, {
  has: hasCookieItem,
  set: setCookieItem,
  setItem: setCookieItem,
  get: getCookieItem,
  getItem: getCookieItem,
  remove: removeCookieItem,
  removeItem: removeCookieItem,
  keys: cookieKeys,
  getJSON: cookieJson
});
var cookie_1 = cookie;

/* eslint-disable valid-typeof */
function isBrowseStorage(storage) {
  try {
    var testKey = '__xe_t';
    storage.setItem(testKey, 1);
    storage.removeItem(testKey);
    return true;
  } catch (e) {
    return false;
  }
}
function isBrowseType(type) {
  return navigator.userAgent.indexOf(type) > -1;
}

/**
  * 获取浏览器内核
  * @return Object
  */
function browse() {
  var $body, isChrome, isEdge;
  var isMobile = false;
  var isLocalStorage = false;
  var isSessionStorage = false;
  var result = {
    isNode: false,
    isMobile: isMobile,
    isPC: false,
    isDoc: !!staticDocument_1
  };
  if (!staticWindow_1 && typeof process !== staticStrUndefined_1) {
    result.isNode = true;
  } else {
    isEdge = isBrowseType('Edge');
    isChrome = isBrowseType('Chrome');
    isMobile = /(Android|webOS|iPhone|iPad|iPod|SymbianOS|BlackBerry|Windows Phone)/.test(navigator.userAgent);
    if (result.isDoc) {
      $body = staticDocument_1.body || staticDocument_1.documentElement;
      arrayEach_1(['webkit', 'khtml', 'moz', 'ms', 'o'], function (core) {
        result['-' + core] = !!$body[core + 'MatchesSelector'];
      });
    }
    try {
      isLocalStorage = isBrowseStorage(staticWindow_1.localStorage);
    } catch (e) {}
    try {
      isSessionStorage = isBrowseStorage(staticWindow_1.sessionStorage);
    } catch (e) {}
    assign_1(result, {
      edge: isEdge,
      firefox: isBrowseType('Firefox'),
      msie: !isEdge && result['-ms'],
      safari: !isChrome && !isEdge && isBrowseType('Safari'),
      isMobile: isMobile,
      isPC: !isMobile,
      isLocalStorage: isLocalStorage,
      isSessionStorage: isSessionStorage
    });
  }
  return result;
}
var browse_1 = browse;

// 核心


// 对象相关的方法






// 数组相关的方法






































// 基础方法

































































// 数值相关方法


















// 日期相关的方法


















// 字符串相关的方法
















// 函数相关的方法










// 地址相关的方法




// 浏览器相关的方法




assign_1(ctor, {
  // object
  assign: assign_1,
  objectEach: objectEach_1,
  lastObjectEach: lastObjectEach_1,
  objectMap: objectMap_1,
  merge: merge_1,
  // array
  uniq: uniq_1,
  union: union_1,
  sortBy: sortBy_1,
  orderBy: orderBy_1,
  shuffle: shuffle_1,
  sample: sample_1,
  some: some_1,
  every: every_1,
  slice: slice_1,
  filter: filter_1,
  find: find_1,
  findLast: findLast_1,
  findKey: findKey_1,
  includes: includes_1,
  arrayIndexOf: arrayIndexOf_1,
  arrayLastIndexOf: arrayLastIndexOf_1,
  map: map_1,
  reduce: reduce_1,
  copyWithin: copyWithin_1,
  chunk: chunk_1,
  zip: zip_1,
  unzip: unzip_1,
  zipObject: zipObject_1,
  flatten: flatten_1,
  toArray: toArray_1,
  includeArrays: includeArrays_1,
  pluck: pluck_1,
  invoke: invoke_1,
  arrayEach: arrayEach_1,
  lastArrayEach: lastArrayEach_1,
  toArrayTree: toArrayTree_1,
  toTreeArray: toTreeArray_1,
  findTree: findTree_1,
  eachTree: eachTree_1,
  mapTree: mapTree_1,
  filterTree: filterTree_1,
  searchTree: searchTree_1,
  // base
  hasOwnProp: hasOwnProp_1,
  eqNull: eqNull_1,
  isNaN: _isNaN,
  isFinite: _isFinite,
  isUndefined: isUndefined_1,
  isArray: isArray_1,
  isFloat: isFloat_1,
  isInteger: isInteger_1,
  isFunction: isFunction_1$1,
  isBoolean: isBoolean_1,
  isString: isString_1,
  isNumber: isNumber_1,
  isRegExp: isRegExp_1,
  isObject: isObject_1,
  isPlainObject: isPlainObject_1,
  isDate: isDate_1,
  isError: isError_1,
  isTypeError: isTypeError_1,
  isEmpty: isEmpty_1,
  isNull: isNull_1,
  isSymbol: isSymbol_1,
  isArguments: isArguments_1,
  isElement: isElement_1,
  isDocument: isDocument_1,
  isWindow: isWindow_1,
  isFormData: isFormData_1,
  isMap: isMap_1,
  isWeakMap: isWeakMap_1,
  isSet: isSet_1,
  isWeakSet: isWeakSet_1,
  isLeapYear: isLeapYear_1,
  isMatch: isMatch_1,
  isEqual: isEqual_1,
  isEqualWith: isEqualWith_1,
  getType: getType_1,
  uniqueId: uniqueId_1,
  getSize: getSize_1,
  indexOf: indexOf_1,
  lastIndexOf: lastIndexOf_1,
  findIndexOf: findIndexOf_1,
  findLastIndexOf: findLastIndexOf_1,
  toStringJSON: toStringJSON_1,
  toJSONString: toJSONString_1,
  keys: keys_1,
  values: values_1,
  entries: entries_1,
  pick: pick_1,
  omit: omit_1,
  first: first_1,
  last: last_1,
  each: each_1,
  forOf: forOf_1,
  lastForOf: lastForOf_1,
  lastEach: lastEach_1,
  has: has_1,
  get: get_1,
  set: set_1,
  groupBy: groupBy_1,
  countBy: countBy_1,
  clone: clone_1,
  clear: clear_1,
  remove: remove_1,
  range: range_1,
  destructuring: destructuring_1,
  // number
  random: random_1,
  min: min_1,
  max: max_1,
  commafy: commafy_1,
  round: round_1,
  ceil: ceil_1,
  floor: floor_1,
  toFixed: toFixed_1,
  toNumber: toNumber_1,
  toNumberString: toNumberString_1,
  toInteger: toInteger_1,
  add: add_1,
  subtract: subtract_1,
  multiply: multiply_1,
  divide: divide_1,
  sum: sum_1,
  mean: mean_1,
  // date
  now: now_1,
  timestamp: timestamp_1,
  isValidDate: isValidDate_1,
  isDateSame: isDateSame_1,
  toStringDate: toStringDate_1,
  toDateString: toDateString_1,
  getWhatYear: getWhatYear_1,
  getWhatQuarter: getWhatQuarter_1,
  getWhatMonth: getWhatMonth_1,
  getWhatWeek: getWhatWeek_1,
  getWhatDay: getWhatDay_1,
  getYearDay: getYearDay_1,
  getYearWeek: getYearWeek_1,
  getMonthWeek: getMonthWeek_1,
  getDayOfYear: getDayOfYear_1,
  getDayOfMonth: getDayOfMonth_1,
  getDateDiff: getDateDiff_1,
  // string
  trim: trim_1,
  trimLeft: trimLeft_1,
  trimRight: trimRight_1,
  escape: _escape,
  unescape: _unescape,
  camelCase: camelCase_1,
  kebabCase: kebabCase_1,
  repeat: repeat_1,
  padStart: padStart_1,
  padEnd: padEnd_1,
  startsWith: startsWith_1,
  endsWith: endsWith_1,
  template: template_1,
  toFormatString: toFormatString_1,
  toString: toValueString_1,
  toValueString: toValueString_1,
  // function
  noop: noop_1,
  property: property_1,
  bind: bind_1,
  once: once_1,
  after: after_1,
  before: before_1,
  throttle: throttle_1,
  debounce: debounce_1,
  delay: delay_1,
  // url
  unserialize: unserialize_1,
  serialize: serialize_1,
  parseUrl: parseUrl_1,
  // web
  getBaseURL: getBaseURL_1,
  locat: locat_1,
  browse: browse_1,
  cookie: cookie_1
});
var xeUtils = ctor;

var prism = createCommonjsModule(function (module) {
/* **********************************************
     Begin prism-core.js
********************************************** */

/// <reference lib="WebWorker"/>

var _self = typeof window !== 'undefined' ? window // if in browser
: typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ? self // if in worker
: {} // if in node js
;

/**
 * Prism: Lightweight, robust, elegant syntax highlighting
 *
 * @license MIT <https://opensource.org/licenses/MIT>
 * @author Lea Verou <https://lea.verou.me>
 * @namespace
 * @public
 */
var Prism = function (_self) {
  // Private helper vars
  var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
  var uniqueId = 0;

  // The grammar object for plaintext
  var plainTextGrammar = {};
  var _ = {
    /**
     * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
     * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
     * additional languages or plugins yourself.
     *
     * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
     *
     * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
     * empty Prism object into the global scope before loading the Prism script like this:
     *
     * ```js
     * window.Prism = window.Prism || {};
     * Prism.manual = true;
     * // add a new <script> to load Prism's script
     * ```
     *
     * @default false
     * @type {boolean}
     * @memberof Prism
     * @public
     */
    manual: _self.Prism && _self.Prism.manual,
    /**
     * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
     * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
     * own worker, you don't want it to do this.
     *
     * By setting this value to `true`, Prism will not add its own listeners to the worker.
     *
     * You obviously have to change this value before Prism executes. To do this, you can add an
     * empty Prism object into the global scope before loading the Prism script like this:
     *
     * ```js
     * window.Prism = window.Prism || {};
     * Prism.disableWorkerMessageHandler = true;
     * // Load Prism's script
     * ```
     *
     * @default false
     * @type {boolean}
     * @memberof Prism
     * @public
     */
    disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
    /**
     * A namespace for utility methods.
     *
     * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
     * change or disappear at any time.
     *
     * @namespace
     * @memberof Prism
     */
    util: {
      encode: function encode(tokens) {
        if (tokens instanceof Token) {
          return new Token(tokens.type, encode(tokens.content), tokens.alias);
        } else if (Array.isArray(tokens)) {
          return tokens.map(encode);
        } else {
          return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
        }
      },
      /**
       * Returns the name of the type of the given value.
       *
       * @param {any} o
       * @returns {string}
       * @example
       * type(null)      === 'Null'
       * type(undefined) === 'Undefined'
       * type(123)       === 'Number'
       * type('foo')     === 'String'
       * type(true)      === 'Boolean'
       * type([1, 2])    === 'Array'
       * type({})        === 'Object'
       * type(String)    === 'Function'
       * type(/abc+/)    === 'RegExp'
       */
      type: function (o) {
        return Object.prototype.toString.call(o).slice(8, -1);
      },
      /**
       * Returns a unique number for the given object. Later calls will still return the same number.
       *
       * @param {Object} obj
       * @returns {number}
       */
      objId: function (obj) {
        if (!obj['__id']) {
          Object.defineProperty(obj, '__id', {
            value: ++uniqueId
          });
        }
        return obj['__id'];
      },
      /**
       * Creates a deep clone of the given object.
       *
       * The main intended use of this function is to clone language definitions.
       *
       * @param {T} o
       * @param {Record<number, any>} [visited]
       * @returns {T}
       * @template T
       */
      clone: function deepClone(o, visited) {
        visited = visited || {};
        var clone;
        var id;
        switch (_.util.type(o)) {
          case 'Object':
            id = _.util.objId(o);
            if (visited[id]) {
              return visited[id];
            }
            clone = /** @type {Record<string, any>} */{};
            visited[id] = clone;
            for (var key in o) {
              if (o.hasOwnProperty(key)) {
                clone[key] = deepClone(o[key], visited);
              }
            }
            return /** @type {any} */clone;
          case 'Array':
            id = _.util.objId(o);
            if (visited[id]) {
              return visited[id];
            }
            clone = [];
            visited[id] = clone;
            ( /** @type {Array} */ /** @type {any} */o).forEach(function (v, i) {
              clone[i] = deepClone(v, visited);
            });
            return /** @type {any} */clone;
          default:
            return o;
        }
      },
      /**
       * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
       *
       * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
       *
       * @param {Element} element
       * @returns {string}
       */
      getLanguage: function (element) {
        while (element) {
          var m = lang.exec(element.className);
          if (m) {
            return m[1].toLowerCase();
          }
          element = element.parentElement;
        }
        return 'none';
      },
      /**
       * Sets the Prism `language-xxxx` class of the given element.
       *
       * @param {Element} element
       * @param {string} language
       * @returns {void}
       */
      setLanguage: function (element, language) {
        // remove all `language-xxxx` classes
        // (this might leave behind a leading space)
        element.className = element.className.replace(RegExp(lang, 'gi'), '');

        // add the new `language-xxxx` class
        // (using `classList` will automatically clean up spaces for us)
        element.classList.add('language-' + language);
      },
      /**
       * Returns the script element that is currently executing.
       *
       * This does __not__ work for line script element.
       *
       * @returns {HTMLScriptElement | null}
       */
      currentScript: function () {
        if (typeof document === 'undefined') {
          return null;
        }
        if ('currentScript' in document && 1 < 2 /* hack to trip TS' flow analysis */) {
          return /** @type {any} */document.currentScript;
        }

        // IE11 workaround
        // we'll get the src of the current script by parsing IE11's error stack trace
        // this will not work for inline scripts

        try {
          throw new Error();
        } catch (err) {
          // Get file src url from stack. Specifically works with the format of stack traces in IE.
          // A stack will look like this:
          //
          // Error
          //    at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
          //    at Global code (http://localhost/components/prism-core.js:606:1)

          var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
          if (src) {
            var scripts = document.getElementsByTagName('script');
            for (var i in scripts) {
              if (scripts[i].src == src) {
                return scripts[i];
              }
            }
          }
          return null;
        }
      },
      /**
       * Returns whether a given class is active for `element`.
       *
       * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
       * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
       * given class is just the given class with a `no-` prefix.
       *
       * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
       * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
       * ancestors have the given class or the negated version of it, then the default activation will be returned.
       *
       * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
       * version of it, the class is considered active.
       *
       * @param {Element} element
       * @param {string} className
       * @param {boolean} [defaultActivation=false]
       * @returns {boolean}
       */
      isActive: function (element, className, defaultActivation) {
        var no = 'no-' + className;
        while (element) {
          var classList = element.classList;
          if (classList.contains(className)) {
            return true;
          }
          if (classList.contains(no)) {
            return false;
          }
          element = element.parentElement;
        }
        return !!defaultActivation;
      }
    },
    /**
     * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
     *
     * @namespace
     * @memberof Prism
     * @public
     */
    languages: {
      /**
       * The grammar for plain, unformatted text.
       */
      plain: plainTextGrammar,
      plaintext: plainTextGrammar,
      text: plainTextGrammar,
      txt: plainTextGrammar,
      /**
       * Creates a deep copy of the language with the given id and appends the given tokens.
       *
       * If a token in `redef` also appears in the copied language, then the existing token in the copied language
       * will be overwritten at its original position.
       *
       * ## Best practices
       *
       * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
       * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
       * understand the language definition because, normally, the order of tokens matters in Prism grammars.
       *
       * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
       * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
       *
       * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
       * @param {Grammar} redef The new tokens to append.
       * @returns {Grammar} The new language created.
       * @public
       * @example
       * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
       *     // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
       *     // at its original position
       *     'comment': { ... },
       *     // CSS doesn't have a 'color' token, so this token will be appended
       *     'color': /\b(?:red|green|blue)\b/
       * });
       */
      extend: function (id, redef) {
        var lang = _.util.clone(_.languages[id]);
        for (var key in redef) {
          lang[key] = redef[key];
        }
        return lang;
      },
      /**
       * Inserts tokens _before_ another token in a language definition or any other grammar.
       *
       * ## Usage
       *
       * This helper method makes it easy to modify existing languages. For example, the CSS language definition
       * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
       * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
       * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
       * this:
       *
       * ```js
       * Prism.languages.markup.style = {
       *     // token
       * };
       * ```
       *
       * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
       * before existing tokens. For the CSS example above, you would use it like this:
       *
       * ```js
       * Prism.languages.insertBefore('markup', 'cdata', {
       *     'style': {
       *         // token
       *     }
       * });
       * ```
       *
       * ## Special cases
       *
       * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
       * will be ignored.
       *
       * This behavior can be used to insert tokens after `before`:
       *
       * ```js
       * Prism.languages.insertBefore('markup', 'comment', {
       *     'comment': Prism.languages.markup.comment,
       *     // tokens after 'comment'
       * });
       * ```
       *
       * ## Limitations
       *
       * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
       * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
       * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
       * deleting properties which is necessary to insert at arbitrary positions.
       *
       * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
       * Instead, it will create a new object and replace all references to the target object with the new one. This
       * can be done without temporarily deleting properties, so the iteration order is well-defined.
       *
       * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
       * you hold the target object in a variable, then the value of the variable will not change.
       *
       * ```js
       * var oldMarkup = Prism.languages.markup;
       * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
       *
       * assert(oldMarkup !== Prism.languages.markup);
       * assert(newMarkup === Prism.languages.markup);
       * ```
       *
       * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
       * object to be modified.
       * @param {string} before The key to insert before.
       * @param {Grammar} insert An object containing the key-value pairs to be inserted.
       * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
       * object to be modified.
       *
       * Defaults to `Prism.languages`.
       * @returns {Grammar} The new grammar object.
       * @public
       */
      insertBefore: function (inside, before, insert, root) {
        root = root || ( /** @type {any} */_.languages);
        var grammar = root[inside];
        /** @type {Grammar} */
        var ret = {};
        for (var token in grammar) {
          if (grammar.hasOwnProperty(token)) {
            if (token == before) {
              for (var newToken in insert) {
                if (insert.hasOwnProperty(newToken)) {
                  ret[newToken] = insert[newToken];
                }
              }
            }

            // Do not insert token which also occur in insert. See #1525
            if (!insert.hasOwnProperty(token)) {
              ret[token] = grammar[token];
            }
          }
        }
        var old = root[inside];
        root[inside] = ret;

        // Update references in other language definitions
        _.languages.DFS(_.languages, function (key, value) {
          if (value === old && key != inside) {
            this[key] = ret;
          }
        });
        return ret;
      },
      // Traverse a language definition with Depth First Search
      DFS: function DFS(o, callback, type, visited) {
        visited = visited || {};
        var objId = _.util.objId;
        for (var i in o) {
          if (o.hasOwnProperty(i)) {
            callback.call(o, i, o[i], type || i);
            var property = o[i];
            var propertyType = _.util.type(property);
            if (propertyType === 'Object' && !visited[objId(property)]) {
              visited[objId(property)] = true;
              DFS(property, callback, null, visited);
            } else if (propertyType === 'Array' && !visited[objId(property)]) {
              visited[objId(property)] = true;
              DFS(property, callback, i, visited);
            }
          }
        }
      }
    },
    plugins: {},
    /**
     * This is the most high-level function in Prism’s API.
     * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
     * each one of them.
     *
     * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
     *
     * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
     * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
     * @memberof Prism
     * @public
     */
    highlightAll: function (async, callback) {
      _.highlightAllUnder(document, async, callback);
    },
    /**
     * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
     * {@link Prism.highlightElement} on each one of them.
     *
     * The following hooks will be run:
     * 1. `before-highlightall`
     * 2. `before-all-elements-highlight`
     * 3. All hooks of {@link Prism.highlightElement} for each element.
     *
     * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
     * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
     * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
     * @memberof Prism
     * @public
     */
    highlightAllUnder: function (container, async, callback) {
      var env = {
        callback: callback,
        container: container,
        selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
      };
      _.hooks.run('before-highlightall', env);
      env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
      _.hooks.run('before-all-elements-highlight', env);
      for (var i = 0, element; element = env.elements[i++];) {
        _.highlightElement(element, async === true, env.callback);
      }
    },
    /**
     * Highlights the code inside a single element.
     *
     * The following hooks will be run:
     * 1. `before-sanity-check`
     * 2. `before-highlight`
     * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
     * 4. `before-insert`
     * 5. `after-highlight`
     * 6. `complete`
     *
     * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
     * the element's language.
     *
     * @param {Element} element The element containing the code.
     * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
     * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
     * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
     * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
     *
     * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
     * asynchronous highlighting to work. You can build your own bundle on the
     * [Download page](https://prismjs.com/download.html).
     * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
     * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
     * @memberof Prism
     * @public
     */
    highlightElement: function (element, async, callback) {
      // Find language
      var language = _.util.getLanguage(element);
      var grammar = _.languages[language];

      // Set language on the element, if not present
      _.util.setLanguage(element, language);

      // Set language on the parent, for styling
      var parent = element.parentElement;
      if (parent && parent.nodeName.toLowerCase() === 'pre') {
        _.util.setLanguage(parent, language);
      }
      var code = element.textContent;
      var env = {
        element: element,
        language: language,
        grammar: grammar,
        code: code
      };
      function insertHighlightedCode(highlightedCode) {
        env.highlightedCode = highlightedCode;
        _.hooks.run('before-insert', env);
        env.element.innerHTML = env.highlightedCode;
        _.hooks.run('after-highlight', env);
        _.hooks.run('complete', env);
        callback && callback.call(env.element);
      }
      _.hooks.run('before-sanity-check', env);

      // plugins may change/add the parent/element
      parent = env.element.parentElement;
      if (parent && parent.nodeName.toLowerCase() === 'pre' && !parent.hasAttribute('tabindex')) {
        parent.setAttribute('tabindex', '0');
      }
      if (!env.code) {
        _.hooks.run('complete', env);
        callback && callback.call(env.element);
        return;
      }
      _.hooks.run('before-highlight', env);
      if (!env.grammar) {
        insertHighlightedCode(_.util.encode(env.code));
        return;
      }
      if (async && _self.Worker) {
        var worker = new Worker(_.filename);
        worker.onmessage = function (evt) {
          insertHighlightedCode(evt.data);
        };
        worker.postMessage(JSON.stringify({
          language: env.language,
          code: env.code,
          immediateClose: true
        }));
      } else {
        insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
      }
    },
    /**
     * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
     * and the language definitions to use, and returns a string with the HTML produced.
     *
     * The following hooks will be run:
     * 1. `before-tokenize`
     * 2. `after-tokenize`
     * 3. `wrap`: On each {@link Token}.
     *
     * @param {string} text A string with the code to be highlighted.
     * @param {Grammar} grammar An object containing the tokens to use.
     *
     * Usually a language definition like `Prism.languages.markup`.
     * @param {string} language The name of the language definition passed to `grammar`.
     * @returns {string} The highlighted HTML.
     * @memberof Prism
     * @public
     * @example
     * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
     */
    highlight: function (text, grammar, language) {
      var env = {
        code: text,
        grammar: grammar,
        language: language
      };
      _.hooks.run('before-tokenize', env);
      if (!env.grammar) {
        throw new Error('The language "' + env.language + '" has no grammar.');
      }
      env.tokens = _.tokenize(env.code, env.grammar);
      _.hooks.run('after-tokenize', env);
      return Token.stringify(_.util.encode(env.tokens), env.language);
    },
    /**
     * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
     * and the language definitions to use, and returns an array with the tokenized code.
     *
     * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
     *
     * This method could be useful in other contexts as well, as a very crude parser.
     *
     * @param {string} text A string with the code to be highlighted.
     * @param {Grammar} grammar An object containing the tokens to use.
     *
     * Usually a language definition like `Prism.languages.markup`.
     * @returns {TokenStream} An array of strings and tokens, a token stream.
     * @memberof Prism
     * @public
     * @example
     * let code = `var foo = 0;`;
     * let tokens = Prism.tokenize(code, Prism.languages.javascript);
     * tokens.forEach(token => {
     *     if (token instanceof Prism.Token && token.type === 'number') {
     *         console.log(`Found numeric literal: ${token.content}`);
     *     }
     * });
     */
    tokenize: function (text, grammar) {
      var rest = grammar.rest;
      if (rest) {
        for (var token in rest) {
          grammar[token] = rest[token];
        }
        delete grammar.rest;
      }
      var tokenList = new LinkedList();
      addAfter(tokenList, tokenList.head, text);
      matchGrammar(text, tokenList, grammar, tokenList.head, 0);
      return toArray(tokenList);
    },
    /**
     * @namespace
     * @memberof Prism
     * @public
     */
    hooks: {
      all: {},
      /**
       * Adds the given callback to the list of callbacks for the given hook.
       *
       * The callback will be invoked when the hook it is registered for is run.
       * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
       *
       * One callback function can be registered to multiple hooks and the same hook multiple times.
       *
       * @param {string} name The name of the hook.
       * @param {HookCallback} callback The callback function which is given environment variables.
       * @public
       */
      add: function (name, callback) {
        var hooks = _.hooks.all;
        hooks[name] = hooks[name] || [];
        hooks[name].push(callback);
      },
      /**
       * Runs a hook invoking all registered callbacks with the given environment variables.
       *
       * Callbacks will be invoked synchronously and in the order in which they were registered.
       *
       * @param {string} name The name of the hook.
       * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
       * @public
       */
      run: function (name, env) {
        var callbacks = _.hooks.all[name];
        if (!callbacks || !callbacks.length) {
          return;
        }
        for (var i = 0, callback; callback = callbacks[i++];) {
          callback(env);
        }
      }
    },
    Token: Token
  };
  _self.Prism = _;

  // Typescript note:
  // The following can be used to import the Token type in JSDoc:
  //
  //   @typedef {InstanceType<import("./prism-core")["Token"]>} Token

  /**
   * Creates a new token.
   *
   * @param {string} type See {@link Token#type type}
   * @param {string | TokenStream} content See {@link Token#content content}
   * @param {string|string[]} [alias] The alias(es) of the token.
   * @param {string} [matchedStr=""] A copy of the full string this token was created from.
   * @class
   * @global
   * @public
   */
  function Token(type, content, alias, matchedStr) {
    /**
     * The type of the token.
     *
     * This is usually the key of a pattern in a {@link Grammar}.
     *
     * @type {string}
     * @see GrammarToken
     * @public
     */
    this.type = type;
    /**
     * The strings or tokens contained by this token.
     *
     * This will be a token stream if the pattern matched also defined an `inside` grammar.
     *
     * @type {string | TokenStream}
     * @public
     */
    this.content = content;
    /**
     * The alias(es) of the token.
     *
     * @type {string|string[]}
     * @see GrammarToken
     * @public
     */
    this.alias = alias;
    // Copy of the full string this token was created from
    this.length = (matchedStr || '').length | 0;
  }

  /**
   * A token stream is an array of strings and {@link Token Token} objects.
   *
   * Token streams have to fulfill a few properties that are assumed by most functions (mostly internal ones) that process
   * them.
   *
   * 1. No adjacent strings.
   * 2. No empty strings.
   *
   *    The only exception here is the token stream that only contains the empty string and nothing else.
   *
   * @typedef {Array<string | Token>} TokenStream
   * @global
   * @public
   */

  /**
   * Converts the given token or token stream to an HTML representation.
   *
   * The following hooks will be run:
   * 1. `wrap`: On each {@link Token}.
   *
   * @param {string | Token | TokenStream} o The token or token stream to be converted.
   * @param {string} language The name of current language.
   * @returns {string} The HTML representation of the token or token stream.
   * @memberof Token
   * @static
   */
  Token.stringify = function stringify(o, language) {
    if (typeof o == 'string') {
      return o;
    }
    if (Array.isArray(o)) {
      var s = '';
      o.forEach(function (e) {
        s += stringify(e, language);
      });
      return s;
    }
    var env = {
      type: o.type,
      content: stringify(o.content, language),
      tag: 'span',
      classes: ['token', o.type],
      attributes: {},
      language: language
    };
    var aliases = o.alias;
    if (aliases) {
      if (Array.isArray(aliases)) {
        Array.prototype.push.apply(env.classes, aliases);
      } else {
        env.classes.push(aliases);
      }
    }
    _.hooks.run('wrap', env);
    var attributes = '';
    for (var name in env.attributes) {
      attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
    }
    return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + '</' + env.tag + '>';
  };

  /**
   * @param {RegExp} pattern
   * @param {number} pos
   * @param {string} text
   * @param {boolean} lookbehind
   * @returns {RegExpExecArray | null}
   */
  function matchPattern(pattern, pos, text, lookbehind) {
    pattern.lastIndex = pos;
    var match = pattern.exec(text);
    if (match && lookbehind && match[1]) {
      // change the match to remove the text matched by the Prism lookbehind group
      var lookbehindLength = match[1].length;
      match.index += lookbehindLength;
      match[0] = match[0].slice(lookbehindLength);
    }
    return match;
  }

  /**
   * @param {string} text
   * @param {LinkedList<string | Token>} tokenList
   * @param {any} grammar
   * @param {LinkedListNode<string | Token>} startNode
   * @param {number} startPos
   * @param {RematchOptions} [rematch]
   * @returns {void}
   * @private
   *
   * @typedef RematchOptions
   * @property {string} cause
   * @property {number} reach
   */
  function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
    for (var token in grammar) {
      if (!grammar.hasOwnProperty(token) || !grammar[token]) {
        continue;
      }
      var patterns = grammar[token];
      patterns = Array.isArray(patterns) ? patterns : [patterns];
      for (var j = 0; j < patterns.length; ++j) {
        if (rematch && rematch.cause == token + ',' + j) {
          return;
        }
        var patternObj = patterns[j];
        var inside = patternObj.inside;
        var lookbehind = !!patternObj.lookbehind;
        var greedy = !!patternObj.greedy;
        var alias = patternObj.alias;
        if (greedy && !patternObj.pattern.global) {
          // Without the global flag, lastIndex won't work
          var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
          patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g');
        }

        /** @type {RegExp} */
        var pattern = patternObj.pattern || patternObj;
        for (
        // iterate the token list and keep track of the current token/string position
        var currentNode = startNode.next, pos = startPos; currentNode !== tokenList.tail; pos += currentNode.value.length, currentNode = currentNode.next) {
          if (rematch && pos >= rematch.reach) {
            break;
          }
          var str = currentNode.value;
          if (tokenList.length > text.length) {
            // Something went terribly wrong, ABORT, ABORT!
            return;
          }
          if (str instanceof Token) {
            continue;
          }
          var removeCount = 1; // this is the to parameter of removeBetween
          var match;
          if (greedy) {
            match = matchPattern(pattern, pos, text, lookbehind);
            if (!match || match.index >= text.length) {
              break;
            }
            var from = match.index;
            var to = match.index + match[0].length;
            var p = pos;

            // find the node that contains the match
            p += currentNode.value.length;
            while (from >= p) {
              currentNode = currentNode.next;
              p += currentNode.value.length;
            }
            // adjust pos (and p)
            p -= currentNode.value.length;
            pos = p;

            // the current node is a Token, then the match starts inside another Token, which is invalid
            if (currentNode.value instanceof Token) {
              continue;
            }

            // find the last node which is affected by this match
            for (var k = currentNode; k !== tokenList.tail && (p < to || typeof k.value === 'string'); k = k.next) {
              removeCount++;
              p += k.value.length;
            }
            removeCount--;

            // replace with the new match
            str = text.slice(pos, p);
            match.index -= pos;
          } else {
            match = matchPattern(pattern, 0, str, lookbehind);
            if (!match) {
              continue;
            }
          }

          // eslint-disable-next-line no-redeclare
          var from = match.index;
          var matchStr = match[0];
          var before = str.slice(0, from);
          var after = str.slice(from + matchStr.length);
          var reach = pos + str.length;
          if (rematch && reach > rematch.reach) {
            rematch.reach = reach;
          }
          var removeFrom = currentNode.prev;
          if (before) {
            removeFrom = addAfter(tokenList, removeFrom, before);
            pos += before.length;
          }
          removeRange(tokenList, removeFrom, removeCount);
          var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
          currentNode = addAfter(tokenList, removeFrom, wrapped);
          if (after) {
            addAfter(tokenList, currentNode, after);
          }
          if (removeCount > 1) {
            // at least one Token object was removed, so we have to do some rematching
            // this can only happen if the current pattern is greedy

            /** @type {RematchOptions} */
            var nestedRematch = {
              cause: token + ',' + j,
              reach: reach
            };
            matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);

            // the reach might have been extended because of the rematching
            if (rematch && nestedRematch.reach > rematch.reach) {
              rematch.reach = nestedRematch.reach;
            }
          }
        }
      }
    }
  }

  /**
   * @typedef LinkedListNode
   * @property {T} value
   * @property {LinkedListNode<T> | null} prev The previous node.
   * @property {LinkedListNode<T> | null} next The next node.
   * @template T
   * @private
   */

  /**
   * @template T
   * @private
   */
  function LinkedList() {
    /** @type {LinkedListNode<T>} */
    var head = {
      value: null,
      prev: null,
      next: null
    };
    /** @type {LinkedListNode<T>} */
    var tail = {
      value: null,
      prev: head,
      next: null
    };
    head.next = tail;

    /** @type {LinkedListNode<T>} */
    this.head = head;
    /** @type {LinkedListNode<T>} */
    this.tail = tail;
    this.length = 0;
  }

  /**
   * Adds a new node with the given value to the list.
   *
   * @param {LinkedList<T>} list
   * @param {LinkedListNode<T>} node
   * @param {T} value
   * @returns {LinkedListNode<T>} The added node.
   * @template T
   */
  function addAfter(list, node, value) {
    // assumes that node != list.tail && values.length >= 0
    var next = node.next;
    var newNode = {
      value: value,
      prev: node,
      next: next
    };
    node.next = newNode;
    next.prev = newNode;
    list.length++;
    return newNode;
  }
  /**
   * Removes `count` nodes after the given node. The given node will not be removed.
   *
   * @param {LinkedList<T>} list
   * @param {LinkedListNode<T>} node
   * @param {number} count
   * @template T
   */
  function removeRange(list, node, count) {
    var next = node.next;
    for (var i = 0; i < count && next !== list.tail; i++) {
      next = next.next;
    }
    node.next = next;
    next.prev = node;
    list.length -= i;
  }
  /**
   * @param {LinkedList<T>} list
   * @returns {T[]}
   * @template T
   */
  function toArray(list) {
    var array = [];
    var node = list.head.next;
    while (node !== list.tail) {
      array.push(node.value);
      node = node.next;
    }
    return array;
  }
  if (!_self.document) {
    if (!_self.addEventListener) {
      // in Node.js
      return _;
    }
    if (!_.disableWorkerMessageHandler) {
      // In worker
      _self.addEventListener('message', function (evt) {
        var message = JSON.parse(evt.data);
        var lang = message.language;
        var code = message.code;
        var immediateClose = message.immediateClose;
        _self.postMessage(_.highlight(code, _.languages[lang], lang));
        if (immediateClose) {
          _self.close();
        }
      }, false);
    }
    return _;
  }

  // Get current script and highlight
  var script = _.util.currentScript();
  if (script) {
    _.filename = script.src;
    if (script.hasAttribute('data-manual')) {
      _.manual = true;
    }
  }
  function highlightAutomaticallyCallback() {
    if (!_.manual) {
      _.highlightAll();
    }
  }
  if (!_.manual) {
    // If the document state is "loading", then we'll use DOMContentLoaded.
    // If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
    // DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
    // might take longer one animation frame to execute which can create a race condition where only some plugins have
    // been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.
    // See https://github.com/PrismJS/prism/issues/2102
    var readyState = document.readyState;
    if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {
      document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);
    } else {
      if (window.requestAnimationFrame) {
        window.requestAnimationFrame(highlightAutomaticallyCallback);
      } else {
        window.setTimeout(highlightAutomaticallyCallback, 16);
      }
    }
  }
  return _;
}(_self);
if (module.exports) {
  module.exports = Prism;
}

// hack for components to work correctly in node.js
if (typeof commonjsGlobal !== 'undefined') {
  commonjsGlobal.Prism = Prism;
}

// some additional documentation/types

/**
 * The expansion of a simple `RegExp` literal to support additional properties.
 *
 * @typedef GrammarToken
 * @property {RegExp} pattern The regular expression of the token.
 * @property {boolean} [lookbehind=false] If `true`, then the first capturing group of `pattern` will (effectively)
 * behave as a lookbehind group meaning that the captured text will not be part of the matched text of the new token.
 * @property {boolean} [greedy=false] Whether the token is greedy.
 * @property {string|string[]} [alias] An optional alias or list of aliases.
 * @property {Grammar} [inside] The nested grammar of this token.
 *
 * The `inside` grammar will be used to tokenize the text value of each token of this kind.
 *
 * This can be used to make nested and even recursive language definitions.
 *
 * Note: This can cause infinite recursion. Be careful when you embed different languages or even the same language into
 * each another.
 * @global
 * @public
 */

/**
 * @typedef Grammar
 * @type {Object<string, RegExp | GrammarToken | Array<RegExp | GrammarToken>>}
 * @property {Grammar} [rest] An optional grammar object that will be appended to this grammar.
 * @global
 * @public
 */

/**
 * A function which will invoked after an element was successfully highlighted.
 *
 * @callback HighlightCallback
 * @param {Element} element The element successfully highlighted.
 * @returns {void}
 * @global
 * @public
 */

/**
 * @callback HookCallback
 * @param {Object<string, any>} env The environment variables of the hook.
 * @returns {void}
 * @global
 * @public
 */

/* **********************************************
     Begin prism-markup.js
********************************************** */

Prism.languages.markup = {
  'comment': {
    pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
    greedy: true
  },
  'prolog': {
    pattern: /<\?[\s\S]+?\?>/,
    greedy: true
  },
  'doctype': {
    // https://www.w3.org/TR/xml/#NT-doctypedecl
    pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
    greedy: true,
    inside: {
      'internal-subset': {
        pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
        lookbehind: true,
        greedy: true,
        inside: null // see below
      },
      'string': {
        pattern: /"[^"]*"|'[^']*'/,
        greedy: true
      },
      'punctuation': /^<!|>$|[[\]]/,
      'doctype-tag': /^DOCTYPE/i,
      'name': /[^\s<>'"]+/
    }
  },
  'cdata': {
    pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
    greedy: true
  },
  'tag': {
    pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
    greedy: true,
    inside: {
      'tag': {
        pattern: /^<\/?[^\s>\/]+/,
        inside: {
          'punctuation': /^<\/?/,
          'namespace': /^[^\s>\/:]+:/
        }
      },
      'special-attr': [],
      'attr-value': {
        pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
        inside: {
          'punctuation': [{
            pattern: /^=/,
            alias: 'attr-equals'
          }, {
            pattern: /^(\s*)["']|["']$/,
            lookbehind: true
          }]
        }
      },
      'punctuation': /\/?>/,
      'attr-name': {
        pattern: /[^\s>\/]+/,
        inside: {
          'namespace': /^[^\s>\/:]+:/
        }
      }
    }
  },
  'entity': [{
    pattern: /&[\da-z]{1,8};/i,
    alias: 'named-entity'
  }, /&#x?[\da-f]{1,8};/i]
};
Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = Prism.languages.markup['entity'];
Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;

// Plugin to make entity title show the real entity, idea by Roman Komarov
Prism.hooks.add('wrap', function (env) {
  if (env.type === 'entity') {
    env.attributes['title'] = env.content.replace(/&amp;/, '&');
  }
});
Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
  /**
   * Adds an inlined language to markup.
   *
   * An example of an inlined language is CSS with `<style>` tags.
   *
   * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
   * case insensitive.
   * @param {string} lang The language key.
   * @example
   * addInlined('style', 'css');
   */
  value: function addInlined(tagName, lang) {
    var includedCdataInside = {};
    includedCdataInside['language-' + lang] = {
      pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
      lookbehind: true,
      inside: Prism.languages[lang]
    };
    includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
    var inside = {
      'included-cdata': {
        pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
        inside: includedCdataInside
      }
    };
    inside['language-' + lang] = {
      pattern: /[\s\S]+/,
      inside: Prism.languages[lang]
    };
    var def = {};
    def[tagName] = {
      pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () {
        return tagName;
      }), 'i'),
      lookbehind: true,
      greedy: true,
      inside: inside
    };
    Prism.languages.insertBefore('markup', 'cdata', def);
  }
});
Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
  /**
   * Adds an pattern to highlight languages embedded in HTML attributes.
   *
   * An example of an inlined language is CSS with `style` attributes.
   *
   * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
   * case insensitive.
   * @param {string} lang The language key.
   * @example
   * addAttribute('style', 'css');
   */
  value: function (attrName, lang) {
    Prism.languages.markup.tag.inside['special-attr'].push({
      pattern: RegExp(/(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, 'i'),
      lookbehind: true,
      inside: {
        'attr-name': /^[^\s=]+/,
        'attr-value': {
          pattern: /=[\s\S]+/,
          inside: {
            'value': {
              pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
              lookbehind: true,
              alias: [lang, 'language-' + lang],
              inside: Prism.languages[lang]
            },
            'punctuation': [{
              pattern: /^=/,
              alias: 'attr-equals'
            }, /"|'/]
          }
        }
      }
    });
  }
});
Prism.languages.html = Prism.languages.markup;
Prism.languages.mathml = Prism.languages.markup;
Prism.languages.svg = Prism.languages.markup;
Prism.languages.xml = Prism.languages.extend('markup', {});
Prism.languages.ssml = Prism.languages.xml;
Prism.languages.atom = Prism.languages.xml;
Prism.languages.rss = Prism.languages.xml;

/* **********************************************
     Begin prism-css.js
********************************************** */

(function (Prism) {
  var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
  Prism.languages.css = {
    'comment': /\/\*[\s\S]*?\*\//,
    'atrule': {
      pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
      inside: {
        'rule': /^@[\w-]+/,
        'selector-function-argument': {
          pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
          lookbehind: true,
          alias: 'selector'
        },
        'keyword': {
          pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
          lookbehind: true
        }
        // See rest below
      }
    },
    'url': {
      // https://drafts.csswg.org/css-values-3/#urls
      pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
      greedy: true,
      inside: {
        'function': /^url/i,
        'punctuation': /^\(|\)$/,
        'string': {
          pattern: RegExp('^' + string.source + '$'),
          alias: 'url'
        }
      }
    },
    'selector': {
      pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
      lookbehind: true
    },
    'string': {
      pattern: string,
      greedy: true
    },
    'property': {
      pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
      lookbehind: true
    },
    'important': /!important\b/i,
    'function': {
      pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
      lookbehind: true
    },
    'punctuation': /[(){};:,]/
  };
  Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
  var markup = Prism.languages.markup;
  if (markup) {
    markup.tag.addInlined('style', 'css');
    markup.tag.addAttribute('style', 'css');
  }
})(Prism);

/* **********************************************
     Begin prism-clike.js
********************************************** */

Prism.languages.clike = {
  'comment': [{
    pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
    lookbehind: true,
    greedy: true
  }, {
    pattern: /(^|[^\\:])\/\/.*/,
    lookbehind: true,
    greedy: true
  }],
  'string': {
    pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
    greedy: true
  },
  'class-name': {
    pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
    lookbehind: true,
    inside: {
      'punctuation': /[.\\]/
    }
  },
  'keyword': /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
  'boolean': /\b(?:false|true)\b/,
  'function': /\b\w+(?=\()/,
  'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
  'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
  'punctuation': /[{}[\];(),.:]/
};

/* **********************************************
     Begin prism-javascript.js
********************************************** */

Prism.languages.javascript = Prism.languages.extend('clike', {
  'class-name': [Prism.languages.clike['class-name'], {
    pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
    lookbehind: true
  }],
  'keyword': [{
    pattern: /((?:^|\})\s*)catch\b/,
    lookbehind: true
  }, {
    pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
    lookbehind: true
  }],
  // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
  'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
  'number': {
    pattern: RegExp(/(^|[^\w$])/.source + '(?:' + (
    // constant
    /NaN|Infinity/.source + '|' +
    // binary integer
    /0[bB][01]+(?:_[01]+)*n?/.source + '|' +
    // octal integer
    /0[oO][0-7]+(?:_[0-7]+)*n?/.source + '|' +
    // hexadecimal integer
    /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + '|' +
    // decimal bigint
    /\d+(?:_\d+)*n/.source + '|' +
    // decimal number (integer or float) but no bigint
    /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ')' + /(?![\w$])/.source),
    lookbehind: true
  },
  'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
});
Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
Prism.languages.insertBefore('javascript', 'keyword', {
  'regex': {
    pattern: RegExp(
    // lookbehind
    // eslint-disable-next-line regexp/no-dupe-characters-character-class
    /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source +
    // Regex pattern:
    // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
    // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
    // with the only syntax, so we have to define 2 different regex patterns.
    /\//.source + '(?:' + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + '|' +
    // `v` flag syntax. This supports 3 levels of nested character classes.
    /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ')' +
    // lookahead
    /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),
    lookbehind: true,
    greedy: true,
    inside: {
      'regex-source': {
        pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
        lookbehind: true,
        alias: 'language-regex',
        inside: Prism.languages.regex
      },
      'regex-delimiter': /^\/|\/$/,
      'regex-flags': /^[a-z]+$/
    }
  },
  // This must be declared before keyword because we use "function" inside the look-forward
  'function-variable': {
    pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
    alias: 'function'
  },
  'parameter': [{
    pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
    lookbehind: true,
    inside: Prism.languages.javascript
  }, {
    pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
    lookbehind: true,
    inside: Prism.languages.javascript
  }, {
    pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
    lookbehind: true,
    inside: Prism.languages.javascript
  }, {
    pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
    lookbehind: true,
    inside: Prism.languages.javascript
  }],
  'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
});
Prism.languages.insertBefore('javascript', 'string', {
  'hashbang': {
    pattern: /^#!.*/,
    greedy: true,
    alias: 'comment'
  },
  'template-string': {
    pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
    greedy: true,
    inside: {
      'template-punctuation': {
        pattern: /^`|`$/,
        alias: 'string'
      },
      'interpolation': {
        pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
        lookbehind: true,
        inside: {
          'interpolation-punctuation': {
            pattern: /^\$\{|\}$/,
            alias: 'punctuation'
          },
          rest: Prism.languages.javascript
        }
      },
      'string': /[\s\S]+/
    }
  },
  'string-property': {
    pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
    lookbehind: true,
    greedy: true,
    alias: 'property'
  }
});
Prism.languages.insertBefore('javascript', 'operator', {
  'literal-property': {
    pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
    lookbehind: true,
    alias: 'property'
  }
});
if (Prism.languages.markup) {
  Prism.languages.markup.tag.addInlined('script', 'javascript');

  // add attribute support for all DOM events.
  // https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events
  Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source, 'javascript');
}
Prism.languages.js = Prism.languages.javascript;

/* **********************************************
     Begin prism-file-highlight.js
********************************************** */

(function () {
  if (typeof Prism === 'undefined' || typeof document === 'undefined') {
    return;
  }

  // https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
  if (!Element.prototype.matches) {
    Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  }
  var LOADING_MESSAGE = 'Loading…';
  var FAILURE_MESSAGE = function (status, message) {
    return '✖ Error ' + status + ' while fetching file: ' + message;
  };
  var FAILURE_EMPTY_MESSAGE = '✖ Error: File does not exist or is empty';
  var EXTENSIONS = {
    'js': 'javascript',
    'py': 'python',
    'rb': 'ruby',
    'ps1': 'powershell',
    'psm1': 'powershell',
    'sh': 'bash',
    'bat': 'batch',
    'h': 'c',
    'tex': 'latex'
  };
  var STATUS_ATTR = 'data-src-status';
  var STATUS_LOADING = 'loading';
  var STATUS_LOADED = 'loaded';
  var STATUS_FAILED = 'failed';
  var SELECTOR = 'pre[data-src]:not([' + STATUS_ATTR + '="' + STATUS_LOADED + '"])' + ':not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])';

  /**
   * Loads the given file.
   *
   * @param {string} src The URL or path of the source file to load.
   * @param {(result: string) => void} success
   * @param {(reason: string) => void} error
   */
  function loadFile(src, success, error) {
    var xhr = new XMLHttpRequest();
    xhr.open('GET', src, true);
    xhr.onreadystatechange = function () {
      if (xhr.readyState == 4) {
        if (xhr.status < 400 && xhr.responseText) {
          success(xhr.responseText);
        } else {
          if (xhr.status >= 400) {
            error(FAILURE_MESSAGE(xhr.status, xhr.statusText));
          } else {
            error(FAILURE_EMPTY_MESSAGE);
          }
        }
      }
    };
    xhr.send(null);
  }

  /**
   * Parses the given range.
   *
   * This returns a range with inclusive ends.
   *
   * @param {string | null | undefined} range
   * @returns {[number, number | undefined] | undefined}
   */
  function parseRange(range) {
    var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range || '');
    if (m) {
      var start = Number(m[1]);
      var comma = m[2];
      var end = m[3];
      if (!comma) {
        return [start, start];
      }
      if (!end) {
        return [start, undefined];
      }
      return [start, Number(end)];
    }
    return undefined;
  }
  Prism.hooks.add('before-highlightall', function (env) {
    env.selector += ', ' + SELECTOR;
  });
  Prism.hooks.add('before-sanity-check', function (env) {
    var pre = /** @type {HTMLPreElement} */env.element;
    if (pre.matches(SELECTOR)) {
      env.code = ''; // fast-path the whole thing and go to complete

      pre.setAttribute(STATUS_ATTR, STATUS_LOADING); // mark as loading

      // add code element with loading message
      var code = pre.appendChild(document.createElement('CODE'));
      code.textContent = LOADING_MESSAGE;
      var src = pre.getAttribute('data-src');
      var language = env.language;
      if (language === 'none') {
        // the language might be 'none' because there is no language set;
        // in this case, we want to use the extension as the language
        var extension = (/\.(\w+)$/.exec(src) || [, 'none'])[1];
        language = EXTENSIONS[extension] || extension;
      }

      // set language classes
      Prism.util.setLanguage(code, language);
      Prism.util.setLanguage(pre, language);

      // preload the language
      var autoloader = Prism.plugins.autoloader;
      if (autoloader) {
        autoloader.loadLanguages(language);
      }

      // load file
      loadFile(src, function (text) {
        // mark as loaded
        pre.setAttribute(STATUS_ATTR, STATUS_LOADED);

        // handle data-range
        var range = parseRange(pre.getAttribute('data-range'));
        if (range) {
          var lines = text.split(/\r\n?|\n/g);

          // the range is one-based and inclusive on both ends
          var start = range[0];
          var end = range[1] == null ? lines.length : range[1];
          if (start < 0) {
            start += lines.length;
          }
          start = Math.max(0, Math.min(start - 1, lines.length));
          if (end < 0) {
            end += lines.length;
          }
          end = Math.max(0, Math.min(end, lines.length));
          text = lines.slice(start, end).join('\n');

          // add data-start for line numbers
          if (!pre.hasAttribute('data-start')) {
            pre.setAttribute('data-start', String(start + 1));
          }
        }

        // highlight code
        code.textContent = text;
        Prism.highlightElement(code);
      }, function (error) {
        // mark as failed
        pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
        code.textContent = error;
      });
    }
  });
  Prism.plugins.fileHighlight = {
    /**
     * Executes the File Highlight plugin for all matching `pre` elements under the given container.
     *
     * Note: Elements which are already loaded or currently loading will not be touched by this method.
     *
     * @param {ParentNode} [container=document]
     */
    highlight: function highlight(container) {
      var elements = (container || document).querySelectorAll(SELECTOR);
      for (var i = 0, element; element = elements[i++];) {
        Prism.highlightElement(element);
      }
    }
  };
  var logged = false;
  /** @deprecated Use `Prism.plugins.fileHighlight.highlight` instead. */
  Prism.fileHighlight = function () {
    if (!logged) {
      console.warn('Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead.');
      logged = true;
    }
    Prism.plugins.fileHighlight.highlight.apply(this, arguments);
  };
})();
});

Prism.languages.clike = {
  'comment': [{
    pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
    lookbehind: true,
    greedy: true
  }, {
    pattern: /(^|[^\\:])\/\/.*/,
    lookbehind: true,
    greedy: true
  }],
  'string': {
    pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
    greedy: true
  },
  'class-name': {
    pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
    lookbehind: true,
    inside: {
      'punctuation': /[.\\]/
    }
  },
  'keyword': /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
  'boolean': /\b(?:false|true)\b/,
  'function': /\b\w+(?=\()/,
  'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
  'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
  'punctuation': /[{}[\];(),.:]/
};

Prism.languages.markup = {
  'comment': {
    pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
    greedy: true
  },
  'prolog': {
    pattern: /<\?[\s\S]+?\?>/,
    greedy: true
  },
  'doctype': {
    // https://www.w3.org/TR/xml/#NT-doctypedecl
    pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
    greedy: true,
    inside: {
      'internal-subset': {
        pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
        lookbehind: true,
        greedy: true,
        inside: null // see below
      },
      'string': {
        pattern: /"[^"]*"|'[^']*'/,
        greedy: true
      },
      'punctuation': /^<!|>$|[[\]]/,
      'doctype-tag': /^DOCTYPE/i,
      'name': /[^\s<>'"]+/
    }
  },
  'cdata': {
    pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
    greedy: true
  },
  'tag': {
    pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
    greedy: true,
    inside: {
      'tag': {
        pattern: /^<\/?[^\s>\/]+/,
        inside: {
          'punctuation': /^<\/?/,
          'namespace': /^[^\s>\/:]+:/
        }
      },
      'special-attr': [],
      'attr-value': {
        pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
        inside: {
          'punctuation': [{
            pattern: /^=/,
            alias: 'attr-equals'
          }, {
            pattern: /^(\s*)["']|["']$/,
            lookbehind: true
          }]
        }
      },
      'punctuation': /\/?>/,
      'attr-name': {
        pattern: /[^\s>\/]+/,
        inside: {
          'namespace': /^[^\s>\/:]+:/
        }
      }
    }
  },
  'entity': [{
    pattern: /&[\da-z]{1,8};/i,
    alias: 'named-entity'
  }, /&#x?[\da-f]{1,8};/i]
};
Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = Prism.languages.markup['entity'];
Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;

// Plugin to make entity title show the real entity, idea by Roman Komarov
Prism.hooks.add('wrap', function (env) {
  if (env.type === 'entity') {
    env.attributes['title'] = env.content.replace(/&amp;/, '&');
  }
});
Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
  /**
   * Adds an inlined language to markup.
   *
   * An example of an inlined language is CSS with `<style>` tags.
   *
   * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
   * case insensitive.
   * @param {string} lang The language key.
   * @example
   * addInlined('style', 'css');
   */
  value: function addInlined(tagName, lang) {
    var includedCdataInside = {};
    includedCdataInside['language-' + lang] = {
      pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
      lookbehind: true,
      inside: Prism.languages[lang]
    };
    includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
    var inside = {
      'included-cdata': {
        pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
        inside: includedCdataInside
      }
    };
    inside['language-' + lang] = {
      pattern: /[\s\S]+/,
      inside: Prism.languages[lang]
    };
    var def = {};
    def[tagName] = {
      pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () {
        return tagName;
      }), 'i'),
      lookbehind: true,
      greedy: true,
      inside: inside
    };
    Prism.languages.insertBefore('markup', 'cdata', def);
  }
});
Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
  /**
   * Adds an pattern to highlight languages embedded in HTML attributes.
   *
   * An example of an inlined language is CSS with `style` attributes.
   *
   * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
   * case insensitive.
   * @param {string} lang The language key.
   * @example
   * addAttribute('style', 'css');
   */
  value: function (attrName, lang) {
    Prism.languages.markup.tag.inside['special-attr'].push({
      pattern: RegExp(/(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, 'i'),
      lookbehind: true,
      inside: {
        'attr-name': /^[^\s=]+/,
        'attr-value': {
          pattern: /=[\s\S]+/,
          inside: {
            'value': {
              pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
              lookbehind: true,
              alias: [lang, 'language-' + lang],
              inside: Prism.languages[lang]
            },
            'punctuation': [{
              pattern: /^=/,
              alias: 'attr-equals'
            }, /"|'/]
          }
        }
      }
    });
  }
});
Prism.languages.html = Prism.languages.markup;
Prism.languages.mathml = Prism.languages.markup;
Prism.languages.svg = Prism.languages.markup;
Prism.languages.xml = Prism.languages.extend('markup', {});
Prism.languages.ssml = Prism.languages.xml;
Prism.languages.atom = Prism.languages.xml;
Prism.languages.rss = Prism.languages.xml;

Prism.languages.javascript = Prism.languages.extend('clike', {
  'class-name': [Prism.languages.clike['class-name'], {
    pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
    lookbehind: true
  }],
  'keyword': [{
    pattern: /((?:^|\})\s*)catch\b/,
    lookbehind: true
  }, {
    pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
    lookbehind: true
  }],
  // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
  'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
  'number': {
    pattern: RegExp(/(^|[^\w$])/.source + '(?:' + (
    // constant
    /NaN|Infinity/.source + '|' +
    // binary integer
    /0[bB][01]+(?:_[01]+)*n?/.source + '|' +
    // octal integer
    /0[oO][0-7]+(?:_[0-7]+)*n?/.source + '|' +
    // hexadecimal integer
    /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + '|' +
    // decimal bigint
    /\d+(?:_\d+)*n/.source + '|' +
    // decimal number (integer or float) but no bigint
    /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ')' + /(?![\w$])/.source),
    lookbehind: true
  },
  'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
});
Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
Prism.languages.insertBefore('javascript', 'keyword', {
  'regex': {
    pattern: RegExp(
    // lookbehind
    // eslint-disable-next-line regexp/no-dupe-characters-character-class
    /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source +
    // Regex pattern:
    // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
    // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
    // with the only syntax, so we have to define 2 different regex patterns.
    /\//.source + '(?:' + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + '|' +
    // `v` flag syntax. This supports 3 levels of nested character classes.
    /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ')' +
    // lookahead
    /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),
    lookbehind: true,
    greedy: true,
    inside: {
      'regex-source': {
        pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
        lookbehind: true,
        alias: 'language-regex',
        inside: Prism.languages.regex
      },
      'regex-delimiter': /^\/|\/$/,
      'regex-flags': /^[a-z]+$/
    }
  },
  // This must be declared before keyword because we use "function" inside the look-forward
  'function-variable': {
    pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
    alias: 'function'
  },
  'parameter': [{
    pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
    lookbehind: true,
    inside: Prism.languages.javascript
  }, {
    pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
    lookbehind: true,
    inside: Prism.languages.javascript
  }, {
    pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
    lookbehind: true,
    inside: Prism.languages.javascript
  }, {
    pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
    lookbehind: true,
    inside: Prism.languages.javascript
  }],
  'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
});
Prism.languages.insertBefore('javascript', 'string', {
  'hashbang': {
    pattern: /^#!.*/,
    greedy: true,
    alias: 'comment'
  },
  'template-string': {
    pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
    greedy: true,
    inside: {
      'template-punctuation': {
        pattern: /^`|`$/,
        alias: 'string'
      },
      'interpolation': {
        pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
        lookbehind: true,
        inside: {
          'interpolation-punctuation': {
            pattern: /^\$\{|\}$/,
            alias: 'punctuation'
          },
          rest: Prism.languages.javascript
        }
      },
      'string': /[\s\S]+/
    }
  },
  'string-property': {
    pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
    lookbehind: true,
    greedy: true,
    alias: 'property'
  }
});
Prism.languages.insertBefore('javascript', 'operator', {
  'literal-property': {
    pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
    lookbehind: true,
    alias: 'property'
  }
});
if (Prism.languages.markup) {
  Prism.languages.markup.tag.addInlined('script', 'javascript');

  // add attribute support for all DOM events.
  // https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events
  Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source, 'javascript');
}
Prism.languages.js = Prism.languages.javascript;

(function (Prism) {
  var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
  Prism.languages.css = {
    'comment': /\/\*[\s\S]*?\*\//,
    'atrule': {
      pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
      inside: {
        'rule': /^@[\w-]+/,
        'selector-function-argument': {
          pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
          lookbehind: true,
          alias: 'selector'
        },
        'keyword': {
          pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
          lookbehind: true
        }
        // See rest below
      }
    },
    'url': {
      // https://drafts.csswg.org/css-values-3/#urls
      pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
      greedy: true,
      inside: {
        'function': /^url/i,
        'punctuation': /^\(|\)$/,
        'string': {
          pattern: RegExp('^' + string.source + '$'),
          alias: 'url'
        }
      }
    },
    'selector': {
      pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
      lookbehind: true
    },
    'string': {
      pattern: string,
      greedy: true
    },
    'property': {
      pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
      lookbehind: true
    },
    'important': /!important\b/i,
    'function': {
      pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
      lookbehind: true
    },
    'punctuation': /[(){};:,]/
  };
  Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
  var markup = Prism.languages.markup;
  if (markup) {
    markup.tag.addInlined('style', 'css');
    markup.tag.addAttribute('style', 'css');
  }
})(Prism);

(function (Prism) {
  // $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\n' '|'
  // + LC_ALL, RANDOM, REPLY, SECONDS.
  // + make sure PS1..4 are here as they are not always set,
  // - some useless things.
  var envVars = '\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b';
  var commandAfterHeredoc = {
    pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
    lookbehind: true,
    alias: 'punctuation',
    // this looks reasonably well in all themes
    inside: null // see below
  };
  var insideString = {
    'bash': commandAfterHeredoc,
    'environment': {
      pattern: RegExp('\\$' + envVars),
      alias: 'constant'
    },
    'variable': [
    // [0]: Arithmetic Environment
    {
      pattern: /\$?\(\([\s\S]+?\)\)/,
      greedy: true,
      inside: {
        // If there is a $ sign at the beginning highlight $(( and )) as variable
        'variable': [{
          pattern: /(^\$\(\([\s\S]+)\)\)/,
          lookbehind: true
        }, /^\$\(\(/],
        'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
        // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
        'operator': /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
        // If there is no $ sign at the beginning highlight (( and )) as punctuation
        'punctuation': /\(\(?|\)\)?|,|;/
      }
    },
    // [1]: Command Substitution
    {
      pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
      greedy: true,
      inside: {
        'variable': /^\$\(|^`|\)$|`$/
      }
    },
    // [2]: Brace expansion
    {
      pattern: /\$\{[^}]+\}/,
      greedy: true,
      inside: {
        'operator': /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
        'punctuation': /[\[\]]/,
        'environment': {
          pattern: RegExp('(\\{)' + envVars),
          lookbehind: true,
          alias: 'constant'
        }
      }
    }, /\$(?:\w+|[#?*!@$])/],
    // Escape sequences from echo and printf's manuals, and escaped quotes.
    'entity': /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
  };
  Prism.languages.bash = {
    'shebang': {
      pattern: /^#!\s*\/.*/,
      alias: 'important'
    },
    'comment': {
      pattern: /(^|[^"{\\$])#.*/,
      lookbehind: true
    },
    'function-name': [
    // a) function foo {
    // b) foo() {
    // c) function foo() {
    // but not “foo {”
    {
      // a) and c)
      pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
      lookbehind: true,
      alias: 'function'
    }, {
      // b)
      pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
      alias: 'function'
    }],
    // Highlight variable names as variables in for and select beginnings.
    'for-or-select': {
      pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
      alias: 'variable',
      lookbehind: true
    },
    // Highlight variable names as variables in the left-hand part
    // of assignments (“=” and “+=”).
    'assign-left': {
      pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
      inside: {
        'environment': {
          pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + envVars),
          lookbehind: true,
          alias: 'constant'
        }
      },
      alias: 'variable',
      lookbehind: true
    },
    // Highlight parameter names as variables
    'parameter': {
      pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
      alias: 'variable',
      lookbehind: true
    },
    'string': [
    // Support for Here-documents https://en.wikipedia.org/wiki/Here_document
    {
      pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
      lookbehind: true,
      greedy: true,
      inside: insideString
    },
    // Here-document with quotes around the tag
    // → No expansion (so no “inside”).
    {
      pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
      lookbehind: true,
      greedy: true,
      inside: {
        'bash': commandAfterHeredoc
      }
    },
    // “Normal” string
    {
      // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
      pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
      lookbehind: true,
      greedy: true,
      inside: insideString
    }, {
      // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
      pattern: /(^|[^$\\])'[^']*'/,
      lookbehind: true,
      greedy: true
    }, {
      // https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
      pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
      greedy: true,
      inside: {
        'entity': insideString.entity
      }
    }],
    'environment': {
      pattern: RegExp('\\$?' + envVars),
      alias: 'constant'
    },
    'variable': insideString.variable,
    'function': {
      pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
      lookbehind: true
    },
    'keyword': {
      pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
      lookbehind: true
    },
    // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
    'builtin': {
      pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
      lookbehind: true,
      // Alias added to make those easier to distinguish from strings.
      alias: 'class-name'
    },
    'boolean': {
      pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
      lookbehind: true
    },
    'file-descriptor': {
      pattern: /\B&\d\b/,
      alias: 'important'
    },
    'operator': {
      // Lots of redirections here, but not just that.
      pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
      inside: {
        'file-descriptor': {
          pattern: /^\d/,
          alias: 'important'
        }
      }
    },
    'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
    'number': {
      pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
      lookbehind: true
    }
  };
  commandAfterHeredoc.inside = Prism.languages.bash;

  /* Patterns in command substitution. */
  var toBeCopied = ['comment', 'function-name', 'for-or-select', 'assign-left', 'parameter', 'string', 'environment', 'function', 'keyword', 'builtin', 'boolean', 'file-descriptor', 'operator', 'punctuation', 'number'];
  var inside = insideString.variable[1].inside;
  for (var i = 0; i < toBeCopied.length; i++) {
    inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]];
  }
  Prism.languages.sh = Prism.languages.bash;
  Prism.languages.shell = Prism.languages.bash;
})(Prism);

(function (Prism) {
  var keywords = [/\b(?:async|sync|yield)\*/, /\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/];

  // Handles named imports, such as http.Client
  var packagePrefix = /(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source;

  // based on the dart naming conventions
  var className = {
    pattern: RegExp(packagePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
    lookbehind: true,
    inside: {
      'namespace': {
        pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,
        inside: {
          'punctuation': /\./
        }
      }
    }
  };
  Prism.languages.dart = Prism.languages.extend('clike', {
    'class-name': [className, {
      // variables and parameters
      // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
      pattern: RegExp(packagePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),
      lookbehind: true,
      inside: className.inside
    }],
    'keyword': keywords,
    'operator': /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/
  });
  Prism.languages.insertBefore('dart', 'string', {
    'string-literal': {
      pattern: /r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,
      greedy: true,
      inside: {
        'interpolation': {
          pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,
          lookbehind: true,
          inside: {
            'punctuation': /^\$\{?|\}$/,
            'expression': {
              pattern: /[\s\S]+/,
              inside: Prism.languages.dart
            }
          }
        },
        'string': /[\s\S]+/
      }
    },
    'string': undefined
  });
  Prism.languages.insertBefore('dart', 'class-name', {
    'metadata': {
      pattern: /@\w+/,
      alias: 'function'
    }
  });
  Prism.languages.insertBefore('dart', 'class-name', {
    'generics': {
      pattern: /<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,
      inside: {
        'class-name': className,
        'keyword': keywords,
        'punctuation': /[<>(),.:]/,
        'operator': /[?&|]/
      }
    }
  });
})(Prism);

(function (Prism) {
  Prism.languages.diff = {
    'coord': [
    // Match all kinds of coord lines (prefixed by "+++", "---" or "***").
    /^(?:\*{3}|-{3}|\+{3}).*$/m,
    // Match "@@ ... @@" coord lines in unified diff.
    /^@@.*@@$/m,
    // Match coord lines in normal diff (starts with a number).
    /^\d.*$/m]

    // deleted, inserted, unchanged, diff
  };

  /**
   * A map from the name of a block to its line prefix.
   *
   * @type {Object<string, string>}
   */
  var PREFIXES = {
    'deleted-sign': '-',
    'deleted-arrow': '<',
    'inserted-sign': '+',
    'inserted-arrow': '>',
    'unchanged': ' ',
    'diff': '!'
  };

  // add a token for each prefix
  Object.keys(PREFIXES).forEach(function (name) {
    var prefix = PREFIXES[name];
    var alias = [];
    if (!/^\w+$/.test(name)) {
      // "deleted-sign" -> "deleted"
      alias.push(/\w+/.exec(name)[0]);
    }
    if (name === 'diff') {
      alias.push('bold');
    }
    Prism.languages.diff[name] = {
      pattern: RegExp('^(?:[' + prefix + '].*(?:\r\n?|\n|(?![\\s\\S])))+', 'm'),
      alias: alias,
      inside: {
        'line': {
          pattern: /(.)(?=[\s\S]).*(?:\r\n?|\n)?/,
          lookbehind: true
        },
        'prefix': {
          pattern: /[\s\S]/,
          alias: /\w+/.exec(name)[0]
        }
      }
    };
  });

  // make prefixes available to Diff plugin
  Object.defineProperty(Prism.languages.diff, 'PREFIXES', {
    value: PREFIXES
  });
})(Prism);

Prism.languages.erlang = {
  'comment': /%.+/,
  'string': {
    pattern: /"(?:\\.|[^\\"\r\n])*"/,
    greedy: true
  },
  'quoted-function': {
    pattern: /'(?:\\.|[^\\'\r\n])+'(?=\()/,
    alias: 'function'
  },
  'quoted-atom': {
    pattern: /'(?:\\.|[^\\'\r\n])+'/,
    alias: 'atom'
  },
  'boolean': /\b(?:false|true)\b/,
  'keyword': /\b(?:after|begin|case|catch|end|fun|if|of|receive|try|when)\b/,
  'number': [/\$\\?./, /\b\d+#[a-z0-9]+/i, /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i],
  'function': /\b[a-z][\w@]*(?=\()/,
  'variable': {
    // Look-behind is used to prevent wrong highlighting of atoms containing "@"
    pattern: /(^|[^@])(?:\b|\?)[A-Z_][\w@]*/,
    lookbehind: true
  },
  'operator': [/[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:and|andalso|band|bnot|bor|bsl|bsr|bxor|div|not|or|orelse|rem|xor)\b/, {
    // We don't want to match <<
    pattern: /(^|[^<])<(?!<)/,
    lookbehind: true
  }, {
    // We don't want to match >>
    pattern: /(^|[^>])>(?!>)/,
    lookbehind: true
  }],
  'atom': /\b[a-z][\w@]*/,
  'punctuation': /[()[\]{}:;,.#|]|<<|>>/
};

Prism.languages.go = Prism.languages.extend('clike', {
  'string': {
    pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,
    lookbehind: true,
    greedy: true
  },
  'keyword': /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,
  'boolean': /\b(?:_|false|iota|nil|true)\b/,
  'number': [
  // binary and octal integers
  /\b0(?:b[01_]+|o[0-7_]+)i?\b/i,
  // hexadecimal integers and floats
  /\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,
  // decimal integers and floats
  /(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],
  'operator': /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,
  'builtin': /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/
});
Prism.languages.insertBefore('go', 'string', {
  'char': {
    pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/,
    greedy: true
  }
});
delete Prism.languages.go['class-name'];

(function (Prism) {
  var interpolation = {
    pattern: /((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/,
    lookbehind: true,
    inside: {
      'interpolation-punctuation': {
        pattern: /^\$\{?|\}$/,
        alias: 'punctuation'
      },
      'expression': {
        pattern: /[\s\S]+/,
        inside: null // see below
      }
    }
  };
  Prism.languages.groovy = Prism.languages.extend('clike', {
    'string': {
      // https://groovy-lang.org/syntax.html#_dollar_slashy_string
      pattern: /'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/,
      greedy: true
    },
    'keyword': /\b(?:abstract|as|assert|boolean|break|byte|case|catch|char|class|const|continue|def|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|in|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,
    'number': /\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,
    'operator': {
      pattern: /(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,
      lookbehind: true
    },
    'punctuation': /\.+|[{}[\];(),:$]/
  });
  Prism.languages.insertBefore('groovy', 'string', {
    'shebang': {
      pattern: /#!.+/,
      alias: 'comment',
      greedy: true
    },
    'interpolation-string': {
      // TODO: Slash strings (e.g. /foo/) can contain line breaks but this will cause a lot of trouble with
      // simple division (see JS regex), so find a fix maybe?
      pattern: /"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,
      greedy: true,
      inside: {
        'interpolation': interpolation,
        'string': /[\s\S]+/
      }
    }
  });
  Prism.languages.insertBefore('groovy', 'punctuation', {
    'spock-block': /\b(?:and|cleanup|expect|given|setup|then|when|where):/
  });
  Prism.languages.insertBefore('groovy', 'function', {
    'annotation': {
      pattern: /(^|[^.])@\w+/,
      lookbehind: true,
      alias: 'punctuation'
    }
  });
  interpolation.inside.expression.inside = Prism.languages.groovy;
})(Prism);

(function (Prism) {
  var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/;

  // full package (optional) + parent classes (optional)
  var classNamePrefix = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source;

  // based on the java naming conventions
  var className = {
    pattern: RegExp(/(^|[^\w.])/.source + classNamePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
    lookbehind: true,
    inside: {
      'namespace': {
        pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,
        inside: {
          'punctuation': /\./
        }
      },
      'punctuation': /\./
    }
  };
  Prism.languages.java = Prism.languages.extend('clike', {
    'string': {
      pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
      lookbehind: true,
      greedy: true
    },
    'class-name': [className, {
      // variables, parameters, and constructor references
      // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
      pattern: RegExp(/(^|[^\w.])/.source + classNamePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),
      lookbehind: true,
      inside: className.inside
    }, {
      // class names based on keyword
      // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
      pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + classNamePrefix + /[A-Z]\w*\b/.source),
      lookbehind: true,
      inside: className.inside
    }],
    'keyword': keywords,
    'function': [Prism.languages.clike.function, {
      pattern: /(::\s*)[a-z_]\w*/,
      lookbehind: true
    }],
    'number': /\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,
    'operator': {
      pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
      lookbehind: true
    },
    'constant': /\b[A-Z][A-Z_\d]+\b/
  });
  Prism.languages.insertBefore('java', 'string', {
    'triple-quoted-string': {
      // http://openjdk.java.net/jeps/355#Description
      pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
      greedy: true,
      alias: 'string'
    },
    'char': {
      pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
      greedy: true
    }
  });
  Prism.languages.insertBefore('java', 'class-name', {
    'annotation': {
      pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
      lookbehind: true,
      alias: 'punctuation'
    },
    'generics': {
      pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
      inside: {
        'class-name': className,
        'keyword': keywords,
        'punctuation': /[<>(),.:]/,
        'operator': /[?&|]/
      }
    },
    'import': [{
      pattern: RegExp(/(\bimport\s+)/.source + classNamePrefix + /(?:[A-Z]\w*|\*)(?=\s*;)/.source),
      lookbehind: true,
      inside: {
        'namespace': className.inside.namespace,
        'punctuation': /\./,
        'operator': /\*/,
        'class-name': /\w+/
      }
    }, {
      pattern: RegExp(/(\bimport\s+static\s+)/.source + classNamePrefix + /(?:\w+|\*)(?=\s*;)/.source),
      lookbehind: true,
      alias: 'static',
      inside: {
        'namespace': className.inside.namespace,
        'static': /\b\w+$/,
        'punctuation': /\./,
        'operator': /\*/,
        'class-name': /\w+/
      }
    }],
    'namespace': {
      pattern: RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g, function () {
        return keywords.source;
      })),
      lookbehind: true,
      inside: {
        'punctuation': /\./
      }
    }
  });
})(Prism);

// https://www.json.org/json-en.html
Prism.languages.json = {
  'property': {
    pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
    lookbehind: true,
    greedy: true
  },
  'string': {
    pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
    lookbehind: true,
    greedy: true
  },
  'comment': {
    pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
    greedy: true
  },
  'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
  'punctuation': /[{}[\],]/,
  'operator': /:/,
  'boolean': /\b(?:false|true)\b/,
  'null': {
    pattern: /\bnull\b/,
    alias: 'keyword'
  }
};
Prism.languages.webmanifest = Prism.languages.json;

(function (Prism) {
  Prism.languages.kotlin = Prism.languages.extend('clike', {
    'keyword': {
      // The lookbehind prevents wrong highlighting of e.g. kotlin.properties.get
      pattern: /(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,
      lookbehind: true
    },
    'function': [{
      pattern: /(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,
      greedy: true
    }, {
      pattern: /(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,
      lookbehind: true,
      greedy: true
    }],
    'number': /\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,
    'operator': /\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/
  });
  delete Prism.languages.kotlin['class-name'];
  var interpolationInside = {
    'interpolation-punctuation': {
      pattern: /^\$\{?|\}$/,
      alias: 'punctuation'
    },
    'expression': {
      pattern: /[\s\S]+/,
      inside: Prism.languages.kotlin
    }
  };
  Prism.languages.insertBefore('kotlin', 'string', {
    // https://kotlinlang.org/spec/expressions.html#string-interpolation-expressions
    'string-literal': [{
      pattern: /"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,
      alias: 'multiline',
      inside: {
        'interpolation': {
          pattern: /\$(?:[a-z_]\w*|\{[^{}]*\})/i,
          inside: interpolationInside
        },
        'string': /[\s\S]+/
      }
    }, {
      pattern: /"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,
      alias: 'singleline',
      inside: {
        'interpolation': {
          pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,
          lookbehind: true,
          inside: interpolationInside
        },
        'string': /[\s\S]+/
      }
    }],
    'char': {
      // https://kotlinlang.org/spec/expressions.html#character-literals
      pattern: /'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,
      greedy: true
    }
  });
  delete Prism.languages.kotlin['string'];
  Prism.languages.insertBefore('kotlin', 'keyword', {
    'annotation': {
      pattern: /\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,
      alias: 'builtin'
    }
  });
  Prism.languages.insertBefore('kotlin', 'function', {
    'label': {
      pattern: /\b\w+@|@\w+\b/,
      alias: 'symbol'
    }
  });
  Prism.languages.kt = Prism.languages.kotlin;
  Prism.languages.kts = Prism.languages.kotlin;
})(Prism);

(function (Prism) {
  var brackets = /(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;
  Prism.languages.perl = {
    'comment': [{
      // POD
      pattern: /(^\s*)=\w[\s\S]*?=cut.*/m,
      lookbehind: true,
      greedy: true
    }, {
      pattern: /(^|[^\\$])#.*/,
      lookbehind: true,
      greedy: true
    }],
    // TODO Could be nice to handle Heredoc too.
    'string': [{
      pattern: RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source + '(?:' + [
      // q/.../
      /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
      // q a...a
      // eslint-disable-next-line regexp/strict
      /([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,
      // q(...)
      // q{...}
      // q[...]
      // q<...>
      brackets].join('|') + ')'),
      greedy: true
    },
    // "...", `...`
    {
      pattern: /("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,
      greedy: true
    },
    // '...'
    // FIXME Multi-line single-quoted strings are not supported as they would break variables containing '
    {
      pattern: /'(?:[^'\\\r\n]|\\.)*'/,
      greedy: true
    }],
    'regex': [{
      pattern: RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source + '(?:' + [
      // m/.../
      /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
      // m a...a
      // eslint-disable-next-line regexp/strict
      /([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,
      // m(...)
      // m{...}
      // m[...]
      // m<...>
      brackets].join('|') + ')' + /[msixpodualngc]*/.source),
      greedy: true
    },
    // The lookbehinds prevent -s from breaking
    {
      pattern: RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source + '(?:' + [
      // s/.../.../
      // eslint-disable-next-line regexp/strict
      /([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,
      // s a...a...a
      // eslint-disable-next-line regexp/strict
      /([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,
      // s(...)(...)
      // s{...}{...}
      // s[...][...]
      // s<...><...>
      // s(...)[...]
      brackets + /\s*/.source + brackets].join('|') + ')' + /[msixpodualngcer]*/.source),
      lookbehind: true,
      greedy: true
    },
    // /.../
    // The look-ahead tries to prevent two divisions on
    // the same line from being highlighted as regex.
    // This does not support multi-line regex.
    {
      pattern: /\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,
      greedy: true
    }],
    // FIXME Not sure about the handling of ::, ', and #
    'variable': [
    // ${^POSTMATCH}
    /[&*$@%]\{\^[A-Z]+\}/,
    // $^V
    /[&*$@%]\^[A-Z_]/,
    // ${...}
    /[&*$@%]#?(?=\{)/,
    // $foo
    /[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,
    // $1
    /[&*$@%]\d+/,
    // $_, @_, %!
    // The negative lookahead prevents from breaking the %= operator
    /(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],
    'filehandle': {
      // <>, <FOO>, _
      pattern: /<(?![<=])\S*?>|\b_\b/,
      alias: 'symbol'
    },
    'v-string': {
      // v1.2, 1.2.3
      pattern: /v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,
      alias: 'string'
    },
    'function': {
      pattern: /(\bsub[ \t]+)\w+/,
      lookbehind: true
    },
    'keyword': /\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,
    'number': /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,
    'operator': /-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,
    'punctuation': /[{}[\];(),:]/
  };
})(Prism);

(function (Prism) {
  /**
   * Returns the placeholder for the given language id and index.
   *
   * @param {string} language
   * @param {string|number} index
   * @returns {string}
   */
  function getPlaceholder(language, index) {
    return '___' + language.toUpperCase() + index + '___';
  }
  Object.defineProperties(Prism.languages['markup-templating'] = {}, {
    buildPlaceholders: {
      /**
       * Tokenize all inline templating expressions matching `placeholderPattern`.
       *
       * If `replaceFilter` is provided, only matches of `placeholderPattern` for which `replaceFilter` returns
       * `true` will be replaced.
       *
       * @param {object} env The environment of the `before-tokenize` hook.
       * @param {string} language The language id.
       * @param {RegExp} placeholderPattern The matches of this pattern will be replaced by placeholders.
       * @param {(match: string) => boolean} [replaceFilter]
       */
      value: function (env, language, placeholderPattern, replaceFilter) {
        if (env.language !== language) {
          return;
        }
        var tokenStack = env.tokenStack = [];
        env.code = env.code.replace(placeholderPattern, function (match) {
          if (typeof replaceFilter === 'function' && !replaceFilter(match)) {
            return match;
          }
          var i = tokenStack.length;
          var placeholder;

          // Check for existing strings
          while (env.code.indexOf(placeholder = getPlaceholder(language, i)) !== -1) {
            ++i;
          }

          // Create a sparse array
          tokenStack[i] = match;
          return placeholder;
        });

        // Switch the grammar to markup
        env.grammar = Prism.languages.markup;
      }
    },
    tokenizePlaceholders: {
      /**
       * Replace placeholders with proper tokens after tokenizing.
       *
       * @param {object} env The environment of the `after-tokenize` hook.
       * @param {string} language The language id.
       */
      value: function (env, language) {
        if (env.language !== language || !env.tokenStack) {
          return;
        }

        // Switch the grammar back
        env.grammar = Prism.languages[language];
        var j = 0;
        var keys = Object.keys(env.tokenStack);
        function walkTokens(tokens) {
          for (var i = 0; i < tokens.length; i++) {
            // all placeholders are replaced already
            if (j >= keys.length) {
              break;
            }
            var token = tokens[i];
            if (typeof token === 'string' || token.content && typeof token.content === 'string') {
              var k = keys[j];
              var t = env.tokenStack[k];
              var s = typeof token === 'string' ? token : token.content;
              var placeholder = getPlaceholder(language, k);
              var index = s.indexOf(placeholder);
              if (index > -1) {
                ++j;
                var before = s.substring(0, index);
                var middle = new Prism.Token(language, Prism.tokenize(t, env.grammar), 'language-' + language, t);
                var after = s.substring(index + placeholder.length);
                var replacement = [];
                if (before) {
                  replacement.push.apply(replacement, walkTokens([before]));
                }
                replacement.push(middle);
                if (after) {
                  replacement.push.apply(replacement, walkTokens([after]));
                }
                if (typeof token === 'string') {
                  tokens.splice.apply(tokens, [i, 1].concat(replacement));
                } else {
                  token.content = replacement;
                }
              }
            } else if (token.content /* && typeof token.content !== 'string' */) {
              walkTokens(token.content);
            }
          }
          return tokens;
        }
        walkTokens(env.tokens);
      }
    }
  });
})(Prism);

/**
 * Original by Aaron Harun: http://aahacreative.com/2012/07/31/php-syntax-highlighting-prism/
 * Modified by Miles Johnson: http://milesj.me
 * Rewritten by Tom Pavelec
 *
 * Supports PHP 5.3 - 8.0
 */
(function (Prism) {
  var comment = /\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/;
  var constant = [{
    pattern: /\b(?:false|true)\b/i,
    alias: 'boolean'
  }, {
    pattern: /(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,
    greedy: true,
    lookbehind: true
  }, {
    pattern: /(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,
    greedy: true,
    lookbehind: true
  }, /\b(?:null)\b/i, /\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/];
  var number = /\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i;
  var operator = /<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/;
  var punctuation = /[{}\[\](),:;]/;
  Prism.languages.php = {
    'delimiter': {
      pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i,
      alias: 'important'
    },
    'comment': comment,
    'variable': /\$+(?:\w+\b|(?=\{))/,
    'package': {
      pattern: /(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
      lookbehind: true,
      inside: {
        'punctuation': /\\/
      }
    },
    'class-name-definition': {
      pattern: /(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,
      lookbehind: true,
      alias: 'class-name'
    },
    'function-definition': {
      pattern: /(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,
      lookbehind: true,
      alias: 'function'
    },
    'keyword': [{
      pattern: /(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,
      alias: 'type-casting',
      greedy: true,
      lookbehind: true
    }, {
      pattern: /([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,
      alias: 'type-hint',
      greedy: true,
      lookbehind: true
    }, {
      pattern: /(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,
      alias: 'return-type',
      greedy: true,
      lookbehind: true
    }, {
      pattern: /\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,
      alias: 'type-declaration',
      greedy: true
    }, {
      pattern: /(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,
      alias: 'type-declaration',
      greedy: true,
      lookbehind: true
    }, {
      pattern: /\b(?:parent|self|static)(?=\s*::)/i,
      alias: 'static-context',
      greedy: true
    }, {
      // yield from
      pattern: /(\byield\s+)from\b/i,
      lookbehind: true
    },
    // `class` is always a keyword unlike other keywords
    /\bclass\b/i, {
      // https://www.php.net/manual/en/reserved.keywords.php
      //
      // keywords cannot be preceded by "->"
      // the complex lookbehind means `(?<!(?:->|::)\s*)`
      pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,
      lookbehind: true
    }],
    'argument-name': {
      pattern: /([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,
      lookbehind: true
    },
    'class-name': [{
      pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,
      greedy: true,
      lookbehind: true
    }, {
      pattern: /(\|\s*)\b[a-z_]\w*(?!\\)\b/i,
      greedy: true,
      lookbehind: true
    }, {
      pattern: /\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,
      greedy: true
    }, {
      pattern: /(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,
      alias: 'class-name-fully-qualified',
      greedy: true,
      lookbehind: true,
      inside: {
        'punctuation': /\\/
      }
    }, {
      pattern: /(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,
      alias: 'class-name-fully-qualified',
      greedy: true,
      inside: {
        'punctuation': /\\/
      }
    }, {
      pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
      alias: 'class-name-fully-qualified',
      greedy: true,
      lookbehind: true,
      inside: {
        'punctuation': /\\/
      }
    }, {
      pattern: /\b[a-z_]\w*(?=\s*\$)/i,
      alias: 'type-declaration',
      greedy: true
    }, {
      pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
      alias: ['class-name-fully-qualified', 'type-declaration'],
      greedy: true,
      inside: {
        'punctuation': /\\/
      }
    }, {
      pattern: /\b[a-z_]\w*(?=\s*::)/i,
      alias: 'static-context',
      greedy: true
    }, {
      pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,
      alias: ['class-name-fully-qualified', 'static-context'],
      greedy: true,
      inside: {
        'punctuation': /\\/
      }
    }, {
      pattern: /([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,
      alias: 'type-hint',
      greedy: true,
      lookbehind: true
    }, {
      pattern: /([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
      alias: ['class-name-fully-qualified', 'type-hint'],
      greedy: true,
      lookbehind: true,
      inside: {
        'punctuation': /\\/
      }
    }, {
      pattern: /(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,
      alias: 'return-type',
      greedy: true,
      lookbehind: true
    }, {
      pattern: /(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
      alias: ['class-name-fully-qualified', 'return-type'],
      greedy: true,
      lookbehind: true,
      inside: {
        'punctuation': /\\/
      }
    }],
    'constant': constant,
    'function': {
      pattern: /(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,
      lookbehind: true,
      inside: {
        'punctuation': /\\/
      }
    },
    'property': {
      pattern: /(->\s*)\w+/,
      lookbehind: true
    },
    'number': number,
    'operator': operator,
    'punctuation': punctuation
  };
  var string_interpolation = {
    pattern: /\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,
    lookbehind: true,
    inside: Prism.languages.php
  };
  var string = [{
    pattern: /<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,
    alias: 'nowdoc-string',
    greedy: true,
    inside: {
      'delimiter': {
        pattern: /^<<<'[^']+'|[a-z_]\w*;$/i,
        alias: 'symbol',
        inside: {
          'punctuation': /^<<<'?|[';]$/
        }
      }
    }
  }, {
    pattern: /<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,
    alias: 'heredoc-string',
    greedy: true,
    inside: {
      'delimiter': {
        pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,
        alias: 'symbol',
        inside: {
          'punctuation': /^<<<"?|[";]$/
        }
      },
      'interpolation': string_interpolation
    }
  }, {
    pattern: /`(?:\\[\s\S]|[^\\`])*`/,
    alias: 'backtick-quoted-string',
    greedy: true
  }, {
    pattern: /'(?:\\[\s\S]|[^\\'])*'/,
    alias: 'single-quoted-string',
    greedy: true
  }, {
    pattern: /"(?:\\[\s\S]|[^\\"])*"/,
    alias: 'double-quoted-string',
    greedy: true,
    inside: {
      'interpolation': string_interpolation
    }
  }];
  Prism.languages.insertBefore('php', 'variable', {
    'string': string,
    'attribute': {
      pattern: /#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,
      greedy: true,
      inside: {
        'attribute-content': {
          pattern: /^(#\[)[\s\S]+(?=\]$)/,
          lookbehind: true,
          // inside can appear subset of php
          inside: {
            'comment': comment,
            'string': string,
            'attribute-class-name': [{
              pattern: /([^:]|^)\b[a-z_]\w*(?!\\)\b/i,
              alias: 'class-name',
              greedy: true,
              lookbehind: true
            }, {
              pattern: /([^:]|^)(?:\\?\b[a-z_]\w*)+/i,
              alias: ['class-name', 'class-name-fully-qualified'],
              greedy: true,
              lookbehind: true,
              inside: {
                'punctuation': /\\/
              }
            }],
            'constant': constant,
            'number': number,
            'operator': operator,
            'punctuation': punctuation
          }
        },
        'delimiter': {
          pattern: /^#\[|\]$/,
          alias: 'punctuation'
        }
      }
    }
  });
  Prism.hooks.add('before-tokenize', function (env) {
    if (!/<\?/.test(env.code)) {
      return;
    }
    var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;
    Prism.languages['markup-templating'].buildPlaceholders(env, 'php', phpPattern);
  });
  Prism.hooks.add('after-tokenize', function (env) {
    Prism.languages['markup-templating'].tokenizePlaceholders(env, 'php');
  });
})(Prism);

(function (Prism) {
  var powershell = Prism.languages.powershell = {
    'comment': [{
      pattern: /(^|[^`])<#[\s\S]*?#>/,
      lookbehind: true
    }, {
      pattern: /(^|[^`])#.*/,
      lookbehind: true
    }],
    'string': [{
      pattern: /"(?:`[\s\S]|[^`"])*"/,
      greedy: true,
      inside: null // see below
    }, {
      pattern: /'(?:[^']|'')*'/,
      greedy: true
    }],
    // Matches name spaces as well as casts, attribute decorators. Force starting with letter to avoid matching array indices
    // Supports two levels of nested brackets (e.g. `[OutputType([System.Collections.Generic.List[int]])]`)
    'namespace': /\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,
    'boolean': /\$(?:false|true)\b/i,
    'variable': /\$\w+\b/,
    // Cmdlets and aliases. Aliases should come last, otherwise "write" gets preferred over "write-host" for example
    // Get-Command | ?{ $_.ModuleName -match "Microsoft.PowerShell.(Util|Core|Management)" }
    // Get-Alias | ?{ $_.ReferencedCommand.Module.Name -match "Microsoft.PowerShell.(Util|Core|Management)" }
    'function': [/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i, /\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],
    // per http://technet.microsoft.com/en-us/library/hh847744.aspx
    'keyword': /\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,
    'operator': {
      pattern: /(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,
      lookbehind: true
    },
    'punctuation': /[|{}[\];(),.]/
  };

  // Variable interpolation inside strings, and nested expressions
  powershell.string[0].inside = {
    'function': {
      // Allow for one level of nesting
      pattern: /(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,
      lookbehind: true,
      inside: powershell
    },
    'boolean': powershell.boolean,
    'variable': powershell.variable
  };
})(Prism);

Prism.languages.python = {
  'comment': {
    pattern: /(^|[^\\])#.*/,
    lookbehind: true,
    greedy: true
  },
  'string-interpolation': {
    pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
    greedy: true,
    inside: {
      'interpolation': {
        // "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
        pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
        lookbehind: true,
        inside: {
          'format-spec': {
            pattern: /(:)[^:(){}]+(?=\}$)/,
            lookbehind: true
          },
          'conversion-option': {
            pattern: /![sra](?=[:}]$)/,
            alias: 'punctuation'
          },
          rest: null
        }
      },
      'string': /[\s\S]+/
    }
  },
  'triple-quoted-string': {
    pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
    greedy: true,
    alias: 'string'
  },
  'string': {
    pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
    greedy: true
  },
  'function': {
    pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
    lookbehind: true
  },
  'class-name': {
    pattern: /(\bclass\s+)\w+/i,
    lookbehind: true
  },
  'decorator': {
    pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
    lookbehind: true,
    alias: ['annotation', 'punctuation'],
    inside: {
      'punctuation': /\./
    }
  },
  'keyword': /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
  'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
  'boolean': /\b(?:False|None|True)\b/,
  'number': /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
  'operator': /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
  'punctuation': /[{}[\];(),.:]/
};
Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python;
Prism.languages.py = Prism.languages.python;

/**
 * Original by Samuel Flores
 *
 * Adds the following new token classes:
 *     constant, builtin, variable, symbol, regex
 */
(function (Prism) {
  Prism.languages.ruby = Prism.languages.extend('clike', {
    'comment': {
      pattern: /#.*|^=begin\s[\s\S]*?^=end/m,
      greedy: true
    },
    'class-name': {
      pattern: /(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,
      lookbehind: true,
      inside: {
        'punctuation': /[.\\]/
      }
    },
    'keyword': /\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,
    'operator': /\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,
    'punctuation': /[(){}[\].,;]/
  });
  Prism.languages.insertBefore('ruby', 'operator', {
    'double-colon': {
      pattern: /::/,
      alias: 'punctuation'
    }
  });
  var interpolation = {
    pattern: /((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,
    lookbehind: true,
    inside: {
      'content': {
        pattern: /^(#\{)[\s\S]+(?=\}$)/,
        lookbehind: true,
        inside: Prism.languages.ruby
      },
      'delimiter': {
        pattern: /^#\{|\}$/,
        alias: 'punctuation'
      }
    }
  };
  delete Prism.languages.ruby.function;
  var percentExpression = '(?:' + [/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source, /\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source, /\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source, /\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source, /<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join('|') + ')';
  var symbolName = /(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;
  Prism.languages.insertBefore('ruby', 'keyword', {
    'regex-literal': [{
      pattern: RegExp(/%r/.source + percentExpression + /[egimnosux]{0,6}/.source),
      greedy: true,
      inside: {
        'interpolation': interpolation,
        'regex': /[\s\S]+/
      }
    }, {
      pattern: /(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,
      lookbehind: true,
      greedy: true,
      inside: {
        'interpolation': interpolation,
        'regex': /[\s\S]+/
      }
    }],
    'variable': /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,
    'symbol': [{
      pattern: RegExp(/(^|[^:]):/.source + symbolName),
      lookbehind: true,
      greedy: true
    }, {
      pattern: RegExp(/([\r\n{(,][ \t]*)/.source + symbolName + /(?=:(?!:))/.source),
      lookbehind: true,
      greedy: true
    }],
    'method-definition': {
      pattern: /(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,
      lookbehind: true,
      inside: {
        'function': /\b\w+$/,
        'keyword': /^self\b/,
        'class-name': /^\w+/,
        'punctuation': /\./
      }
    }
  });
  Prism.languages.insertBefore('ruby', 'string', {
    'string-literal': [{
      pattern: RegExp(/%[qQiIwWs]?/.source + percentExpression),
      greedy: true,
      inside: {
        'interpolation': interpolation,
        'string': /[\s\S]+/
      }
    }, {
      pattern: /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,
      greedy: true,
      inside: {
        'interpolation': interpolation,
        'string': /[\s\S]+/
      }
    }, {
      pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
      alias: 'heredoc-string',
      greedy: true,
      inside: {
        'delimiter': {
          pattern: /^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,
          inside: {
            'symbol': /\b\w+/,
            'punctuation': /^<<[-~]?/
          }
        },
        'interpolation': interpolation,
        'string': /[\s\S]+/
      }
    }, {
      pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
      alias: 'heredoc-string',
      greedy: true,
      inside: {
        'delimiter': {
          pattern: /^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,
          inside: {
            'symbol': /\b\w+/,
            'punctuation': /^<<[-~]?'|'$/
          }
        },
        'string': /[\s\S]+/
      }
    }],
    'command-literal': [{
      pattern: RegExp(/%x/.source + percentExpression),
      greedy: true,
      inside: {
        'interpolation': interpolation,
        'command': {
          pattern: /[\s\S]+/,
          alias: 'string'
        }
      }
    }, {
      pattern: /`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,
      greedy: true,
      inside: {
        'interpolation': interpolation,
        'command': {
          pattern: /[\s\S]+/,
          alias: 'string'
        }
      }
    }]
  });
  delete Prism.languages.ruby.string;
  Prism.languages.insertBefore('ruby', 'number', {
    'builtin': /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,
    'constant': /\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/
  });
  Prism.languages.rb = Prism.languages.ruby;
})(Prism);

Prism.languages.scala = Prism.languages.extend('java', {
  'triple-quoted-string': {
    pattern: /"""[\s\S]*?"""/,
    greedy: true,
    alias: 'string'
  },
  'string': {
    pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
    greedy: true
  },
  'keyword': /<-|=>|\b(?:abstract|case|catch|class|def|derives|do|else|enum|extends|extension|final|finally|for|forSome|given|if|implicit|import|infix|inline|lazy|match|new|null|object|opaque|open|override|package|private|protected|return|sealed|self|super|this|throw|trait|transparent|try|type|using|val|var|while|with|yield)\b/,
  'number': /\b0x(?:[\da-f]*\.)?[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e\d+)?[dfl]?/i,
  'builtin': /\b(?:Any|AnyRef|AnyVal|Boolean|Byte|Char|Double|Float|Int|Long|Nothing|Short|String|Unit)\b/,
  'symbol': /'[^\d\s\\]\w*/
});
Prism.languages.insertBefore('scala', 'triple-quoted-string', {
  'string-interpolation': {
    pattern: /\b[a-z]\w*(?:"""(?:[^$]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*?"""|"(?:[^$"\r\n]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*")/i,
    greedy: true,
    inside: {
      'id': {
        pattern: /^\w+/,
        greedy: true,
        alias: 'function'
      },
      'escape': {
        pattern: /\\\$"|\$[$"]/,
        greedy: true,
        alias: 'symbol'
      },
      'interpolation': {
        pattern: /\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,
        greedy: true,
        inside: {
          'punctuation': /^\$\{?|\}$/,
          'expression': {
            pattern: /[\s\S]+/,
            inside: Prism.languages.scala
          }
        }
      },
      'string': /[\s\S]+/
    }
  }
});
delete Prism.languages.scala['class-name'];
delete Prism.languages.scala['function'];
delete Prism.languages.scala['constant'];

Prism.languages.sql = {
  'comment': {
    pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,
    lookbehind: true
  },
  'variable': [{
    pattern: /@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,
    greedy: true
  }, /@[\w.$]+/],
  'string': {
    pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,
    greedy: true,
    lookbehind: true
  },
  'identifier': {
    pattern: /(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,
    greedy: true,
    lookbehind: true,
    inside: {
      'punctuation': /^`|`$/
    }
  },
  'function': /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,
  // Should we highlight user defined functions too?
  'keyword': /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,
  'boolean': /\b(?:FALSE|NULL|TRUE)\b/i,
  'number': /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,
  'operator': /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,
  'punctuation': /[;[\]()`,.]/
};

Prism.languages['visual-basic'] = {
  'comment': {
    pattern: /(?:['‘’]|REM\b)(?:[^\r\n_]|_(?:\r\n?|\n)?)*/i,
    inside: {
      'keyword': /^REM/i
    }
  },
  'directive': {
    pattern: /#(?:Const|Else|ElseIf|End|ExternalChecksum|ExternalSource|If|Region)(?:\b_[ \t]*(?:\r\n?|\n)|.)+/i,
    alias: 'property',
    greedy: true
  },
  'string': {
    pattern: /\$?["“”](?:["“”]{2}|[^"“”])*["“”]C?/i,
    greedy: true
  },
  'date': {
    pattern: /#[ \t]*(?:\d+([/-])\d+\1\d+(?:[ \t]+(?:\d+[ \t]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[ \t]*(?:AM|PM))?))?|\d+[ \t]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[ \t]*(?:AM|PM))?)[ \t]*#/i,
    alias: 'number'
  },
  'number': /(?:(?:\b\d+(?:\.\d+)?|\.\d+)(?:E[+-]?\d+)?|&[HO][\dA-F]+)(?:[FRD]|U?[ILS])?/i,
  'boolean': /\b(?:False|Nothing|True)\b/i,
  'keyword': /\b(?:AddHandler|AddressOf|Alias|And(?:Also)?|As|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|C(?:Bool|Byte|Char|Date|Dbl|Dec|Int|Lng|Obj|SByte|Short|Sng|Str|Type|UInt|ULng|UShort)|Char|Class|Const|Continue|Currency|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else(?:If)?|End(?:If)?|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get(?:Type|XMLNamespace)?|Global|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|IsNot|Let|Lib|Like|Long|Loop|Me|Mod|Module|Must(?:Inherit|Override)|My(?:Base|Class)|Namespace|Narrowing|New|Next|Not(?:Inheritable|Overridable)?|Object|Of|On|Operator|Option(?:al)?|Or(?:Else)?|Out|Overloads|Overridable|Overrides|ParamArray|Partial|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|SByte|Select|Set|Shadows|Shared|short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TryCast|Type|TypeOf|U(?:Integer|Long|Short)|Until|Using|Variant|Wend|When|While|Widening|With(?:Events)?|WriteOnly|Xor)\b/i,
  'operator': /[+\-*/\\^<=>&#@$%!]|\b_(?=[ \t]*[\r\n])/,
  'punctuation': /[{}().,:?]/
};
Prism.languages.vb = Prism.languages['visual-basic'];
Prism.languages.vba = Prism.languages['visual-basic'];

(function (Prism) {
  /**
   * If the given language is present, it will insert the given doc comment grammar token into it.
   *
   * @param {string} lang
   * @param {any} docComment
   */
  function insertDocComment(lang, docComment) {
    if (Prism.languages[lang]) {
      Prism.languages.insertBefore(lang, 'comment', {
        'doc-comment': docComment
      });
    }
  }
  var tag = Prism.languages.markup.tag;
  var slashDocComment = {
    pattern: /\/\/\/.*/,
    greedy: true,
    alias: 'comment',
    inside: {
      'tag': tag
    }
  };
  var tickDocComment = {
    pattern: /'''.*/,
    greedy: true,
    alias: 'comment',
    inside: {
      'tag': tag
    }
  };
  insertDocComment('csharp', slashDocComment);
  insertDocComment('fsharp', slashDocComment);
  insertDocComment('vbnet', tickDocComment);
})(Prism);

(function (Prism) {
  // https://yaml.org/spec/1.2/spec.html#c-ns-anchor-property
  // https://yaml.org/spec/1.2/spec.html#c-ns-alias-node
  var anchorOrAlias = /[*&][^\s[\]{},]+/;
  // https://yaml.org/spec/1.2/spec.html#c-ns-tag-property
  var tag = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/;
  // https://yaml.org/spec/1.2/spec.html#c-ns-properties(n,c)
  var properties = '(?:' + tag.source + '(?:[ \t]+' + anchorOrAlias.source + ')?|' + anchorOrAlias.source + '(?:[ \t]+' + tag.source + ')?)';
  // https://yaml.org/spec/1.2/spec.html#ns-plain(n,c)
  // This is a simplified version that doesn't support "#" and multiline keys
  // All these long scarry character classes are simplified versions of YAML's characters
  var plainKey = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g, function () {
    return /[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source;
  });
  var string = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;

  /**
   *
   * @param {string} value
   * @param {string} [flags]
   * @returns {RegExp}
   */
  function createValuePattern(value, flags) {
    flags = (flags || '').replace(/m/g, '') + 'm'; // add m flag
    var pattern = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g, function () {
      return properties;
    }).replace(/<<value>>/g, function () {
      return value;
    });
    return RegExp(pattern, flags);
  }
  Prism.languages.yaml = {
    'scalar': {
      pattern: RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g, function () {
        return properties;
      })),
      lookbehind: true,
      alias: 'string'
    },
    'comment': /#.*/,
    'key': {
      pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g, function () {
        return properties;
      }).replace(/<<key>>/g, function () {
        return '(?:' + plainKey + '|' + string + ')';
      })),
      lookbehind: true,
      greedy: true,
      alias: 'atrule'
    },
    'directive': {
      pattern: /(^[ \t]*)%.+/m,
      lookbehind: true,
      alias: 'important'
    },
    'datetime': {
      pattern: createValuePattern(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),
      lookbehind: true,
      alias: 'number'
    },
    'boolean': {
      pattern: createValuePattern(/false|true/.source, 'i'),
      lookbehind: true,
      alias: 'important'
    },
    'null': {
      pattern: createValuePattern(/null|~/.source, 'i'),
      lookbehind: true,
      alias: 'important'
    },
    'string': {
      pattern: createValuePattern(string),
      lookbehind: true,
      greedy: true
    },
    'number': {
      pattern: createValuePattern(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, 'i'),
      lookbehind: true
    },
    'tag': tag,
    'important': anchorOrAlias,
    'punctuation': /---|[:[\]{}\-,|>?]|\.\.\./
  };
  Prism.languages.yml = Prism.languages.yaml;
})(Prism);

(function () {
  if (typeof Prism === 'undefined' || typeof document === 'undefined') {
    return;
  }

  /**
   * Plugin name which is used as a class name for <pre> which is activating the plugin
   *
   * @type {string}
   */
  var PLUGIN_NAME = 'line-numbers';

  /**
   * Regular expression used for determining line breaks
   *
   * @type {RegExp}
   */
  var NEW_LINE_EXP = /\n(?!$)/g;

  /**
   * Global exports
   */
  var config = Prism.plugins.lineNumbers = {
    /**
     * Get node for provided line number
     *
     * @param {Element} element pre element
     * @param {number} number line number
     * @returns {Element|undefined}
     */
    getLine: function (element, number) {
      if (element.tagName !== 'PRE' || !element.classList.contains(PLUGIN_NAME)) {
        return;
      }
      var lineNumberRows = element.querySelector('.line-numbers-rows');
      if (!lineNumberRows) {
        return;
      }
      var lineNumberStart = parseInt(element.getAttribute('data-start'), 10) || 1;
      var lineNumberEnd = lineNumberStart + (lineNumberRows.children.length - 1);
      if (number < lineNumberStart) {
        number = lineNumberStart;
      }
      if (number > lineNumberEnd) {
        number = lineNumberEnd;
      }
      var lineIndex = number - lineNumberStart;
      return lineNumberRows.children[lineIndex];
    },
    /**
     * Resizes the line numbers of the given element.
     *
     * This function will not add line numbers. It will only resize existing ones.
     *
     * @param {HTMLElement} element A `<pre>` element with line numbers.
     * @returns {void}
     */
    resize: function (element) {
      resizeElements([element]);
    },
    /**
     * Whether the plugin can assume that the units font sizes and margins are not depended on the size of
     * the current viewport.
     *
     * Setting this to `true` will allow the plugin to do certain optimizations for better performance.
     *
     * Set this to `false` if you use any of the following CSS units: `vh`, `vw`, `vmin`, `vmax`.
     *
     * @type {boolean}
     */
    assumeViewportIndependence: true
  };

  /**
   * Resizes the given elements.
   *
   * @param {HTMLElement[]} elements
   */
  function resizeElements(elements) {
    elements = elements.filter(function (e) {
      var codeStyles = getStyles(e);
      var whiteSpace = codeStyles['white-space'];
      return whiteSpace === 'pre-wrap' || whiteSpace === 'pre-line';
    });
    if (elements.length == 0) {
      return;
    }
    var infos = elements.map(function (element) {
      var codeElement = element.querySelector('code');
      var lineNumbersWrapper = element.querySelector('.line-numbers-rows');
      if (!codeElement || !lineNumbersWrapper) {
        return undefined;
      }

      /** @type {HTMLElement} */
      var lineNumberSizer = element.querySelector('.line-numbers-sizer');
      var codeLines = codeElement.textContent.split(NEW_LINE_EXP);
      if (!lineNumberSizer) {
        lineNumberSizer = document.createElement('span');
        lineNumberSizer.className = 'line-numbers-sizer';
        codeElement.appendChild(lineNumberSizer);
      }
      lineNumberSizer.innerHTML = '0';
      lineNumberSizer.style.display = 'block';
      var oneLinerHeight = lineNumberSizer.getBoundingClientRect().height;
      lineNumberSizer.innerHTML = '';
      return {
        element: element,
        lines: codeLines,
        lineHeights: [],
        oneLinerHeight: oneLinerHeight,
        sizer: lineNumberSizer
      };
    }).filter(Boolean);
    infos.forEach(function (info) {
      var lineNumberSizer = info.sizer;
      var lines = info.lines;
      var lineHeights = info.lineHeights;
      var oneLinerHeight = info.oneLinerHeight;
      lineHeights[lines.length - 1] = undefined;
      lines.forEach(function (line, index) {
        if (line && line.length > 1) {
          var e = lineNumberSizer.appendChild(document.createElement('span'));
          e.style.display = 'block';
          e.textContent = line;
        } else {
          lineHeights[index] = oneLinerHeight;
        }
      });
    });
    infos.forEach(function (info) {
      var lineNumberSizer = info.sizer;
      var lineHeights = info.lineHeights;
      var childIndex = 0;
      for (var i = 0; i < lineHeights.length; i++) {
        if (lineHeights[i] === undefined) {
          lineHeights[i] = lineNumberSizer.children[childIndex++].getBoundingClientRect().height;
        }
      }
    });
    infos.forEach(function (info) {
      var lineNumberSizer = info.sizer;
      var wrapper = info.element.querySelector('.line-numbers-rows');
      lineNumberSizer.style.display = 'none';
      lineNumberSizer.innerHTML = '';
      info.lineHeights.forEach(function (height, lineNumber) {
        wrapper.children[lineNumber].style.height = height + 'px';
      });
    });
  }

  /**
   * Returns style declarations for the element
   *
   * @param {Element} element
   */
  function getStyles(element) {
    if (!element) {
      return null;
    }
    return window.getComputedStyle ? getComputedStyle(element) : element.currentStyle || null;
  }
  var lastWidth = undefined;
  window.addEventListener('resize', function () {
    if (config.assumeViewportIndependence && lastWidth === window.innerWidth) {
      return;
    }
    lastWidth = window.innerWidth;
    resizeElements(Array.prototype.slice.call(document.querySelectorAll('pre.' + PLUGIN_NAME)));
  });
  Prism.hooks.add('complete', function (env) {
    if (!env.code) {
      return;
    }
    var code = /** @type {Element} */env.element;
    var pre = /** @type {HTMLElement} */code.parentNode;

    // works only for <code> wrapped inside <pre> (not inline)
    if (!pre || !/pre/i.test(pre.nodeName)) {
      return;
    }

    // Abort if line numbers already exists
    if (code.querySelector('.line-numbers-rows')) {
      return;
    }

    // only add line numbers if <code> or one of its ancestors has the `line-numbers` class
    if (!Prism.util.isActive(code, PLUGIN_NAME)) {
      return;
    }

    // Remove the class 'line-numbers' from the <code>
    code.classList.remove(PLUGIN_NAME);
    // Add the class 'line-numbers' to the <pre>
    pre.classList.add(PLUGIN_NAME);
    var match = env.code.match(NEW_LINE_EXP);
    var linesNum = match ? match.length + 1 : 1;
    var lineNumbersWrapper;
    var lines = new Array(linesNum + 1).join('<span></span>');
    lineNumbersWrapper = document.createElement('span');
    lineNumbersWrapper.setAttribute('aria-hidden', 'true');
    lineNumbersWrapper.className = 'line-numbers-rows';
    lineNumbersWrapper.innerHTML = lines;
    if (pre.hasAttribute('data-start')) {
      pre.style.counterReset = 'linenumber ' + (parseInt(pre.getAttribute('data-start'), 10) - 1);
    }
    env.element.appendChild(lineNumbersWrapper);
    resizeElements([pre]);
    Prism.hooks.run('line-numbers', env);
  });
  Prism.hooks.add('line-numbers', function (env) {
    env.plugins = env.plugins || {};
    env.plugins.lineNumbers = true;
  });
})();

(function () {
  if (typeof Prism === 'undefined' || typeof document === 'undefined') {
    return;
  }
  var callbacks = [];
  var map = {};
  var noop = function () {};
  Prism.plugins.toolbar = {};

  /**
   * @typedef ButtonOptions
   * @property {string} text The text displayed.
   * @property {string} [url] The URL of the link which will be created.
   * @property {Function} [onClick] The event listener for the `click` event of the created button.
   * @property {string} [className] The class attribute to include with element.
   */

  /**
   * Register a button callback with the toolbar.
   *
   * @param {string} key
   * @param {ButtonOptions|Function} opts
   */
  var registerButton = Prism.plugins.toolbar.registerButton = function (key, opts) {
    var callback;
    if (typeof opts === 'function') {
      callback = opts;
    } else {
      callback = function (env) {
        var element;
        if (typeof opts.onClick === 'function') {
          element = document.createElement('button');
          element.type = 'button';
          element.addEventListener('click', function () {
            opts.onClick.call(this, env);
          });
        } else if (typeof opts.url === 'string') {
          element = document.createElement('a');
          element.href = opts.url;
        } else {
          element = document.createElement('span');
        }
        if (opts.className) {
          element.classList.add(opts.className);
        }
        element.textContent = opts.text;
        return element;
      };
    }
    if (key in map) {
      console.warn('There is a button with the key "' + key + '" registered already.');
      return;
    }
    callbacks.push(map[key] = callback);
  };

  /**
   * Returns the callback order of the given element.
   *
   * @param {HTMLElement} element
   * @returns {string[] | undefined}
   */
  function getOrder(element) {
    while (element) {
      var order = element.getAttribute('data-toolbar-order');
      if (order != null) {
        order = order.trim();
        if (order.length) {
          return order.split(/\s*,\s*/g);
        } else {
          return [];
        }
      }
      element = element.parentElement;
    }
  }

  /**
   * Post-highlight Prism hook callback.
   *
   * @param env
   */
  var hook = Prism.plugins.toolbar.hook = function (env) {
    // Check if inline or actual code block (credit to line-numbers plugin)
    var pre = env.element.parentNode;
    if (!pre || !/pre/i.test(pre.nodeName)) {
      return;
    }

    // Autoloader rehighlights, so only do this once.
    if (pre.parentNode.classList.contains('code-toolbar')) {
      return;
    }

    // Create wrapper for <pre> to prevent scrolling toolbar with content
    var wrapper = document.createElement('div');
    wrapper.classList.add('code-toolbar');
    pre.parentNode.insertBefore(wrapper, pre);
    wrapper.appendChild(pre);

    // Setup the toolbar
    var toolbar = document.createElement('div');
    toolbar.classList.add('toolbar');

    // order callbacks
    var elementCallbacks = callbacks;
    var order = getOrder(env.element);
    if (order) {
      elementCallbacks = order.map(function (key) {
        return map[key] || noop;
      });
    }
    elementCallbacks.forEach(function (callback) {
      var element = callback(env);
      if (!element) {
        return;
      }
      var item = document.createElement('div');
      item.classList.add('toolbar-item');
      item.appendChild(element);
      toolbar.appendChild(item);
    });

    // Add our toolbar to the currently created wrapper of <pre> tag
    wrapper.appendChild(toolbar);
  };
  registerButton('label', function (env) {
    var pre = env.element.parentNode;
    if (!pre || !/pre/i.test(pre.nodeName)) {
      return;
    }
    if (!pre.hasAttribute('data-label')) {
      return;
    }
    var element;
    var template;
    var text = pre.getAttribute('data-label');
    try {
      // Any normal text will blow up this selector.
      template = document.querySelector('template#' + text);
    } catch (e) {/* noop */}
    if (template) {
      element = template.content;
    } else {
      if (pre.hasAttribute('data-url')) {
        element = document.createElement('a');
        element.href = pre.getAttribute('data-url');
      } else {
        element = document.createElement('span');
      }
      element.textContent = text;
    }
    return element;
  });

  /**
   * Register the toolbar with Prism.
   */
  Prism.hooks.add('complete', hook);
})();

(function () {
  if (typeof Prism === 'undefined' || typeof document === 'undefined') {
    return;
  }
  if (!Prism.plugins.toolbar) {
    console.warn('Show Languages plugin loaded before Toolbar plugin.');
    return;
  }

  /* eslint-disable */

  // The languages map is built automatically with gulp
  var Languages = /*languages_placeholder[*/{
    "none": "Plain text",
    "plain": "Plain text",
    "plaintext": "Plain text",
    "text": "Plain text",
    "txt": "Plain text",
    "html": "HTML",
    "xml": "XML",
    "svg": "SVG",
    "mathml": "MathML",
    "ssml": "SSML",
    "rss": "RSS",
    "css": "CSS",
    "clike": "C-like",
    "js": "JavaScript",
    "abap": "ABAP",
    "abnf": "ABNF",
    "al": "AL",
    "antlr4": "ANTLR4",
    "g4": "ANTLR4",
    "apacheconf": "Apache Configuration",
    "apl": "APL",
    "aql": "AQL",
    "ino": "Arduino",
    "arff": "ARFF",
    "armasm": "ARM Assembly",
    "arm-asm": "ARM Assembly",
    "art": "Arturo",
    "asciidoc": "AsciiDoc",
    "adoc": "AsciiDoc",
    "aspnet": "ASP.NET (C#)",
    "asm6502": "6502 Assembly",
    "asmatmel": "Atmel AVR Assembly",
    "autohotkey": "AutoHotkey",
    "autoit": "AutoIt",
    "avisynth": "AviSynth",
    "avs": "AviSynth",
    "avro-idl": "Avro IDL",
    "avdl": "Avro IDL",
    "awk": "AWK",
    "gawk": "GAWK",
    "sh": "Shell",
    "basic": "BASIC",
    "bbcode": "BBcode",
    "bbj": "BBj",
    "bnf": "BNF",
    "rbnf": "RBNF",
    "bqn": "BQN",
    "bsl": "BSL (1C:Enterprise)",
    "oscript": "OneScript",
    "csharp": "C#",
    "cs": "C#",
    "dotnet": "C#",
    "cpp": "C++",
    "cfscript": "CFScript",
    "cfc": "CFScript",
    "cil": "CIL",
    "cilkc": "Cilk/C",
    "cilk-c": "Cilk/C",
    "cilkcpp": "Cilk/C++",
    "cilk-cpp": "Cilk/C++",
    "cilk": "Cilk/C++",
    "cmake": "CMake",
    "cobol": "COBOL",
    "coffee": "CoffeeScript",
    "conc": "Concurnas",
    "csp": "Content-Security-Policy",
    "css-extras": "CSS Extras",
    "csv": "CSV",
    "cue": "CUE",
    "dataweave": "DataWeave",
    "dax": "DAX",
    "django": "Django/Jinja2",
    "jinja2": "Django/Jinja2",
    "dns-zone-file": "DNS zone file",
    "dns-zone": "DNS zone file",
    "dockerfile": "Docker",
    "dot": "DOT (Graphviz)",
    "gv": "DOT (Graphviz)",
    "ebnf": "EBNF",
    "editorconfig": "EditorConfig",
    "ejs": "EJS",
    "etlua": "Embedded Lua templating",
    "erb": "ERB",
    "excel-formula": "Excel Formula",
    "xlsx": "Excel Formula",
    "xls": "Excel Formula",
    "fsharp": "F#",
    "firestore-security-rules": "Firestore security rules",
    "ftl": "FreeMarker Template Language",
    "gml": "GameMaker Language",
    "gamemakerlanguage": "GameMaker Language",
    "gap": "GAP (CAS)",
    "gcode": "G-code",
    "gdscript": "GDScript",
    "gedcom": "GEDCOM",
    "gettext": "gettext",
    "po": "gettext",
    "glsl": "GLSL",
    "gn": "GN",
    "gni": "GN",
    "linker-script": "GNU Linker Script",
    "ld": "GNU Linker Script",
    "go-module": "Go module",
    "go-mod": "Go module",
    "graphql": "GraphQL",
    "hbs": "Handlebars",
    "hs": "Haskell",
    "hcl": "HCL",
    "hlsl": "HLSL",
    "http": "HTTP",
    "hpkp": "HTTP Public-Key-Pins",
    "hsts": "HTTP Strict-Transport-Security",
    "ichigojam": "IchigoJam",
    "icu-message-format": "ICU Message Format",
    "idr": "Idris",
    "ignore": ".ignore",
    "gitignore": ".gitignore",
    "hgignore": ".hgignore",
    "npmignore": ".npmignore",
    "inform7": "Inform 7",
    "javadoc": "JavaDoc",
    "javadoclike": "JavaDoc-like",
    "javastacktrace": "Java stack trace",
    "jq": "JQ",
    "jsdoc": "JSDoc",
    "js-extras": "JS Extras",
    "json": "JSON",
    "webmanifest": "Web App Manifest",
    "json5": "JSON5",
    "jsonp": "JSONP",
    "jsstacktrace": "JS stack trace",
    "js-templates": "JS Templates",
    "keepalived": "Keepalived Configure",
    "kts": "Kotlin Script",
    "kt": "Kotlin",
    "kumir": "KuMir (КуМир)",
    "kum": "KuMir (КуМир)",
    "latex": "LaTeX",
    "tex": "TeX",
    "context": "ConTeXt",
    "lilypond": "LilyPond",
    "ly": "LilyPond",
    "emacs": "Lisp",
    "elisp": "Lisp",
    "emacs-lisp": "Lisp",
    "llvm": "LLVM IR",
    "log": "Log file",
    "lolcode": "LOLCODE",
    "magma": "Magma (CAS)",
    "md": "Markdown",
    "markup-templating": "Markup templating",
    "matlab": "MATLAB",
    "maxscript": "MAXScript",
    "mel": "MEL",
    "metafont": "METAFONT",
    "mongodb": "MongoDB",
    "moon": "MoonScript",
    "n1ql": "N1QL",
    "n4js": "N4JS",
    "n4jsd": "N4JS",
    "nand2tetris-hdl": "Nand To Tetris HDL",
    "naniscript": "Naninovel Script",
    "nani": "Naninovel Script",
    "nasm": "NASM",
    "neon": "NEON",
    "nginx": "nginx",
    "nsis": "NSIS",
    "objectivec": "Objective-C",
    "objc": "Objective-C",
    "ocaml": "OCaml",
    "opencl": "OpenCL",
    "openqasm": "OpenQasm",
    "qasm": "OpenQasm",
    "parigp": "PARI/GP",
    "objectpascal": "Object Pascal",
    "psl": "PATROL Scripting Language",
    "pcaxis": "PC-Axis",
    "px": "PC-Axis",
    "peoplecode": "PeopleCode",
    "pcode": "PeopleCode",
    "php": "PHP",
    "phpdoc": "PHPDoc",
    "php-extras": "PHP Extras",
    "plant-uml": "PlantUML",
    "plantuml": "PlantUML",
    "plsql": "PL/SQL",
    "powerquery": "PowerQuery",
    "pq": "PowerQuery",
    "mscript": "PowerQuery",
    "powershell": "PowerShell",
    "promql": "PromQL",
    "properties": ".properties",
    "protobuf": "Protocol Buffers",
    "purebasic": "PureBasic",
    "pbfasm": "PureBasic",
    "purs": "PureScript",
    "py": "Python",
    "qsharp": "Q#",
    "qs": "Q#",
    "q": "Q (kdb+ database)",
    "qml": "QML",
    "rkt": "Racket",
    "cshtml": "Razor C#",
    "razor": "Razor C#",
    "jsx": "React JSX",
    "tsx": "React TSX",
    "renpy": "Ren'py",
    "rpy": "Ren'py",
    "res": "ReScript",
    "rest": "reST (reStructuredText)",
    "robotframework": "Robot Framework",
    "robot": "Robot Framework",
    "rb": "Ruby",
    "sas": "SAS",
    "sass": "Sass (Sass)",
    "scss": "Sass (SCSS)",
    "shell-session": "Shell session",
    "sh-session": "Shell session",
    "shellsession": "Shell session",
    "sml": "SML",
    "smlnj": "SML/NJ",
    "solidity": "Solidity (Ethereum)",
    "sol": "Solidity (Ethereum)",
    "solution-file": "Solution file",
    "sln": "Solution file",
    "soy": "Soy (Closure Template)",
    "sparql": "SPARQL",
    "rq": "SPARQL",
    "splunk-spl": "Splunk SPL",
    "sqf": "SQF: Status Quo Function (Arma 3)",
    "sql": "SQL",
    "stata": "Stata Ado",
    "iecst": "Structured Text (IEC 61131-3)",
    "supercollider": "SuperCollider",
    "sclang": "SuperCollider",
    "systemd": "Systemd configuration file",
    "t4-templating": "T4 templating",
    "t4-cs": "T4 Text Templates (C#)",
    "t4": "T4 Text Templates (C#)",
    "t4-vb": "T4 Text Templates (VB)",
    "tap": "TAP",
    "tt2": "Template Toolkit 2",
    "toml": "TOML",
    "trickle": "trickle",
    "troy": "troy",
    "trig": "TriG",
    "ts": "TypeScript",
    "tsconfig": "TSConfig",
    "uscript": "UnrealScript",
    "uc": "UnrealScript",
    "uorazor": "UO Razor Script",
    "uri": "URI",
    "url": "URL",
    "vbnet": "VB.Net",
    "vhdl": "VHDL",
    "vim": "vim",
    "visual-basic": "Visual Basic",
    "vba": "VBA",
    "vb": "Visual Basic",
    "wasm": "WebAssembly",
    "web-idl": "Web IDL",
    "webidl": "Web IDL",
    "wgsl": "WGSL",
    "wiki": "Wiki markup",
    "wolfram": "Wolfram language",
    "nb": "Mathematica Notebook",
    "wl": "Wolfram language",
    "xeoracube": "XeoraCube",
    "xml-doc": "XML doc (.net)",
    "xojo": "Xojo (REALbasic)",
    "xquery": "XQuery",
    "yaml": "YAML",
    "yml": "YAML",
    "yang": "YANG"
  } /*]*/;

  /* eslint-enable */

  Prism.plugins.toolbar.registerButton('show-language', function (env) {
    var pre = env.element.parentNode;
    if (!pre || !/pre/i.test(pre.nodeName)) {
      return;
    }

    /**
     * Tries to guess the name of a language given its id.
     *
     * @param {string} id The language id.
     * @returns {string}
     */
    function guessTitle(id) {
      if (!id) {
        return id;
      }
      return (id.substring(0, 1).toUpperCase() + id.substring(1)).replace(/s(?=cript)/, 'S');
    }
    var language = pre.getAttribute('data-language') || Languages[env.language] || guessTitle(env.language);
    if (!language) {
      return;
    }
    var element = document.createElement('span');
    element.textContent = language;
    return element;
  });
})();

(function () {
  if (typeof Prism === 'undefined' || typeof document === 'undefined') {
    return;
  }
  if (!Prism.plugins.toolbar) {
    console.warn('Copy to Clipboard plugin loaded before Toolbar plugin.');
    return;
  }

  /**
   * When the given elements is clicked by the user, the given text will be copied to clipboard.
   *
   * @param {HTMLElement} element
   * @param {CopyInfo} copyInfo
   *
   * @typedef CopyInfo
   * @property {() => string} getText
   * @property {() => void} success
   * @property {(reason: unknown) => void} error
   */
  function registerClipboard(element, copyInfo) {
    element.addEventListener('click', function () {
      copyTextToClipboard(copyInfo);
    });
  }

  // https://stackoverflow.com/a/30810322/7595472

  /** @param {CopyInfo} copyInfo */
  function fallbackCopyTextToClipboard(copyInfo) {
    var textArea = document.createElement('textarea');
    textArea.value = copyInfo.getText();

    // Avoid scrolling to bottom
    textArea.style.top = '0';
    textArea.style.left = '0';
    textArea.style.position = 'fixed';
    document.body.appendChild(textArea);
    textArea.focus();
    textArea.select();
    try {
      var successful = document.execCommand('copy');
      setTimeout(function () {
        if (successful) {
          copyInfo.success();
        } else {
          copyInfo.error();
        }
      }, 1);
    } catch (err) {
      setTimeout(function () {
        copyInfo.error(err);
      }, 1);
    }
    document.body.removeChild(textArea);
  }
  /** @param {CopyInfo} copyInfo */
  function copyTextToClipboard(copyInfo) {
    if (navigator.clipboard) {
      navigator.clipboard.writeText(copyInfo.getText()).then(copyInfo.success, function () {
        // try the fallback in case `writeText` didn't work
        fallbackCopyTextToClipboard(copyInfo);
      });
    } else {
      fallbackCopyTextToClipboard(copyInfo);
    }
  }

  /**
   * Selects the text content of the given element.
   *
   * @param {Element} element
   */
  function selectElementText(element) {
    // https://stackoverflow.com/a/20079910/7595472
    window.getSelection().selectAllChildren(element);
  }

  /**
   * Traverses up the DOM tree to find data attributes that override the default plugin settings.
   *
   * @param {Element} startElement An element to start from.
   * @returns {Settings} The plugin settings.
   * @typedef {Record<"copy" | "copy-error" | "copy-success" | "copy-timeout", string | number>} Settings
   */
  function getSettings(startElement) {
    /** @type {Settings} */
    var settings = {
      'copy': 'Copy',
      'copy-error': 'Press Ctrl+C to copy',
      'copy-success': 'Copied!',
      'copy-timeout': 5000
    };
    var prefix = 'data-prismjs-';
    for (var key in settings) {
      var attr = prefix + key;
      var element = startElement;
      while (element && !element.hasAttribute(attr)) {
        element = element.parentElement;
      }
      if (element) {
        settings[key] = element.getAttribute(attr);
      }
    }
    return settings;
  }
  Prism.plugins.toolbar.registerButton('copy-to-clipboard', function (env) {
    var element = env.element;
    var settings = getSettings(element);
    var linkCopy = document.createElement('button');
    linkCopy.className = 'copy-to-clipboard-button';
    linkCopy.setAttribute('type', 'button');
    var linkSpan = document.createElement('span');
    linkCopy.appendChild(linkSpan);
    setState('copy');
    registerClipboard(linkCopy, {
      getText: function () {
        return element.textContent;
      },
      success: function () {
        setState('copy-success');
        resetText();
      },
      error: function () {
        setState('copy-error');
        setTimeout(function () {
          selectElementText(element);
        }, 1);
        resetText();
      }
    });
    return linkCopy;
    function resetText() {
      setTimeout(function () {
        setState('copy');
      }, settings['copy-timeout']);
    }

    /** @param {"copy" | "copy-error" | "copy-success"} state */
    function setState(state) {
      linkSpan.textContent = settings[state];
      linkCopy.setAttribute('data-copy-state', state);
    }
  });
})();

var top$1 = 'top';
var bottom = 'bottom';
var right = 'right';
var left = 'left';
var auto = 'auto';
var basePlacements = [top$1, bottom, right, left];
var start = 'start';
var end = 'end';
var clippingParents = 'clippingParents';
var viewport = 'viewport';
var popper = 'popper';
var reference = 'reference';
var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
  return acc.concat([placement + "-" + start, placement + "-" + end]);
}, []);
var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
  return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
}, []); // modifiers that need to read the DOM

var beforeRead = 'beforeRead';
var read = 'read';
var afterRead = 'afterRead'; // pure-logic modifiers

var beforeMain = 'beforeMain';
var main = 'main';
var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)

var beforeWrite = 'beforeWrite';
var write = 'write';
var afterWrite = 'afterWrite';
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];

function getNodeName(element) {
  return element ? (element.nodeName || '').toLowerCase() : null;
}

function getWindow(node) {
  if (node == null) {
    return window;
  }
  if (node.toString() !== '[object Window]') {
    var ownerDocument = node.ownerDocument;
    return ownerDocument ? ownerDocument.defaultView || window : window;
  }
  return node;
}

function isElement$1(node) {
  var OwnElement = getWindow(node).Element;
  return node instanceof OwnElement || node instanceof Element;
}
function isHTMLElement(node) {
  var OwnElement = getWindow(node).HTMLElement;
  return node instanceof OwnElement || node instanceof HTMLElement;
}
function isShadowRoot(node) {
  // IE 11 has no ShadowRoot
  if (typeof ShadowRoot === 'undefined') {
    return false;
  }
  var OwnElement = getWindow(node).ShadowRoot;
  return node instanceof OwnElement || node instanceof ShadowRoot;
}

// and applies them to the HTMLElements such as popper and arrow

function applyStyles(_ref) {
  var state = _ref.state;
  Object.keys(state.elements).forEach(function (name) {
    var style = state.styles[name] || {};
    var attributes = state.attributes[name] || {};
    var element = state.elements[name]; // arrow is optional + virtual elements

    if (!isHTMLElement(element) || !getNodeName(element)) {
      return;
    } // Flow doesn't support to extend this property, but it's the most
    // effective way to apply styles to an HTMLElement
    // $FlowFixMe[cannot-write]

    Object.assign(element.style, style);
    Object.keys(attributes).forEach(function (name) {
      var value = attributes[name];
      if (value === false) {
        element.removeAttribute(name);
      } else {
        element.setAttribute(name, value === true ? '' : value);
      }
    });
  });
}
function effect$2(_ref2) {
  var state = _ref2.state;
  var initialStyles = {
    popper: {
      position: state.options.strategy,
      left: '0',
      top: '0',
      margin: '0'
    },
    arrow: {
      position: 'absolute'
    },
    reference: {}
  };
  Object.assign(state.elements.popper.style, initialStyles.popper);
  state.styles = initialStyles;
  if (state.elements.arrow) {
    Object.assign(state.elements.arrow.style, initialStyles.arrow);
  }
  return function () {
    Object.keys(state.elements).forEach(function (name) {
      var element = state.elements[name];
      var attributes = state.attributes[name] || {};
      var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them

      var style = styleProperties.reduce(function (style, property) {
        style[property] = '';
        return style;
      }, {}); // arrow is optional + virtual elements

      if (!isHTMLElement(element) || !getNodeName(element)) {
        return;
      }
      Object.assign(element.style, style);
      Object.keys(attributes).forEach(function (attribute) {
        element.removeAttribute(attribute);
      });
    });
  };
} // eslint-disable-next-line import/no-unused-modules

var applyStyles$1 = {
  name: 'applyStyles',
  enabled: true,
  phase: 'write',
  fn: applyStyles,
  effect: effect$2,
  requires: ['computeStyles']
};

function getBasePlacement$1(placement) {
  return placement.split('-')[0];
}

var max = Math.max;
var min = Math.min;
var round = Math.round;

function getUAString() {
  var uaData = navigator.userAgentData;
  if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
    return uaData.brands.map(function (item) {
      return item.brand + "/" + item.version;
    }).join(' ');
  }
  return navigator.userAgent;
}

function isLayoutViewport() {
  return !/^((?!chrome|android).)*safari/i.test(getUAString());
}

function getBoundingClientRect$1(element, includeScale, isFixedStrategy) {
  if (includeScale === void 0) {
    includeScale = false;
  }
  if (isFixedStrategy === void 0) {
    isFixedStrategy = false;
  }
  var clientRect = element.getBoundingClientRect();
  var scaleX = 1;
  var scaleY = 1;
  if (includeScale && isHTMLElement(element)) {
    scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
    scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
  }
  var _ref = isElement$1(element) ? getWindow(element) : window,
    visualViewport = _ref.visualViewport;
  var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
  var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
  var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
  var width = clientRect.width / scaleX;
  var height = clientRect.height / scaleY;
  return {
    width: width,
    height: height,
    top: y,
    right: x + width,
    bottom: y + height,
    left: x,
    x: x,
    y: y
  };
}

// means it doesn't take into account transforms.

function getLayoutRect(element) {
  var clientRect = getBoundingClientRect$1(element); // Use the clientRect sizes if it's not been transformed.
  // Fixes https://github.com/popperjs/popper-core/issues/1223

  var width = element.offsetWidth;
  var height = element.offsetHeight;
  if (Math.abs(clientRect.width - width) <= 1) {
    width = clientRect.width;
  }
  if (Math.abs(clientRect.height - height) <= 1) {
    height = clientRect.height;
  }
  return {
    x: element.offsetLeft,
    y: element.offsetTop,
    width: width,
    height: height
  };
}

function contains(parent, child) {
  var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method

  if (parent.contains(child)) {
    return true;
  } // then fallback to custom implementation with Shadow DOM support
  else if (rootNode && isShadowRoot(rootNode)) {
    var next = child;
    do {
      if (next && parent.isSameNode(next)) {
        return true;
      } // $FlowFixMe[prop-missing]: need a better way to handle this...

      next = next.parentNode || next.host;
    } while (next);
  } // Give up, the result is false

  return false;
}

function getComputedStyle$1(element) {
  return getWindow(element).getComputedStyle(element);
}

function isTableElement(element) {
  return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
}

function getDocumentElement(element) {
  // $FlowFixMe[incompatible-return]: assume body is always available
  return ((isElement$1(element) ? element.ownerDocument :
  // $FlowFixMe[prop-missing]
  element.document) || window.document).documentElement;
}

function getParentNode(element) {
  if (getNodeName(element) === 'html') {
    return element;
  }
  return (
    // this is a quicker (but less type safe) way to save quite some bytes from the bundle
    // $FlowFixMe[incompatible-return]
    // $FlowFixMe[prop-missing]
    element.assignedSlot ||
    // step into the shadow DOM of the parent of a slotted node
    element.parentNode || (
    // DOM Element detected
    isShadowRoot(element) ? element.host : null) ||
    // ShadowRoot detected
    // $FlowFixMe[incompatible-call]: HTMLElement is a Node
    getDocumentElement(element) // fallback
  );
}

function getTrueOffsetParent(element) {
  if (!isHTMLElement(element) ||
  // https://github.com/popperjs/popper-core/issues/837
  getComputedStyle$1(element).position === 'fixed') {
    return null;
  }
  return element.offsetParent;
} // `.offsetParent` reports `null` for fixed elements, while absolute elements
// return the containing block

function getContainingBlock(element) {
  var isFirefox = /firefox/i.test(getUAString());
  var isIE = /Trident/i.test(getUAString());
  if (isIE && isHTMLElement(element)) {
    // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
    var elementCss = getComputedStyle$1(element);
    if (elementCss.position === 'fixed') {
      return null;
    }
  }
  var currentNode = getParentNode(element);
  if (isShadowRoot(currentNode)) {
    currentNode = currentNode.host;
  }
  while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
    var css = getComputedStyle$1(currentNode); // This is non-exhaustive but covers the most common CSS properties that
    // create a containing block.
    // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block

    if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
      return currentNode;
    } else {
      currentNode = currentNode.parentNode;
    }
  }
  return null;
} // Gets the closest ancestor positioned element. Handles some edge cases,
// such as table ancestors and cross browser bugs.

function getOffsetParent(element) {
  var window = getWindow(element);
  var offsetParent = getTrueOffsetParent(element);
  while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
    offsetParent = getTrueOffsetParent(offsetParent);
  }
  if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static')) {
    return window;
  }
  return offsetParent || getContainingBlock(element) || window;
}

function getMainAxisFromPlacement(placement) {
  return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
}

function within(min$1, value, max$1) {
  return max(min$1, min(value, max$1));
}
function withinMaxClamp(min, value, max) {
  var v = within(min, value, max);
  return v > max ? max : v;
}

function getFreshSideObject() {
  return {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0
  };
}

function mergePaddingObject(paddingObject) {
  return Object.assign({}, getFreshSideObject(), paddingObject);
}

function expandToHashMap(value, keys) {
  return keys.reduce(function (hashMap, key) {
    hashMap[key] = value;
    return hashMap;
  }, {});
}

var toPaddingObject = function toPaddingObject(padding, state) {
  padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
    placement: state.placement
  })) : padding;
  return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
};
function arrow(_ref) {
  var _state$modifiersData$;
  var state = _ref.state,
    name = _ref.name,
    options = _ref.options;
  var arrowElement = state.elements.arrow;
  var popperOffsets = state.modifiersData.popperOffsets;
  var basePlacement = getBasePlacement$1(state.placement);
  var axis = getMainAxisFromPlacement(basePlacement);
  var isVertical = [left, right].indexOf(basePlacement) >= 0;
  var len = isVertical ? 'height' : 'width';
  if (!arrowElement || !popperOffsets) {
    return;
  }
  var paddingObject = toPaddingObject(options.padding, state);
  var arrowRect = getLayoutRect(arrowElement);
  var minProp = axis === 'y' ? top$1 : left;
  var maxProp = axis === 'y' ? bottom : right;
  var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
  var startDiff = popperOffsets[axis] - state.rects.reference[axis];
  var arrowOffsetParent = getOffsetParent(arrowElement);
  var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
  var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
  // outside of the popper bounds

  var min = paddingObject[minProp];
  var max = clientSize - arrowRect[len] - paddingObject[maxProp];
  var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
  var offset = within(min, center, max); // Prevents breaking syntax highlighting...

  var axisProp = axis;
  state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
}
function effect$1(_ref2) {
  var state = _ref2.state,
    options = _ref2.options;
  var _options$element = options.element,
    arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
  if (arrowElement == null) {
    return;
  } // CSS selector

  if (typeof arrowElement === 'string') {
    arrowElement = state.elements.popper.querySelector(arrowElement);
    if (!arrowElement) {
      return;
    }
  }
  if (!contains(state.elements.popper, arrowElement)) {
    return;
  }
  state.elements.arrow = arrowElement;
} // eslint-disable-next-line import/no-unused-modules

var arrow$1 = {
  name: 'arrow',
  enabled: true,
  phase: 'main',
  fn: arrow,
  effect: effect$1,
  requires: ['popperOffsets'],
  requiresIfExists: ['preventOverflow']
};

function getVariation(placement) {
  return placement.split('-')[1];
}

var unsetSides = {
  top: 'auto',
  right: 'auto',
  bottom: 'auto',
  left: 'auto'
}; // Round the offsets to the nearest suitable subpixel based on the DPR.
// Zooming can change the DPR, but it seems to report a value that will
// cleanly divide the values into the appropriate subpixels.

function roundOffsetsByDPR(_ref, win) {
  var x = _ref.x,
    y = _ref.y;
  var dpr = win.devicePixelRatio || 1;
  return {
    x: round(x * dpr) / dpr || 0,
    y: round(y * dpr) / dpr || 0
  };
}
function mapToStyles(_ref2) {
  var _Object$assign2;
  var popper = _ref2.popper,
    popperRect = _ref2.popperRect,
    placement = _ref2.placement,
    variation = _ref2.variation,
    offsets = _ref2.offsets,
    position = _ref2.position,
    gpuAcceleration = _ref2.gpuAcceleration,
    adaptive = _ref2.adaptive,
    roundOffsets = _ref2.roundOffsets,
    isFixed = _ref2.isFixed;
  var _offsets$x = offsets.x,
    x = _offsets$x === void 0 ? 0 : _offsets$x,
    _offsets$y = offsets.y,
    y = _offsets$y === void 0 ? 0 : _offsets$y;
  var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
    x: x,
    y: y
  }) : {
    x: x,
    y: y
  };
  x = _ref3.x;
  y = _ref3.y;
  var hasX = offsets.hasOwnProperty('x');
  var hasY = offsets.hasOwnProperty('y');
  var sideX = left;
  var sideY = top$1;
  var win = window;
  if (adaptive) {
    var offsetParent = getOffsetParent(popper);
    var heightProp = 'clientHeight';
    var widthProp = 'clientWidth';
    if (offsetParent === getWindow(popper)) {
      offsetParent = getDocumentElement(popper);
      if (getComputedStyle$1(offsetParent).position !== 'static' && position === 'absolute') {
        heightProp = 'scrollHeight';
        widthProp = 'scrollWidth';
      }
    } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it

    offsetParent = offsetParent;
    if (placement === top$1 || (placement === left || placement === right) && variation === end) {
      sideY = bottom;
      var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height :
      // $FlowFixMe[prop-missing]
      offsetParent[heightProp];
      y -= offsetY - popperRect.height;
      y *= gpuAcceleration ? 1 : -1;
    }
    if (placement === left || (placement === top$1 || placement === bottom) && variation === end) {
      sideX = right;
      var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width :
      // $FlowFixMe[prop-missing]
      offsetParent[widthProp];
      x -= offsetX - popperRect.width;
      x *= gpuAcceleration ? 1 : -1;
    }
  }
  var commonStyles = Object.assign({
    position: position
  }, adaptive && unsetSides);
  var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
    x: x,
    y: y
  }, getWindow(popper)) : {
    x: x,
    y: y
  };
  x = _ref4.x;
  y = _ref4.y;
  if (gpuAcceleration) {
    var _Object$assign;
    return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
  }
  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
}
function computeStyles(_ref5) {
  var state = _ref5.state,
    options = _ref5.options;
  var _options$gpuAccelerat = options.gpuAcceleration,
    gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
    _options$adaptive = options.adaptive,
    adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
    _options$roundOffsets = options.roundOffsets,
    roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
  var commonStyles = {
    placement: getBasePlacement$1(state.placement),
    variation: getVariation(state.placement),
    popper: state.elements.popper,
    popperRect: state.rects.popper,
    gpuAcceleration: gpuAcceleration,
    isFixed: state.options.strategy === 'fixed'
  };
  if (state.modifiersData.popperOffsets != null) {
    state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
      offsets: state.modifiersData.popperOffsets,
      position: state.options.strategy,
      adaptive: adaptive,
      roundOffsets: roundOffsets
    })));
  }
  if (state.modifiersData.arrow != null) {
    state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
      offsets: state.modifiersData.arrow,
      position: 'absolute',
      adaptive: false,
      roundOffsets: roundOffsets
    })));
  }
  state.attributes.popper = Object.assign({}, state.attributes.popper, {
    'data-popper-placement': state.placement
  });
} // eslint-disable-next-line import/no-unused-modules

var computeStyles$1 = {
  name: 'computeStyles',
  enabled: true,
  phase: 'beforeWrite',
  fn: computeStyles,
  data: {}
};

var passive = {
  passive: true
};
function effect(_ref) {
  var state = _ref.state,
    instance = _ref.instance,
    options = _ref.options;
  var _options$scroll = options.scroll,
    scroll = _options$scroll === void 0 ? true : _options$scroll,
    _options$resize = options.resize,
    resize = _options$resize === void 0 ? true : _options$resize;
  var window = getWindow(state.elements.popper);
  var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
  if (scroll) {
    scrollParents.forEach(function (scrollParent) {
      scrollParent.addEventListener('scroll', instance.update, passive);
    });
  }
  if (resize) {
    window.addEventListener('resize', instance.update, passive);
  }
  return function () {
    if (scroll) {
      scrollParents.forEach(function (scrollParent) {
        scrollParent.removeEventListener('scroll', instance.update, passive);
      });
    }
    if (resize) {
      window.removeEventListener('resize', instance.update, passive);
    }
  };
} // eslint-disable-next-line import/no-unused-modules

var eventListeners = {
  name: 'eventListeners',
  enabled: true,
  phase: 'write',
  fn: function fn() {},
  effect: effect,
  data: {}
};

var hash$2 = {
  left: 'right',
  right: 'left',
  bottom: 'top',
  top: 'bottom'
};
function getOppositePlacement(placement) {
  return placement.replace(/left|right|bottom|top/g, function (matched) {
    return hash$2[matched];
  });
}

var hash$1 = {
  start: 'end',
  end: 'start'
};
function getOppositeVariationPlacement(placement) {
  return placement.replace(/start|end/g, function (matched) {
    return hash$1[matched];
  });
}

function getWindowScroll(node) {
  var win = getWindow(node);
  var scrollLeft = win.pageXOffset;
  var scrollTop = win.pageYOffset;
  return {
    scrollLeft: scrollLeft,
    scrollTop: scrollTop
  };
}

function getWindowScrollBarX(element) {
  // If <html> has a CSS width greater than the viewport, then this will be
  // incorrect for RTL.
  // Popper 1 is broken in this case and never had a bug report so let's assume
  // it's not an issue. I don't think anyone ever specifies width on <html>
  // anyway.
  // Browsers where the left scrollbar doesn't cause an issue report `0` for
  // this (e.g. Edge 2019, IE11, Safari)
  return getBoundingClientRect$1(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
}

function getViewportRect(element, strategy) {
  var win = getWindow(element);
  var html = getDocumentElement(element);
  var visualViewport = win.visualViewport;
  var width = html.clientWidth;
  var height = html.clientHeight;
  var x = 0;
  var y = 0;
  if (visualViewport) {
    width = visualViewport.width;
    height = visualViewport.height;
    var layoutViewport = isLayoutViewport();
    if (layoutViewport || !layoutViewport && strategy === 'fixed') {
      x = visualViewport.offsetLeft;
      y = visualViewport.offsetTop;
    }
  }
  return {
    width: width,
    height: height,
    x: x + getWindowScrollBarX(element),
    y: y
  };
}

// of the `<html>` and `<body>` rect bounds if horizontally scrollable

function getDocumentRect(element) {
  var _element$ownerDocumen;
  var html = getDocumentElement(element);
  var winScroll = getWindowScroll(element);
  var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
  var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
  var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
  var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
  var y = -winScroll.scrollTop;
  if (getComputedStyle$1(body || html).direction === 'rtl') {
    x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
  }
  return {
    width: width,
    height: height,
    x: x,
    y: y
  };
}

function isScrollParent(element) {
  // Firefox wants us to check `-x` and `-y` variations as well
  var _getComputedStyle = getComputedStyle$1(element),
    overflow = _getComputedStyle.overflow,
    overflowX = _getComputedStyle.overflowX,
    overflowY = _getComputedStyle.overflowY;
  return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
}

function getScrollParent(node) {
  if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
    // $FlowFixMe[incompatible-return]: assume body is always available
    return node.ownerDocument.body;
  }
  if (isHTMLElement(node) && isScrollParent(node)) {
    return node;
  }
  return getScrollParent(getParentNode(node));
}

/*
given a DOM element, return the list of all scroll parents, up the list of ancesors
until we get to the top window object. This list is what we attach scroll listeners
to, because if any of these parent elements scroll, we'll need to re-calculate the
reference element's position.
*/

function listScrollParents(element, list) {
  var _element$ownerDocumen;
  if (list === void 0) {
    list = [];
  }
  var scrollParent = getScrollParent(element);
  var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
  var win = getWindow(scrollParent);
  var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
  var updatedList = list.concat(target);
  return isBody ? updatedList :
  // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
  updatedList.concat(listScrollParents(getParentNode(target)));
}

function rectToClientRect(rect) {
  return Object.assign({}, rect, {
    left: rect.x,
    top: rect.y,
    right: rect.x + rect.width,
    bottom: rect.y + rect.height
  });
}

function getInnerBoundingClientRect(element, strategy) {
  var rect = getBoundingClientRect$1(element, false, strategy === 'fixed');
  rect.top = rect.top + element.clientTop;
  rect.left = rect.left + element.clientLeft;
  rect.bottom = rect.top + element.clientHeight;
  rect.right = rect.left + element.clientWidth;
  rect.width = element.clientWidth;
  rect.height = element.clientHeight;
  rect.x = rect.left;
  rect.y = rect.top;
  return rect;
}
function getClientRectFromMixedType(element, clippingParent, strategy) {
  return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement$1(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
} // A "clipping parent" is an overflowable container with the characteristic of
// clipping (or hiding) overflowing elements with a position different from
// `initial`

function getClippingParents(element) {
  var clippingParents = listScrollParents(getParentNode(element));
  var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle$1(element).position) >= 0;
  var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
  if (!isElement$1(clipperElement)) {
    return [];
  } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414

  return clippingParents.filter(function (clippingParent) {
    return isElement$1(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
  });
} // Gets the maximum area that the element is visible in due to any number of
// clipping parents

function getClippingRect(element, boundary, rootBoundary, strategy) {
  var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
  var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
  var firstClippingParent = clippingParents[0];
  var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
    var rect = getClientRectFromMixedType(element, clippingParent, strategy);
    accRect.top = max(rect.top, accRect.top);
    accRect.right = min(rect.right, accRect.right);
    accRect.bottom = min(rect.bottom, accRect.bottom);
    accRect.left = max(rect.left, accRect.left);
    return accRect;
  }, getClientRectFromMixedType(element, firstClippingParent, strategy));
  clippingRect.width = clippingRect.right - clippingRect.left;
  clippingRect.height = clippingRect.bottom - clippingRect.top;
  clippingRect.x = clippingRect.left;
  clippingRect.y = clippingRect.top;
  return clippingRect;
}

function computeOffsets(_ref) {
  var reference = _ref.reference,
    element = _ref.element,
    placement = _ref.placement;
  var basePlacement = placement ? getBasePlacement$1(placement) : null;
  var variation = placement ? getVariation(placement) : null;
  var commonX = reference.x + reference.width / 2 - element.width / 2;
  var commonY = reference.y + reference.height / 2 - element.height / 2;
  var offsets;
  switch (basePlacement) {
    case top$1:
      offsets = {
        x: commonX,
        y: reference.y - element.height
      };
      break;
    case bottom:
      offsets = {
        x: commonX,
        y: reference.y + reference.height
      };
      break;
    case right:
      offsets = {
        x: reference.x + reference.width,
        y: commonY
      };
      break;
    case left:
      offsets = {
        x: reference.x - element.width,
        y: commonY
      };
      break;
    default:
      offsets = {
        x: reference.x,
        y: reference.y
      };
  }
  var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
  if (mainAxis != null) {
    var len = mainAxis === 'y' ? 'height' : 'width';
    switch (variation) {
      case start:
        offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
        break;
      case end:
        offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
        break;
    }
  }
  return offsets;
}

function detectOverflow(state, options) {
  if (options === void 0) {
    options = {};
  }
  var _options = options,
    _options$placement = _options.placement,
    placement = _options$placement === void 0 ? state.placement : _options$placement,
    _options$strategy = _options.strategy,
    strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,
    _options$boundary = _options.boundary,
    boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
    _options$rootBoundary = _options.rootBoundary,
    rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
    _options$elementConte = _options.elementContext,
    elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
    _options$altBoundary = _options.altBoundary,
    altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
    _options$padding = _options.padding,
    padding = _options$padding === void 0 ? 0 : _options$padding;
  var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
  var altContext = elementContext === popper ? reference : popper;
  var popperRect = state.rects.popper;
  var element = state.elements[altBoundary ? altContext : elementContext];
  var clippingClientRect = getClippingRect(isElement$1(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
  var referenceClientRect = getBoundingClientRect$1(state.elements.reference);
  var popperOffsets = computeOffsets({
    reference: referenceClientRect,
    element: popperRect,
    strategy: 'absolute',
    placement: placement
  });
  var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
  var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
  // 0 or negative = within the clipping rect

  var overflowOffsets = {
    top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
    bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
    left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
    right: elementClientRect.right - clippingClientRect.right + paddingObject.right
  };
  var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element

  if (elementContext === popper && offsetData) {
    var offset = offsetData[placement];
    Object.keys(overflowOffsets).forEach(function (key) {
      var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
      var axis = [top$1, bottom].indexOf(key) >= 0 ? 'y' : 'x';
      overflowOffsets[key] += offset[axis] * multiply;
    });
  }
  return overflowOffsets;
}

function computeAutoPlacement(state, options) {
  if (options === void 0) {
    options = {};
  }
  var _options = options,
    placement = _options.placement,
    boundary = _options.boundary,
    rootBoundary = _options.rootBoundary,
    padding = _options.padding,
    flipVariations = _options.flipVariations,
    _options$allowedAutoP = _options.allowedAutoPlacements,
    allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
  var variation = getVariation(placement);
  var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
    return getVariation(placement) === variation;
  }) : basePlacements;
  var allowedPlacements = placements$1.filter(function (placement) {
    return allowedAutoPlacements.indexOf(placement) >= 0;
  });
  if (allowedPlacements.length === 0) {
    allowedPlacements = placements$1;
  } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...

  var overflows = allowedPlacements.reduce(function (acc, placement) {
    acc[placement] = detectOverflow(state, {
      placement: placement,
      boundary: boundary,
      rootBoundary: rootBoundary,
      padding: padding
    })[getBasePlacement$1(placement)];
    return acc;
  }, {});
  return Object.keys(overflows).sort(function (a, b) {
    return overflows[a] - overflows[b];
  });
}

function getExpandedFallbackPlacements(placement) {
  if (getBasePlacement$1(placement) === auto) {
    return [];
  }
  var oppositePlacement = getOppositePlacement(placement);
  return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
}
function flip$1(_ref) {
  var state = _ref.state,
    options = _ref.options,
    name = _ref.name;
  if (state.modifiersData[name]._skip) {
    return;
  }
  var _options$mainAxis = options.mainAxis,
    checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
    _options$altAxis = options.altAxis,
    checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
    specifiedFallbackPlacements = options.fallbackPlacements,
    padding = options.padding,
    boundary = options.boundary,
    rootBoundary = options.rootBoundary,
    altBoundary = options.altBoundary,
    _options$flipVariatio = options.flipVariations,
    flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
    allowedAutoPlacements = options.allowedAutoPlacements;
  var preferredPlacement = state.options.placement;
  var basePlacement = getBasePlacement$1(preferredPlacement);
  var isBasePlacement = basePlacement === preferredPlacement;
  var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
  var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
    return acc.concat(getBasePlacement$1(placement) === auto ? computeAutoPlacement(state, {
      placement: placement,
      boundary: boundary,
      rootBoundary: rootBoundary,
      padding: padding,
      flipVariations: flipVariations,
      allowedAutoPlacements: allowedAutoPlacements
    }) : placement);
  }, []);
  var referenceRect = state.rects.reference;
  var popperRect = state.rects.popper;
  var checksMap = new Map();
  var makeFallbackChecks = true;
  var firstFittingPlacement = placements[0];
  for (var i = 0; i < placements.length; i++) {
    var placement = placements[i];
    var _basePlacement = getBasePlacement$1(placement);
    var isStartVariation = getVariation(placement) === start;
    var isVertical = [top$1, bottom].indexOf(_basePlacement) >= 0;
    var len = isVertical ? 'width' : 'height';
    var overflow = detectOverflow(state, {
      placement: placement,
      boundary: boundary,
      rootBoundary: rootBoundary,
      altBoundary: altBoundary,
      padding: padding
    });
    var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top$1;
    if (referenceRect[len] > popperRect[len]) {
      mainVariationSide = getOppositePlacement(mainVariationSide);
    }
    var altVariationSide = getOppositePlacement(mainVariationSide);
    var checks = [];
    if (checkMainAxis) {
      checks.push(overflow[_basePlacement] <= 0);
    }
    if (checkAltAxis) {
      checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
    }
    if (checks.every(function (check) {
      return check;
    })) {
      firstFittingPlacement = placement;
      makeFallbackChecks = false;
      break;
    }
    checksMap.set(placement, checks);
  }
  if (makeFallbackChecks) {
    // `2` may be desired in some cases – research later
    var numberOfChecks = flipVariations ? 3 : 1;
    var _loop = function _loop(_i) {
      var fittingPlacement = placements.find(function (placement) {
        var checks = checksMap.get(placement);
        if (checks) {
          return checks.slice(0, _i).every(function (check) {
            return check;
          });
        }
      });
      if (fittingPlacement) {
        firstFittingPlacement = fittingPlacement;
        return "break";
      }
    };
    for (var _i = numberOfChecks; _i > 0; _i--) {
      var _ret = _loop(_i);
      if (_ret === "break") break;
    }
  }
  if (state.placement !== firstFittingPlacement) {
    state.modifiersData[name]._skip = true;
    state.placement = firstFittingPlacement;
    state.reset = true;
  }
} // eslint-disable-next-line import/no-unused-modules

var flip$2 = {
  name: 'flip',
  enabled: true,
  phase: 'main',
  fn: flip$1,
  requiresIfExists: ['offset'],
  data: {
    _skip: false
  }
};

function getSideOffsets(overflow, rect, preventedOffsets) {
  if (preventedOffsets === void 0) {
    preventedOffsets = {
      x: 0,
      y: 0
    };
  }
  return {
    top: overflow.top - rect.height - preventedOffsets.y,
    right: overflow.right - rect.width + preventedOffsets.x,
    bottom: overflow.bottom - rect.height + preventedOffsets.y,
    left: overflow.left - rect.width - preventedOffsets.x
  };
}
function isAnySideFullyClipped(overflow) {
  return [top$1, right, bottom, left].some(function (side) {
    return overflow[side] >= 0;
  });
}
function hide(_ref) {
  var state = _ref.state,
    name = _ref.name;
  var referenceRect = state.rects.reference;
  var popperRect = state.rects.popper;
  var preventedOffsets = state.modifiersData.preventOverflow;
  var referenceOverflow = detectOverflow(state, {
    elementContext: 'reference'
  });
  var popperAltOverflow = detectOverflow(state, {
    altBoundary: true
  });
  var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
  var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
  var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
  var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
  state.modifiersData[name] = {
    referenceClippingOffsets: referenceClippingOffsets,
    popperEscapeOffsets: popperEscapeOffsets,
    isReferenceHidden: isReferenceHidden,
    hasPopperEscaped: hasPopperEscaped
  };
  state.attributes.popper = Object.assign({}, state.attributes.popper, {
    'data-popper-reference-hidden': isReferenceHidden,
    'data-popper-escaped': hasPopperEscaped
  });
} // eslint-disable-next-line import/no-unused-modules

var hide$1 = {
  name: 'hide',
  enabled: true,
  phase: 'main',
  requiresIfExists: ['preventOverflow'],
  fn: hide
};

function distanceAndSkiddingToXY(placement, rects, offset) {
  var basePlacement = getBasePlacement$1(placement);
  var invertDistance = [left, top$1].indexOf(basePlacement) >= 0 ? -1 : 1;
  var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
      placement: placement
    })) : offset,
    skidding = _ref[0],
    distance = _ref[1];
  skidding = skidding || 0;
  distance = (distance || 0) * invertDistance;
  return [left, right].indexOf(basePlacement) >= 0 ? {
    x: distance,
    y: skidding
  } : {
    x: skidding,
    y: distance
  };
}
function offset$1(_ref2) {
  var state = _ref2.state,
    options = _ref2.options,
    name = _ref2.name;
  var _options$offset = options.offset,
    offset = _options$offset === void 0 ? [0, 0] : _options$offset;
  var data = placements.reduce(function (acc, placement) {
    acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
    return acc;
  }, {});
  var _data$state$placement = data[state.placement],
    x = _data$state$placement.x,
    y = _data$state$placement.y;
  if (state.modifiersData.popperOffsets != null) {
    state.modifiersData.popperOffsets.x += x;
    state.modifiersData.popperOffsets.y += y;
  }
  state.modifiersData[name] = data;
} // eslint-disable-next-line import/no-unused-modules

var offset$2 = {
  name: 'offset',
  enabled: true,
  phase: 'main',
  requires: ['popperOffsets'],
  fn: offset$1
};

function popperOffsets(_ref) {
  var state = _ref.state,
    name = _ref.name;
  // Offsets are the actual position the popper needs to have to be
  // properly positioned near its reference element
  // This is the most basic placement, and will be adjusted by
  // the modifiers in the next step
  state.modifiersData[name] = computeOffsets({
    reference: state.rects.reference,
    element: state.rects.popper,
    strategy: 'absolute',
    placement: state.placement
  });
} // eslint-disable-next-line import/no-unused-modules

var popperOffsets$1 = {
  name: 'popperOffsets',
  enabled: true,
  phase: 'read',
  fn: popperOffsets,
  data: {}
};

function getAltAxis(axis) {
  return axis === 'x' ? 'y' : 'x';
}

function preventOverflow(_ref) {
  var state = _ref.state,
    options = _ref.options,
    name = _ref.name;
  var _options$mainAxis = options.mainAxis,
    checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
    _options$altAxis = options.altAxis,
    checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
    boundary = options.boundary,
    rootBoundary = options.rootBoundary,
    altBoundary = options.altBoundary,
    padding = options.padding,
    _options$tether = options.tether,
    tether = _options$tether === void 0 ? true : _options$tether,
    _options$tetherOffset = options.tetherOffset,
    tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
  var overflow = detectOverflow(state, {
    boundary: boundary,
    rootBoundary: rootBoundary,
    padding: padding,
    altBoundary: altBoundary
  });
  var basePlacement = getBasePlacement$1(state.placement);
  var variation = getVariation(state.placement);
  var isBasePlacement = !variation;
  var mainAxis = getMainAxisFromPlacement(basePlacement);
  var altAxis = getAltAxis(mainAxis);
  var popperOffsets = state.modifiersData.popperOffsets;
  var referenceRect = state.rects.reference;
  var popperRect = state.rects.popper;
  var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
    placement: state.placement
  })) : tetherOffset;
  var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
    mainAxis: tetherOffsetValue,
    altAxis: tetherOffsetValue
  } : Object.assign({
    mainAxis: 0,
    altAxis: 0
  }, tetherOffsetValue);
  var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
  var data = {
    x: 0,
    y: 0
  };
  if (!popperOffsets) {
    return;
  }
  if (checkMainAxis) {
    var _offsetModifierState$;
    var mainSide = mainAxis === 'y' ? top$1 : left;
    var altSide = mainAxis === 'y' ? bottom : right;
    var len = mainAxis === 'y' ? 'height' : 'width';
    var offset = popperOffsets[mainAxis];
    var min$1 = offset + overflow[mainSide];
    var max$1 = offset - overflow[altSide];
    var additive = tether ? -popperRect[len] / 2 : 0;
    var minLen = variation === start ? referenceRect[len] : popperRect[len];
    var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
    // outside the reference bounds

    var arrowElement = state.elements.arrow;
    var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
      width: 0,
      height: 0
    };
    var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
    var arrowPaddingMin = arrowPaddingObject[mainSide];
    var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
    // to include its full size in the calculation. If the reference is small
    // and near the edge of a boundary, the popper can overflow even if the
    // reference is not overflowing as well (e.g. virtual elements with no
    // width or height)

    var arrowLen = within(0, referenceRect[len], arrowRect[len]);
    var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
    var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
    var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
    var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
    var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
    var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
    var tetherMax = offset + maxOffset - offsetModifierValue;
    var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
    popperOffsets[mainAxis] = preventedOffset;
    data[mainAxis] = preventedOffset - offset;
  }
  if (checkAltAxis) {
    var _offsetModifierState$2;
    var _mainSide = mainAxis === 'x' ? top$1 : left;
    var _altSide = mainAxis === 'x' ? bottom : right;
    var _offset = popperOffsets[altAxis];
    var _len = altAxis === 'y' ? 'height' : 'width';
    var _min = _offset + overflow[_mainSide];
    var _max = _offset - overflow[_altSide];
    var isOriginSide = [top$1, left].indexOf(basePlacement) !== -1;
    var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
    var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
    var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
    var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
    popperOffsets[altAxis] = _preventedOffset;
    data[altAxis] = _preventedOffset - _offset;
  }
  state.modifiersData[name] = data;
} // eslint-disable-next-line import/no-unused-modules

var preventOverflow$1 = {
  name: 'preventOverflow',
  enabled: true,
  phase: 'main',
  fn: preventOverflow,
  requiresIfExists: ['offset']
};

function getHTMLElementScroll(element) {
  return {
    scrollLeft: element.scrollLeft,
    scrollTop: element.scrollTop
  };
}

function getNodeScroll(node) {
  if (node === getWindow(node) || !isHTMLElement(node)) {
    return getWindowScroll(node);
  } else {
    return getHTMLElementScroll(node);
  }
}

function isElementScaled(element) {
  var rect = element.getBoundingClientRect();
  var scaleX = round(rect.width) / element.offsetWidth || 1;
  var scaleY = round(rect.height) / element.offsetHeight || 1;
  return scaleX !== 1 || scaleY !== 1;
} // Returns the composite rect of an element relative to its offsetParent.
// Composite means it takes into account transforms as well as layout.

function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
  if (isFixed === void 0) {
    isFixed = false;
  }
  var isOffsetParentAnElement = isHTMLElement(offsetParent);
  var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
  var documentElement = getDocumentElement(offsetParent);
  var rect = getBoundingClientRect$1(elementOrVirtualElement, offsetParentIsScaled, isFixed);
  var scroll = {
    scrollLeft: 0,
    scrollTop: 0
  };
  var offsets = {
    x: 0,
    y: 0
  };
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
    if (getNodeName(offsetParent) !== 'body' ||
    // https://github.com/popperjs/popper-core/issues/1078
    isScrollParent(documentElement)) {
      scroll = getNodeScroll(offsetParent);
    }
    if (isHTMLElement(offsetParent)) {
      offsets = getBoundingClientRect$1(offsetParent, true);
      offsets.x += offsetParent.clientLeft;
      offsets.y += offsetParent.clientTop;
    } else if (documentElement) {
      offsets.x = getWindowScrollBarX(documentElement);
    }
  }
  return {
    x: rect.left + scroll.scrollLeft - offsets.x,
    y: rect.top + scroll.scrollTop - offsets.y,
    width: rect.width,
    height: rect.height
  };
}

function order(modifiers) {
  var map = new Map();
  var visited = new Set();
  var result = [];
  modifiers.forEach(function (modifier) {
    map.set(modifier.name, modifier);
  }); // On visiting object, check for its dependencies and visit them recursively

  function sort(modifier) {
    visited.add(modifier.name);
    var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
    requires.forEach(function (dep) {
      if (!visited.has(dep)) {
        var depModifier = map.get(dep);
        if (depModifier) {
          sort(depModifier);
        }
      }
    });
    result.push(modifier);
  }
  modifiers.forEach(function (modifier) {
    if (!visited.has(modifier.name)) {
      // check for visited object
      sort(modifier);
    }
  });
  return result;
}
function orderModifiers(modifiers) {
  // order based on dependencies
  var orderedModifiers = order(modifiers); // order based on phase

  return modifierPhases.reduce(function (acc, phase) {
    return acc.concat(orderedModifiers.filter(function (modifier) {
      return modifier.phase === phase;
    }));
  }, []);
}

function debounce$2(fn) {
  var pending;
  return function () {
    if (!pending) {
      pending = new Promise(function (resolve) {
        Promise.resolve().then(function () {
          pending = undefined;
          resolve(fn());
        });
      });
    }
    return pending;
  };
}

function mergeByName(modifiers) {
  var merged = modifiers.reduce(function (merged, current) {
    var existing = merged[current.name];
    merged[current.name] = existing ? Object.assign({}, existing, current, {
      options: Object.assign({}, existing.options, current.options),
      data: Object.assign({}, existing.data, current.data)
    }) : current;
    return merged;
  }, {}); // IE11 does not support Object.values

  return Object.keys(merged).map(function (key) {
    return merged[key];
  });
}

var DEFAULT_OPTIONS = {
  placement: 'bottom',
  modifiers: [],
  strategy: 'absolute'
};
function areValidElements() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }
  return !args.some(function (element) {
    return !(element && typeof element.getBoundingClientRect === 'function');
  });
}
function popperGenerator(generatorOptions) {
  if (generatorOptions === void 0) {
    generatorOptions = {};
  }
  var _generatorOptions = generatorOptions,
    _generatorOptions$def = _generatorOptions.defaultModifiers,
    defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
    _generatorOptions$def2 = _generatorOptions.defaultOptions,
    defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
  return function createPopper(reference, popper, options) {
    if (options === void 0) {
      options = defaultOptions;
    }
    var state = {
      placement: 'bottom',
      orderedModifiers: [],
      options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
      modifiersData: {},
      elements: {
        reference: reference,
        popper: popper
      },
      attributes: {},
      styles: {}
    };
    var effectCleanupFns = [];
    var isDestroyed = false;
    var instance = {
      state: state,
      setOptions: function setOptions(setOptionsAction) {
        var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
        cleanupModifierEffects();
        state.options = Object.assign({}, defaultOptions, state.options, options);
        state.scrollParents = {
          reference: isElement$1(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
          popper: listScrollParents(popper)
        }; // Orders the modifiers based on their dependencies and `phase`
        // properties

        var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers

        state.orderedModifiers = orderedModifiers.filter(function (m) {
          return m.enabled;
        });
        runModifierEffects();
        return instance.update();
      },
      // Sync update – it will always be executed, even if not necessary. This
      // is useful for low frequency updates where sync behavior simplifies the
      // logic.
      // For high frequency updates (e.g. `resize` and `scroll` events), always
      // prefer the async Popper#update method
      forceUpdate: function forceUpdate() {
        if (isDestroyed) {
          return;
        }
        var _state$elements = state.elements,
          reference = _state$elements.reference,
          popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
        // anymore

        if (!areValidElements(reference, popper)) {
          return;
        } // Store the reference and popper rects to be read by modifiers

        state.rects = {
          reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
          popper: getLayoutRect(popper)
        }; // Modifiers have the ability to reset the current update cycle. The
        // most common use case for this is the `flip` modifier changing the
        // placement, which then needs to re-run all the modifiers, because the
        // logic was previously ran for the previous placement and is therefore
        // stale/incorrect

        state.reset = false;
        state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
        // is filled with the initial data specified by the modifier. This means
        // it doesn't persist and is fresh on each update.
        // To ensure persistent data, use `${name}#persistent`

        state.orderedModifiers.forEach(function (modifier) {
          return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
        });
        for (var index = 0; index < state.orderedModifiers.length; index++) {
          if (state.reset === true) {
            state.reset = false;
            index = -1;
            continue;
          }
          var _state$orderedModifie = state.orderedModifiers[index],
            fn = _state$orderedModifie.fn,
            _state$orderedModifie2 = _state$orderedModifie.options,
            _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
            name = _state$orderedModifie.name;
          if (typeof fn === 'function') {
            state = fn({
              state: state,
              options: _options,
              name: name,
              instance: instance
            }) || state;
          }
        }
      },
      // Async and optimistically optimized update – it will not be executed if
      // not necessary (debounced to run at most once-per-tick)
      update: debounce$2(function () {
        return new Promise(function (resolve) {
          instance.forceUpdate();
          resolve(state);
        });
      }),
      destroy: function destroy() {
        cleanupModifierEffects();
        isDestroyed = true;
      }
    };
    if (!areValidElements(reference, popper)) {
      return instance;
    }
    instance.setOptions(options).then(function (state) {
      if (!isDestroyed && options.onFirstUpdate) {
        options.onFirstUpdate(state);
      }
    }); // Modifiers have the ability to execute arbitrary code before the first
    // update cycle runs. They will be executed in the same order as the update
    // cycle. This is useful when a modifier adds some persistent data that
    // other modifiers need to use, but the modifier is run after the dependent
    // one.

    function runModifierEffects() {
      state.orderedModifiers.forEach(function (_ref) {
        var name = _ref.name,
          _ref$options = _ref.options,
          options = _ref$options === void 0 ? {} : _ref$options,
          effect = _ref.effect;
        if (typeof effect === 'function') {
          var cleanupFn = effect({
            state: state,
            name: name,
            instance: instance,
            options: options
          });
          var noopFn = function noopFn() {};
          effectCleanupFns.push(cleanupFn || noopFn);
        }
      });
    }
    function cleanupModifierEffects() {
      effectCleanupFns.forEach(function (fn) {
        return fn();
      });
      effectCleanupFns = [];
    }
    return instance;
  };
}

var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$2, flip$2, preventOverflow$1, arrow$1, hide$1];
var createPopper = /*#__PURE__*/popperGenerator({
  defaultModifiers: defaultModifiers
}); // eslint-disable-next-line import/no-unused-modules

/**!
* tippy.js v6.3.7
* (c) 2017-2021 atomiks
* MIT License
*/
var BOX_CLASS = "tippy-box";
var CONTENT_CLASS = "tippy-content";
var BACKDROP_CLASS = "tippy-backdrop";
var ARROW_CLASS = "tippy-arrow";
var SVG_ARROW_CLASS = "tippy-svg-arrow";
var TOUCH_OPTIONS = {
  passive: true,
  capture: true
};
var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() {
  return document.body;
};
function hasOwnProperty$1(obj, key) {
  return {}.hasOwnProperty.call(obj, key);
}
function getValueAtIndexOrReturn(value, index, defaultValue) {
  if (Array.isArray(value)) {
    var v = value[index];
    return v == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v;
  }
  return value;
}
function isType(value, type) {
  var str = {}.toString.call(value);
  return str.indexOf('[object') === 0 && str.indexOf(type + "]") > -1;
}
function invokeWithArgsOrReturn(value, args) {
  return typeof value === 'function' ? value.apply(void 0, args) : value;
}
function debounce$1(fn, ms) {
  // Avoid wrapping in `setTimeout` if ms is 0 anyway
  if (ms === 0) {
    return fn;
  }
  var timeout;
  return function (arg) {
    clearTimeout(timeout);
    timeout = setTimeout(function () {
      fn(arg);
    }, ms);
  };
}
function removeProperties(obj, keys) {
  var clone = Object.assign({}, obj);
  keys.forEach(function (key) {
    delete clone[key];
  });
  return clone;
}
function splitBySpaces(value) {
  return value.split(/\s+/).filter(Boolean);
}
function normalizeToArray(value) {
  return [].concat(value);
}
function pushIfUnique(arr, value) {
  if (arr.indexOf(value) === -1) {
    arr.push(value);
  }
}
function unique(arr) {
  return arr.filter(function (item, index) {
    return arr.indexOf(item) === index;
  });
}
function getBasePlacement(placement) {
  return placement.split('-')[0];
}
function arrayFrom(value) {
  return [].slice.call(value);
}
function removeUndefinedProps(obj) {
  return Object.keys(obj).reduce(function (acc, key) {
    if (obj[key] !== undefined) {
      acc[key] = obj[key];
    }
    return acc;
  }, {});
}
function div() {
  return document.createElement('div');
}
function isElement(value) {
  return ['Element', 'Fragment'].some(function (type) {
    return isType(value, type);
  });
}
function isNodeList(value) {
  return isType(value, 'NodeList');
}
function isMouseEvent(value) {
  return isType(value, 'MouseEvent');
}
function isReferenceElement(value) {
  return !!(value && value._tippy && value._tippy.reference === value);
}
function getArrayOfElements(value) {
  if (isElement(value)) {
    return [value];
  }
  if (isNodeList(value)) {
    return arrayFrom(value);
  }
  if (Array.isArray(value)) {
    return value;
  }
  return arrayFrom(document.querySelectorAll(value));
}
function setTransitionDuration(els, value) {
  els.forEach(function (el) {
    if (el) {
      el.style.transitionDuration = value + "ms";
    }
  });
}
function setVisibilityState(els, state) {
  els.forEach(function (el) {
    if (el) {
      el.setAttribute('data-state', state);
    }
  });
}
function getOwnerDocument(elementOrElements) {
  var _element$ownerDocumen;
  var _normalizeToArray = normalizeToArray(elementOrElements),
    element = _normalizeToArray[0]; // Elements created via a <template> have an ownerDocument with no reference to the body

  return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document;
}
function isCursorOutsideInteractiveBorder(popperTreeData, event) {
  var clientX = event.clientX,
    clientY = event.clientY;
  return popperTreeData.every(function (_ref) {
    var popperRect = _ref.popperRect,
      popperState = _ref.popperState,
      props = _ref.props;
    var interactiveBorder = props.interactiveBorder;
    var basePlacement = getBasePlacement(popperState.placement);
    var offsetData = popperState.modifiersData.offset;
    if (!offsetData) {
      return true;
    }
    var topDistance = basePlacement === 'bottom' ? offsetData.top.y : 0;
    var bottomDistance = basePlacement === 'top' ? offsetData.bottom.y : 0;
    var leftDistance = basePlacement === 'right' ? offsetData.left.x : 0;
    var rightDistance = basePlacement === 'left' ? offsetData.right.x : 0;
    var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder;
    var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder;
    var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder;
    var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder;
    return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;
  });
}
function updateTransitionEndListener(box, action, listener) {
  var method = action + "EventListener"; // some browsers apparently support `transition` (unprefixed) but only fire
  // `webkitTransitionEnd`...

  ['transitionend', 'webkitTransitionEnd'].forEach(function (event) {
    box[method](event, listener);
  });
}
/**
 * Compared to xxx.contains, this function works for dom structures with shadow
 * dom
 */

function actualContains(parent, child) {
  var target = child;
  while (target) {
    var _target$getRootNode;
    if (parent.contains(target)) {
      return true;
    }
    target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host;
  }
  return false;
}
var currentInput = {
  isTouch: false
};
var lastMouseMoveTime = 0;
/**
 * When a `touchstart` event is fired, it's assumed the user is using touch
 * input. We'll bind a `mousemove` event listener to listen for mouse input in
 * the future. This way, the `isTouch` property is fully dynamic and will handle
 * hybrid devices that use a mix of touch + mouse input.
 */

function onDocumentTouchStart() {
  if (currentInput.isTouch) {
    return;
  }
  currentInput.isTouch = true;
  if (window.performance) {
    document.addEventListener('mousemove', onDocumentMouseMove);
  }
}
/**
 * When two `mousemove` event are fired consecutively within 20ms, it's assumed
 * the user is using mouse input again. `mousemove` can fire on touch devices as
 * well, but very rarely that quickly.
 */

function onDocumentMouseMove() {
  var now = performance.now();
  if (now - lastMouseMoveTime < 20) {
    currentInput.isTouch = false;
    document.removeEventListener('mousemove', onDocumentMouseMove);
  }
  lastMouseMoveTime = now;
}
/**
 * When an element is in focus and has a tippy, leaving the tab/window and
 * returning causes it to show again. For mouse users this is unexpected, but
 * for keyboard use it makes sense.
 * TODO: find a better technique to solve this problem
 */

function onWindowBlur() {
  var activeElement = document.activeElement;
  if (isReferenceElement(activeElement)) {
    var instance = activeElement._tippy;
    if (activeElement.blur && !instance.state.isVisible) {
      activeElement.blur();
    }
  }
}
function bindGlobalEventListeners() {
  document.addEventListener('touchstart', onDocumentTouchStart, TOUCH_OPTIONS);
  window.addEventListener('blur', onWindowBlur);
}
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
var isIE11 = isBrowser ?
// @ts-ignore
!!window.msCrypto : false;
function createMemoryLeakWarning(method) {
  var txt = method === 'destroy' ? 'n already-' : ' ';
  return [method + "() was called on a" + txt + "destroyed instance. This is a no-op but", 'indicates a potential memory leak.'].join(' ');
}
function clean$1(value) {
  var spacesAndTabs = /[ \t]{2,}/g;
  var lineStartWithSpaces = /^[ \t]*/gm;
  return value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();
}
function getDevMessage(message) {
  return clean$1("\n  %ctippy.js\n\n  %c" + clean$1(message) + "\n\n  %c\uD83D\uDC77\u200D This is a development-only message. It will be removed in production.\n  ");
}
function getFormattedMessage(message) {
  return [getDevMessage(message),
  // title
  'color: #00C584; font-size: 1.3em; font-weight: bold;',
  // message
  'line-height: 1.5',
  // footer
  'color: #a6a095;'];
} // Assume warnings and errors never have the same message

var visitedMessages;
{
  resetVisitedMessages();
}
function resetVisitedMessages() {
  visitedMessages = new Set();
}
function warnWhen(condition, message) {
  if (condition && !visitedMessages.has(message)) {
    var _console;
    visitedMessages.add(message);
    (_console = console).warn.apply(_console, getFormattedMessage(message));
  }
}
function errorWhen(condition, message) {
  if (condition && !visitedMessages.has(message)) {
    var _console2;
    visitedMessages.add(message);
    (_console2 = console).error.apply(_console2, getFormattedMessage(message));
  }
}
function validateTargets(targets) {
  var didPassFalsyValue = !targets;
  var didPassPlainObject = Object.prototype.toString.call(targets) === '[object Object]' && !targets.addEventListener;
  errorWhen(didPassFalsyValue, ['tippy() was passed', '`' + String(targets) + '`', 'as its targets (first) argument. Valid types are: String, Element,', 'Element[], or NodeList.'].join(' '));
  errorWhen(didPassPlainObject, ['tippy() was passed a plain object which is not supported as an argument', 'for virtual positioning. Use props.getReferenceClientRect instead.'].join(' '));
}
var pluginProps = {
  animateFill: false,
  followCursor: false,
  inlinePositioning: false,
  sticky: false
};
var renderProps = {
  allowHTML: false,
  animation: 'fade',
  arrow: true,
  content: '',
  inertia: false,
  maxWidth: 350,
  role: 'tooltip',
  theme: '',
  zIndex: 9999
};
var defaultProps = Object.assign({
  appendTo: TIPPY_DEFAULT_APPEND_TO,
  aria: {
    content: 'auto',
    expanded: 'auto'
  },
  delay: 0,
  duration: [300, 250],
  getReferenceClientRect: null,
  hideOnClick: true,
  ignoreAttributes: false,
  interactive: false,
  interactiveBorder: 2,
  interactiveDebounce: 0,
  moveTransition: '',
  offset: [0, 10],
  onAfterUpdate: function onAfterUpdate() {},
  onBeforeUpdate: function onBeforeUpdate() {},
  onCreate: function onCreate() {},
  onDestroy: function onDestroy() {},
  onHidden: function onHidden() {},
  onHide: function onHide() {},
  onMount: function onMount() {},
  onShow: function onShow() {},
  onShown: function onShown() {},
  onTrigger: function onTrigger() {},
  onUntrigger: function onUntrigger() {},
  onClickOutside: function onClickOutside() {},
  placement: 'top',
  plugins: [],
  popperOptions: {},
  render: null,
  showOnCreate: false,
  touch: true,
  trigger: 'mouseenter focus',
  triggerTarget: null
}, pluginProps, renderProps);
var defaultKeys = Object.keys(defaultProps);
var setDefaultProps = function setDefaultProps(partialProps) {
  /* istanbul ignore else */
  {
    validateProps(partialProps, []);
  }
  var keys = Object.keys(partialProps);
  keys.forEach(function (key) {
    defaultProps[key] = partialProps[key];
  });
};
function getExtendedPassedProps(passedProps) {
  var plugins = passedProps.plugins || [];
  var pluginProps = plugins.reduce(function (acc, plugin) {
    var name = plugin.name,
      defaultValue = plugin.defaultValue;
    if (name) {
      var _name;
      acc[name] = passedProps[name] !== undefined ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue;
    }
    return acc;
  }, {});
  return Object.assign({}, passedProps, pluginProps);
}
function getDataAttributeProps(reference, plugins) {
  var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {
    plugins: plugins
  }))) : defaultKeys;
  var props = propKeys.reduce(function (acc, key) {
    var valueAsString = (reference.getAttribute("data-tippy-" + key) || '').trim();
    if (!valueAsString) {
      return acc;
    }
    if (key === 'content') {
      acc[key] = valueAsString;
    } else {
      try {
        acc[key] = JSON.parse(valueAsString);
      } catch (e) {
        acc[key] = valueAsString;
      }
    }
    return acc;
  }, {});
  return props;
}
function evaluateProps(reference, props) {
  var out = Object.assign({}, props, {
    content: invokeWithArgsOrReturn(props.content, [reference])
  }, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins));
  out.aria = Object.assign({}, defaultProps.aria, out.aria);
  out.aria = {
    expanded: out.aria.expanded === 'auto' ? props.interactive : out.aria.expanded,
    content: out.aria.content === 'auto' ? props.interactive ? null : 'describedby' : out.aria.content
  };
  return out;
}
function validateProps(partialProps, plugins) {
  if (partialProps === void 0) {
    partialProps = {};
  }
  if (plugins === void 0) {
    plugins = [];
  }
  var keys = Object.keys(partialProps);
  keys.forEach(function (prop) {
    var nonPluginProps = removeProperties(defaultProps, Object.keys(pluginProps));
    var didPassUnknownProp = !hasOwnProperty$1(nonPluginProps, prop); // Check if the prop exists in `plugins`

    if (didPassUnknownProp) {
      didPassUnknownProp = plugins.filter(function (plugin) {
        return plugin.name === prop;
      }).length === 0;
    }
    warnWhen(didPassUnknownProp, ["`" + prop + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", 'a plugin, forgot to pass it in an array as props.plugins.', '\n\n', 'All props: https://atomiks.github.io/tippyjs/v6/all-props/\n', 'Plugins: https://atomiks.github.io/tippyjs/v6/plugins/'].join(' '));
  });
}
var innerHTML = function innerHTML() {
  return 'innerHTML';
};
function dangerouslySetInnerHTML(element, html) {
  element[innerHTML()] = html;
}
function createArrowElement(value) {
  var arrow = div();
  if (value === true) {
    arrow.className = ARROW_CLASS;
  } else {
    arrow.className = SVG_ARROW_CLASS;
    if (isElement(value)) {
      arrow.appendChild(value);
    } else {
      dangerouslySetInnerHTML(arrow, value);
    }
  }
  return arrow;
}
function setContent(content, props) {
  if (isElement(props.content)) {
    dangerouslySetInnerHTML(content, '');
    content.appendChild(props.content);
  } else if (typeof props.content !== 'function') {
    if (props.allowHTML) {
      dangerouslySetInnerHTML(content, props.content);
    } else {
      content.textContent = props.content;
    }
  }
}
function getChildren(popper) {
  var box = popper.firstElementChild;
  var boxChildren = arrayFrom(box.children);
  return {
    box: box,
    content: boxChildren.find(function (node) {
      return node.classList.contains(CONTENT_CLASS);
    }),
    arrow: boxChildren.find(function (node) {
      return node.classList.contains(ARROW_CLASS) || node.classList.contains(SVG_ARROW_CLASS);
    }),
    backdrop: boxChildren.find(function (node) {
      return node.classList.contains(BACKDROP_CLASS);
    })
  };
}
function render(instance) {
  var popper = div();
  var box = div();
  box.className = BOX_CLASS;
  box.setAttribute('data-state', 'hidden');
  box.setAttribute('tabindex', '-1');
  var content = div();
  content.className = CONTENT_CLASS;
  content.setAttribute('data-state', 'hidden');
  setContent(content, instance.props);
  popper.appendChild(box);
  box.appendChild(content);
  onUpdate(instance.props, instance.props);
  function onUpdate(prevProps, nextProps) {
    var _getChildren = getChildren(popper),
      box = _getChildren.box,
      content = _getChildren.content,
      arrow = _getChildren.arrow;
    if (nextProps.theme) {
      box.setAttribute('data-theme', nextProps.theme);
    } else {
      box.removeAttribute('data-theme');
    }
    if (typeof nextProps.animation === 'string') {
      box.setAttribute('data-animation', nextProps.animation);
    } else {
      box.removeAttribute('data-animation');
    }
    if (nextProps.inertia) {
      box.setAttribute('data-inertia', '');
    } else {
      box.removeAttribute('data-inertia');
    }
    box.style.maxWidth = typeof nextProps.maxWidth === 'number' ? nextProps.maxWidth + "px" : nextProps.maxWidth;
    if (nextProps.role) {
      box.setAttribute('role', nextProps.role);
    } else {
      box.removeAttribute('role');
    }
    if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) {
      setContent(content, instance.props);
    }
    if (nextProps.arrow) {
      if (!arrow) {
        box.appendChild(createArrowElement(nextProps.arrow));
      } else if (prevProps.arrow !== nextProps.arrow) {
        box.removeChild(arrow);
        box.appendChild(createArrowElement(nextProps.arrow));
      }
    } else if (arrow) {
      box.removeChild(arrow);
    }
  }
  return {
    popper: popper,
    onUpdate: onUpdate
  };
} // Runtime check to identify if the render function is the default one; this
// way we can apply default CSS transitions logic and it can be tree-shaken away

render.$$tippy = true;
var idCounter = 1;
var mouseMoveListeners = []; // Used by `hideAll()`

var mountedInstances = [];
function createTippy(reference, passedProps) {
  var props = evaluateProps(reference, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps)))); // ===========================================================================
  // 🔒 Private members
  // ===========================================================================

  var showTimeout;
  var hideTimeout;
  var scheduleHideAnimationFrame;
  var isVisibleFromClick = false;
  var didHideDueToDocumentMouseDown = false;
  var didTouchMove = false;
  var ignoreOnFirstUpdate = false;
  var lastTriggerEvent;
  var currentTransitionEndListener;
  var onFirstUpdate;
  var listeners = [];
  var debouncedOnMouseMove = debounce$1(onMouseMove, props.interactiveDebounce);
  var currentTarget; // ===========================================================================
  // 🔑 Public members
  // ===========================================================================

  var id = idCounter++;
  var popperInstance = null;
  var plugins = unique(props.plugins);
  var state = {
    // Is the instance currently enabled?
    isEnabled: true,
    // Is the tippy currently showing and not transitioning out?
    isVisible: false,
    // Has the instance been destroyed?
    isDestroyed: false,
    // Is the tippy currently mounted to the DOM?
    isMounted: false,
    // Has the tippy finished transitioning in?
    isShown: false
  };
  var instance = {
    // properties
    id: id,
    reference: reference,
    popper: div(),
    popperInstance: popperInstance,
    props: props,
    state: state,
    plugins: plugins,
    // methods
    clearDelayTimeouts: clearDelayTimeouts,
    setProps: setProps,
    setContent: setContent,
    show: show,
    hide: hide,
    hideWithInteractivity: hideWithInteractivity,
    enable: enable,
    disable: disable,
    unmount: unmount,
    destroy: destroy
  }; // TODO: Investigate why this early return causes a TDZ error in the tests —
  // it doesn't seem to happen in the browser

  /* istanbul ignore if */

  if (!props.render) {
    {
      errorWhen(true, 'render() function has not been supplied.');
    }
    return instance;
  } // ===========================================================================
  // Initial mutations
  // ===========================================================================

  var _props$render = props.render(instance),
    popper = _props$render.popper,
    onUpdate = _props$render.onUpdate;
  popper.setAttribute('data-tippy-root', '');
  popper.id = "tippy-" + instance.id;
  instance.popper = popper;
  reference._tippy = instance;
  popper._tippy = instance;
  var pluginsHooks = plugins.map(function (plugin) {
    return plugin.fn(instance);
  });
  var hasAriaExpanded = reference.hasAttribute('aria-expanded');
  addListeners();
  handleAriaExpandedAttribute();
  handleStyles();
  invokeHook('onCreate', [instance]);
  if (props.showOnCreate) {
    scheduleShow();
  } // Prevent a tippy with a delay from hiding if the cursor left then returned
  // before it started hiding

  popper.addEventListener('mouseenter', function () {
    if (instance.props.interactive && instance.state.isVisible) {
      instance.clearDelayTimeouts();
    }
  });
  popper.addEventListener('mouseleave', function () {
    if (instance.props.interactive && instance.props.trigger.indexOf('mouseenter') >= 0) {
      getDocument().addEventListener('mousemove', debouncedOnMouseMove);
    }
  });
  return instance; // ===========================================================================
  // 🔒 Private methods
  // ===========================================================================

  function getNormalizedTouchSettings() {
    var touch = instance.props.touch;
    return Array.isArray(touch) ? touch : [touch, 0];
  }
  function getIsCustomTouchBehavior() {
    return getNormalizedTouchSettings()[0] === 'hold';
  }
  function getIsDefaultRenderFn() {
    var _instance$props$rende;

    // @ts-ignore
    return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy);
  }
  function getCurrentTarget() {
    return currentTarget || reference;
  }
  function getDocument() {
    var parent = getCurrentTarget().parentNode;
    return parent ? getOwnerDocument(parent) : document;
  }
  function getDefaultTemplateChildren() {
    return getChildren(popper);
  }
  function getDelay(isShow) {
    // For touch or keyboard input, force `0` delay for UX reasons
    // Also if the instance is mounted but not visible (transitioning out),
    // ignore delay
    if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === 'focus') {
      return 0;
    }
    return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay);
  }
  function handleStyles(fromHide) {
    if (fromHide === void 0) {
      fromHide = false;
    }
    popper.style.pointerEvents = instance.props.interactive && !fromHide ? '' : 'none';
    popper.style.zIndex = "" + instance.props.zIndex;
  }
  function invokeHook(hook, args, shouldInvokePropsHook) {
    if (shouldInvokePropsHook === void 0) {
      shouldInvokePropsHook = true;
    }
    pluginsHooks.forEach(function (pluginHooks) {
      if (pluginHooks[hook]) {
        pluginHooks[hook].apply(pluginHooks, args);
      }
    });
    if (shouldInvokePropsHook) {
      var _instance$props;
      (_instance$props = instance.props)[hook].apply(_instance$props, args);
    }
  }
  function handleAriaContentAttribute() {
    var aria = instance.props.aria;
    if (!aria.content) {
      return;
    }
    var attr = "aria-" + aria.content;
    var id = popper.id;
    var nodes = normalizeToArray(instance.props.triggerTarget || reference);
    nodes.forEach(function (node) {
      var currentValue = node.getAttribute(attr);
      if (instance.state.isVisible) {
        node.setAttribute(attr, currentValue ? currentValue + " " + id : id);
      } else {
        var nextValue = currentValue && currentValue.replace(id, '').trim();
        if (nextValue) {
          node.setAttribute(attr, nextValue);
        } else {
          node.removeAttribute(attr);
        }
      }
    });
  }
  function handleAriaExpandedAttribute() {
    if (hasAriaExpanded || !instance.props.aria.expanded) {
      return;
    }
    var nodes = normalizeToArray(instance.props.triggerTarget || reference);
    nodes.forEach(function (node) {
      if (instance.props.interactive) {
        node.setAttribute('aria-expanded', instance.state.isVisible && node === getCurrentTarget() ? 'true' : 'false');
      } else {
        node.removeAttribute('aria-expanded');
      }
    });
  }
  function cleanupInteractiveMouseListeners() {
    getDocument().removeEventListener('mousemove', debouncedOnMouseMove);
    mouseMoveListeners = mouseMoveListeners.filter(function (listener) {
      return listener !== debouncedOnMouseMove;
    });
  }
  function onDocumentPress(event) {
    // Moved finger to scroll instead of an intentional tap outside
    if (currentInput.isTouch) {
      if (didTouchMove || event.type === 'mousedown') {
        return;
      }
    }
    var actualTarget = event.composedPath && event.composedPath()[0] || event.target; // Clicked on interactive popper

    if (instance.props.interactive && actualContains(popper, actualTarget)) {
      return;
    } // Clicked on the event listeners target

    if (normalizeToArray(instance.props.triggerTarget || reference).some(function (el) {
      return actualContains(el, actualTarget);
    })) {
      if (currentInput.isTouch) {
        return;
      }
      if (instance.state.isVisible && instance.props.trigger.indexOf('click') >= 0) {
        return;
      }
    } else {
      invokeHook('onClickOutside', [instance, event]);
    }
    if (instance.props.hideOnClick === true) {
      instance.clearDelayTimeouts();
      instance.hide(); // `mousedown` event is fired right before `focus` if pressing the
      // currentTarget. This lets a tippy with `focus` trigger know that it
      // should not show

      didHideDueToDocumentMouseDown = true;
      setTimeout(function () {
        didHideDueToDocumentMouseDown = false;
      }); // The listener gets added in `scheduleShow()`, but this may be hiding it
      // before it shows, and hide()'s early bail-out behavior can prevent it
      // from being cleaned up

      if (!instance.state.isMounted) {
        removeDocumentPress();
      }
    }
  }
  function onTouchMove() {
    didTouchMove = true;
  }
  function onTouchStart() {
    didTouchMove = false;
  }
  function addDocumentPress() {
    var doc = getDocument();
    doc.addEventListener('mousedown', onDocumentPress, true);
    doc.addEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);
    doc.addEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);
    doc.addEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);
  }
  function removeDocumentPress() {
    var doc = getDocument();
    doc.removeEventListener('mousedown', onDocumentPress, true);
    doc.removeEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);
    doc.removeEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);
    doc.removeEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);
  }
  function onTransitionedOut(duration, callback) {
    onTransitionEnd(duration, function () {
      if (!instance.state.isVisible && popper.parentNode && popper.parentNode.contains(popper)) {
        callback();
      }
    });
  }
  function onTransitionedIn(duration, callback) {
    onTransitionEnd(duration, callback);
  }
  function onTransitionEnd(duration, callback) {
    var box = getDefaultTemplateChildren().box;
    function listener(event) {
      if (event.target === box) {
        updateTransitionEndListener(box, 'remove', listener);
        callback();
      }
    } // Make callback synchronous if duration is 0
    // `transitionend` won't fire otherwise

    if (duration === 0) {
      return callback();
    }
    updateTransitionEndListener(box, 'remove', currentTransitionEndListener);
    updateTransitionEndListener(box, 'add', listener);
    currentTransitionEndListener = listener;
  }
  function on(eventType, handler, options) {
    if (options === void 0) {
      options = false;
    }
    var nodes = normalizeToArray(instance.props.triggerTarget || reference);
    nodes.forEach(function (node) {
      node.addEventListener(eventType, handler, options);
      listeners.push({
        node: node,
        eventType: eventType,
        handler: handler,
        options: options
      });
    });
  }
  function addListeners() {
    if (getIsCustomTouchBehavior()) {
      on('touchstart', onTrigger, {
        passive: true
      });
      on('touchend', onMouseLeave, {
        passive: true
      });
    }
    splitBySpaces(instance.props.trigger).forEach(function (eventType) {
      if (eventType === 'manual') {
        return;
      }
      on(eventType, onTrigger);
      switch (eventType) {
        case 'mouseenter':
          on('mouseleave', onMouseLeave);
          break;
        case 'focus':
          on(isIE11 ? 'focusout' : 'blur', onBlurOrFocusOut);
          break;
        case 'focusin':
          on('focusout', onBlurOrFocusOut);
          break;
      }
    });
  }
  function removeListeners() {
    listeners.forEach(function (_ref) {
      var node = _ref.node,
        eventType = _ref.eventType,
        handler = _ref.handler,
        options = _ref.options;
      node.removeEventListener(eventType, handler, options);
    });
    listeners = [];
  }
  function onTrigger(event) {
    var _lastTriggerEvent;
    var shouldScheduleClickHide = false;
    if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) {
      return;
    }
    var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === 'focus';
    lastTriggerEvent = event;
    currentTarget = event.currentTarget;
    handleAriaExpandedAttribute();
    if (!instance.state.isVisible && isMouseEvent(event)) {
      // If scrolling, `mouseenter` events can be fired if the cursor lands
      // over a new target, but `mousemove` events don't get fired. This
      // causes interactive tooltips to get stuck open until the cursor is
      // moved
      mouseMoveListeners.forEach(function (listener) {
        return listener(event);
      });
    } // Toggle show/hide when clicking click-triggered tooltips

    if (event.type === 'click' && (instance.props.trigger.indexOf('mouseenter') < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {
      shouldScheduleClickHide = true;
    } else {
      scheduleShow(event);
    }
    if (event.type === 'click') {
      isVisibleFromClick = !shouldScheduleClickHide;
    }
    if (shouldScheduleClickHide && !wasFocused) {
      scheduleHide(event);
    }
  }
  function onMouseMove(event) {
    var target = event.target;
    var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper.contains(target);
    if (event.type === 'mousemove' && isCursorOverReferenceOrPopper) {
      return;
    }
    var popperTreeData = getNestedPopperTree().concat(popper).map(function (popper) {
      var _instance$popperInsta;
      var instance = popper._tippy;
      var state = (_instance$popperInsta = instance.popperInstance) == null ? void 0 : _instance$popperInsta.state;
      if (state) {
        return {
          popperRect: popper.getBoundingClientRect(),
          popperState: state,
          props: props
        };
      }
      return null;
    }).filter(Boolean);
    if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {
      cleanupInteractiveMouseListeners();
      scheduleHide(event);
    }
  }
  function onMouseLeave(event) {
    var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf('click') >= 0 && isVisibleFromClick;
    if (shouldBail) {
      return;
    }
    if (instance.props.interactive) {
      instance.hideWithInteractivity(event);
      return;
    }
    scheduleHide(event);
  }
  function onBlurOrFocusOut(event) {
    if (instance.props.trigger.indexOf('focusin') < 0 && event.target !== getCurrentTarget()) {
      return;
    } // If focus was moved to within the popper

    if (instance.props.interactive && event.relatedTarget && popper.contains(event.relatedTarget)) {
      return;
    }
    scheduleHide(event);
  }
  function isEventListenerStopped(event) {
    return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf('touch') >= 0 : false;
  }
  function createPopperInstance() {
    destroyPopperInstance();
    var _instance$props2 = instance.props,
      popperOptions = _instance$props2.popperOptions,
      placement = _instance$props2.placement,
      offset = _instance$props2.offset,
      getReferenceClientRect = _instance$props2.getReferenceClientRect,
      moveTransition = _instance$props2.moveTransition;
    var arrow = getIsDefaultRenderFn() ? getChildren(popper).arrow : null;
    var computedReference = getReferenceClientRect ? {
      getBoundingClientRect: getReferenceClientRect,
      contextElement: getReferenceClientRect.contextElement || getCurrentTarget()
    } : reference;
    var tippyModifier = {
      name: '$$tippy',
      enabled: true,
      phase: 'beforeWrite',
      requires: ['computeStyles'],
      fn: function fn(_ref2) {
        var state = _ref2.state;
        if (getIsDefaultRenderFn()) {
          var _getDefaultTemplateCh = getDefaultTemplateChildren(),
            box = _getDefaultTemplateCh.box;
          ['placement', 'reference-hidden', 'escaped'].forEach(function (attr) {
            if (attr === 'placement') {
              box.setAttribute('data-placement', state.placement);
            } else {
              if (state.attributes.popper["data-popper-" + attr]) {
                box.setAttribute("data-" + attr, '');
              } else {
                box.removeAttribute("data-" + attr);
              }
            }
          });
          state.attributes.popper = {};
        }
      }
    };
    var modifiers = [{
      name: 'offset',
      options: {
        offset: offset
      }
    }, {
      name: 'preventOverflow',
      options: {
        padding: {
          top: 2,
          bottom: 2,
          left: 5,
          right: 5
        }
      }
    }, {
      name: 'flip',
      options: {
        padding: 5
      }
    }, {
      name: 'computeStyles',
      options: {
        adaptive: !moveTransition
      }
    }, tippyModifier];
    if (getIsDefaultRenderFn() && arrow) {
      modifiers.push({
        name: 'arrow',
        options: {
          element: arrow,
          padding: 3
        }
      });
    }
    modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []);
    instance.popperInstance = createPopper(computedReference, popper, Object.assign({}, popperOptions, {
      placement: placement,
      onFirstUpdate: onFirstUpdate,
      modifiers: modifiers
    }));
  }
  function destroyPopperInstance() {
    if (instance.popperInstance) {
      instance.popperInstance.destroy();
      instance.popperInstance = null;
    }
  }
  function mount() {
    var appendTo = instance.props.appendTo;
    var parentNode; // By default, we'll append the popper to the triggerTargets's parentNode so
    // it's directly after the reference element so the elements inside the
    // tippy can be tabbed to
    // If there are clipping issues, the user can specify a different appendTo
    // and ensure focus management is handled correctly manually

    var node = getCurrentTarget();
    if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') {
      parentNode = node.parentNode;
    } else {
      parentNode = invokeWithArgsOrReturn(appendTo, [node]);
    } // The popper element needs to exist on the DOM before its position can be
    // updated as Popper needs to read its dimensions

    if (!parentNode.contains(popper)) {
      parentNode.appendChild(popper);
    }
    instance.state.isMounted = true;
    createPopperInstance();
    /* istanbul ignore else */

    {
      // Accessibility check
      warnWhen(instance.props.interactive && appendTo === defaultProps.appendTo && node.nextElementSibling !== popper, ['Interactive tippy element may not be accessible via keyboard', 'navigation because it is not directly after the reference element', 'in the DOM source order.', '\n\n', 'Using a wrapper <div> or <span> tag around the reference element', 'solves this by creating a new parentNode context.', '\n\n', 'Specifying `appendTo: document.body` silences this warning, but it', 'assumes you are using a focus management solution to handle', 'keyboard navigation.', '\n\n', 'See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity'].join(' '));
    }
  }
  function getNestedPopperTree() {
    return arrayFrom(popper.querySelectorAll('[data-tippy-root]'));
  }
  function scheduleShow(event) {
    instance.clearDelayTimeouts();
    if (event) {
      invokeHook('onTrigger', [instance, event]);
    }
    addDocumentPress();
    var delay = getDelay(true);
    var _getNormalizedTouchSe = getNormalizedTouchSettings(),
      touchValue = _getNormalizedTouchSe[0],
      touchDelay = _getNormalizedTouchSe[1];
    if (currentInput.isTouch && touchValue === 'hold' && touchDelay) {
      delay = touchDelay;
    }
    if (delay) {
      showTimeout = setTimeout(function () {
        instance.show();
      }, delay);
    } else {
      instance.show();
    }
  }
  function scheduleHide(event) {
    instance.clearDelayTimeouts();
    invokeHook('onUntrigger', [instance, event]);
    if (!instance.state.isVisible) {
      removeDocumentPress();
      return;
    } // For interactive tippies, scheduleHide is added to a document.body handler
    // from onMouseLeave so must intercept scheduled hides from mousemove/leave
    // events when trigger contains mouseenter and click, and the tip is
    // currently shown as a result of a click.

    if (instance.props.trigger.indexOf('mouseenter') >= 0 && instance.props.trigger.indexOf('click') >= 0 && ['mouseleave', 'mousemove'].indexOf(event.type) >= 0 && isVisibleFromClick) {
      return;
    }
    var delay = getDelay(false);
    if (delay) {
      hideTimeout = setTimeout(function () {
        if (instance.state.isVisible) {
          instance.hide();
        }
      }, delay);
    } else {
      // Fixes a `transitionend` problem when it fires 1 frame too
      // late sometimes, we don't want hide() to be called.
      scheduleHideAnimationFrame = requestAnimationFrame(function () {
        instance.hide();
      });
    }
  } // ===========================================================================
  // 🔑 Public methods
  // ===========================================================================

  function enable() {
    instance.state.isEnabled = true;
  }
  function disable() {
    // Disabling the instance should also hide it
    // https://github.com/atomiks/tippy.js-react/issues/106
    instance.hide();
    instance.state.isEnabled = false;
  }
  function clearDelayTimeouts() {
    clearTimeout(showTimeout);
    clearTimeout(hideTimeout);
    cancelAnimationFrame(scheduleHideAnimationFrame);
  }
  function setProps(partialProps) {
    /* istanbul ignore else */
    {
      warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('setProps'));
    }
    if (instance.state.isDestroyed) {
      return;
    }
    invokeHook('onBeforeUpdate', [instance, partialProps]);
    removeListeners();
    var prevProps = instance.props;
    var nextProps = evaluateProps(reference, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {
      ignoreAttributes: true
    }));
    instance.props = nextProps;
    addListeners();
    if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {
      cleanupInteractiveMouseListeners();
      debouncedOnMouseMove = debounce$1(onMouseMove, nextProps.interactiveDebounce);
    } // Ensure stale aria-expanded attributes are removed

    if (prevProps.triggerTarget && !nextProps.triggerTarget) {
      normalizeToArray(prevProps.triggerTarget).forEach(function (node) {
        node.removeAttribute('aria-expanded');
      });
    } else if (nextProps.triggerTarget) {
      reference.removeAttribute('aria-expanded');
    }
    handleAriaExpandedAttribute();
    handleStyles();
    if (onUpdate) {
      onUpdate(prevProps, nextProps);
    }
    if (instance.popperInstance) {
      createPopperInstance(); // Fixes an issue with nested tippies if they are all getting re-rendered,
      // and the nested ones get re-rendered first.
      // https://github.com/atomiks/tippyjs-react/issues/177
      // TODO: find a cleaner / more efficient solution(!)

      getNestedPopperTree().forEach(function (nestedPopper) {
        // React (and other UI libs likely) requires a rAF wrapper as it flushes
        // its work in one
        requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate);
      });
    }
    invokeHook('onAfterUpdate', [instance, partialProps]);
  }
  function setContent(content) {
    instance.setProps({
      content: content
    });
  }
  function show() {
    /* istanbul ignore else */
    {
      warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('show'));
    } // Early bail-out

    var isAlreadyVisible = instance.state.isVisible;
    var isDestroyed = instance.state.isDestroyed;
    var isDisabled = !instance.state.isEnabled;
    var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch;
    var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration);
    if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) {
      return;
    } // Normalize `disabled` behavior across browsers.
    // Firefox allows events on disabled elements, but Chrome doesn't.
    // Using a wrapper element (i.e. <span>) is recommended.

    if (getCurrentTarget().hasAttribute('disabled')) {
      return;
    }
    invokeHook('onShow', [instance], false);
    if (instance.props.onShow(instance) === false) {
      return;
    }
    instance.state.isVisible = true;
    if (getIsDefaultRenderFn()) {
      popper.style.visibility = 'visible';
    }
    handleStyles();
    addDocumentPress();
    if (!instance.state.isMounted) {
      popper.style.transition = 'none';
    } // If flipping to the opposite side after hiding at least once, the
    // animation will use the wrong placement without resetting the duration

    if (getIsDefaultRenderFn()) {
      var _getDefaultTemplateCh2 = getDefaultTemplateChildren(),
        box = _getDefaultTemplateCh2.box,
        content = _getDefaultTemplateCh2.content;
      setTransitionDuration([box, content], 0);
    }
    onFirstUpdate = function onFirstUpdate() {
      var _instance$popperInsta2;
      if (!instance.state.isVisible || ignoreOnFirstUpdate) {
        return;
      }
      ignoreOnFirstUpdate = true; // reflow

      void popper.offsetHeight;
      popper.style.transition = instance.props.moveTransition;
      if (getIsDefaultRenderFn() && instance.props.animation) {
        var _getDefaultTemplateCh3 = getDefaultTemplateChildren(),
          _box = _getDefaultTemplateCh3.box,
          _content = _getDefaultTemplateCh3.content;
        setTransitionDuration([_box, _content], duration);
        setVisibilityState([_box, _content], 'visible');
      }
      handleAriaContentAttribute();
      handleAriaExpandedAttribute();
      pushIfUnique(mountedInstances, instance); // certain modifiers (e.g. `maxSize`) require a second update after the
      // popper has been positioned for the first time

      (_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate();
      invokeHook('onMount', [instance]);
      if (instance.props.animation && getIsDefaultRenderFn()) {
        onTransitionedIn(duration, function () {
          instance.state.isShown = true;
          invokeHook('onShown', [instance]);
        });
      }
    };
    mount();
  }
  function hide() {
    /* istanbul ignore else */
    {
      warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hide'));
    } // Early bail-out

    var isAlreadyHidden = !instance.state.isVisible;
    var isDestroyed = instance.state.isDestroyed;
    var isDisabled = !instance.state.isEnabled;
    var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration);
    if (isAlreadyHidden || isDestroyed || isDisabled) {
      return;
    }
    invokeHook('onHide', [instance], false);
    if (instance.props.onHide(instance) === false) {
      return;
    }
    instance.state.isVisible = false;
    instance.state.isShown = false;
    ignoreOnFirstUpdate = false;
    isVisibleFromClick = false;
    if (getIsDefaultRenderFn()) {
      popper.style.visibility = 'hidden';
    }
    cleanupInteractiveMouseListeners();
    removeDocumentPress();
    handleStyles(true);
    if (getIsDefaultRenderFn()) {
      var _getDefaultTemplateCh4 = getDefaultTemplateChildren(),
        box = _getDefaultTemplateCh4.box,
        content = _getDefaultTemplateCh4.content;
      if (instance.props.animation) {
        setTransitionDuration([box, content], duration);
        setVisibilityState([box, content], 'hidden');
      }
    }
    handleAriaContentAttribute();
    handleAriaExpandedAttribute();
    if (instance.props.animation) {
      if (getIsDefaultRenderFn()) {
        onTransitionedOut(duration, instance.unmount);
      }
    } else {
      instance.unmount();
    }
  }
  function hideWithInteractivity(event) {
    /* istanbul ignore else */
    {
      warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hideWithInteractivity'));
    }
    getDocument().addEventListener('mousemove', debouncedOnMouseMove);
    pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
    debouncedOnMouseMove(event);
  }
  function unmount() {
    /* istanbul ignore else */
    {
      warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('unmount'));
    }
    if (instance.state.isVisible) {
      instance.hide();
    }
    if (!instance.state.isMounted) {
      return;
    }
    destroyPopperInstance(); // If a popper is not interactive, it will be appended outside the popper
    // tree by default. This seems mainly for interactive tippies, but we should
    // find a workaround if possible

    getNestedPopperTree().forEach(function (nestedPopper) {
      nestedPopper._tippy.unmount();
    });
    if (popper.parentNode) {
      popper.parentNode.removeChild(popper);
    }
    mountedInstances = mountedInstances.filter(function (i) {
      return i !== instance;
    });
    instance.state.isMounted = false;
    invokeHook('onHidden', [instance]);
  }
  function destroy() {
    /* istanbul ignore else */
    {
      warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('destroy'));
    }
    if (instance.state.isDestroyed) {
      return;
    }
    instance.clearDelayTimeouts();
    instance.unmount();
    removeListeners();
    delete reference._tippy;
    instance.state.isDestroyed = true;
    invokeHook('onDestroy', [instance]);
  }
}
function tippy(targets, optionalProps) {
  if (optionalProps === void 0) {
    optionalProps = {};
  }
  var plugins = defaultProps.plugins.concat(optionalProps.plugins || []);
  /* istanbul ignore else */

  {
    validateTargets(targets);
    validateProps(optionalProps, plugins);
  }
  bindGlobalEventListeners();
  var passedProps = Object.assign({}, optionalProps, {
    plugins: plugins
  });
  var elements = getArrayOfElements(targets);
  /* istanbul ignore else */

  {
    var isSingleContentElement = isElement(passedProps.content);
    var isMoreThanOneReferenceElement = elements.length > 1;
    warnWhen(isSingleContentElement && isMoreThanOneReferenceElement, ['tippy() was passed an Element as the `content` prop, but more than', 'one tippy instance was created by this invocation. This means the', 'content element will only be appended to the last tippy instance.', '\n\n', 'Instead, pass the .innerHTML of the element, or use a function that', 'returns a cloned version of the element instead.', '\n\n', '1) content: element.innerHTML\n', '2) content: () => element.cloneNode(true)'].join(' '));
  }
  var instances = elements.reduce(function (acc, reference) {
    var instance = reference && createTippy(reference, passedProps);
    if (instance) {
      acc.push(instance);
    }
    return acc;
  }, []);
  return isElement(targets) ? instances[0] : instances;
}
tippy.defaultProps = defaultProps;
tippy.setDefaultProps = setDefaultProps;
tippy.currentInput = currentInput;

// every time the popper is destroyed (i.e. a new target), removing the styles
// and causing transitions to break for singletons when the console is open, but
// most notably for non-transform styles being used, `gpuAcceleration: false`.

Object.assign({}, applyStyles$1, {
  effect: function effect(_ref) {
    var state = _ref.state;
    var initialStyles = {
      popper: {
        position: state.options.strategy,
        left: '0',
        top: '0',
        margin: '0'
      },
      arrow: {
        position: 'absolute'
      },
      reference: {}
    };
    Object.assign(state.elements.popper.style, initialStyles.popper);
    state.styles = initialStyles;
    if (state.elements.arrow) {
      Object.assign(state.elements.arrow.style, initialStyles.arrow);
    } // intentionally return no cleanup function
    // return () => { ... }
  }
});
var mouseCoords = {
  clientX: 0,
  clientY: 0
};
var activeInstances = [];
function storeMouseCoords(_ref) {
  var clientX = _ref.clientX,
    clientY = _ref.clientY;
  mouseCoords = {
    clientX: clientX,
    clientY: clientY
  };
}
function addMouseCoordsListener(doc) {
  doc.addEventListener('mousemove', storeMouseCoords);
}
function removeMouseCoordsListener(doc) {
  doc.removeEventListener('mousemove', storeMouseCoords);
}
var followCursor = {
  name: 'followCursor',
  defaultValue: false,
  fn: function fn(instance) {
    var reference = instance.reference;
    var doc = getOwnerDocument(instance.props.triggerTarget || reference);
    var isInternalUpdate = false;
    var wasFocusEvent = false;
    var isUnmounted = true;
    var prevProps = instance.props;
    function getIsInitialBehavior() {
      return instance.props.followCursor === 'initial' && instance.state.isVisible;
    }
    function addListener() {
      doc.addEventListener('mousemove', onMouseMove);
    }
    function removeListener() {
      doc.removeEventListener('mousemove', onMouseMove);
    }
    function unsetGetReferenceClientRect() {
      isInternalUpdate = true;
      instance.setProps({
        getReferenceClientRect: null
      });
      isInternalUpdate = false;
    }
    function onMouseMove(event) {
      // If the instance is interactive, avoid updating the position unless it's
      // over the reference element
      var isCursorOverReference = event.target ? reference.contains(event.target) : true;
      var followCursor = instance.props.followCursor;
      var clientX = event.clientX,
        clientY = event.clientY;
      var rect = reference.getBoundingClientRect();
      var relativeX = clientX - rect.left;
      var relativeY = clientY - rect.top;
      if (isCursorOverReference || !instance.props.interactive) {
        instance.setProps({
          // @ts-ignore - unneeded DOMRect properties
          getReferenceClientRect: function getReferenceClientRect() {
            var rect = reference.getBoundingClientRect();
            var x = clientX;
            var y = clientY;
            if (followCursor === 'initial') {
              x = rect.left + relativeX;
              y = rect.top + relativeY;
            }
            var top = followCursor === 'horizontal' ? rect.top : y;
            var right = followCursor === 'vertical' ? rect.right : x;
            var bottom = followCursor === 'horizontal' ? rect.bottom : y;
            var left = followCursor === 'vertical' ? rect.left : x;
            return {
              width: right - left,
              height: bottom - top,
              top: top,
              right: right,
              bottom: bottom,
              left: left
            };
          }
        });
      }
    }
    function create() {
      if (instance.props.followCursor) {
        activeInstances.push({
          instance: instance,
          doc: doc
        });
        addMouseCoordsListener(doc);
      }
    }
    function destroy() {
      activeInstances = activeInstances.filter(function (data) {
        return data.instance !== instance;
      });
      if (activeInstances.filter(function (data) {
        return data.doc === doc;
      }).length === 0) {
        removeMouseCoordsListener(doc);
      }
    }
    return {
      onCreate: create,
      onDestroy: destroy,
      onBeforeUpdate: function onBeforeUpdate() {
        prevProps = instance.props;
      },
      onAfterUpdate: function onAfterUpdate(_, _ref2) {
        var followCursor = _ref2.followCursor;
        if (isInternalUpdate) {
          return;
        }
        if (followCursor !== undefined && prevProps.followCursor !== followCursor) {
          destroy();
          if (followCursor) {
            create();
            if (instance.state.isMounted && !wasFocusEvent && !getIsInitialBehavior()) {
              addListener();
            }
          } else {
            removeListener();
            unsetGetReferenceClientRect();
          }
        }
      },
      onMount: function onMount() {
        if (instance.props.followCursor && !wasFocusEvent) {
          if (isUnmounted) {
            onMouseMove(mouseCoords);
            isUnmounted = false;
          }
          if (!getIsInitialBehavior()) {
            addListener();
          }
        }
      },
      onTrigger: function onTrigger(_, event) {
        if (isMouseEvent(event)) {
          mouseCoords = {
            clientX: event.clientX,
            clientY: event.clientY
          };
        }
        wasFocusEvent = event.type === 'focus';
      },
      onHidden: function onHidden() {
        if (instance.props.followCursor) {
          unsetGetReferenceClientRect();
          removeListener();
          isUnmounted = true;
        }
      }
    };
  }
};
tippy.setDefaultProps({
  render: render
});

var t = function () {
  return t = Object.assign || function (t) {
    for (var e, n = 1, i = arguments.length; n < i; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
    return t;
  }, t.apply(this, arguments);
};
"function" == typeof SuppressedError && SuppressedError;
var e;
!function (t) {
  t[t.render = 0] = "render", t[t.selected = 1] = "selected";
}(e || (e = {}));
var n = function () {
  function e(e, n) {
    void 0 === n && (n = {}), this._initStatus = !1, this.onArr = [], this.prefix = "mark", this._selectionchangeTimeOut = 0, this.markRange = [], this.sectionChangeDelay = 100, this.lineColor = "#F17F53", this.lineWidth = 2, this.eventController = new AbortController(), this.options = {
      idPrefix: "mark-svg"
    };
    var i = null;
    if ("string" == typeof e ? i = document.getElementById(e) : e.nodeType == Node.ELEMENT_NODE && (i = e), !i) throw new Error("target错误 或 未找到对应元素");
    this.targetElement = i, this.onArr = [], this.options = t(t({}, this.options), n);
    var r = n.sectionChangeDelay,
      o = n.lineColor,
      a = n.lineWidth;
    r && (this.sectionChangeDelay = r), o && (this.lineColor = o), a && (this.lineWidth = a);
  }
  return e.prototype.render = function () {
    var t = this;
    if (!this._initStatus) {
      var e = this.targetElement.parentNode,
        n = document.createElement("div");
      n.className = "mark-view", n.style.position = "relative", n.style.width = "fit-content", n.style.height = "fit-content", n.style.minWidth = "100%";
      var i = document.createElement("style");
      i.innerHTML = "\n              @keyframes blink {\n                0%, 100% { opacity: 0; }\n                50% { opacity: 1; }\n              }\n              .blink {\n                animation: blink 1s linear 0;\n                animation-iteration-count: 3;\n              }\n            ", n.appendChild(i);
      var r = this.targetElement.cloneNode(!0);
      this.targetNode = r, n.appendChild(r);
      var o = document.createElementNS("http://www.w3.org/2000/svg", "svg");
      this.svgDom = o, o.id = "".concat(this.options.idPrefix || "mark-svg").concat(this.options.id ? "_#_" + this.options.id : ""), o.style.position = "absolute", o.style.left = "0px", o.style.top = "0px", o.style.width = "100%", o.style.height = "100%", o.style.mixBlendMode = "multiply", o.setAttribute("width", "100%"), o.setAttribute("height", "100%"), o.setAttribute("pointer-events", "none"), n.appendChild(o), null == e || e.replaceChild(n, this.targetElement), this.rootElement = n, this.targetNodeRect = this.rootElement.getBoundingClientRect(), this.targetNode.addEventListener("click", function (e) {
        if (t.rootElement) {
          var n = t.rootElement.getBoundingClientRect(),
            i = e,
            r = i.pageX - n.x,
            o = i.pageY - n.y,
            a = t.markRange.filter(function (t) {
              return t.position.filter(function (t) {
                return r > t.x1 && r < t.x2 && o > t.y1 && o < t.y2;
              }).length > 0;
            });
          a.length > 0 && a.forEach(function (t) {
            var e = new Event("click");
            t.node.dispatchEvent(e);
          });
        }
      }, {
        signal: this.eventController.signal
      }), this._handletListener(), this._update(), this._handleOn("render", this.rootElement);
    }
    this._initStatus = !0;
  }, e.prototype.update = function () {
    var t = this;
    this.markRange.forEach(function (e) {
      var n = t.svgDom.querySelector("[data-id='".concat(e.markStr, "']"));
      if (n && (n.innerHTML = "", !t._handleEfiToRange(e.markStr).collapsed)) {
        var i = e.range.getClientRects(),
          r = [],
          o = document.createDocumentFragment(),
          a = t._detachRangeRects(i),
          l = a.textRunRects;
        a.rowRects;
        for (var s = 0; s < l.length; s++) {
          var h = l[s],
            c = {
              line: "underline" === e.type ? e.styleScheme : "",
              rect: "highlight" === e.type ? e.styleScheme : ""
            },
            d = t._handleCreateSvgG(h, o, e.type, c);
          d.group;
          var u = d.position;
          r.push(u);
        }
        n.appendChild(o), e.position = r;
      }
    });
  }, e.prototype.add = function (t) {
    var e,
      n,
      i = t.type,
      r = null !== (e = t.click) && void 0 !== e ? e : null,
      o = this._handleEfiToRange(t.markStr);
    if (!o.collapsed) {
      var a = o.getClientRects(),
        l = document.createElementNS("http://www.w3.org/2000/svg", "g"),
        s = "";
      t.className && (s = t.className.split("__")[1], l.classList.add(t.className)), this.options.id && l.setAttribute("id", "".concat(this.options.id, "_#_").concat(t.markStr)), l.setAttribute("data-id", t.markStr), l.setAttribute("data-styleScheme", s), l.setAttribute("data-type", t.type), l.setAttribute("opacity", "0.5");
      var h = [],
        c = document.createDocumentFragment(),
        d = this._detachRangeRects(a),
        u = d.textRunRects;
      d.rowRects;
      for (var p = 0; p < u.length; p++) {
        var g = u[p],
          f = {
            line: "underline" === t.type ? s : "",
            rect: "highlight" === t.type ? s : ""
          },
          m = this._handleCreateSvgG(g, c, i, f);
        m.group;
        var v = m.position;
        h.push(v);
      }
      l.appendChild(c), this.markRange.push({
        markStr: t.markStr,
        range: o,
        type: i,
        styleScheme: s,
        position: h,
        node: l,
        data: null !== (n = t.data) && void 0 !== n ? n : {}
      }), r && "function" == typeof r && l.addEventListener("click", function (t) {
        var e = this.getAttribute("data-id");
        r.apply(this, [t, e]);
      }, {
        signal: this.eventController.signal
      }), this.svgDom.appendChild(l);
    }
  }, e.prototype.remove = function (t, e) {
    var n;
    if (!t) throw new Error("未传入MarkEfiCode");
    for (var i = this.markRange.map(function (t, e) {
        return {
          item: t,
          index: e
        };
      }).filter(function (n) {
        return n.item.markStr == t && (!e || n.item.type == e);
      }), r = 0, o = this.svgDom, a = 0; a < i.length; a++) {
      var l = i[a].index - r,
        s = i[a].item;
      null === (n = o.querySelector("[data-id='".concat(s.markStr, "']"))) || void 0 === n || n.remove(), this.markRange.splice(l, 1), r++;
    }
  }, e.prototype.animate = function (t, e) {
    if (void 0 === e && (e = {
      type: "blink"
    }), !t) throw new Error("未传入动画目标target");
    var n = this.svgDom.querySelectorAll('g[data-id="'.concat(t, '"] > rect'));
    Array.from(n).forEach(function (t, n) {
      t.classList.add(e.type), t.addEventListener("animationend", function () {
        t.classList.contains("blink") && t.classList.remove("blink");
      });
    });
  }, e.prototype.highlight = function (t, e, n, i) {
    if (void 0 === i && (i = {}), !t) throw new Error("未传入MarkEfiCode");
    this.add({
      type: "highlight",
      markStr: t,
      className: e,
      click: n,
      data: i
    });
  }, e.prototype.underline = function (t, e, n, i) {
    if (void 0 === i && (i = {}), !t) throw new Error("未传入MarkEfiCode");
    this.add({
      type: "underline",
      markStr: t,
      className: e,
      click: n,
      data: i
    });
  }, e.prototype.show = function (t) {
    var e, n;
    t ? null === (e = this.svgDom) || void 0 === e || e.querySelectorAll('g[data-type="'.concat(t, '"]')).forEach(function (t) {
      t.setAttribute("display", "auto");
    }) : null === (n = this.svgDom) || void 0 === n || n.querySelectorAll("g").forEach(function (t) {
      t.setAttribute("display", "auto");
    });
  }, e.prototype.hide = function (t) {
    var e, n;
    t ? null === (e = this.svgDom) || void 0 === e || e.querySelectorAll('g[data-type="'.concat(t, '"]')).forEach(function (t) {
      t.setAttribute("display", "none");
    }) : null === (n = this.svgDom) || void 0 === n || n.querySelectorAll("g").forEach(function (t) {
      t.setAttribute("display", "none");
    });
  }, e.prototype.clear = function (t) {
    for (var e, n = this.markRange.map(function (t, e) {
        return {
          item: t,
          index: e
        };
      }).filter(function (e) {
        return !t || e.item.type == t;
      }), i = 0, r = this.svgDom, o = 0; o < n.length; o++) {
      var a = n[o].index - i,
        l = n[o].item;
      null === (e = r.querySelector("[data-id='".concat(l.markStr, "']"))) || void 0 === e || e.remove(), this.markRange.splice(a, 1), i++;
    }
  }, e.prototype.on = function (t, e) {
    this.onArr.push({
      key: t,
      func: e
    });
  }, e.prototype.destroy = function () {
    this.eventController.abort(), this.rootElement = void 0, this.targetNode = void 0, this.svgDom = void 0, this.markRange = [], this.onArr = [], this._initStatus = !1;
  }, e.prototype.getMarks = function () {
    return this.markRange.map(function (t) {
      return {
        markStr: t.markStr,
        type: t.type,
        data: t.data
      };
    });
  }, e.prototype._update = function () {
    var t = this;
    window.addEventListener("resize", function () {
      requestAnimationFrame(function () {
        t.rootElement && (t.targetNodeRect = t.rootElement.getBoundingClientRect(), t.update());
      });
    }, {
      signal: this.eventController.signal
    });
  }, e.prototype._handletListener = function () {
    var t = this,
      e = this;
    document.addEventListener("selectionchange", function () {
      for (var n = [], i = 0; i < arguments.length; i++) n[i] = arguments[i];
      clearTimeout(t._selectionchangeTimeOut), t._selectionchangeTimeOut = setTimeout(function () {
        t._handleSelected.apply(t, n);
      }, e.sectionChangeDelay || 250);
    }, {
      signal: e.eventController.signal
    });
  }, e.prototype._handleSelected = function () {
    var t,
      e,
      n,
      i = window.getSelection();
    if (i && !i.isCollapsed) {
      var r = i.getRangeAt(0),
        o = this._handleSelectRangePostion(r),
        a = r.getClientRects(),
        l = a[0],
        s = a[a.length - 1],
        h = (null === (t = this.rootElement) || void 0 === t ? void 0 : t.getBoundingClientRect()) || this.targetNodeRect || {},
        c = null !== (e = null == h ? void 0 : h.top) && void 0 !== e ? e : 0,
        d = null !== (n = null == h ? void 0 : h.left) && void 0 !== n ? n : 0,
        u = {
          top_left: [l.left - d, l.top - c],
          top_center: [l.left + l.width / 2 - d, l.top - c],
          top_right: [l.right - d, l.top - c],
          center_left: [s.left - d, l.top + (s.bottom - l.top) / 2 - c],
          center: [s.left + (l.right - s.left) / 2 - d, l.top + (s.bottom - l.top) / 2 - c],
          center_right: [l.right - d, l.top + (s.bottom - l.top) / 2 - c],
          bottom_left: [s.left - d, s.bottom - c],
          bottom_center: [s.left + s.width / 2 - d, s.top + s.height - c],
          bottom_right: [s.right - d, s.bottom - c]
        };
      this._handleOn("selected", {
        markStr: o,
        range: r,
        position: u
      });
    }
  }, e.prototype._handleSelectRangePostion = function (t) {
    var e = this._handleSelectNodePostion(t.startContainer),
      n = t.startOffset,
      i = this._handleSelectNodePostion(t.endContainer),
      r = t.endOffset;
    return "".concat(this.prefix, "(").concat(e, ":").concat(n, ",").concat(i, ":").concat(r, ")");
  }, e.prototype._handleSelectNodePostion = function (t) {
    for (var e = [], n = t; n != this.targetNode;) {
      for (var i = 0; n.previousSibling;) i++, n = n.previousSibling;
      if (e.push(i), null == n.parentNode) break;
      n = n.parentNode;
    }
    return e.reverse().join("/");
  }, e.prototype._handleEfiToRange = function (t) {
    var e = document.createRange(),
      n = this._handleCheckEfi(t);
    if (!n) return e;
    for (var i = this.targetNode, r = null, o = 0; o < n.start_arr.length; o++) {
      var a = n.start_arr[o];
      i = r = i.childNodes[a];
    }
    n.start_node = r, i = this.targetNode;
    for (o = 0; o < n.end_arr.length; o++) {
      a = n.end_arr[o];
      i = r = i.childNodes[a];
    }
    return n.end_node = r, e.setStart(n.start_node, n.start_offset), e.setEnd(n.end_node, n.end_offset), e;
  }, e.prototype._handleOn = function (t, e) {
    void 0 === e && (e = {}), this.onArr.filter(function (e) {
      return e.key == t;
    }).forEach(function (t) {
      null == t || t.func(e);
    });
  }, e.prototype._handleCheckEfi = function (t) {
    var e = new RegExp("".concat(this.prefix, "(.*,.*)")),
      n = t.match(e);
    if (!n || n.length < 2) return null;
    var i = n[1],
      r = (i = i.replace("(", "").replace(")", "")).split(",");
    return {
      start_arr: r[0].split(":")[0].split("/").map(function (t) {
        return Number(t);
      }),
      start_offset: Number(r[0].split(":")[1]),
      end_arr: r[1].split(":")[0].split("/").map(function (t) {
        return Number(t);
      }),
      end_offset: Number(r[1].split(":")[1]),
      start_node: null,
      end_node: null
    };
  }, e.prototype._detachRangeRects = function (t) {
    for (var e = [], n = [], i = [], r = 0, o = t.length; r < o; r++) {
      var a = !0,
        l = t[r],
        s = r ? t[r - 1] : null;
      s && s.x === l.x && l.y < s.y + s.height && (a = !1), a || (i[r - 1] = !1), i.push(!0);
    }
    return i.forEach(function (i, r) {
      i ? e.push(t[r]) : n.push(t[r]);
    }), {
      textRunRects: e,
      rowRects: n
    };
  }, e.prototype._handleCreateRect = function (t, e) {
    var n;
    void 0 === e && (e = {
      opcity: !1
    });
    var i = document.createElementNS("http://www.w3.org/2000/svg", "rect"),
      r = (null === (n = this.rootElement) || void 0 === n ? void 0 : n.getBoundingClientRect()) || this.targetNodeRect || {},
      o = t.x - r.x,
      a = t.y - r.y;
    return i.setAttribute("x", o.toString()), i.setAttribute("y", a.toString()), i.setAttribute("width", t.width.toString()), i.setAttribute("height", t.height.toString()), i.setAttribute("fill", e.isPlaceholder ? this.options.animationColor || "#D6D6D6" : "#FFFF00"), i.setAttribute("mix-blend-mode", "multiply"), e.opcity && i.setAttribute("opacity", "0"), i;
  }, e.prototype._handleCreateLine = function (t, e) {
    var n,
      i = document.createElementNS("http://www.w3.org/2000/svg", "line"),
      r = (null === (n = this.rootElement) || void 0 === n ? void 0 : n.getBoundingClientRect()) || this.targetNodeRect || {},
      o = this.lineColor,
      a = t.x - r.x,
      l = t.y - r.y + t.height;
    "dashed" === (null == e ? void 0 : e.styleScheme) && (l += 3, o = "#25B774");
    var s = a + t.width,
      h = l;
    return i.setAttribute("x1", a.toString()), i.setAttribute("y1", l.toString()), i.setAttribute("x2", s.toString()), i.setAttribute("y2", h.toString()), i.setAttribute("stroke-width", "".concat(this.lineWidth) || "2"), i.setAttribute("stroke", o || "#03a9f4"), i.setAttribute("mix-blend-mode", "multiply"), "dashed" === (null == e ? void 0 : e.styleScheme) && i.setAttribute("stroke-dasharray", "6,3"), i;
  }, e.prototype._handleCreateSvgG = function (t, e, n, i) {
    var r,
      o = (null === (r = this.rootElement) || void 0 === r ? void 0 : r.getBoundingClientRect()) || this.targetNodeRect || {},
      a = document.createDocumentFragment();
    if ("highlight" == n) {
      var l = this._handleCreateRect(t, {
        styleScheme: i.rect
      });
      e.appendChild(l);
    }
    if ("underline" == n) {
      l = this._handleCreateRect(t, {
        opcity: !0,
        isPlaceholder: !0
      });
      var s = this._handleCreateLine(t, {
        styleScheme: i.line
      });
      e.appendChild(l), e.appendChild(s);
    }
    var h = t.x - o.x,
      c = t.y - o.y;
    return {
      group: a,
      position: {
        x1: h,
        y1: c,
        x2: h + t.width,
        y2: c + t.height
      }
    };
  }, e;
}();

//

// @pos 导入
/***
 * 文本块
 */

let prevOverflow$1 = '';
var script$4M = {
  name: 'XmlTextRender',
  components: {
    addFile: __vue_component__$4N,
    XmlTextDialogRender: __vue_component__$4P,
    [ImagePreview$1.Component.name]: ImagePreview$1.Component
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    pBlockData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    dataIndex: Number,
    //数据下标
    containerClass: String,
    extendParams: {
      type: Object,
      default: function () {
        return {
          //默认开启编辑器
          defaultOpenEditor: false
        };
      }
    },
    headers: {
      // 上传文件头部
      type: Object,
      default: () => {}
    },
    action: {
      // 上传文件地址
      type: String,
      default: ''
    },
    data: {
      // 上传文件附带的额外参数
      type: Object,
      default: () => {}
    },
    textBookData: Object //数字教材信息
  },
  data() {
    return {
      blockId: `blockId${v4()}`,
      propertyComponentsName: 'XmlTextProperty',
      editorId: `editor-container${`${Math.random()}`.replaceAll('0.', '')}`,
      blockData: {
        html: ''
      },
      showViewer: false,
      imageViewerTitles: [],
      imageViewerSrcs: [],
      inlineWordsModal: {
        visible: false,
        title: '',
        content: '',
        stylemode: ''
      },
      markRootId: `mark-view__${v4()}`,
      markEfiStr: '',
      markInstance: null,
      activeTippy: null,
      tippyTplBarId: `tipbar-tpl__${v4()}`,
      tippyTplNoteId: `tipnote-tpl__${v4()}`,
      actionCopyId: `act-copy__${v4()}`,
      actionNoteId: `act-note__${v4()}`,
      actionHighlightId: `act-light__${v4()}`,
      addTeacherResourcesId: `add-teacher-resources__${v4()}`,
      noteInputId: `note_input__${v4()}`,
      actNoteCancelId: `act-cancel__${v4()}`,
      actNoteConfirmId: `act-confirm__${v4()}`,
      editNoteTplId: `editnote-tpl__${v4()}`,
      actNoteDeleteId: `act-delete__${v4()}`,
      actNoteEditId: `act-edit__${v4()}`,
      noteOperateMode: '',
      tempMarkModel: {},
      noteData: {
        selectionText: '',
        content: ''
      },
      noteEditData: {
        selectionText: '',
        content: ''
      },
      tempMarkEfiStr: '',
      isMobile: false,
      notePopupVisible: false
    };
  },
  inject: {
    getProviderUserType: {
      from: 'getProviderUserType',
      default: () => () => ''
    },
    getProviderInsideIndex: {
      from: 'getProviderInsideIndex',
      default: () => () => -1
    },
    getSingleGroupLocation: {
      from: 'getSingleGroupLocation',
      default: () => () => ''
    },
    getToolbarVisible: {
      from: 'getToolbarVisible',
      default: () => () => false
    },
    getReaderBoxId: {
      from: 'getReaderBoxId',
      default: () => () => ''
    },
    getTeacherNoteList: {
      from: 'getTeacherNoteList',
      default: () => () => []
    },
    getStudentNoteList: {
      from: 'getStudentNoteList',
      default: () => () => []
    },
    getHighlightList: {
      from: 'getHighlightList',
      default: () => () => []
    },
    getKeyboardShow: {
      from: 'getKeyboardShow',
      default: () => () => false
    },
    getInitialLoad: {
      from: 'getInitialLoad',
      default: () => () => false
    }
  },
  computed: {
    feedback() {
      return {
        ruleIndex: this.ruleIndex,
        dataName: this.blockDataName,
        data: this.pBlockData,
        dataIndex: this.dataIndex,
        blockId: this.blockId
      };
    },
    userType() {
      return this.getProviderUserType();
    },
    insideIndex() {
      return this.getProviderInsideIndex();
    },
    groupLocation() {
      return this.getSingleGroupLocation();
    },
    toolbarVisible() {
      return this.getToolbarVisible();
    },
    readerBoxId() {
      return this.getReaderBoxId();
    },
    keyboardShow() {
      return this.getKeyboardShow();
    },
    mergeMarkList() {
      let teacherNoteList = this.getTeacherNoteList() || [],
        studentNoteList = this.getStudentNoteList() || [],
        highlightList = this.getHighlightList() || [];
      return [...teacherNoteList.filter(item => item.location === this.groupLocation && item.blockIndex === this.ruleIndex), ...studentNoteList.filter(item => item.location === this.groupLocation && item.blockIndex === this.ruleIndex), ...highlightList.filter(item => item.location === this.groupLocation && item.blockIndex === this.ruleIndex)];
    }
  },
  watch: {
    mergeMarkList: {
      handler(newValue) {
        // console.log("%c%s","font-size:2em;background: #00965E;color: #FFF",'教师笔记回显0',newValue,this.markInstance)
        // this.$nextTick(() => {
        //   if (newValue?.length && this.markInstance) {
        //     this.updateMarkView()
        //   }
        // })
      },
      immediate: true,
      deep: true
    }
  },
  created() {},
  mounted() {
    // 兼容一期文本弹窗=====
    this.$nextTick(() => {
      setTimeout(() => {
        jquery('a').attr('target', '_self');
      }, 2000);
      window.inlineWordsShow = uuid => {
        const ele = document.getElementById(`words__${uuid}`);
        const {
          title = '',
          content = ''
        } = ele.dataset || {};
        this.inlineWordsModal = {
          title,
          content,
          visible: true
        };
      };
    });
    // ==================
    let _this = this;
    this.blockData = this.pBlockData;
    if (!this.blockData.html) {
      this.blockData.html = '<span>暂无内容</span>';
    }
    const wrapSelector = `#${this.blockId} .richtext-reset-wrapper--view`;
    let mceMagicLinkRegistered = window.customElements?.get('magic-link');
    if (!mceMagicLinkRegistered) {
      window.customElements.whenDefined('magic-link').then(res => {
        console.log('%c%s', 'font-size:2em;background: #00965E;color: #FFF', '富文本组件MCE注册完成', res);
      });
      window.customElements.define('magic-link', MagicLink);
    }
    let containerSelector = `#${this.blockId}.richtext-reset-container`;
    this.$nextTick(() => {
      jquery(wrapSelector).on('click', 'img', function (e) {
        let target = jquery(e.target);
        console.log('%c%s', 'font-size:2em;background: #00965E;color: #FFF', '事件对象', e, target, target.index('img[preview]'));
        let title = target.attr('alt');
        let src = target.attr('src');
        let notallowgallery = target.attr('notallowgallery');
        if (notallowgallery) {
          return;
        }
        _this.imageViewerTitles = [title];
        _this.imageViewerSrcs = [src];
        prevOverflow$1 = document.body.style.overflow;
        document.body.style.overflow = 'hidden';
        if (_this.pageType == 'pc') {
          _this.showViewer = true;
        } else {
          ImagePreview$1({
            images: [src],
            startPosition: 0,
            closeable: true
          });
        }
      });
      jquery(containerSelector).on('click', 'magic-link', function (e) {
        let {
          plaintext,
          title,
          content,
          type,
          isPlaying,
          stylemode
        } = e.target.dataset;
        console.log('%c%s', 'font-size:2em;background: #00965E;color: #FFF', 'magic-link点击', e, e.target.dataset);
        if (_this.mode === 'editor') {
          _this.$message.info('当前内容仅支持在预览模式下查看');
          return;
        }
        if (type === 'image') {
          // 魔链图片
          _this.imageViewerTitles = [plaintext];
          _this.imageViewerSrcs = [content];
          prevOverflow$1 = document.body.style.overflow;
          document.body.style.overflow = 'hidden';
          _this.showViewer = true;
        }
        if (type === 'audio') {
          // 魔链音频
          _this.$EventBus.$emit('handleMagicLinkAudioPlay', {
            plaintext,
            title,
            content,
            type,
            isPlaying,
            targetId: e.target.id,
            callback: audio => {
              e.target.setAttribute('data-isplaying', audio.paused ? 'false' : 'true');
            }
          });
        }
        if (type === 'richtext') {
          content = content.replace(/text\-align:\s?justify/g, 'text-align:left');
          // 魔链富文本
          _this.inlineWordsModal = {
            title,
            content,
            stylemode,
            visible: true
          };
        }
        if (type === 'sheet') {
          // 插入活页
          window.open(process.env.VUE_APP_TEXTBOOK_WEB + 'previewLooseLeaf?pageType=' + _this.pageType + '&businessType=looseLeaf' + '&looseLeafId=' + content + '&isTrial=' + true + '&uuid=' + v4());
        }
      });
      jquery(containerSelector).on('openTarget', 'magic-link', function (e) {
        // let {plaintext,title,content,type,isPlaying,stylemode} = e.target.dataset
        console.log('%c%s', 'font-size:2em;background: #00965E;color: #FFF', 'leaflet target点击', e, e.detail);
      });
      jquery(`#${this.blockId} .inline-link-wrap`).each(function (i) {
        let parent = jquery(this).parent();
        // let indent = parent ? parent.css("text-indent") : '' // 此处使用css()方法获取属性值有内部bug
        let elem = parent.length ? parent[0] : null;
        if (elem) {
          let indent = getComputedStyle(elem, null)['textIndent'];
          let hackStyle = jquery(this).attr('style') + `max-width:calc(100% - ${indent})`;
          jquery(this).attr('style', hackStyle);
        }
      });
      jquery(`#${this.blockId} :not(.inline-link-wrap) img`).each(function (i) {
        let parent = jquery(this).parent();
        let elem = parent.length ? parent[0] : null;
        if (elem) {
          let indent = getComputedStyle(elem, null)['textIndent'];
          let hackStyle = jquery(this).attr('style') + `max-width:calc(100% - ${indent}) !important`;
          jquery(this).attr('style', hackStyle);
        }
      });
      if ('ontouchstart' in window || 'onmsgesturechange' in window) {
        this.isMobile = true;
        console.log('%c%s', 'font-size:2em;background: #00965E;color: #FFF', '当前环境:移动端');
      } else {
        this.isMobile = false;
        console.log('%c%s', 'font-size:2em;background: #00965E;color: #FFF', '当前环境:PC端');
      }

      // @pos 初始化tippy
      tippy.setDefaultProps({
        plugins: [followCursor]
      });
      _this.activeTippy = tippy(`#${_this.blockId}`, {
        content: '',
        placement: 'top',
        trigger: 'manual',
        theme: 'light',
        animation: 'shift-away',
        interactive: true,
        allowHTML: true,
        // followCursor: this.isMobile ? true : 'initial',
        followCursor: 'initial'
      });
      function findParentByClassName(node, className) {
        if (node && !(node.nodeType == 1 && node.tagName.toLowerCase() === 'body')) {
          while (node) {
            let isBody = node && node.nodeType == 1 && node.tagName.toLowerCase() == 'body';
            let hasClass = node && node.nodeType == 1 && node.classList.contains(className);
            if (hasClass || isBody) {
              return !hasClass ? null : node;
            }
            node = node.parentNode;
          }
        }
        return null;
      }
      if (this.userType) {
        this.markInstance = new n(this.markRootId, {
          id: this.currentRule.xmlCompRef
        });
        let timer = null;
        this.markInstance.on('selected', data => {
          if (this.insideIndex === this.ruleIndex) {
            console.log('%c%s', 'font-size:2em;background: #00965E;color: #FFF', 'SelectionChange', data);
            let {
              startContainer,
              endContainer
            } = data.range;
            let startParent = startContainer && findParentByClassName(startContainer, 'richtext-reset-wrapper--view');
            let endParent = endContainer && findParentByClassName(endContainer, 'richtext-reset-wrapper--view');
            if (startParent && endParent && startParent !== endParent) {
              _this.activeTippy[0].setContent('暂不支持跨组件标注');
              _this.activeTippy[0].show();
              setTimeout(handler => {
                _this.hideTippy();
              }, 1500);
              return;
            }
            _this.markEfiStr = data.markStr;
            if (_this.tempMarkEfiStr) {
              this.markInstance.remove(_this.tempMarkEfiStr, 'underline');
            }
            if (timer) {
              clearTimeout(timer);
            }
            if (this.isMobile) {
              _this.activeTippy[0] && _this.hideTippy();
              timer = setTimeout(() => {
                _this.handleMouseUp();
              }, 200);
            }
          }
        });
        this.markInstance.render();
        this.$nextTick(() => {
          this.$EventBus.$on('previewRepaint', () => {
            setTimeout(() => {
              _this.markInstance.update();
            }, 10);
          });
          this.$EventBus.$on('markJumpIn', target => {
            setTimeout(() => {
              if (target.location === _this.groupLocation && target.blockIndex === _this.ruleIndex) {
                _this.markInstance.animate(target.markEfiCode);
              }
            }, 10);
          });
          this.$once('hook:beforeDestroy', () => {
            _this.$EventBus.$off('previewRepaint');
            _this.$EventBus.$off('markJumpIn');
          });
          this.updateCodeBlock();
          setTimeout(() => {
            this.updateMarkView();
          }, this.getInitialLoad() ? 1000 : 0);
        });
      } else {
        this.updateCodeBlock();
      }
    });
    this.$EventBus.$on('clickToolbarTip', function (data) {
      if (data.type == 'copy' && data.tippyTplBarId == _this.tippyTplBarId) {
        _this.actionCopy();
      } else if (data.type == 'note' && data.tippyTplBarId == _this.tippyTplBarId) {
        _this.actionAddNote();
      } else if (data.type == 'highlight' && data.tippyTplBarId == _this.tippyTplBarId) {
        _this.actionAddHighlight();
      }
      _this.$EventBus.$emit('selectionTextChange', {
        state: false,
        tippyTplBarId: _this.tippyTplBarId
      });
    });
    this.$once('hook:beforeDestroy', () => {
      _this.$EventBus.$off('clickToolbarTip');
    });
    this.$EventBus.$on('underlineSign', function (data) {
      // this.noteOperateMode = 'add'
      // let defaultUnderlineStyle = 'mk-underline__default'
      if (data.operationType == 'add' && _this.groupLocation == data.location) {
        _this.markInstance.underline(data.markEfiCode, 'mk-underline__default', e => {
        });
        _this.tempMarkEfiStr = '';
      } else if (data.operationType == 'remove' && _this.groupLocation == data.location) {
        _this.markInstance.remove(data.markEfiCode, data.signType);
      }
    });
    this.$once('hook:beforeDestroy', () => {
      _this.$EventBus.$off('underlineSign');
    });
  },
  beforeDestroy() {
    if (this.markInstance) {
      this.markInstance.destroy();
    }
    if (this.activeTippy && this.activeTippy[0]) {
      this.activeTippy[0].destroy();
    }
  },
  methods: {
    // // 添加教师资源
    // addTeacherResources() {
    //   let markId = `mark__${uuidv4()}`
    //   // let styleType = 'mk-addTeacherResources__default'
    //   let model = {
    //     selectionText: this.noteData.selectionText,
    //     markEfiCode: this.markEfiStr,
    //     type: `note__${this.userType}`,
    //     // styleType,
    //     blockIndex: this.ruleIndex,
    //     markId
    //   }
    //   this.emitRollbackHandler('addTeacherResources', model)
    //     .then((id) => {
    //       id === markId && _this.markInstance.remove(rollbackMark, 'addTeacherResources')
    //       console.log(222)
    //     })
    //     .catch((err) => {
    //       console.log(err)
    //     })
    // },
    // 打开添加教师资源弹窗
    addTeacherResources(e) {
      let markId = `mark__${v4()}`;
      // let styleType = 'mk-addTeacherResources__default'
      let model = {
        selectionText: this.noteData.selectionText,
        markEfiCode: this.markEfiStr,
        type: `note__${this.userType}`,
        // styleType,
        blockIndex: this.ruleIndex,
        markId
      };
      let _this = this;
      // this.noteOperateMode = 'add'
      // let defaultUnderlineStyle = 'mk-underline__default'
      _this.tempMarkEfiStr = _this.markEfiStr;
      _this.noteData.content = '';
      // _this.markInstance.underline(_this.markEfiStr, defaultUnderlineStyle, (e) => {
      //   try {
      //     // 下划线点击事件, 比如打开编辑框
      //     // let markEfiStr = e.target.getAttribute('data-id')
      //     // _this.noteClick(e, markEfiStr)
      //   } catch (error) {
      //     console.log('%c%s', 'font-size:2em;background: #DD5644;color: #FFF', 'underline error', error)
      //   }
      // })
      this.emitRollbackHandler('addTeacherResources', model).then(id => {
        id === markId && _this.markInstance.remove(rollbackMark, 'underline');
      }).catch(err => {
        console.log(err);
      });
      this.hideTippy();
    },
    // 添加数据
    addData(type, item) {
      this.data[type].list.push(item);
      let list = JSON.stringify(this.data);
      localStorage.setItem('simulated-data_' + this.textBookData.id, list);
      this.getData(type, item);
    },
    // 确认添加教师资源
    addResources(e) {
      this.$emit('addResources', e);
    },
    // 编辑教师资源
    editTeachingResource(e) {
      this.$refs.addTeacherResources.open({
        isEdit: true,
        ...e
      });
    },
    // 确认编辑教师资源
    editResources(e) {
      this.$emit('editResources', e);
    },
    updateMarkView() {
      // @pos 硬刷新Mark视图
      let _this = this;
      this.markInstance.clear();
      this.mergeMarkList.forEach(item => {
        if (item.type === 'note__teacher') {
          this.markInstance.underline(item.markEfiCode, item.styleType, e => {
            try {
              // 下划线点击事件, 比如打开编辑框
              let markEfiStr = e.target.getAttribute('data-id');
              console.log('%c%s', 'font-size:2em;background: #00965E;color: #FFF', 'Mark Click', e, markEfiStr);
              console.log('下划线点击事件, 比如打开编辑框', markEfiStr);
              this.emitRollbackHandler('openTeacherResources', {
                ...e,
                markEfiStr
              });
              // _this.noteClick(e, markEfiStr)
            } catch (error) {
              console.log('%c%s', 'font-size:2em;background: #DD5644;color: #FFF', 'MarkClick Error', error);
            }
          });
        }
        if (item.type === 'note__student') {
          this.markInstance.underline(item.markEfiCode, item.styleType, e => {
            try {
              // 下划线点击事件, 比如打开编辑框
              // if (!_this.markEfiStr) {
              let markEfiStr = e.target.getAttribute('data-id');
              _this.noteClick(e, markEfiStr);
              // }
            } catch (error) {
              console.log('%c%s', 'font-size:2em;background: #DD5644;color: #FFF', 'MarkClick Error', error);
            }
          });
        }
        if (item.type === 'highlight__student') {
          this.markInstance.highlight(item.markEfiCode, item.styleType, e => {
            try {
              // 下划线点击事件, 比如打开编辑框
              let markEfiStr = e.target.getAttribute('data-id');
              _this.highlightClick(e, markEfiStr);
            } catch (error) {
              console.log('%c%s', 'font-size:2em;background: #DD5644;color: #FFF', 'HighlightClick Error', error);
            }
          });
        }
      });
    },
    handleMouseUp() {
      // @pos MouseUp
      let _this = this;
      if (this.userType && this.insideIndex === this.ruleIndex) {
        setTimeout(() => {
          console.log('%c%s', 'font-size:2em;background: #00965E;color: #FFF', 'MouseUp', _this.markEfiStr);
          this.$EventBus.$emit('selectionTextChange', {
            state: false,
            tippyTplBarId: _this.tippyTplBarId
          });
          const text = window?.getSelection()?.toString() || '';
          if (text.length && text.length <= 200 && _this.markEfiStr) {
            let checkHasSaved = _this.mergeMarkList.find(item => item.markEfiCode === _this.markEfiStr);
            if (checkHasSaved) {
              let msg = '当前位置已存在标记',
                resourceType = checkHasSaved.resourcesType || checkHasSaved.type?.split('__')[0];
              if (checkHasSaved.resourcesName) {
                resourceType = 'resource';
              }
              switch (resourceType) {
                case 'notes':
                  msg = '当前位置已存在笔记';
                  break;
                case 'recorded':
                  msg = '当前位置已存在录音';
                  break;
                case 'underline':
                  msg = '当前位置已存在笔记';
                  break;
                case 'highlight':
                  msg = '当前位置已存在高亮';
                  break;
                case 'resource':
                  msg = '当前位置已存在资源';
                  break;
              }
              _this.activeTippy[0].setContent(msg);
              _this.activeTippy[0].show();
              _this.markEfiStr = '';
              setTimeout(handler => {
                _this.hideTippy();
              }, 1500);
              return;
            }
            _this.noteData.selectionText = text;
            const templateBar = document.getElementById(_this.tippyTplBarId);
            // let HTMLContentClone = $J(`#${_this.tippyTplBarId}`)?.clone(true,true)?.get(0)
            let content = templateBar?.innerHTML || '<span style="color:"#EE3751;"">选区解析错误</span>';
            let u = navigator.userAgent;
            if (_this.pageType == 'pc' || !u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
              _this.activeTippy[0].setProps({
                content,
                onShown: instance => {
                  // @pos 显示tippybar
                  let actCopy = instance.popper.children[0]?.querySelector(`#${_this.actionCopyId}`),
                    actNote = instance.popper.children[0]?.querySelector(`#${_this.actionNoteId}`),
                    actHighlight = instance.popper.children[0]?.querySelector(`#${_this.actionHighlightId}`),
                    addTeacherResources = instance.popper.children[0]?.querySelector(`#${_this.addTeacherResourcesId}`);
                  if (actCopy) {
                    actCopy.addEventListener('click', _this.actionCopy, {
                      once: true
                    });
                  }
                  if (actNote) {
                    actNote.addEventListener('click', _this.actionAddNote, {
                      once: true
                    });
                  }
                  if (actHighlight) {
                    actHighlight.addEventListener('click', _this.actionAddHighlight, {
                      once: true
                    });
                  }
                  if (addTeacherResources) {
                    addTeacherResources.addEventListener('click', _this.addTeacherResources, {
                      once: true
                    });
                  }
                }
              });
              // _this.activeTippy = tippy(e.target, {
              //   content: templateBar,
              //   placement: 'top',
              //   trigger: 'manual',
              //   theme: 'light',
              //   animation: 'shift-away',
              //   interactive: true,
              //   onClickOutside(instance, event) {
              //     instance.hide()
              //   },
              // })
              _this.activeTippy[0].show();
            } else {
              this.$EventBus.$emit('selectionTextChange', {
                state: true,
                tippyTplBarId: _this.tippyTplBarId
              });
            }
          } else if (text.length > 200) {
            _this.activeTippy[0].setContent(`<div style="color:#666;">可选文本最多为200字</div>`);
            _this.activeTippy[0].show();
            setTimeout(handler => {
              _this.activeTippy[0].hide();
            }, 2000);
          }
        }, 110);
      }
    },
    resetTempNote() {
      if (this.tempMarkEfiStr) {
        this.noteData.selectionText = '';
        this.markInstance.remove(this.tempMarkEfiStr, 'underline');
      }
    },
    actionCopy() {
      if (!this.noteData.selectionText) {
        this.$message.error('未选中任何内容');
        return;
      }
      document.execCommand('copy');
      this.$message.success('复制成功');
      this.hideTippy();
      this.markEfiStr = '';
      this.noteData = {
        selectionText: '',
        content: ''
      };
      window.getSelection()?.removeAllRanges();
    },
    cancelEditNote(instance) {
      this.noteEditData = {
        selectionText: '',
        content: ''
      };
      this.noteOperateMode = '';
      this.tempMarkModel = {};
      instance.hide();
      instance.destroy();
    },
    deleteNote(instance) {
      let _this = this;
      let noteModel = {
        ...this.tempMarkModel
      };
      let markId = noteModel.markId;
      if (this.userType && this.insideIndex === this.ruleIndex) {
        let rollbackMark = noteModel.markEfiCode;
        this.emitRollbackHandler('deleteNote', noteModel).then(id => {
          id === markId && _this.markInstance.remove(rollbackMark, 'underline');
        });
      }
      this.cancelEditNote(instance);
    },
    confirmEditNote(noteInput, instance) {
      let value = noteInput?.value || '';
      if (!value) {
        this.$message.error('笔记内容不能为空');
        return;
      }
      let noteModel = {
        ...this.tempMarkModel,
        noteContent: value
      };
      if (this.userType && this.insideIndex === this.ruleIndex) {
        this.$EventBus.$emit('editNote', noteModel);
      }
      this.cancelEditNote(instance);
    },
    showEditNoteTippy() {
      let _this = this;
      try {
        const templateNote = document.getElementById(_this.editNoteTplId);
        let content = templateNote?.innerHTML || '笔记面板加载错误';
        // @pos 解决tippy不弹出问题
        let newTippy = tippy(`#${_this.blockId}`, {
          content,
          placement: 'top',
          trigger: 'manual',
          theme: 'light',
          animation: 'shift-away',
          interactive: true,
          allowHTML: true,
          followCursor: 'initial',
          onShown: instance => {
            // @pos 弹出编辑笔记tippy
            let actNoteCancel = instance.popper.children[0]?.querySelector(`#${_this.actNoteCancelId}`),
              actNoteDelete = instance.popper.children[0]?.querySelector(`#${_this.actNoteDeleteId}`),
              actNoteEditSave = instance.popper.children[0]?.querySelector(`#${_this.actNoteEditId}`),
              noteInput = instance.popper.children[0]?.querySelector(`#${_this.noteInputId}`);
            console.log('%c%s', 'font-size:2em;background: #00965E;color: #FFF', '获取不到事件?', {
              actNoteCancel,
              actNoteDelete,
              actNoteEditSave,
              noteInput
            });
            if (noteInput) {
              noteInput.value = _this.noteEditData.content;
              noteInput.addEventListener('input', e => {
                let value = e.target.value;
                if (value === _this.noteEditData.content) {
                  actNoteEditSave && actNoteEditSave.parentElement.classList.add('disabled');
                } else {
                  actNoteEditSave && actNoteEditSave.parentElement.classList.remove('disabled');
                }
              });
            }
            if (actNoteCancel) {
              actNoteCancel.addEventListener('click', () => _this.cancelEditNote(instance), {
                once: true
              });
            }
            if (actNoteDelete) {
              actNoteDelete.addEventListener('click', () => _this.deleteNote(instance), {
                once: true
              });
            }
            if (actNoteEditSave && noteInput) {
              actNoteEditSave.addEventListener('click', () => _this.confirmEditNote(noteInput, instance), {
                once: true
              });
            }
          }
        });
        newTippy[0].show();
      } catch (error) {
        console.log('%c%s', 'font-size:2em;background: #DD5644;color: #FFF', 'error', error);
      }
    },
    // @pos 学生笔记编辑
    noteClick(e, markEfi) {
      let _this = this;
      let styleScheme = e.target.getAttribute('data-styleScheme');
      console.log('%c%s', 'font-size:2em;background: #DD5644;color: #FFF', '下划线样式', styleScheme);
      if (this.userType === 'student' && styleScheme === 'default' || this.userType === 'teacher' && styleScheme === 'dashed') {
        // 学生和教师分别仅可触发各自对应的笔记下划线点击事件
        return;
      }
      let model = this.mergeMarkList.find(item => item.markEfiCode === markEfi);
      if (!model) {
        _this.activeTippy[0].setContent('查找笔记出错');
        _this.activeTippy[0].show();
        setTimeout(handler => {
          _this.hideTippy();
        }, 1500);
        return;
      }
      this.noteOperateMode = 'edit';
      this.tempMarkModel = model;
      if (this.userType === 'student' && this.isMobile) {
        this.notePopupVisible = true;
        this.noteData = {
          selectionText: model.selectionText,
          content: model.noteContent
        };
      } else {
        this.noteEditData = {
          selectionText: model.selectionText,
          content: model.noteContent
        };
        this.$nextTick(() => {
          this.showEditNoteTippy(e);
        });
      }
    },
    actionAddNote(e) {
      // @pos 添加笔记
      // e?.stopPropagation && e.stopPropagation()
      let _this = this;
      this.noteOperateMode = 'add';
      let defaultUnderlineStyle = this.userType === 'teacher' ? 'mk-underline__default' : 'mk-underline__dashed';
      _this.markInstance.underline(_this.markEfiStr, defaultUnderlineStyle, e => {
        try {
          // 下划线点击事件, 比如打开编辑框
          let markEfiStr = e.target.getAttribute('data-id');
          console.log('%c%s', 'font-size:2em;background: #00965E;color: #FFF', 'UnderlineClick', e, markEfiStr);
          _this.noteClick(e, markEfiStr);
        } catch (error) {
          console.log('%c%s', 'font-size:2em;background: #DD5644;color: #FFF', 'underline error', error);
        }
      });
      _this.tempMarkEfiStr = _this.markEfiStr;
      _this.noteData.content = '';
      console.log('this.isMobile', this.isMobile);
      if (!this.isMobile) {
        const templateNote = document.getElementById(_this.tippyTplNoteId);
        let content = templateNote?.innerHTML || '笔记面板加载错误';
        _this.activeTippy[0].setProps({
          content,
          onAfterUpdate: instance => {
            // @pos 更新tippy
            _this.noteEventController = new AbortController();
            let actNoteCancel = instance.popper.children[0]?.querySelector(`#${_this.actNoteCancelId}`),
              actNoteConfirm = instance.popper.children[0]?.querySelector(`#${_this.actNoteConfirmId}`),
              noteInput = instance.popper.children[0]?.querySelector(`#${_this.noteInputId}`);
            if (actNoteCancel && noteInput) {
              actNoteCancel.addEventListener('click', _this.cancelAddNote, {
                once: true
              });
            }
            if (actNoteConfirm) {
              actNoteConfirm.addEventListener('click', () => _this.confirmAddNote(noteInput), {
                signal: _this.noteEventController.signal
              });
            }
          },
          onUntrigger: instance => {
            console.log('%c%s', 'font-size:2em;background: #DD5644;color: #FFF', 'Untrigger');
          }
        });
      } else {
        this.hideTippy();
        this.notePopupVisible = true;
      }
      window.getSelection()?.removeAllRanges();
    },
    confirmAddStudentNote() {
      let noteContent = this.noteData.content;
      console.log('%c%s', 'font-size:2em;background: #DD5644;color: #FFF', '内容', noteContent);
      if (!noteContent) {
        this.$message.error('请输入笔记内容');
        return;
      }
      if (this.noteOperateMode === 'edit') {
        this.confirmEditStudentNote(noteContent);
        return;
      }
      let markId = `mark__${v4()}`;
      let noteModel = {
        selectionText: this.noteData.selectionText,
        noteContent,
        markEfiCode: this.markEfiStr,
        type: `note__${this.userType}`,
        styleType: 'mk-underline__dashed',
        blockIndex: this.ruleIndex,
        markId
      };
      this.tempMarkEfiStr = '';
      this.noteData = {
        selectionText: '',
        content: ''
      };
      if (this.userType && this.insideIndex === this.ruleIndex) {
        let rollbackMark = this.markEfiStr;
        this.emitRollbackHandler('createNote', noteModel).then(id => {
          id === markId && _this.markInstance.remove(rollbackMark, 'underline');
        });
      }
      this.notePopupVisible = false;
    },
    confirmEditStudentNote(noteContent) {
      let noteModel = {
        ...this.tempMarkModel,
        noteContent
      };
      this.tempMarkEfiStr = '';
      this.noteData = {
        selectionText: '',
        content: ''
      };
      if (this.userType && this.insideIndex === this.ruleIndex) {
        this.$EventBus.$emit('editNote', noteModel);
      }
      this.notePopupVisible = false;
      this.noteOperateMode = '';
      this.tempMarkModel = {};
    },
    deleteStudentNote() {
      let _this = this;
      let noteModel = {
        ...this.tempMarkModel
      };
      let markId = noteModel.markId;
      if (this.userType && this.insideIndex === this.ruleIndex) {
        let rollbackMark = noteModel.markEfiCode;
        this.emitRollbackHandler('deleteNote', noteModel).then(id => {
          id === markId && _this.markInstance.remove(rollbackMark, 'underline');
        });
      }
      this.notePopupVisible = false;
      this.noteOperateMode = '';
      this.tempMarkModel = {};
    },
    actionAddHighlight() {
      let _this = this;
      let styleType = 'mk-hightlight__default';
      _this.markInstance.highlight(_this.markEfiStr, styleType, e => {
        try {
          let markEfiStr = e.target.getAttribute('data-id');
          _this.highlightClick(e, markEfiStr);
        } catch (error) {
          console.log('%c%s', 'font-size:2em;background: #DD5644;color: #FFF', 'underline error', error);
        }
      });
      this.hideTippy();
      let markId = `mark__${v4()}`;
      let model = {
        selectionText: this.noteData.selectionText,
        markEfiCode: this.markEfiStr,
        type: `highlight__${this.userType}`,
        styleType,
        blockIndex: this.ruleIndex,
        markId
      };
      this.noteData.selectionText = '';
      if (this.userType && this.insideIndex === this.ruleIndex) {
        // this.$EventBus.$emit('createHighlight', model)
        let rollbackMark = this.markEfiStr;
        this.emitRollbackHandler('createHighlight', model).then(id => {
          id === markId && _this.markInstance.remove(rollbackMark, 'highlight');
        });
      }
      window.getSelection()?.removeAllRanges();
    },
    highlightClick(e, efi) {
      console.log('%c%s', 'font-size:2em;background: #00965E;color: #FFF', 'HighLight Click', e, _this.markEfiStr);
    },
    emitRollbackHandler(eventName, eventData) {
      console.log('emitRollbackHandler', eventName, eventData);
      return new Promise((resolve, reject) => {
        this.$EventBus.$emit(eventName, eventData, resolve);
      });
    },
    confirmAddNote(noteInput) {
      let value = noteInput?.value || '';
      if (!value) {
        this.$message.error('请输入笔记内容');
        return;
      }
      if (!value.trim()) {
        this.$message.error('笔记内容不能为空！');
        return;
      }
      this.hideTippy();
      let markId = `mark__${v4()}`;
      let noteModel = {
        selectionText: this.noteData.selectionText,
        noteContent: value,
        markEfiCode: this.markEfiStr,
        type: `note__${this.userType}`,
        styleType: 'mk-underline__dashed',
        blockIndex: this.ruleIndex,
        markId
      };
      this.tempMarkEfiStr = '';
      this.noteData = {
        selectionText: '',
        content: ''
      };
      if (this.userType && this.insideIndex === this.ruleIndex) {
        let rollbackMark = this.markEfiStr;
        this.emitRollbackHandler('createNote', noteModel).then(id => {
          id === markId && _this.markInstance.remove(rollbackMark, 'underline');
        });
      }
      this.noteEventController.abort();
    },
    cancelAddNote() {
      this.hideTippy();
      this.markEfiStr && this.markInstance.remove(this.markEfiStr, 'underline');
      this.markEfiStr = '';
      this.noteData = {
        selectionText: '',
        content: ''
      };
    },
    hideTippy() {
      this.activeTippy[0].hide();
      this.activeTippy[0].setContent('');
    },
    closeViewer() {
      document.body.style.overflow = prevOverflow$1;
      this.showViewer = false;
      this.imageViewTitles = [];
      this.imageViewSrcs = [];
    },
    formatImg(str) {
      if (str) {
        let data = str.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, (match, p1) => {
          if (match.indexOf('style') !== -1) {
            // if (match.indexOf('http') !== -1) {
            //   return match
            // } else {
            //   let src = this.resourceBasisPath + p1.split('./')[1]
            //   let image = match.replace(p1, src)
            //   return image.split('style="')[0] + 'style="max-width:100% !important;' + image.split('style="')[1]
            // }
            let src = this.resourceBasisPath + p1.split('./')[1];
            let image = match.indexOf('http') !== -1 ? match : match.replace(p1, src);
            return image.split('style="')[0] + 'style="max-width:100% !important;' + image.split('style="')[1];
          } else {
            return `<img src='${p1.indexOf('http') > -1 ? p1 : this.resourceBasisPath + p1.split('./')[1]}' style="max-width:100%;" />`;
          }
        });
        return data;
      }
    },
    updateCodeBlock() {
      jquery(`#${this.blockId} .richtext-reset-wrapper--view pre`).each(function (i) {
        let classStrs = jquery(this).attr('class');
        let classArr = classStrs.split(';');
        classArr = classArr[0].split(':');
        let lang = 'language-' + classArr[1];
        let codeElemStr = '<code class="line-numbers ' + lang + '" data-prismjs-copy="复制代码" data-prismjs-copy-success="复制完成">' + jquery(this).html() + '</code>';
        jquery(this).html(codeElemStr);
        jquery(this).attr('class', 'line-numbers');
        let codeElem = jquery(this).children('code').get(0);
        // Prism.highlightAll();
        prism.highlightElement(codeElem);
      });
    },
    groupDataChange() {
      this.$emit('groupDataChange', {
        ruleIndex: this.ruleIndex,
        dataName: this.blockDataName,
        data: this.blockData,
        dataIndex: this.dataIndex
      });
    },
    //编辑器是否存在
    getIsEditorContainerExist() {
      const container = document.getElementById(this.editorId);
      if (!container) return false;
      const isWeExist = container.getAttribute('data-w-e-textarea');
      return isWeExist;
    },
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      // this.markEfiStr = ''
      this.hideTippy();
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex,
        dataIndex: this.dataIndex
      });
    }
  }
};

/* script */
const __vue_script__$4M = script$4M;
/* template */
var __vue_render__$4M = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      class: [
        "xml-text-" + _vm.pageType,
        "" + _vm.containerClass,
        "richtext-reset-container",
      ],
      attrs: { id: _vm.blockId },
      on: { mousedown: _vm.blockClick, mouseup: _vm.handleMouseUp },
    },
    [
      _vm.mode === "editor"
        ? _vm._t("editor", null, { feedback: _vm.feedback })
        : _c("div", {
            staticClass: "richtext-reset-wrapper--view",
            attrs: { id: _vm.markRootId },
            domProps: { innerHTML: _vm._s(_vm.formatImg(_vm.pBlockData.html)) },
          }),
      _vm._v(" "),
      _vm._t("mater-lib-dialog"),
      _vm._v(" "),
      _vm._t("mater-lib-dialog2"),
      _vm._v(" "),
      _c(
        "el-dialog",
        {
          staticClass: "xml-text-preview-box-dialog",
          attrs: {
            visible: _vm.inlineWordsModal.visible,
            "append-to-body": true,
            width: _vm.pageType == "pc" ? "40%" : "80%",
            center: "",
            "show-close": false,
          },
          on: {
            "update:visible": function ($event) {
              return _vm.$set(_vm.inlineWordsModal, "visible", $event)
            },
          },
        },
        [
          _c("xml-text-dialog-render", {
            attrs: {
              content: _vm.inlineWordsModal.content,
              textstyle: _vm.inlineWordsModal.stylemode
                ? _vm.inlineWordsModal.stylemode
                : "D",
              "page-type": _vm.pageType,
              resourceBasisPath: _vm.resourceBasisPath,
            },
          }),
        ],
        1
      ),
      _vm._v(" "),
      _vm.showViewer
        ? _c("xml-image-viewer", {
            attrs: {
              title: _vm.imageViewerTitles,
              "z-index": 2000,
              "on-close": _vm.closeViewer,
              "url-list": _vm.imageViewerSrcs,
            },
          })
        : _vm._e(),
      _vm._v(" "),
      _c(
        "div",
        { staticStyle: { display: "none" }, attrs: { id: _vm.tippyTplBarId } },
        [
          _c(
            "div",
            {
              staticClass: "tipbar tipbar-tpl",
              on: {
                click: function ($event) {
                  $event.stopPropagation();
                },
              },
            },
            [
              _c(
                "div",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: _vm.isMobile,
                      expression: "isMobile",
                    },
                  ],
                  staticClass: "tipbar-remark--mobile",
                },
                [
                  _c("span", { staticClass: "tipbar-remark" }, [
                    _vm._v("均<=200字"),
                  ]),
                ]
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  staticClass: "tipbar-action",
                  attrs: { id: _vm.actionCopyId },
                  on: {
                    click: function ($event) {
                      $event.stopPropagation();
                      return _vm.actionCopy.apply(null, arguments)
                    },
                  },
                },
                [
                  _c("i", { staticClass: "tipbar-icon copy" }),
                  _vm._v(" "),
                  _c("span", [_vm._v("复制")]),
                ]
              ),
              _vm._v(" "),
              _c(
                "span",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: !_vm.isMobile,
                      expression: "!isMobile",
                    },
                  ],
                  staticClass: "tipbar-separator",
                },
                [_vm._v("|")]
              ),
              _vm._v(" "),
              _c("span", {
                directives: [
                  {
                    name: "show",
                    rawName: "v-show",
                    value: _vm.isMobile,
                    expression: "isMobile",
                  },
                ],
                staticClass: "tipbar-separator--mobile",
              }),
              _vm._v(" "),
              _vm.userType !== "teacher"
                ? [
                    _c(
                      "div",
                      {
                        staticClass: "tipbar-action",
                        attrs: { id: _vm.actionNoteId },
                        on: {
                          click: function ($event) {
                            $event.stopPropagation();
                            return _vm.actionAddNote.apply(null, arguments)
                          },
                        },
                      },
                      [
                        _c("i", { staticClass: "tipbar-icon note" }),
                        _vm._v(" "),
                        _c("span", [_vm._v("笔记")]),
                      ]
                    ),
                    _vm._v(" "),
                    _c(
                      "span",
                      {
                        directives: [
                          {
                            name: "show",
                            rawName: "v-show",
                            value: !_vm.isMobile,
                            expression: "!isMobile",
                          },
                        ],
                        staticClass: "tipbar-separator",
                      },
                      [_vm._v("|")]
                    ),
                  ]
                : _vm._e(),
              _vm._v(" "),
              _c("span", {
                directives: [
                  {
                    name: "show",
                    rawName: "v-show",
                    value: _vm.isMobile,
                    expression: "isMobile",
                  },
                ],
                staticClass: "tipbar-separator--mobile",
              }),
              _vm._v(" "),
              _vm.userType == "teacher"
                ? _c(
                    "div",
                    {
                      staticClass: "tipbar-action",
                      attrs: { id: _vm.addTeacherResourcesId },
                      on: {
                        click: function ($event) {
                          return _vm.addTeacherResources()
                        },
                      },
                    },
                    [
                      _c("i", {
                        staticClass: "tipbar-icon addTeacherResources",
                      }),
                      _vm._v(" "),
                      _c("span", [_vm._v("资源")]),
                    ]
                  )
                : _vm._e(),
              _vm._v(" "),
              _vm.userType === "student"
                ? _c(
                    "div",
                    {
                      staticClass: "tipbar-action",
                      attrs: { id: _vm.actionHighlightId },
                    },
                    [
                      _c("i", { staticClass: "tipbar-icon highlight" }),
                      _vm._v(" "),
                      _c("span", [_vm._v("高亮")]),
                    ]
                  )
                : _vm._e(),
              _vm._v(" "),
              _c(
                "span",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: !_vm.isMobile,
                      expression: "!isMobile",
                    },
                  ],
                  staticClass: "tipbar-remark",
                },
                [_vm._v("均<=200字")]
              ),
            ],
            2
          ),
        ]
      ),
      _vm._v(" "),
      _c(
        "div",
        { staticStyle: { display: "none" }, attrs: { id: _vm.tippyTplNoteId } },
        [
          _c("div", { staticClass: "tipnote tipnote-tpl" }, [
            _c("div", { staticClass: "tipnote-title" }, [
              _vm._v(_vm._s(_vm.noteData.selectionText)),
            ]),
            _vm._v(" "),
            _c("textarea", {
              directives: [
                {
                  name: "model",
                  rawName: "v-model.trim",
                  value: _vm.noteData.content,
                  expression: "noteData.content",
                  modifiers: { trim: true },
                },
              ],
              ref: "tippyTextarea",
              staticClass: "tipnote-textarea",
              attrs: {
                id: _vm.noteInputId,
                placeholder: "请输入笔记内容",
                maxlength: "200",
                rows: "5",
              },
              domProps: { value: _vm.noteData.content },
              on: {
                input: function ($event) {
                  if ($event.target.composing) {
                    return
                  }
                  _vm.$set(_vm.noteData, "content", $event.target.value.trim());
                },
                blur: function ($event) {
                  return _vm.$forceUpdate()
                },
              },
            }),
            _vm._v(" "),
            _c("div", { staticClass: "tipnote-footer" }, [
              _c(
                "div",
                {
                  staticClass: "tipnote-btn cancel",
                  attrs: { id: _vm.actNoteCancelId },
                  on: { click: _vm.cancelAddNote },
                },
                [_c("span", [_vm._v("取消")])]
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  staticClass: "tipnote-btn confirm",
                  attrs: { id: _vm.actNoteConfirmId },
                  on: { click: _vm.confirmAddNote },
                },
                [_c("span", [_vm._v("确认")])]
              ),
            ]),
          ]),
        ]
      ),
      _vm._v(" "),
      _c(
        "div",
        { staticStyle: { display: "none" }, attrs: { id: _vm.editNoteTplId } },
        [
          _c("div", { staticClass: "tipnote tipnote-tpl" }, [
            _c("div", { staticClass: "tipnote-title" }, [
              _vm._v(_vm._s(_vm.noteEditData.selectionText)),
            ]),
            _vm._v(" "),
            _c("textarea", {
              ref: "tippyTextarea",
              staticClass: "tipnote-textarea",
              attrs: {
                id: _vm.noteInputId,
                placeholder: "请输入笔记内容",
                maxlength: "200",
                rows: "5",
              },
              domProps: { value: _vm.noteEditData.content },
            }),
            _vm._v(" "),
            _c("div", { staticClass: "tipnote-footer" }, [
              _c(
                "div",
                {
                  staticClass: "tipnote-btn cancel",
                  attrs: { id: _vm.actNoteCancelId },
                },
                [_c("span", [_vm._v("取消")])]
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  staticClass: "tipnote-btn delete",
                  attrs: { id: _vm.actNoteDeleteId },
                },
                [_c("span", [_vm._v("删除")])]
              ),
              _vm._v(" "),
              _c("div", { staticClass: "tipnote-btn btn-wrap disabled" }, [
                _c(
                  "div",
                  { staticClass: "btn-edit", attrs: { id: _vm.actNoteEditId } },
                  [_c("span", [_vm._v("保存修改")])]
                ),
              ]),
            ]),
          ]),
        ]
      ),
      _vm._v(" "),
      _vm.isMobile
        ? _c(
            "van-popup",
            {
              style: { backgroundColor: "transparent" },
              attrs: { "get-container": "body", position: "bottom" },
              on: { "click-overlay": _vm.resetTempNote },
              model: {
                value: _vm.notePopupVisible,
                callback: function ($$v) {
                  _vm.notePopupVisible = $$v;
                },
                expression: "notePopupVisible",
              },
            },
            [
              _c(
                "div",
                {
                  staticClass: "xml-reader-phone-mark-note-popup",
                  class: [
                    _vm.toolbarVisible &&
                      !_vm.keyboardShow &&
                      "is-toolbar-shown",
                    _vm.keyboardShow && "keyboard-show",
                    _vm.toolbarVisible && "toolbar-show",
                  ],
                  on: {
                    click: function ($event) {
                      $event.stopPropagation();
                    },
                  },
                },
                [
                  _c("div", { staticClass: "mark-note__selection" }, [
                    _c("div", [_vm._v(_vm._s(_vm.noteData.selectionText))]),
                  ]),
                  _vm._v(" "),
                  _c("section", { staticClass: "mark-note__wrap" }, [
                    _c("textarea", {
                      directives: [
                        {
                          name: "model",
                          rawName: "v-model.trim",
                          value: _vm.noteData.content,
                          expression: "noteData.content",
                          modifiers: { trim: true },
                        },
                      ],
                      ref: "popupTextarea",
                      staticClass: "mark-note__textarea",
                      attrs: {
                        placeholder: "添加笔记...",
                        maxlength: "200",
                        rows: "5",
                      },
                      domProps: { value: _vm.noteData.content },
                      on: {
                        input: function ($event) {
                          if ($event.target.composing) {
                            return
                          }
                          _vm.$set(
                            _vm.noteData,
                            "content",
                            $event.target.value.trim()
                          );
                        },
                        blur: function ($event) {
                          return _vm.$forceUpdate()
                        },
                      },
                    }),
                    _vm._v(" "),
                    _c("div", { staticClass: "mark-note__footer" }, [
                      _c("div", { staticClass: "mark-note__count" }, [
                        _vm._v(_vm._s(_vm.noteData.content.length) + "/200"),
                      ]),
                      _vm._v(" "),
                      _vm.noteOperateMode === "edit"
                        ? _c(
                            "div",
                            {
                              staticClass: "mark-note__delete",
                              on: {
                                click: function ($event) {
                                  if ($event.target !== $event.currentTarget) {
                                    return null
                                  }
                                  return _vm.deleteStudentNote.apply(
                                    null,
                                    arguments
                                  )
                                },
                              },
                            },
                            [_vm._v("删除")]
                          )
                        : _vm._e(),
                      _vm._v(" "),
                      _c(
                        "div",
                        {
                          staticClass: "mark-note__confirm",
                          class: _vm.noteData.content.length && "enable",
                          on: {
                            click: function ($event) {
                              if ($event.target !== $event.currentTarget) {
                                return null
                              }
                              return _vm.confirmAddStudentNote.apply(
                                null,
                                arguments
                              )
                            },
                          },
                        },
                        [_vm._v("\n            保存\n          ")]
                      ),
                    ]),
                  ]),
                ]
              ),
            ]
          )
        : _vm._e(),
    ],
    2
  )
};
var __vue_staticRenderFns__$4M = [];
__vue_render__$4M._withStripped = true;

  /* style */
  const __vue_inject_styles__$4M = undefined;
  /* scoped */
  const __vue_scope_id__$4M = "data-v-640283d5";
  /* module identifier */
  const __vue_module_identifier__$4M = undefined;
  /* functional template */
  const __vue_is_functional_template__$4M = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4M = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4M, staticRenderFns: __vue_staticRenderFns__$4M },
    __vue_inject_styles__$4M,
    __vue_script__$4M,
    __vue_scope_id__$4M,
    __vue_is_functional_template__$4M,
    __vue_module_identifier__$4M,
    false,
    undefined,
    undefined,
    undefined
  );

const TextComponents = [__vue_component__$4M, __vue_component__$4P];
var XmlText = {
  ...TextComponents
};

//
//
//
//
//
//
//
//
//
//
//

var script$4L = {
  name: 'XmlGroupRender',
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    ruleIndex: Number,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    field: String,
    typeText: {
      type: String,
      default: ''
    },
    showLine: {
      type: Boolean,
      default: true
    },
    pBlockData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    BookName: {
      type: String,
      default: ''
    },
    //块儿数据名
    blockDataName: String
  },
  data() {
    return {
      isShowUp: false,
      isShowDown: false,
      //当前所处组的规则
      currentRule: {},
      mouseHover: false,
      showBtn: false
    };
  },
  created() {
    const _this = this;
    this.$EventBus.$on('blockClick', function ({
      blockId,
      ruleIndex
    }) {
      if (_this.ruleIndex === ruleIndex) {
        _this.showBtn = true;
      } else {
        _this.showBtn = false;
      }
    });
  },
  mounted() {
    this.blockData = this.pBlockData;
  },
  methods: {
    hover() {
      this.mouseHover = true;
    },
    leave() {
      this.mouseHover = false;
    }
  }
};

/* script */
const __vue_script__$4L = script$4L;
/* template */
var __vue_render__$4L = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      class: _vm.showLine ? "xml-group-box" : "",
      on: { mousemove: _vm.hover, mouseleave: _vm.leave },
    },
    [
      _vm.mode === "editor"
        ? _c("span", { staticClass: "xml-group-type-text" }, [
            _vm._v(_vm._s(_vm.typeText)),
          ])
        : _vm._e(),
      _vm._v(" "),
      _vm.showBtn && _vm.mode === "editor"
        ? _vm._t("action-buttons")
        : _vm._e(),
      _vm._v(" "),
      _c(
        "div",
        {
          class: [
            "xml-group-" + _vm.pageType,
            _vm.mode === "editor" ? "xml-group--editor" : "",
            _vm.mouseHover && _vm.mode === "editor" ? "hovered" : "",
          ],
        },
        [_vm._t("default")],
        2
      ),
    ],
    2
  )
};
var __vue_staticRenderFns__$4L = [];
__vue_render__$4L._withStripped = true;

  /* style */
  const __vue_inject_styles__$4L = undefined;
  /* scoped */
  const __vue_scope_id__$4L = "data-v-35e9204b";
  /* module identifier */
  const __vue_module_identifier__$4L = undefined;
  /* functional template */
  const __vue_is_functional_template__$4L = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4L = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4L, staticRenderFns: __vue_staticRenderFns__$4L },
    __vue_inject_styles__$4L,
    __vue_script__$4L,
    __vue_scope_id__$4L,
    __vue_is_functional_template__$4L,
    __vue_module_identifier__$4L,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$4L.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('group-render', {
    prefix: options.prefix
  }), __vue_component__$4L);
};

function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}var urlToolkit={exports:{}};(function(module,exports){// see https://tools.ietf.org/html/rfc1808
(function(root){var URL_REGEX=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/;var FIRST_SEGMENT_REGEX=/^(?=([^\/?#]*))\1([^]*)$/;var SLASH_DOT_REGEX=/(?:\/|^)\.(?=\/)/g;var SLASH_DOT_DOT_REGEX=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g;var URLToolkit={// If opts.alwaysNormalize is true then the path will always be normalized even when it starts with / or //
// E.g
// With opts.alwaysNormalize = false (default, spec compliant)
// http://a.com/b/cd + /e/f/../g => http://a.com/e/f/../g
// With opts.alwaysNormalize = true (not spec compliant)
// http://a.com/b/cd + /e/f/../g => http://a.com/e/g
buildAbsoluteURL:function(baseURL,relativeURL,opts){opts=opts||{};// remove any remaining space and CRLF
baseURL=baseURL.trim();relativeURL=relativeURL.trim();if(!relativeURL){// 2a) If the embedded URL is entirely empty, it inherits the
// entire base URL (i.e., is set equal to the base URL)
// and we are done.
if(!opts.alwaysNormalize){return baseURL;}var basePartsForNormalise=URLToolkit.parseURL(baseURL);if(!basePartsForNormalise){throw new Error('Error trying to parse base URL.');}basePartsForNormalise.path=URLToolkit.normalizePath(basePartsForNormalise.path);return URLToolkit.buildURLFromParts(basePartsForNormalise);}var relativeParts=URLToolkit.parseURL(relativeURL);if(!relativeParts){throw new Error('Error trying to parse relative URL.');}if(relativeParts.scheme){// 2b) If the embedded URL starts with a scheme name, it is
// interpreted as an absolute URL and we are done.
if(!opts.alwaysNormalize){return relativeURL;}relativeParts.path=URLToolkit.normalizePath(relativeParts.path);return URLToolkit.buildURLFromParts(relativeParts);}var baseParts=URLToolkit.parseURL(baseURL);if(!baseParts){throw new Error('Error trying to parse base URL.');}if(!baseParts.netLoc&&baseParts.path&&baseParts.path[0]!=='/'){// If netLoc missing and path doesn't start with '/', assume everthing before the first '/' is the netLoc
// This causes 'example.com/a' to be handled as '//example.com/a' instead of '/example.com/a'
var pathParts=FIRST_SEGMENT_REGEX.exec(baseParts.path);baseParts.netLoc=pathParts[1];baseParts.path=pathParts[2];}if(baseParts.netLoc&&!baseParts.path){baseParts.path='/';}var builtParts={// 2c) Otherwise, the embedded URL inherits the scheme of
// the base URL.
scheme:baseParts.scheme,netLoc:relativeParts.netLoc,path:null,params:relativeParts.params,query:relativeParts.query,fragment:relativeParts.fragment};if(!relativeParts.netLoc){// 3) If the embedded URL's <net_loc> is non-empty, we skip to
// Step 7.  Otherwise, the embedded URL inherits the <net_loc>
// (if any) of the base URL.
builtParts.netLoc=baseParts.netLoc;// 4) If the embedded URL path is preceded by a slash "/", the
// path is not relative and we skip to Step 7.
if(relativeParts.path[0]!=='/'){if(!relativeParts.path){// 5) If the embedded URL path is empty (and not preceded by a
// slash), then the embedded URL inherits the base URL path
builtParts.path=baseParts.path;// 5a) if the embedded URL's <params> is non-empty, we skip to
// step 7; otherwise, it inherits the <params> of the base
// URL (if any) and
if(!relativeParts.params){builtParts.params=baseParts.params;// 5b) if the embedded URL's <query> is non-empty, we skip to
// step 7; otherwise, it inherits the <query> of the base
// URL (if any) and we skip to step 7.
if(!relativeParts.query){builtParts.query=baseParts.query;}}}else {// 6) The last segment of the base URL's path (anything
// following the rightmost slash "/", or the entire path if no
// slash is present) is removed and the embedded URL's path is
// appended in its place.
var baseURLPath=baseParts.path;var newPath=baseURLPath.substring(0,baseURLPath.lastIndexOf('/')+1)+relativeParts.path;builtParts.path=URLToolkit.normalizePath(newPath);}}}if(builtParts.path===null){builtParts.path=opts.alwaysNormalize?URLToolkit.normalizePath(relativeParts.path):relativeParts.path;}return URLToolkit.buildURLFromParts(builtParts);},parseURL:function(url){var parts=URL_REGEX.exec(url);if(!parts){return null;}return {scheme:parts[1]||'',netLoc:parts[2]||'',path:parts[3]||'',params:parts[4]||'',query:parts[5]||'',fragment:parts[6]||''};},normalizePath:function(path){// The following operations are
// then applied, in order, to the new path:
// 6a) All occurrences of "./", where "." is a complete path
// segment, are removed.
// 6b) If the path ends with "." as a complete path segment,
// that "." is removed.
path=path.split('').reverse().join('').replace(SLASH_DOT_REGEX,'');// 6c) All occurrences of "<segment>/../", where <segment> is a
// complete path segment not equal to "..", are removed.
// Removal of these path segments is performed iteratively,
// removing the leftmost matching pattern on each iteration,
// until no matching pattern remains.
// 6d) If the path ends with "<segment>/..", where <segment> is a
// complete path segment not equal to "..", that
// "<segment>/.." is removed.
while(path.length!==(path=path.replace(SLASH_DOT_DOT_REGEX,'')).length){}return path.split('').reverse().join('');},buildURLFromParts:function(parts){return parts.scheme+parts.netLoc+parts.path+parts.params+parts.query+parts.fragment;}};module.exports=URLToolkit;})();})(urlToolkit);var urlToolkitExports=urlToolkit.exports;function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread2(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string"===r?String:Number)(t);}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return "symbol"==typeof i?i:String(i);}function _defineProperty(obj,key,value){key=_toPropertyKey(key);if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else {obj[key]=value;}return obj;}function _extends(){_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}// https://caniuse.com/mdn-javascript_builtins_number_isfinite
const isFiniteNumber=Number.isFinite||function(value){return typeof value==='number'&&isFinite(value);};// https://caniuse.com/mdn-javascript_builtins_number_issafeinteger
const isSafeInteger=Number.isSafeInteger||function(value){return typeof value==='number'&&Math.abs(value)<=MAX_SAFE_INTEGER;};const MAX_SAFE_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991;let Events$1=/*#__PURE__*/function(Events){Events["MEDIA_ATTACHING"]="hlsMediaAttaching";Events["MEDIA_ATTACHED"]="hlsMediaAttached";Events["MEDIA_DETACHING"]="hlsMediaDetaching";Events["MEDIA_DETACHED"]="hlsMediaDetached";Events["BUFFER_RESET"]="hlsBufferReset";Events["BUFFER_CODECS"]="hlsBufferCodecs";Events["BUFFER_CREATED"]="hlsBufferCreated";Events["BUFFER_APPENDING"]="hlsBufferAppending";Events["BUFFER_APPENDED"]="hlsBufferAppended";Events["BUFFER_EOS"]="hlsBufferEos";Events["BUFFER_FLUSHING"]="hlsBufferFlushing";Events["BUFFER_FLUSHED"]="hlsBufferFlushed";Events["MANIFEST_LOADING"]="hlsManifestLoading";Events["MANIFEST_LOADED"]="hlsManifestLoaded";Events["MANIFEST_PARSED"]="hlsManifestParsed";Events["LEVEL_SWITCHING"]="hlsLevelSwitching";Events["LEVEL_SWITCHED"]="hlsLevelSwitched";Events["LEVEL_LOADING"]="hlsLevelLoading";Events["LEVEL_LOADED"]="hlsLevelLoaded";Events["LEVEL_UPDATED"]="hlsLevelUpdated";Events["LEVEL_PTS_UPDATED"]="hlsLevelPtsUpdated";Events["LEVELS_UPDATED"]="hlsLevelsUpdated";Events["AUDIO_TRACKS_UPDATED"]="hlsAudioTracksUpdated";Events["AUDIO_TRACK_SWITCHING"]="hlsAudioTrackSwitching";Events["AUDIO_TRACK_SWITCHED"]="hlsAudioTrackSwitched";Events["AUDIO_TRACK_LOADING"]="hlsAudioTrackLoading";Events["AUDIO_TRACK_LOADED"]="hlsAudioTrackLoaded";Events["SUBTITLE_TRACKS_UPDATED"]="hlsSubtitleTracksUpdated";Events["SUBTITLE_TRACKS_CLEARED"]="hlsSubtitleTracksCleared";Events["SUBTITLE_TRACK_SWITCH"]="hlsSubtitleTrackSwitch";Events["SUBTITLE_TRACK_LOADING"]="hlsSubtitleTrackLoading";Events["SUBTITLE_TRACK_LOADED"]="hlsSubtitleTrackLoaded";Events["SUBTITLE_FRAG_PROCESSED"]="hlsSubtitleFragProcessed";Events["CUES_PARSED"]="hlsCuesParsed";Events["NON_NATIVE_TEXT_TRACKS_FOUND"]="hlsNonNativeTextTracksFound";Events["INIT_PTS_FOUND"]="hlsInitPtsFound";Events["FRAG_LOADING"]="hlsFragLoading";Events["FRAG_LOAD_EMERGENCY_ABORTED"]="hlsFragLoadEmergencyAborted";Events["FRAG_LOADED"]="hlsFragLoaded";Events["FRAG_DECRYPTED"]="hlsFragDecrypted";Events["FRAG_PARSING_INIT_SEGMENT"]="hlsFragParsingInitSegment";Events["FRAG_PARSING_USERDATA"]="hlsFragParsingUserdata";Events["FRAG_PARSING_METADATA"]="hlsFragParsingMetadata";Events["FRAG_PARSED"]="hlsFragParsed";Events["FRAG_BUFFERED"]="hlsFragBuffered";Events["FRAG_CHANGED"]="hlsFragChanged";Events["FPS_DROP"]="hlsFpsDrop";Events["FPS_DROP_LEVEL_CAPPING"]="hlsFpsDropLevelCapping";Events["MAX_AUTO_LEVEL_UPDATED"]="hlsMaxAutoLevelUpdated";Events["ERROR"]="hlsError";Events["DESTROYING"]="hlsDestroying";Events["KEY_LOADING"]="hlsKeyLoading";Events["KEY_LOADED"]="hlsKeyLoaded";Events["LIVE_BACK_BUFFER_REACHED"]="hlsLiveBackBufferReached";Events["BACK_BUFFER_REACHED"]="hlsBackBufferReached";Events["STEERING_MANIFEST_LOADED"]="hlsSteeringManifestLoaded";return Events;}({});/**
 * Defines each Event type and payload by Event name. Used in {@link hls.js#HlsEventEmitter} to strongly type the event listener API.
 */let ErrorTypes=/*#__PURE__*/function(ErrorTypes){ErrorTypes["NETWORK_ERROR"]="networkError";ErrorTypes["MEDIA_ERROR"]="mediaError";ErrorTypes["KEY_SYSTEM_ERROR"]="keySystemError";ErrorTypes["MUX_ERROR"]="muxError";ErrorTypes["OTHER_ERROR"]="otherError";return ErrorTypes;}({});let ErrorDetails=/*#__PURE__*/function(ErrorDetails){ErrorDetails["KEY_SYSTEM_NO_KEYS"]="keySystemNoKeys";ErrorDetails["KEY_SYSTEM_NO_ACCESS"]="keySystemNoAccess";ErrorDetails["KEY_SYSTEM_NO_SESSION"]="keySystemNoSession";ErrorDetails["KEY_SYSTEM_NO_CONFIGURED_LICENSE"]="keySystemNoConfiguredLicense";ErrorDetails["KEY_SYSTEM_LICENSE_REQUEST_FAILED"]="keySystemLicenseRequestFailed";ErrorDetails["KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED"]="keySystemServerCertificateRequestFailed";ErrorDetails["KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED"]="keySystemServerCertificateUpdateFailed";ErrorDetails["KEY_SYSTEM_SESSION_UPDATE_FAILED"]="keySystemSessionUpdateFailed";ErrorDetails["KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED"]="keySystemStatusOutputRestricted";ErrorDetails["KEY_SYSTEM_STATUS_INTERNAL_ERROR"]="keySystemStatusInternalError";ErrorDetails["MANIFEST_LOAD_ERROR"]="manifestLoadError";ErrorDetails["MANIFEST_LOAD_TIMEOUT"]="manifestLoadTimeOut";ErrorDetails["MANIFEST_PARSING_ERROR"]="manifestParsingError";ErrorDetails["MANIFEST_INCOMPATIBLE_CODECS_ERROR"]="manifestIncompatibleCodecsError";ErrorDetails["LEVEL_EMPTY_ERROR"]="levelEmptyError";ErrorDetails["LEVEL_LOAD_ERROR"]="levelLoadError";ErrorDetails["LEVEL_LOAD_TIMEOUT"]="levelLoadTimeOut";ErrorDetails["LEVEL_PARSING_ERROR"]="levelParsingError";ErrorDetails["LEVEL_SWITCH_ERROR"]="levelSwitchError";ErrorDetails["AUDIO_TRACK_LOAD_ERROR"]="audioTrackLoadError";ErrorDetails["AUDIO_TRACK_LOAD_TIMEOUT"]="audioTrackLoadTimeOut";ErrorDetails["SUBTITLE_LOAD_ERROR"]="subtitleTrackLoadError";ErrorDetails["SUBTITLE_TRACK_LOAD_TIMEOUT"]="subtitleTrackLoadTimeOut";ErrorDetails["FRAG_LOAD_ERROR"]="fragLoadError";ErrorDetails["FRAG_LOAD_TIMEOUT"]="fragLoadTimeOut";ErrorDetails["FRAG_DECRYPT_ERROR"]="fragDecryptError";ErrorDetails["FRAG_PARSING_ERROR"]="fragParsingError";ErrorDetails["FRAG_GAP"]="fragGap";ErrorDetails["REMUX_ALLOC_ERROR"]="remuxAllocError";ErrorDetails["KEY_LOAD_ERROR"]="keyLoadError";ErrorDetails["KEY_LOAD_TIMEOUT"]="keyLoadTimeOut";ErrorDetails["BUFFER_ADD_CODEC_ERROR"]="bufferAddCodecError";ErrorDetails["BUFFER_INCOMPATIBLE_CODECS_ERROR"]="bufferIncompatibleCodecsError";ErrorDetails["BUFFER_APPEND_ERROR"]="bufferAppendError";ErrorDetails["BUFFER_APPENDING_ERROR"]="bufferAppendingError";ErrorDetails["BUFFER_STALLED_ERROR"]="bufferStalledError";ErrorDetails["BUFFER_FULL_ERROR"]="bufferFullError";ErrorDetails["BUFFER_SEEK_OVER_HOLE"]="bufferSeekOverHole";ErrorDetails["BUFFER_NUDGE_ON_STALL"]="bufferNudgeOnStall";ErrorDetails["INTERNAL_EXCEPTION"]="internalException";ErrorDetails["INTERNAL_ABORTED"]="aborted";ErrorDetails["UNKNOWN"]="unknown";return ErrorDetails;}({});const noop$3=function noop(){};const fakeLogger={trace:noop$3,debug:noop$3,log:noop$3,warn:noop$3,info:noop$3,error:noop$3};let exportedLogger=fakeLogger;// let lastCallTime;
// function formatMsgWithTimeInfo(type, msg) {
//   const now = Date.now();
//   const diff = lastCallTime ? '+' + (now - lastCallTime) : '0';
//   lastCallTime = now;
//   msg = (new Date(now)).toISOString() + ' | [' +  type + '] > ' + msg + ' ( ' + diff + ' ms )';
//   return msg;
// }
function consolePrintFn(type){const func=self.console[type];if(func){return func.bind(self.console,`[${type}] >`);}return noop$3;}function exportLoggerFunctions(debugConfig,...functions){functions.forEach(function(type){exportedLogger[type]=debugConfig[type]?debugConfig[type].bind(debugConfig):consolePrintFn(type);});}function enableLogs(debugConfig,id){// check that console is available
if(typeof console==='object'&&debugConfig===true||typeof debugConfig==='object'){exportLoggerFunctions(debugConfig,// Remove out from list here to hard-disable a log-level
// 'trace',
'debug','log','info','warn','error');// Some browsers don't allow to use bind on console object anyway
// fallback to default if needed
try{exportedLogger.log(`Debug logs enabled for "${id}" in hls.js version ${"1.5.9"}`);}catch(e){exportedLogger=fakeLogger;}}else {exportedLogger=fakeLogger;}}const logger=exportedLogger;const DECIMAL_RESOLUTION_REGEX=/^(\d+)x(\d+)$/;const ATTR_LIST_REGEX=/(.+?)=(".*?"|.*?)(?:,|$)/g;// adapted from https://github.com/kanongil/node-m3u8parse/blob/master/attrlist.js
class AttrList{constructor(attrs){if(typeof attrs==='string'){attrs=AttrList.parseAttrList(attrs);}_extends(this,attrs);}get clientAttrs(){return Object.keys(this).filter(attr=>attr.substring(0,2)==='X-');}decimalInteger(attrName){const intValue=parseInt(this[attrName],10);if(intValue>Number.MAX_SAFE_INTEGER){return Infinity;}return intValue;}hexadecimalInteger(attrName){if(this[attrName]){let stringValue=(this[attrName]||'0x').slice(2);stringValue=(stringValue.length&1?'0':'')+stringValue;const value=new Uint8Array(stringValue.length/2);for(let i=0;i<stringValue.length/2;i++){value[i]=parseInt(stringValue.slice(i*2,i*2+2),16);}return value;}else {return null;}}hexadecimalIntegerAsNumber(attrName){const intValue=parseInt(this[attrName],16);if(intValue>Number.MAX_SAFE_INTEGER){return Infinity;}return intValue;}decimalFloatingPoint(attrName){return parseFloat(this[attrName]);}optionalFloat(attrName,defaultValue){const value=this[attrName];return value?parseFloat(value):defaultValue;}enumeratedString(attrName){return this[attrName];}bool(attrName){return this[attrName]==='YES';}decimalResolution(attrName){const res=DECIMAL_RESOLUTION_REGEX.exec(this[attrName]);if(res===null){return undefined;}return {width:parseInt(res[1],10),height:parseInt(res[2],10)};}static parseAttrList(input){let match;const attrs={};const quote='"';ATTR_LIST_REGEX.lastIndex=0;while((match=ATTR_LIST_REGEX.exec(input))!==null){let value=match[2];if(value.indexOf(quote)===0&&value.lastIndexOf(quote)===value.length-1){value=value.slice(1,-1);}const name=match[1].trim();attrs[name]=value;}return attrs;}}// Avoid exporting const enum so that these values can be inlined
function isDateRangeCueAttribute(attrName){return attrName!=="ID"&&attrName!=="CLASS"&&attrName!=="START-DATE"&&attrName!=="DURATION"&&attrName!=="END-DATE"&&attrName!=="END-ON-NEXT";}function isSCTE35Attribute(attrName){return attrName==="SCTE35-OUT"||attrName==="SCTE35-IN";}class DateRange{constructor(dateRangeAttr,dateRangeWithSameId){this.attr=void 0;this._startDate=void 0;this._endDate=void 0;this._badValueForSameId=void 0;if(dateRangeWithSameId){const previousAttr=dateRangeWithSameId.attr;for(const key in previousAttr){if(Object.prototype.hasOwnProperty.call(dateRangeAttr,key)&&dateRangeAttr[key]!==previousAttr[key]){logger.warn(`DATERANGE tag attribute: "${key}" does not match for tags with ID: "${dateRangeAttr.ID}"`);this._badValueForSameId=key;break;}}// Merge DateRange tags with the same ID
dateRangeAttr=_extends(new AttrList({}),previousAttr,dateRangeAttr);}this.attr=dateRangeAttr;this._startDate=new Date(dateRangeAttr["START-DATE"]);if("END-DATE"in this.attr){const endDate=new Date(this.attr["END-DATE"]);if(isFiniteNumber(endDate.getTime())){this._endDate=endDate;}}}get id(){return this.attr.ID;}get class(){return this.attr.CLASS;}get startDate(){return this._startDate;}get endDate(){if(this._endDate){return this._endDate;}const duration=this.duration;if(duration!==null){return new Date(this._startDate.getTime()+duration*1000);}return null;}get duration(){if("DURATION"in this.attr){const duration=this.attr.decimalFloatingPoint("DURATION");if(isFiniteNumber(duration)){return duration;}}else if(this._endDate){return (this._endDate.getTime()-this._startDate.getTime())/1000;}return null;}get plannedDuration(){if("PLANNED-DURATION"in this.attr){return this.attr.decimalFloatingPoint("PLANNED-DURATION");}return null;}get endOnNext(){return this.attr.bool("END-ON-NEXT");}get isValid(){return !!this.id&&!this._badValueForSameId&&isFiniteNumber(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class);}}class LoadStats{constructor(){this.aborted=false;this.loaded=0;this.retry=0;this.total=0;this.chunkCount=0;this.bwEstimate=0;this.loading={start:0,first:0,end:0};this.parsing={start:0,end:0};this.buffering={start:0,first:0,end:0};}}var ElementaryStreamTypes={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class BaseSegment{constructor(baseurl){this._byteRange=null;this._url=null;// baseurl is the URL to the playlist
this.baseurl=void 0;// relurl is the portion of the URL that comes from inside the playlist.
this.relurl=void 0;// Holds the types of data this fragment supports
this.elementaryStreams={[ElementaryStreamTypes.AUDIO]:null,[ElementaryStreamTypes.VIDEO]:null,[ElementaryStreamTypes.AUDIOVIDEO]:null};this.baseurl=baseurl;}// setByteRange converts a EXT-X-BYTERANGE attribute into a two element array
setByteRange(value,previous){const params=value.split('@',2);let start;if(params.length===1){start=(previous==null?void 0:previous.byteRangeEndOffset)||0;}else {start=parseInt(params[1]);}this._byteRange=[start,parseInt(params[0])+start];}get byteRange(){if(!this._byteRange){return [];}return this._byteRange;}get byteRangeStartOffset(){return this.byteRange[0];}get byteRangeEndOffset(){return this.byteRange[1];}get url(){if(!this._url&&this.baseurl&&this.relurl){this._url=urlToolkitExports.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:true});}return this._url||'';}set url(value){this._url=value;}}/**
 * Object representing parsed data from an HLS Segment. Found in {@link hls.js#LevelDetails.fragments}.
 */class Fragment extends BaseSegment{constructor(type,baseurl){super(baseurl);this._decryptdata=null;this.rawProgramDateTime=null;this.programDateTime=null;this.tagList=[];// EXTINF has to be present for a m3u8 to be considered valid
this.duration=0;// sn notates the sequence number for a segment, and if set to a string can be 'initSegment'
this.sn=0;// levelkeys are the EXT-X-KEY tags that apply to this segment for decryption
// core difference from the private field _decryptdata is the lack of the initialized IV
// _decryptdata will set the IV for this segment based on the segment number in the fragment
this.levelkeys=void 0;// A string representing the fragment type
this.type=void 0;// A reference to the loader. Set while the fragment is loading, and removed afterwards. Used to abort fragment loading
this.loader=null;// A reference to the key loader. Set while the key is loading, and removed afterwards. Used to abort key loading
this.keyLoader=null;// The level/track index to which the fragment belongs
this.level=-1;// The continuity counter of the fragment
this.cc=0;// The starting Presentation Time Stamp (PTS) of the fragment. Set after transmux complete.
this.startPTS=void 0;// The ending Presentation Time Stamp (PTS) of the fragment. Set after transmux complete.
this.endPTS=void 0;// The starting Decode Time Stamp (DTS) of the fragment. Set after transmux complete.
this.startDTS=void 0;// The ending Decode Time Stamp (DTS) of the fragment. Set after transmux complete.
this.endDTS=void 0;// The start time of the fragment, as listed in the manifest. Updated after transmux complete.
this.start=0;// Set by `updateFragPTSDTS` in level-helper
this.deltaPTS=void 0;// The maximum starting Presentation Time Stamp (audio/video PTS) of the fragment. Set after transmux complete.
this.maxStartPTS=void 0;// The minimum ending Presentation Time Stamp (audio/video PTS) of the fragment. Set after transmux complete.
this.minEndPTS=void 0;// Load/parse timing information
this.stats=new LoadStats();// Init Segment bytes (unset for media segments)
this.data=void 0;// A flag indicating whether the segment was downloaded in order to test bitrate, and was not buffered
this.bitrateTest=false;// #EXTINF  segment title
this.title=null;// The Media Initialization Section for this segment
this.initSegment=null;// Fragment is the last fragment in the media playlist
this.endList=void 0;// Fragment is marked by an EXT-X-GAP tag indicating that it does not contain media data and should not be loaded
this.gap=void 0;// Deprecated
this.urlId=0;this.type=type;}get decryptdata(){const{levelkeys}=this;if(!levelkeys&&!this._decryptdata){return null;}if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const key=this.levelkeys.identity;if(key){this._decryptdata=key.getDecryptData(this.sn);}else {const keyFormats=Object.keys(this.levelkeys);if(keyFormats.length===1){return this._decryptdata=this.levelkeys[keyFormats[0]].getDecryptData(this.sn);}}}return this._decryptdata;}get end(){return this.start+this.duration;}get endProgramDateTime(){if(this.programDateTime===null){return null;}if(!isFiniteNumber(this.programDateTime)){return null;}const duration=!isFiniteNumber(this.duration)?0:this.duration;return this.programDateTime+duration*1000;}get encrypted(){var _this$_decryptdata;// At the m3u8-parser level we need to add support for manifest signalled keyformats
// when we want the fragment to start reporting that it is encrypted.
// Currently, keyFormat will only be set for identity keys
if((_this$_decryptdata=this._decryptdata)!=null&&_this$_decryptdata.encrypted){return true;}else if(this.levelkeys){const keyFormats=Object.keys(this.levelkeys);const len=keyFormats.length;if(len>1||len===1&&this.levelkeys[keyFormats[0]].encrypted){return true;}}return false;}setKeyFormat(keyFormat){if(this.levelkeys){const key=this.levelkeys[keyFormat];if(key&&!this._decryptdata){this._decryptdata=key.getDecryptData(this.sn);}}}abortRequests(){var _this$loader,_this$keyLoader;(_this$loader=this.loader)==null?void 0:_this$loader.abort();(_this$keyLoader=this.keyLoader)==null?void 0:_this$keyLoader.abort();}setElementaryStreamInfo(type,startPTS,endPTS,startDTS,endDTS,partial=false){const{elementaryStreams}=this;const info=elementaryStreams[type];if(!info){elementaryStreams[type]={startPTS,endPTS,startDTS,endDTS,partial};return;}info.startPTS=Math.min(info.startPTS,startPTS);info.endPTS=Math.max(info.endPTS,endPTS);info.startDTS=Math.min(info.startDTS,startDTS);info.endDTS=Math.max(info.endDTS,endDTS);}clearElementaryStreamInfo(){const{elementaryStreams}=this;elementaryStreams[ElementaryStreamTypes.AUDIO]=null;elementaryStreams[ElementaryStreamTypes.VIDEO]=null;elementaryStreams[ElementaryStreamTypes.AUDIOVIDEO]=null;}}/**
 * Object representing parsed data from an HLS Partial Segment. Found in {@link hls.js#LevelDetails.partList}.
 */class Part extends BaseSegment{constructor(partAttrs,frag,baseurl,index,previous){super(baseurl);this.fragOffset=0;this.duration=0;this.gap=false;this.independent=false;this.relurl=void 0;this.fragment=void 0;this.index=void 0;this.stats=new LoadStats();this.duration=partAttrs.decimalFloatingPoint('DURATION');this.gap=partAttrs.bool('GAP');this.independent=partAttrs.bool('INDEPENDENT');this.relurl=partAttrs.enumeratedString('URI');this.fragment=frag;this.index=index;const byteRange=partAttrs.enumeratedString('BYTERANGE');if(byteRange){this.setByteRange(byteRange,previous);}if(previous){this.fragOffset=previous.fragOffset+previous.duration;}}get start(){return this.fragment.start+this.fragOffset;}get end(){return this.start+this.duration;}get loaded(){const{elementaryStreams}=this;return !!(elementaryStreams.audio||elementaryStreams.video||elementaryStreams.audiovideo);}}const DEFAULT_TARGET_DURATION=10;/**
 * Object representing parsed data from an HLS Media Playlist. Found in {@link hls.js#Level.details}.
 */class LevelDetails{constructor(baseUrl){this.PTSKnown=false;this.alignedSliding=false;this.averagetargetduration=void 0;this.endCC=0;this.endSN=0;this.fragments=void 0;this.fragmentHint=void 0;this.partList=null;this.dateRanges=void 0;this.live=true;this.ageHeader=0;this.advancedDateTime=void 0;this.updated=true;this.advanced=true;this.availabilityDelay=void 0;// Manifest reload synchronization
this.misses=0;this.startCC=0;this.startSN=0;this.startTimeOffset=null;this.targetduration=0;this.totalduration=0;this.type=null;this.url=void 0;this.m3u8='';this.version=null;this.canBlockReload=false;this.canSkipUntil=0;this.canSkipDateRanges=false;this.skippedSegments=0;this.recentlyRemovedDateranges=void 0;this.partHoldBack=0;this.holdBack=0;this.partTarget=0;this.preloadHint=void 0;this.renditionReports=void 0;this.tuneInGoal=0;this.deltaUpdateFailed=void 0;this.driftStartTime=0;this.driftEndTime=0;this.driftStart=0;this.driftEnd=0;this.encryptedFragments=void 0;this.playlistParsingError=null;this.variableList=null;this.hasVariableRefs=false;this.fragments=[];this.encryptedFragments=[];this.dateRanges={};this.url=baseUrl;}reloaded(previous){if(!previous){this.advanced=true;this.updated=true;return;}const partSnDiff=this.lastPartSn-previous.lastPartSn;const partIndexDiff=this.lastPartIndex-previous.lastPartIndex;this.updated=this.endSN!==previous.endSN||!!partIndexDiff||!!partSnDiff||!this.live;this.advanced=this.endSN>previous.endSN||partSnDiff>0||partSnDiff===0&&partIndexDiff>0;if(this.updated||this.advanced){this.misses=Math.floor(previous.misses*0.6);}else {this.misses=previous.misses+1;}this.availabilityDelay=previous.availabilityDelay;}get hasProgramDateTime(){if(this.fragments.length){return isFiniteNumber(this.fragments[this.fragments.length-1].programDateTime);}return false;}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||DEFAULT_TARGET_DURATION;}get drift(){const runTime=this.driftEndTime-this.driftStartTime;if(runTime>0){const runDuration=this.driftEnd-this.driftStart;return runDuration*1000/runTime;}return 1;}get edge(){return this.partEnd||this.fragmentEnd;}get partEnd(){var _this$partList;if((_this$partList=this.partList)!=null&&_this$partList.length){return this.partList[this.partList.length-1].end;}return this.fragmentEnd;}get fragmentEnd(){var _this$fragments;if((_this$fragments=this.fragments)!=null&&_this$fragments.length){return this.fragments[this.fragments.length-1].end;}return 0;}get age(){if(this.advancedDateTime){return Math.max(Date.now()-this.advancedDateTime,0)/1000;}return 0;}get lastPartIndex(){var _this$partList2;if((_this$partList2=this.partList)!=null&&_this$partList2.length){return this.partList[this.partList.length-1].index;}return -1;}get lastPartSn(){var _this$partList3;if((_this$partList3=this.partList)!=null&&_this$partList3.length){return this.partList[this.partList.length-1].fragment.sn;}return this.endSN;}}function base64Decode(base64encodedStr){return Uint8Array.from(atob(base64encodedStr),c=>c.charCodeAt(0));}function getKeyIdBytes(str){const keyIdbytes=strToUtf8array(str).subarray(0,16);const paddedkeyIdbytes=new Uint8Array(16);paddedkeyIdbytes.set(keyIdbytes,16-keyIdbytes.length);return paddedkeyIdbytes;}function changeEndianness(keyId){const swap=function swap(array,from,to){const cur=array[from];array[from]=array[to];array[to]=cur;};swap(keyId,0,3);swap(keyId,1,2);swap(keyId,4,5);swap(keyId,6,7);}function convertDataUriToArrayBytes(uri){// data:[<media type][;attribute=value][;base64],<data>
const colonsplit=uri.split(':');let keydata=null;if(colonsplit[0]==='data'&&colonsplit.length===2){const semicolonsplit=colonsplit[1].split(';');const commasplit=semicolonsplit[semicolonsplit.length-1].split(',');if(commasplit.length===2){const isbase64=commasplit[0]==='base64';const data=commasplit[1];if(isbase64){semicolonsplit.splice(-1,1);// remove from processing
keydata=base64Decode(data);}else {keydata=getKeyIdBytes(data);}}}return keydata;}function strToUtf8array(str){return Uint8Array.from(unescape(encodeURIComponent(str)),c=>c.charCodeAt(0));}/** returns `undefined` is `self` is missing, e.g. in node */const optionalSelf=typeof self!=='undefined'?self:undefined;/**
 * @see https://developer.mozilla.org/en-US/docs/Web/API/Navigator/requestMediaKeySystemAccess
 */var KeySystems={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"};// Playlist #EXT-X-KEY KEYFORMAT values
var KeySystemFormats={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function keySystemFormatToKeySystemDomain(format){switch(format){case KeySystemFormats.FAIRPLAY:return KeySystems.FAIRPLAY;case KeySystemFormats.PLAYREADY:return KeySystems.PLAYREADY;case KeySystemFormats.WIDEVINE:return KeySystems.WIDEVINE;case KeySystemFormats.CLEARKEY:return KeySystems.CLEARKEY;}}// System IDs for which we can extract a key ID from "encrypted" event PSSH
var KeySystemIds={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function keySystemIdToKeySystemDomain(systemId){if(systemId===KeySystemIds.WIDEVINE){return KeySystems.WIDEVINE;// } else if (systemId === KeySystemIds.PLAYREADY) {
//   return KeySystems.PLAYREADY;
// } else if (systemId === KeySystemIds.CENC || systemId === KeySystemIds.CLEARKEY) {
//   return KeySystems.CLEARKEY;
}}function keySystemDomainToKeySystemFormat(keySystem){switch(keySystem){case KeySystems.FAIRPLAY:return KeySystemFormats.FAIRPLAY;case KeySystems.PLAYREADY:return KeySystemFormats.PLAYREADY;case KeySystems.WIDEVINE:return KeySystemFormats.WIDEVINE;case KeySystems.CLEARKEY:return KeySystemFormats.CLEARKEY;}}function getKeySystemsForConfig(config){const{drmSystems,widevineLicenseUrl}=config;const keySystemsToAttempt=drmSystems?[KeySystems.FAIRPLAY,KeySystems.WIDEVINE,KeySystems.PLAYREADY,KeySystems.CLEARKEY].filter(keySystem=>!!drmSystems[keySystem]):[];if(!keySystemsToAttempt[KeySystems.WIDEVINE]&&widevineLicenseUrl){keySystemsToAttempt.push(KeySystems.WIDEVINE);}return keySystemsToAttempt;}const requestMediaKeySystemAccess=function(_optionalSelf$navigat){if(optionalSelf!=null&&(_optionalSelf$navigat=optionalSelf.navigator)!=null&&_optionalSelf$navigat.requestMediaKeySystemAccess){return self.navigator.requestMediaKeySystemAccess.bind(self.navigator);}else {return null;}}();/**
 * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySystemConfiguration
 */function getSupportedMediaKeySystemConfigurations(keySystem,audioCodecs,videoCodecs,drmSystemOptions){let initDataTypes;switch(keySystem){case KeySystems.FAIRPLAY:initDataTypes=['cenc','sinf'];break;case KeySystems.WIDEVINE:case KeySystems.PLAYREADY:initDataTypes=['cenc'];break;case KeySystems.CLEARKEY:initDataTypes=['cenc','keyids'];break;default:throw new Error(`Unknown key-system: ${keySystem}`);}return createMediaKeySystemConfigurations(initDataTypes,audioCodecs,videoCodecs,drmSystemOptions);}function createMediaKeySystemConfigurations(initDataTypes,audioCodecs,videoCodecs,drmSystemOptions){const baseConfig={initDataTypes:initDataTypes,persistentState:drmSystemOptions.persistentState||'optional',distinctiveIdentifier:drmSystemOptions.distinctiveIdentifier||'optional',sessionTypes:drmSystemOptions.sessionTypes||[drmSystemOptions.sessionType||'temporary'],audioCapabilities:audioCodecs.map(codec=>({contentType:`audio/mp4; codecs="${codec}"`,robustness:drmSystemOptions.audioRobustness||'',encryptionScheme:drmSystemOptions.audioEncryptionScheme||null})),videoCapabilities:videoCodecs.map(codec=>({contentType:`video/mp4; codecs="${codec}"`,robustness:drmSystemOptions.videoRobustness||'',encryptionScheme:drmSystemOptions.videoEncryptionScheme||null}))};return [baseConfig];}function sliceUint8(array,start,end){// @ts-expect-error This polyfills IE11 usage of Uint8Array slice.
// It always exists in the TypeScript definition so fails, but it fails at runtime on IE11.
return Uint8Array.prototype.slice?array.slice(start,end):new Uint8Array(Array.prototype.slice.call(array,start,end));}// breaking up those two types in order to clarify what is happening in the decoding path.
/**
 * Returns true if an ID3 header can be found at offset in data
 * @param data - The data to search
 * @param offset - The offset at which to start searching
 */const isHeader$2=(data,offset)=>{/*
   * http://id3.org/id3v2.3.0
   * [0]     = 'I'
   * [1]     = 'D'
   * [2]     = '3'
   * [3,4]   = {Version}
   * [5]     = {Flags}
   * [6-9]   = {ID3 Size}
   *
   * An ID3v2 tag can be detected with the following pattern:
   *  $49 44 33 yy yy xx zz zz zz zz
   * Where yy is less than $FF, xx is the 'flags' byte and zz is less than $80
   */if(offset+10<=data.length){// look for 'ID3' identifier
if(data[offset]===0x49&&data[offset+1]===0x44&&data[offset+2]===0x33){// check version is within range
if(data[offset+3]<0xff&&data[offset+4]<0xff){// check size is within range
if(data[offset+6]<0x80&&data[offset+7]<0x80&&data[offset+8]<0x80&&data[offset+9]<0x80){return true;}}}}return false;};/**
 * Returns true if an ID3 footer can be found at offset in data
 * @param data - The data to search
 * @param offset - The offset at which to start searching
 */const isFooter=(data,offset)=>{/*
   * The footer is a copy of the header, but with a different identifier
   */if(offset+10<=data.length){// look for '3DI' identifier
if(data[offset]===0x33&&data[offset+1]===0x44&&data[offset+2]===0x49){// check version is within range
if(data[offset+3]<0xff&&data[offset+4]<0xff){// check size is within range
if(data[offset+6]<0x80&&data[offset+7]<0x80&&data[offset+8]<0x80&&data[offset+9]<0x80){return true;}}}}return false;};/**
 * Returns any adjacent ID3 tags found in data starting at offset, as one block of data
 * @param data - The data to search in
 * @param offset - The offset at which to start searching
 * @returns the block of data containing any ID3 tags found
 * or *undefined* if no header is found at the starting offset
 */const getID3Data=(data,offset)=>{const front=offset;let length=0;while(isHeader$2(data,offset)){// ID3 header is 10 bytes
length+=10;const size=readSize(data,offset+6);length+=size;if(isFooter(data,offset+10)){// ID3 footer is 10 bytes
length+=10;}offset+=length;}if(length>0){return data.subarray(front,front+length);}return undefined;};const readSize=(data,offset)=>{let size=0;size=(data[offset]&0x7f)<<21;size|=(data[offset+1]&0x7f)<<14;size|=(data[offset+2]&0x7f)<<7;size|=data[offset+3]&0x7f;return size;};const canParse$2=(data,offset)=>{return isHeader$2(data,offset)&&readSize(data,offset+6)+10<=data.length-offset;};/**
 * Searches for the Elementary Stream timestamp found in the ID3 data chunk
 * @param data - Block of data containing one or more ID3 tags
 */const getTimeStamp=data=>{const frames=getID3Frames(data);for(let i=0;i<frames.length;i++){const frame=frames[i];if(isTimeStampFrame(frame)){return readTimeStamp(frame);}}return undefined;};/**
 * Returns true if the ID3 frame is an Elementary Stream timestamp frame
 */const isTimeStampFrame=frame=>{return frame&&frame.key==='PRIV'&&frame.info==='com.apple.streaming.transportStreamTimestamp';};const getFrameData=data=>{/*
  Frame ID       $xx xx xx xx (four characters)
  Size           $xx xx xx xx
  Flags          $xx xx
  */const type=String.fromCharCode(data[0],data[1],data[2],data[3]);const size=readSize(data,4);// skip frame id, size, and flags
const offset=10;return {type,size,data:data.subarray(offset,offset+size)};};/**
 * Returns an array of ID3 frames found in all the ID3 tags in the id3Data
 * @param id3Data - The ID3 data containing one or more ID3 tags
 */const getID3Frames=id3Data=>{let offset=0;const frames=[];while(isHeader$2(id3Data,offset)){const size=readSize(id3Data,offset+6);// skip past ID3 header
offset+=10;const end=offset+size;// loop through frames in the ID3 tag
while(offset+8<end){const frameData=getFrameData(id3Data.subarray(offset));const frame=decodeFrame(frameData);if(frame){frames.push(frame);}// skip frame header and frame data
offset+=frameData.size+10;}if(isFooter(id3Data,offset)){offset+=10;}}return frames;};const decodeFrame=frame=>{if(frame.type==='PRIV'){return decodePrivFrame(frame);}else if(frame.type[0]==='W'){return decodeURLFrame(frame);}return decodeTextFrame(frame);};const decodePrivFrame=frame=>{/*
  Format: <text string>\0<binary data>
  */if(frame.size<2){return undefined;}const owner=utf8ArrayToStr(frame.data,true);const privateData=new Uint8Array(frame.data.subarray(owner.length+1));return {key:frame.type,info:owner,data:privateData.buffer};};const decodeTextFrame=frame=>{if(frame.size<2){return undefined;}if(frame.type==='TXXX'){/*
    Format:
    [0]   = {Text Encoding}
    [1-?] = {Description}\0{Value}
    */let index=1;const description=utf8ArrayToStr(frame.data.subarray(index),true);index+=description.length+1;const value=utf8ArrayToStr(frame.data.subarray(index));return {key:frame.type,info:description,data:value};}/*
  Format:
  [0]   = {Text Encoding}
  [1-?] = {Value}
  */const text=utf8ArrayToStr(frame.data.subarray(1));return {key:frame.type,data:text};};const decodeURLFrame=frame=>{if(frame.type==='WXXX'){/*
    Format:
    [0]   = {Text Encoding}
    [1-?] = {Description}\0{URL}
    */if(frame.size<2){return undefined;}let index=1;const description=utf8ArrayToStr(frame.data.subarray(index),true);index+=description.length+1;const value=utf8ArrayToStr(frame.data.subarray(index));return {key:frame.type,info:description,data:value};}/*
  Format:
  [0-?] = {URL}
  */const url=utf8ArrayToStr(frame.data);return {key:frame.type,data:url};};const readTimeStamp=timeStampFrame=>{if(timeStampFrame.data.byteLength===8){const data=new Uint8Array(timeStampFrame.data);// timestamp is 33 bit expressed as a big-endian eight-octet number,
// with the upper 31 bits set to zero.
const pts33Bit=data[3]&0x1;let timestamp=(data[4]<<23)+(data[5]<<15)+(data[6]<<7)+data[7];timestamp/=45;if(pts33Bit){timestamp+=47721858.84;}// 2^32 / 90
return Math.round(timestamp);}return undefined;};// http://stackoverflow.com/questions/8936984/uint8array-to-string-in-javascript/22373197
// http://www.onicos.com/staff/iz/amuse/javascript/expert/utf.txt
/* utf.js - UTF-8 <=> UTF-16 convertion
 *
 * Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
 * Version: 1.0
 * LastModified: Dec 25 1999
 * This library is free.  You can redistribute it and/or modify it.
 */const utf8ArrayToStr=(array,exitOnNull=false)=>{const decoder=getTextDecoder();if(decoder){const decoded=decoder.decode(array);if(exitOnNull){// grab up to the first null
const idx=decoded.indexOf('\0');return idx!==-1?decoded.substring(0,idx):decoded;}// remove any null characters
return decoded.replace(/\0/g,'');}const len=array.length;let c;let char2;let char3;let out='';let i=0;while(i<len){c=array[i++];if(c===0x00&&exitOnNull){return out;}else if(c===0x00||c===0x03){// If the character is 3 (END_OF_TEXT) or 0 (NULL) then skip it
continue;}switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:// 0xxxxxxx
out+=String.fromCharCode(c);break;case 12:case 13:// 110x xxxx   10xx xxxx
char2=array[i++];out+=String.fromCharCode((c&0x1f)<<6|char2&0x3f);break;case 14:// 1110 xxxx  10xx xxxx  10xx xxxx
char2=array[i++];char3=array[i++];out+=String.fromCharCode((c&0x0f)<<12|(char2&0x3f)<<6|(char3&0x3f)<<0);break;}}return out;};let decoder;function getTextDecoder(){// On Play Station 4, TextDecoder is defined but partially implemented.
// Manual decoding option is preferable
if(navigator.userAgent.includes('PlayStation 4')){return;}if(!decoder&&typeof self.TextDecoder!=='undefined'){decoder=new self.TextDecoder('utf-8');}return decoder;}/**
 *  hex dump helper class
 */const Hex={hexDump:function(array){let str='';for(let i=0;i<array.length;i++){let h=array[i].toString(16);if(h.length<2){h='0'+h;}str+=h;}return str;}};const UINT32_MAX$1=Math.pow(2,32)-1;const push=[].push;// We are using fixed track IDs for driving the MP4 remuxer
// instead of following the TS PIDs.
// There is no reason not to do this and some browsers/SourceBuffer-demuxers
// may not like if there are TrackID "switches"
// See https://github.com/video-dev/hls.js/issues/1331
// Here we are mapping our internal track types to constant MP4 track IDs
// With MSE currently one can only have one track of each, and we are muxing
// whatever video/audio rendition in them.
const RemuxerTrackIdConfig={video:1,audio:2,id3:3,text:4};function bin2str(data){return String.fromCharCode.apply(null,data);}function readUint16(buffer,offset){const val=buffer[offset]<<8|buffer[offset+1];return val<0?65536+val:val;}function readUint32(buffer,offset){const val=readSint32(buffer,offset);return val<0?4294967296+val:val;}function readUint64(buffer,offset){let result=readUint32(buffer,offset);result*=Math.pow(2,32);result+=readUint32(buffer,offset+4);return result;}function readSint32(buffer,offset){return buffer[offset]<<24|buffer[offset+1]<<16|buffer[offset+2]<<8|buffer[offset+3];}function writeUint32(buffer,offset,value){buffer[offset]=value>>24;buffer[offset+1]=value>>16&0xff;buffer[offset+2]=value>>8&0xff;buffer[offset+3]=value&0xff;}// Find "moof" box
function hasMoofData(data){const end=data.byteLength;for(let i=0;i<end;){const size=readUint32(data,i);if(size>8&&data[i+4]===0x6d&&data[i+5]===0x6f&&data[i+6]===0x6f&&data[i+7]===0x66){return true;}i=size>1?i+size:end;}return false;}// Find the data for a box specified by its path
function findBox(data,path){const results=[];if(!path.length){// short-circuit the search for empty paths
return results;}const end=data.byteLength;for(let i=0;i<end;){const size=readUint32(data,i);const type=bin2str(data.subarray(i+4,i+8));const endbox=size>1?i+size:end;if(type===path[0]){if(path.length===1){// this is the end of the path and we've found the box we were
// looking for
results.push(data.subarray(i+8,endbox));}else {// recursively search for the next box along the path
const subresults=findBox(data.subarray(i+8,endbox),path.slice(1));if(subresults.length){push.apply(results,subresults);}}}i=endbox;}// we've finished searching all of data
return results;}function parseSegmentIndex(sidx){const references=[];const version=sidx[0];// set initial offset, we skip the reference ID (not needed)
let index=8;const timescale=readUint32(sidx,index);index+=4;let earliestPresentationTime=0;let firstOffset=0;if(version===0){earliestPresentationTime=readUint32(sidx,index);firstOffset=readUint32(sidx,index+4);index+=8;}else {earliestPresentationTime=readUint64(sidx,index);firstOffset=readUint64(sidx,index+8);index+=16;}// skip reserved
index+=2;let startByte=sidx.length+firstOffset;const referencesCount=readUint16(sidx,index);index+=2;for(let i=0;i<referencesCount;i++){let referenceIndex=index;const referenceInfo=readUint32(sidx,referenceIndex);referenceIndex+=4;const referenceSize=referenceInfo&0x7fffffff;const referenceType=(referenceInfo&0x80000000)>>>31;if(referenceType===1){logger.warn('SIDX has hierarchical references (not supported)');return null;}const subsegmentDuration=readUint32(sidx,referenceIndex);referenceIndex+=4;references.push({referenceSize,subsegmentDuration,// unscaled
info:{duration:subsegmentDuration/timescale,start:startByte,end:startByte+referenceSize-1}});startByte+=referenceSize;// Skipping 1 bit for |startsWithSap|, 3 bits for |sapType|, and 28 bits
// for |sapDelta|.
referenceIndex+=4;// skip to next ref
index=referenceIndex;}return {earliestPresentationTime,timescale,version,referencesCount,references};}/**
 * Parses an MP4 initialization segment and extracts stream type and
 * timescale values for any declared tracks. Timescale values indicate the
 * number of clock ticks per second to assume for time-based values
 * elsewhere in the MP4.
 *
 * To determine the start time of an MP4, you need two pieces of
 * information: the timescale unit and the earliest base media decode
 * time. Multiple timescales can be specified within an MP4 but the
 * base media decode time is always expressed in the timescale from
 * the media header box for the track:
 * ```
 * moov > trak > mdia > mdhd.timescale
 * moov > trak > mdia > hdlr
 * ```
 * @param initSegment the bytes of the init segment
 * @returns a hash of track type to timescale values or null if
 * the init segment is malformed.
 */function parseInitSegment(initSegment){const result=[];const traks=findBox(initSegment,['moov','trak']);for(let i=0;i<traks.length;i++){const trak=traks[i];const tkhd=findBox(trak,['tkhd'])[0];if(tkhd){let version=tkhd[0];const trackId=readUint32(tkhd,version===0?12:20);const mdhd=findBox(trak,['mdia','mdhd'])[0];if(mdhd){version=mdhd[0];const timescale=readUint32(mdhd,version===0?12:20);const hdlr=findBox(trak,['mdia','hdlr'])[0];if(hdlr){const hdlrType=bin2str(hdlr.subarray(8,12));const type={soun:ElementaryStreamTypes.AUDIO,vide:ElementaryStreamTypes.VIDEO}[hdlrType];if(type){// Parse codec details
const stsd=findBox(trak,['mdia','minf','stbl','stsd'])[0];const stsdData=parseStsd(stsd);result[trackId]={timescale,type};result[type]=_objectSpread2({timescale,id:trackId},stsdData);}}}}}const trex=findBox(initSegment,['moov','mvex','trex']);trex.forEach(trex=>{const trackId=readUint32(trex,4);const track=result[trackId];if(track){track.default={duration:readUint32(trex,12),flags:readUint32(trex,20)};}});return result;}function parseStsd(stsd){const sampleEntries=stsd.subarray(8);const sampleEntriesEnd=sampleEntries.subarray(8+78);const fourCC=bin2str(sampleEntries.subarray(4,8));let codec=fourCC;const encrypted=fourCC==='enca'||fourCC==='encv';if(encrypted){const encBox=findBox(sampleEntries,[fourCC])[0];const encBoxChildren=encBox.subarray(fourCC==='enca'?28:78);const sinfs=findBox(encBoxChildren,['sinf']);sinfs.forEach(sinf=>{const schm=findBox(sinf,['schm'])[0];if(schm){const scheme=bin2str(schm.subarray(4,8));if(scheme==='cbcs'||scheme==='cenc'){const frma=findBox(sinf,['frma'])[0];if(frma){// for encrypted content codec fourCC will be in frma
codec=bin2str(frma);}}}});}switch(codec){case'avc1':case'avc2':case'avc3':case'avc4':{// extract profile + compatibility + level out of avcC box
const avcCBox=findBox(sampleEntriesEnd,['avcC'])[0];codec+='.'+toHex(avcCBox[1])+toHex(avcCBox[2])+toHex(avcCBox[3]);break;}case'mp4a':{const codecBox=findBox(sampleEntries,[fourCC])[0];const esdsBox=findBox(codecBox.subarray(28),['esds'])[0];if(esdsBox&&esdsBox.length>12){let i=4;// ES Descriptor tag
if(esdsBox[i++]!==0x03){break;}i=skipBERInteger(esdsBox,i);i+=2;// skip es_id;
const flags=esdsBox[i++];if(flags&0x80){i+=2;// skip dependency es_id
}if(flags&0x40){i+=esdsBox[i++];// skip URL
}// Decoder config descriptor
if(esdsBox[i++]!==0x04){break;}i=skipBERInteger(esdsBox,i);const objectType=esdsBox[i++];if(objectType===0x40){codec+='.'+toHex(objectType);}else {break;}i+=12;// Decoder specific info
if(esdsBox[i++]!==0x05){break;}i=skipBERInteger(esdsBox,i);const firstByte=esdsBox[i++];let audioObjectType=(firstByte&0xf8)>>3;if(audioObjectType===31){audioObjectType+=1+((firstByte&0x7)<<3)+((esdsBox[i]&0xe0)>>5);}codec+='.'+audioObjectType;}break;}case'hvc1':case'hev1':{const hvcCBox=findBox(sampleEntriesEnd,['hvcC'])[0];const profileByte=hvcCBox[1];const profileSpace=['','A','B','C'][profileByte>>6];const generalProfileIdc=profileByte&0x1f;const profileCompat=readUint32(hvcCBox,2);const tierFlag=(profileByte&0x20)>>5?'H':'L';const levelIDC=hvcCBox[12];const constraintIndicator=hvcCBox.subarray(6,12);codec+='.'+profileSpace+generalProfileIdc;codec+='.'+profileCompat.toString(16).toUpperCase();codec+='.'+tierFlag+levelIDC;let constraintString='';for(let i=constraintIndicator.length;i--;){const byte=constraintIndicator[i];if(byte||constraintString){const encodedByte=byte.toString(16).toUpperCase();constraintString='.'+encodedByte+constraintString;}}codec+=constraintString;break;}case'dvh1':case'dvhe':{const dvcCBox=findBox(sampleEntriesEnd,['dvcC'])[0];const profile=dvcCBox[2]>>1&0x7f;const level=dvcCBox[2]<<5&0x20|dvcCBox[3]>>3&0x1f;codec+='.'+addLeadingZero(profile)+'.'+addLeadingZero(level);break;}case'vp09':{const vpcCBox=findBox(sampleEntriesEnd,['vpcC'])[0];const profile=vpcCBox[4];const level=vpcCBox[5];const bitDepth=vpcCBox[6]>>4&0x0f;codec+='.'+addLeadingZero(profile)+'.'+addLeadingZero(level)+'.'+addLeadingZero(bitDepth);break;}case'av01':{const av1CBox=findBox(sampleEntriesEnd,['av1C'])[0];const profile=av1CBox[1]>>>5;const level=av1CBox[1]&0x1f;const tierFlag=av1CBox[2]>>>7?'H':'M';const highBitDepth=(av1CBox[2]&0x40)>>6;const twelveBit=(av1CBox[2]&0x20)>>5;const bitDepth=profile===2&&highBitDepth?twelveBit?12:10:highBitDepth?10:8;const monochrome=(av1CBox[2]&0x10)>>4;const chromaSubsamplingX=(av1CBox[2]&0x08)>>3;const chromaSubsamplingY=(av1CBox[2]&0x04)>>2;const chromaSamplePosition=av1CBox[2]&0x03;// TODO: parse color_description_present_flag
// default it to BT.709/limited range for now
// more info https://aomediacodec.github.io/av1-isobmff/#av1codecconfigurationbox-syntax
const colorPrimaries=1;const transferCharacteristics=1;const matrixCoefficients=1;const videoFullRangeFlag=0;codec+='.'+profile+'.'+addLeadingZero(level)+tierFlag+'.'+addLeadingZero(bitDepth)+'.'+monochrome+'.'+chromaSubsamplingX+chromaSubsamplingY+chromaSamplePosition+'.'+addLeadingZero(colorPrimaries)+'.'+addLeadingZero(transferCharacteristics)+'.'+addLeadingZero(matrixCoefficients)+'.'+videoFullRangeFlag;break;}}return {codec,encrypted};}function skipBERInteger(bytes,i){const limit=i+5;while(bytes[i++]&0x80&&i<limit){}return i;}function toHex(x){return ('0'+x.toString(16).toUpperCase()).slice(-2);}function addLeadingZero(num){return (num<10?'0':'')+num;}function patchEncyptionData(initSegment,decryptdata){if(!initSegment||!decryptdata){return initSegment;}const keyId=decryptdata.keyId;if(keyId&&decryptdata.isCommonEncryption){const traks=findBox(initSegment,['moov','trak']);traks.forEach(trak=>{const stsd=findBox(trak,['mdia','minf','stbl','stsd'])[0];// skip the sample entry count
const sampleEntries=stsd.subarray(8);let encBoxes=findBox(sampleEntries,['enca']);const isAudio=encBoxes.length>0;if(!isAudio){encBoxes=findBox(sampleEntries,['encv']);}encBoxes.forEach(enc=>{const encBoxChildren=isAudio?enc.subarray(28):enc.subarray(78);const sinfBoxes=findBox(encBoxChildren,['sinf']);sinfBoxes.forEach(sinf=>{const tenc=parseSinf(sinf);if(tenc){// Look for default key id (keyID offset is always 8 within the tenc box):
const tencKeyId=tenc.subarray(8,24);if(!tencKeyId.some(b=>b!==0)){logger.log(`[eme] Patching keyId in 'enc${isAudio?'a':'v'}>sinf>>tenc' box: ${Hex.hexDump(tencKeyId)} -> ${Hex.hexDump(keyId)}`);tenc.set(keyId,8);}}});});});}return initSegment;}function parseSinf(sinf){const schm=findBox(sinf,['schm'])[0];if(schm){const scheme=bin2str(schm.subarray(4,8));if(scheme==='cbcs'||scheme==='cenc'){return findBox(sinf,['schi','tenc'])[0];}}logger.error(`[eme] missing 'schm' box`);return null;}/**
 * Determine the base media decode start time, in seconds, for an MP4
 * fragment. If multiple fragments are specified, the earliest time is
 * returned.
 *
 * The base media decode time can be parsed from track fragment
 * metadata:
 * ```
 * moof > traf > tfdt.baseMediaDecodeTime
 * ```
 * It requires the timescale value from the mdhd to interpret.
 *
 * @param initData - a hash of track type to timescale values
 * @param fmp4 - the bytes of the mp4 fragment
 * @returns the earliest base media decode start time for the
 * fragment, in seconds
 */function getStartDTS(initData,fmp4){// we need info from two children of each track fragment box
return findBox(fmp4,['moof','traf']).reduce((result,traf)=>{const tfdt=findBox(traf,['tfdt'])[0];const version=tfdt[0];const start=findBox(traf,['tfhd']).reduce((result,tfhd)=>{// get the track id from the tfhd
const id=readUint32(tfhd,4);const track=initData[id];if(track){let baseTime=readUint32(tfdt,4);if(version===1){// If value is too large, assume signed 64-bit. Negative track fragment decode times are invalid, but they exist in the wild.
// This prevents large values from being used for initPTS, which can cause playlist sync issues.
// https://github.com/video-dev/hls.js/issues/5303
if(baseTime===UINT32_MAX$1){logger.warn(`[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time`);return result;}baseTime*=UINT32_MAX$1+1;baseTime+=readUint32(tfdt,8);}// assume a 90kHz clock if no timescale was specified
const scale=track.timescale||90e3;// convert base time to seconds
const startTime=baseTime/scale;if(isFiniteNumber(startTime)&&(result===null||startTime<result)){return startTime;}}return result;},null);if(start!==null&&isFiniteNumber(start)&&(result===null||start<result)){return start;}return result;},null);}/*
  For Reference:
  aligned(8) class TrackFragmentHeaderBox
           extends FullBox(‘tfhd’, 0, tf_flags){
     unsigned int(32)  track_ID;
     // all the following are optional fields
     unsigned int(64)  base_data_offset;
     unsigned int(32)  sample_description_index;
     unsigned int(32)  default_sample_duration;
     unsigned int(32)  default_sample_size;
     unsigned int(32)  default_sample_flags
  }
 */function getDuration(data,initData){let rawDuration=0;let videoDuration=0;let audioDuration=0;const trafs=findBox(data,['moof','traf']);for(let i=0;i<trafs.length;i++){const traf=trafs[i];// There is only one tfhd & trun per traf
// This is true for CMAF style content, and we should perhaps check the ftyp
// and only look for a single trun then, but for ISOBMFF we should check
// for multiple track runs.
const tfhd=findBox(traf,['tfhd'])[0];// get the track id from the tfhd
const id=readUint32(tfhd,4);const track=initData[id];if(!track){continue;}const trackDefault=track.default;const tfhdFlags=readUint32(tfhd,0)|(trackDefault==null?void 0:trackDefault.flags);let sampleDuration=trackDefault==null?void 0:trackDefault.duration;if(tfhdFlags&0x000008){// 0x000008 indicates the presence of the default_sample_duration field
if(tfhdFlags&0x000002){// 0x000002 indicates the presence of the sample_description_index field, which precedes default_sample_duration
// If present, the default_sample_duration exists at byte offset 12
sampleDuration=readUint32(tfhd,12);}else {// Otherwise, the duration is at byte offset 8
sampleDuration=readUint32(tfhd,8);}}// assume a 90kHz clock if no timescale was specified
const timescale=track.timescale||90e3;const truns=findBox(traf,['trun']);for(let j=0;j<truns.length;j++){rawDuration=computeRawDurationFromSamples(truns[j]);if(!rawDuration&&sampleDuration){const sampleCount=readUint32(truns[j],4);rawDuration=sampleDuration*sampleCount;}if(track.type===ElementaryStreamTypes.VIDEO){videoDuration+=rawDuration/timescale;}else if(track.type===ElementaryStreamTypes.AUDIO){audioDuration+=rawDuration/timescale;}}}if(videoDuration===0&&audioDuration===0){// If duration samples are not available in the traf use sidx subsegment_duration
let sidxMinStart=Infinity;let sidxMaxEnd=0;let sidxDuration=0;const sidxs=findBox(data,['sidx']);for(let i=0;i<sidxs.length;i++){const sidx=parseSegmentIndex(sidxs[i]);if(sidx!=null&&sidx.references){sidxMinStart=Math.min(sidxMinStart,sidx.earliestPresentationTime/sidx.timescale);const subSegmentDuration=sidx.references.reduce((dur,ref)=>dur+ref.info.duration||0,0);sidxMaxEnd=Math.max(sidxMaxEnd,subSegmentDuration+sidx.earliestPresentationTime/sidx.timescale);sidxDuration=sidxMaxEnd-sidxMinStart;}}if(sidxDuration&&isFiniteNumber(sidxDuration)){return sidxDuration;}}if(videoDuration){return videoDuration;}return audioDuration;}/*
  For Reference:
  aligned(8) class TrackRunBox
           extends FullBox(‘trun’, version, tr_flags) {
     unsigned int(32)  sample_count;
     // the following are optional fields
     signed int(32) data_offset;
     unsigned int(32)  first_sample_flags;
     // all fields in the following array are optional
     {
        unsigned int(32)  sample_duration;
        unsigned int(32)  sample_size;
        unsigned int(32)  sample_flags
        if (version == 0)
           { unsigned int(32)
        else
           { signed int(32)
     }[ sample_count ]
  }
 */function computeRawDurationFromSamples(trun){const flags=readUint32(trun,0);// Flags are at offset 0, non-optional sample_count is at offset 4. Therefore we start 8 bytes in.
// Each field is an int32, which is 4 bytes
let offset=8;// data-offset-present flag
if(flags&0x000001){offset+=4;}// first-sample-flags-present flag
if(flags&0x000004){offset+=4;}let duration=0;const sampleCount=readUint32(trun,4);for(let i=0;i<sampleCount;i++){// sample-duration-present flag
if(flags&0x000100){const sampleDuration=readUint32(trun,offset);duration+=sampleDuration;offset+=4;}// sample-size-present flag
if(flags&0x000200){offset+=4;}// sample-flags-present flag
if(flags&0x000400){offset+=4;}// sample-composition-time-offsets-present flag
if(flags&0x000800){offset+=4;}}return duration;}function offsetStartDTS(initData,fmp4,timeOffset){findBox(fmp4,['moof','traf']).forEach(traf=>{findBox(traf,['tfhd']).forEach(tfhd=>{// get the track id from the tfhd
const id=readUint32(tfhd,4);const track=initData[id];if(!track){return;}// assume a 90kHz clock if no timescale was specified
const timescale=track.timescale||90e3;// get the base media decode time from the tfdt
findBox(traf,['tfdt']).forEach(tfdt=>{const version=tfdt[0];const offset=timeOffset*timescale;if(offset){let baseMediaDecodeTime=readUint32(tfdt,4);if(version===0){baseMediaDecodeTime-=offset;baseMediaDecodeTime=Math.max(baseMediaDecodeTime,0);writeUint32(tfdt,4,baseMediaDecodeTime);}else {baseMediaDecodeTime*=Math.pow(2,32);baseMediaDecodeTime+=readUint32(tfdt,8);baseMediaDecodeTime-=offset;baseMediaDecodeTime=Math.max(baseMediaDecodeTime,0);const upper=Math.floor(baseMediaDecodeTime/(UINT32_MAX$1+1));const lower=Math.floor(baseMediaDecodeTime%(UINT32_MAX$1+1));writeUint32(tfdt,4,upper);writeUint32(tfdt,8,lower);}}});});});}// TODO: Check if the last moof+mdat pair is part of the valid range
function segmentValidRange(data){const segmentedRange={valid:null,remainder:null};const moofs=findBox(data,['moof']);if(moofs.length<2){segmentedRange.remainder=data;return segmentedRange;}const last=moofs[moofs.length-1];// Offset by 8 bytes; findBox offsets the start by as much
segmentedRange.valid=sliceUint8(data,0,last.byteOffset-8);segmentedRange.remainder=sliceUint8(data,last.byteOffset-8);return segmentedRange;}function appendUint8Array(data1,data2){const temp=new Uint8Array(data1.length+data2.length);temp.set(data1);temp.set(data2,data1.length);return temp;}function parseSamples(timeOffset,track){const seiSamples=[];const videoData=track.samples;const timescale=track.timescale;const trackId=track.id;let isHEVCFlavor=false;const moofs=findBox(videoData,['moof']);moofs.map(moof=>{const moofOffset=moof.byteOffset-8;const trafs=findBox(moof,['traf']);trafs.map(traf=>{// get the base media decode time from the tfdt
const baseTime=findBox(traf,['tfdt']).map(tfdt=>{const version=tfdt[0];let result=readUint32(tfdt,4);if(version===1){result*=Math.pow(2,32);result+=readUint32(tfdt,8);}return result/timescale;})[0];if(baseTime!==undefined){timeOffset=baseTime;}return findBox(traf,['tfhd']).map(tfhd=>{const id=readUint32(tfhd,4);const tfhdFlags=readUint32(tfhd,0)&0xffffff;const baseDataOffsetPresent=(tfhdFlags&0x000001)!==0;const sampleDescriptionIndexPresent=(tfhdFlags&0x000002)!==0;const defaultSampleDurationPresent=(tfhdFlags&0x000008)!==0;let defaultSampleDuration=0;const defaultSampleSizePresent=(tfhdFlags&0x000010)!==0;let defaultSampleSize=0;const defaultSampleFlagsPresent=(tfhdFlags&0x000020)!==0;let tfhdOffset=8;if(id===trackId){if(baseDataOffsetPresent){tfhdOffset+=8;}if(sampleDescriptionIndexPresent){tfhdOffset+=4;}if(defaultSampleDurationPresent){defaultSampleDuration=readUint32(tfhd,tfhdOffset);tfhdOffset+=4;}if(defaultSampleSizePresent){defaultSampleSize=readUint32(tfhd,tfhdOffset);tfhdOffset+=4;}if(defaultSampleFlagsPresent){tfhdOffset+=4;}if(track.type==='video'){isHEVCFlavor=isHEVC(track.codec);}findBox(traf,['trun']).map(trun=>{const version=trun[0];const flags=readUint32(trun,0)&0xffffff;const dataOffsetPresent=(flags&0x000001)!==0;let dataOffset=0;const firstSampleFlagsPresent=(flags&0x000004)!==0;const sampleDurationPresent=(flags&0x000100)!==0;let sampleDuration=0;const sampleSizePresent=(flags&0x000200)!==0;let sampleSize=0;const sampleFlagsPresent=(flags&0x000400)!==0;const sampleCompositionOffsetsPresent=(flags&0x000800)!==0;let compositionOffset=0;const sampleCount=readUint32(trun,4);let trunOffset=8;// past version, flags, and sample count
if(dataOffsetPresent){dataOffset=readUint32(trun,trunOffset);trunOffset+=4;}if(firstSampleFlagsPresent){trunOffset+=4;}let sampleOffset=dataOffset+moofOffset;for(let ix=0;ix<sampleCount;ix++){if(sampleDurationPresent){sampleDuration=readUint32(trun,trunOffset);trunOffset+=4;}else {sampleDuration=defaultSampleDuration;}if(sampleSizePresent){sampleSize=readUint32(trun,trunOffset);trunOffset+=4;}else {sampleSize=defaultSampleSize;}if(sampleFlagsPresent){trunOffset+=4;}if(sampleCompositionOffsetsPresent){if(version===0){compositionOffset=readUint32(trun,trunOffset);}else {compositionOffset=readSint32(trun,trunOffset);}trunOffset+=4;}if(track.type===ElementaryStreamTypes.VIDEO){let naluTotalSize=0;while(naluTotalSize<sampleSize){const naluSize=readUint32(videoData,sampleOffset);sampleOffset+=4;if(isSEIMessage(isHEVCFlavor,videoData[sampleOffset])){const data=videoData.subarray(sampleOffset,sampleOffset+naluSize);parseSEIMessageFromNALu(data,isHEVCFlavor?2:1,timeOffset+compositionOffset/timescale,seiSamples);}sampleOffset+=naluSize;naluTotalSize+=naluSize+4;}}timeOffset+=sampleDuration/timescale;}});}});});});return seiSamples;}function isHEVC(codec){if(!codec){return false;}const delimit=codec.indexOf('.');const baseCodec=delimit<0?codec:codec.substring(0,delimit);return baseCodec==='hvc1'||baseCodec==='hev1'||// Dolby Vision
baseCodec==='dvh1'||baseCodec==='dvhe';}function isSEIMessage(isHEVCFlavor,naluHeader){if(isHEVCFlavor){const naluType=naluHeader>>1&0x3f;return naluType===39||naluType===40;}else {const naluType=naluHeader&0x1f;return naluType===6;}}function parseSEIMessageFromNALu(unescapedData,headerSize,pts,samples){const data=discardEPB(unescapedData);let seiPtr=0;// skip nal header
seiPtr+=headerSize;let payloadType=0;let payloadSize=0;let b=0;while(seiPtr<data.length){payloadType=0;do{if(seiPtr>=data.length){break;}b=data[seiPtr++];payloadType+=b;}while(b===0xff);// Parse payload size.
payloadSize=0;do{if(seiPtr>=data.length){break;}b=data[seiPtr++];payloadSize+=b;}while(b===0xff);const leftOver=data.length-seiPtr;// Create a variable to process the payload
let payPtr=seiPtr;// Increment the seiPtr to the end of the payload
if(payloadSize<leftOver){seiPtr+=payloadSize;}else if(payloadSize>leftOver){// Some type of corruption has happened?
logger.error(`Malformed SEI payload. ${payloadSize} is too small, only ${leftOver} bytes left to parse.`);// We might be able to parse some data, but let's be safe and ignore it.
break;}if(payloadType===4){const countryCode=data[payPtr++];if(countryCode===181){const providerCode=readUint16(data,payPtr);payPtr+=2;if(providerCode===49){const userStructure=readUint32(data,payPtr);payPtr+=4;if(userStructure===0x47413934){const userDataType=data[payPtr++];// Raw CEA-608 bytes wrapped in CEA-708 packet
if(userDataType===3){const firstByte=data[payPtr++];const totalCCs=0x1f&firstByte;const enabled=0x40&firstByte;const totalBytes=enabled?2+totalCCs*3:0;const byteArray=new Uint8Array(totalBytes);if(enabled){byteArray[0]=firstByte;for(let i=1;i<totalBytes;i++){byteArray[i]=data[payPtr++];}}samples.push({type:userDataType,payloadType,pts,bytes:byteArray});}}}}}else if(payloadType===5){if(payloadSize>16){const uuidStrArray=[];for(let i=0;i<16;i++){const _b=data[payPtr++].toString(16);uuidStrArray.push(_b.length==1?'0'+_b:_b);if(i===3||i===5||i===7||i===9){uuidStrArray.push('-');}}const length=payloadSize-16;const userDataBytes=new Uint8Array(length);for(let i=0;i<length;i++){userDataBytes[i]=data[payPtr++];}samples.push({payloadType,pts,uuid:uuidStrArray.join(''),userData:utf8ArrayToStr(userDataBytes),userDataBytes});}}}}/**
 * remove Emulation Prevention bytes from a RBSP
 */function discardEPB(data){const length=data.byteLength;const EPBPositions=[];let i=1;// Find all `Emulation Prevention Bytes`
while(i<length-2){if(data[i]===0&&data[i+1]===0&&data[i+2]===0x03){EPBPositions.push(i+2);i+=2;}else {i++;}}// If no Emulation Prevention Bytes were found just return the original
// array
if(EPBPositions.length===0){return data;}// Create a new array to hold the NAL unit data
const newLength=length-EPBPositions.length;const newData=new Uint8Array(newLength);let sourceIndex=0;for(i=0;i<newLength;sourceIndex++,i++){if(sourceIndex===EPBPositions[0]){// Skip this byte
sourceIndex++;// Remove this position index
EPBPositions.shift();}newData[i]=data[sourceIndex];}return newData;}function parseEmsg(data){const version=data[0];let schemeIdUri='';let value='';let timeScale=0;let presentationTimeDelta=0;let presentationTime=0;let eventDuration=0;let id=0;let offset=0;if(version===0){while(bin2str(data.subarray(offset,offset+1))!=='\0'){schemeIdUri+=bin2str(data.subarray(offset,offset+1));offset+=1;}schemeIdUri+=bin2str(data.subarray(offset,offset+1));offset+=1;while(bin2str(data.subarray(offset,offset+1))!=='\0'){value+=bin2str(data.subarray(offset,offset+1));offset+=1;}value+=bin2str(data.subarray(offset,offset+1));offset+=1;timeScale=readUint32(data,12);presentationTimeDelta=readUint32(data,16);eventDuration=readUint32(data,20);id=readUint32(data,24);offset=28;}else if(version===1){offset+=4;timeScale=readUint32(data,offset);offset+=4;const leftPresentationTime=readUint32(data,offset);offset+=4;const rightPresentationTime=readUint32(data,offset);offset+=4;presentationTime=2**32*leftPresentationTime+rightPresentationTime;if(!isSafeInteger(presentationTime)){presentationTime=Number.MAX_SAFE_INTEGER;logger.warn('Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box');}eventDuration=readUint32(data,offset);offset+=4;id=readUint32(data,offset);offset+=4;while(bin2str(data.subarray(offset,offset+1))!=='\0'){schemeIdUri+=bin2str(data.subarray(offset,offset+1));offset+=1;}schemeIdUri+=bin2str(data.subarray(offset,offset+1));offset+=1;while(bin2str(data.subarray(offset,offset+1))!=='\0'){value+=bin2str(data.subarray(offset,offset+1));offset+=1;}value+=bin2str(data.subarray(offset,offset+1));offset+=1;}const payload=data.subarray(offset,data.byteLength);return {schemeIdUri,value,timeScale,presentationTime,presentationTimeDelta,eventDuration,id,payload};}function mp4Box(type,...payload){const len=payload.length;let size=8;let i=len;while(i--){size+=payload[i].byteLength;}const result=new Uint8Array(size);result[0]=size>>24&0xff;result[1]=size>>16&0xff;result[2]=size>>8&0xff;result[3]=size&0xff;result.set(type,4);for(i=0,size=8;i<len;i++){result.set(payload[i],size);size+=payload[i].byteLength;}return result;}function mp4pssh(systemId,keyids,data){if(systemId.byteLength!==16){throw new RangeError('Invalid system id');}let version;let kids;if(keyids){version=1;kids=new Uint8Array(keyids.length*16);for(let ix=0;ix<keyids.length;ix++){const k=keyids[ix];// uint8array
if(k.byteLength!==16){throw new RangeError('Invalid key');}kids.set(k,ix*16);}}else {version=0;kids=new Uint8Array();}let kidCount;if(version>0){kidCount=new Uint8Array(4);if(keyids.length>0){new DataView(kidCount.buffer).setUint32(0,keyids.length,false);}}else {kidCount=new Uint8Array();}const dataSize=new Uint8Array(4);if(data&&data.byteLength>0){new DataView(dataSize.buffer).setUint32(0,data.byteLength,false);}return mp4Box([112,115,115,104],new Uint8Array([version,0x00,0x00,0x00// Flags
]),systemId,// 16 bytes
kidCount,kids,dataSize,data||new Uint8Array());}function parsePssh(initData){if(!(initData instanceof ArrayBuffer)||initData.byteLength<32){return null;}const result={version:0,systemId:'',kids:null,data:null};const view=new DataView(initData);const boxSize=view.getUint32(0);if(initData.byteLength!==boxSize&&boxSize>44){return null;}const type=view.getUint32(4);if(type!==0x70737368){return null;}result.version=view.getUint32(8)>>>24;if(result.version>1){return null;}result.systemId=Hex.hexDump(new Uint8Array(initData,12,16));const dataSizeOrKidCount=view.getUint32(28);if(result.version===0){if(boxSize-32<dataSizeOrKidCount){return null;}result.data=new Uint8Array(initData,32,dataSizeOrKidCount);}else if(result.version===1){result.kids=[];for(let i=0;i<dataSizeOrKidCount;i++){result.kids.push(new Uint8Array(initData,32+i*16,16));}}return result;}let keyUriToKeyIdMap={};class LevelKey{static clearKeyUriToKeyIdMap(){keyUriToKeyIdMap={};}constructor(method,uri,format,formatversions=[1],iv=null){this.uri=void 0;this.method=void 0;this.keyFormat=void 0;this.keyFormatVersions=void 0;this.encrypted=void 0;this.isCommonEncryption=void 0;this.iv=null;this.key=null;this.keyId=null;this.pssh=null;this.method=method;this.uri=uri;this.keyFormat=format;this.keyFormatVersions=formatversions;this.iv=iv;this.encrypted=method?method!=='NONE':false;this.isCommonEncryption=this.encrypted&&method!=='AES-128';}isSupported(){// If it's Segment encryption or No encryption, just select that key system
if(this.method){if(this.method==='AES-128'||this.method==='NONE'){return true;}if(this.keyFormat==='identity'){// Maintain support for clear SAMPLE-AES with MPEG-3 TS
return this.method==='SAMPLE-AES';}else {switch(this.keyFormat){case KeySystemFormats.FAIRPLAY:case KeySystemFormats.WIDEVINE:case KeySystemFormats.PLAYREADY:case KeySystemFormats.CLEARKEY:return ['ISO-23001-7','SAMPLE-AES','SAMPLE-AES-CENC','SAMPLE-AES-CTR'].indexOf(this.method)!==-1;}}}return false;}getDecryptData(sn){if(!this.encrypted||!this.uri){return null;}if(this.method==='AES-128'&&this.uri&&!this.iv){if(typeof sn!=='number'){// We are fetching decryption data for a initialization segment
// If the segment was encrypted with AES-128
// It must have an IV defined. We cannot substitute the Segment Number in.
if(this.method==='AES-128'&&!this.iv){logger.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`);}// Explicitly set sn to resulting value from implicit conversions 'initSegment' values for IV generation.
sn=0;}const iv=createInitializationVector(sn);const decryptdata=new LevelKey(this.method,this.uri,'identity',this.keyFormatVersions,iv);return decryptdata;}// Initialize keyId if possible
const keyBytes=convertDataUriToArrayBytes(this.uri);if(keyBytes){switch(this.keyFormat){case KeySystemFormats.WIDEVINE:this.pssh=keyBytes;// In case of widevine keyID is embedded in PSSH box. Read Key ID.
if(keyBytes.length>=22){this.keyId=keyBytes.subarray(keyBytes.length-22,keyBytes.length-6);}break;case KeySystemFormats.PLAYREADY:{const PlayReadyKeySystemUUID=new Uint8Array([0x9a,0x04,0xf0,0x79,0x98,0x40,0x42,0x86,0xab,0x92,0xe6,0x5b,0xe0,0x88,0x5f,0x95]);this.pssh=mp4pssh(PlayReadyKeySystemUUID,null,keyBytes);const keyBytesUtf16=new Uint16Array(keyBytes.buffer,keyBytes.byteOffset,keyBytes.byteLength/2);const keyByteStr=String.fromCharCode.apply(null,Array.from(keyBytesUtf16));// Parse Playready WRMHeader XML
const xmlKeyBytes=keyByteStr.substring(keyByteStr.indexOf('<'),keyByteStr.length);const parser=new DOMParser();const xmlDoc=parser.parseFromString(xmlKeyBytes,'text/xml');const keyData=xmlDoc.getElementsByTagName('KID')[0];if(keyData){const keyId=keyData.childNodes[0]?keyData.childNodes[0].nodeValue:keyData.getAttribute('VALUE');if(keyId){const keyIdArray=base64Decode(keyId).subarray(0,16);// KID value in PRO is a base64-encoded little endian GUID interpretation of UUID
// KID value in ‘tenc’ is a big endian UUID GUID interpretation of UUID
changeEndianness(keyIdArray);this.keyId=keyIdArray;}}break;}default:{let keydata=keyBytes.subarray(0,16);if(keydata.length!==16){const padded=new Uint8Array(16);padded.set(keydata,16-keydata.length);keydata=padded;}this.keyId=keydata;break;}}}// Default behavior: assign a new keyId for each uri
if(!this.keyId||this.keyId.byteLength!==16){let keyId=keyUriToKeyIdMap[this.uri];if(!keyId){const val=Object.keys(keyUriToKeyIdMap).length%Number.MAX_SAFE_INTEGER;keyId=new Uint8Array(16);const dv=new DataView(keyId.buffer,12,4);// Just set the last 4 bytes
dv.setUint32(0,val);keyUriToKeyIdMap[this.uri]=keyId;}this.keyId=keyId;}return this;}}function createInitializationVector(segmentNumber){const uint8View=new Uint8Array(16);for(let i=12;i<16;i++){uint8View[i]=segmentNumber>>8*(15-i)&0xff;}return uint8View;}const VARIABLE_REPLACEMENT_REGEX=/\{\$([a-zA-Z0-9-_]+)\}/g;function hasVariableReferences(str){return VARIABLE_REPLACEMENT_REGEX.test(str);}function substituteVariablesInAttributes(parsed,attr,attributeNames){if(parsed.variableList!==null||parsed.hasVariableRefs){for(let i=attributeNames.length;i--;){const name=attributeNames[i];const value=attr[name];if(value){attr[name]=substituteVariables(parsed,value);}}}}function substituteVariables(parsed,value){if(parsed.variableList!==null||parsed.hasVariableRefs){const variableList=parsed.variableList;return value.replace(VARIABLE_REPLACEMENT_REGEX,variableReference=>{const variableName=variableReference.substring(2,variableReference.length-1);const variableValue=variableList==null?void 0:variableList[variableName];if(variableValue===undefined){parsed.playlistParsingError||(parsed.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${variableName}"`));return variableReference;}return variableValue;});}return value;}function addVariableDefinition(parsed,attr,parentUrl){let variableList=parsed.variableList;if(!variableList){parsed.variableList=variableList={};}let NAME;let VALUE;if('QUERYPARAM'in attr){NAME=attr.QUERYPARAM;try{const searchParams=new self.URL(parentUrl).searchParams;if(searchParams.has(NAME)){VALUE=searchParams.get(NAME);}else {throw new Error(`"${NAME}" does not match any query parameter in URI: "${parentUrl}"`);}}catch(error){parsed.playlistParsingError||(parsed.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${error.message}`));}}else {NAME=attr.NAME;VALUE=attr.VALUE;}if(NAME in variableList){parsed.playlistParsingError||(parsed.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${NAME}"`));}else {variableList[NAME]=VALUE||'';}}function importVariableDefinition(parsed,attr,sourceVariableList){const IMPORT=attr.IMPORT;if(sourceVariableList&&IMPORT in sourceVariableList){let variableList=parsed.variableList;if(!variableList){parsed.variableList=variableList={};}variableList[IMPORT]=sourceVariableList[IMPORT];}else {parsed.playlistParsingError||(parsed.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${IMPORT}"`));}}/**
 * MediaSource helper
 */function getMediaSource(preferManagedMediaSource=true){if(typeof self==='undefined')return undefined;const mms=(preferManagedMediaSource||!self.MediaSource)&&self.ManagedMediaSource;return mms||self.MediaSource||self.WebKitMediaSource;}function isManagedMediaSource(source){return typeof self!=='undefined'&&source===self.ManagedMediaSource;}// from http://mp4ra.org/codecs.html
// values indicate codec selection preference (lower is higher priority)
const sampleEntryCodesISO={audio:{a3ds:1,'ac-3':0.95,'ac-4':1,alac:0.9,alaw:1,dra1:1,'dts+':1,'dts-':1,dtsc:1,dtse:1,dtsh:1,'ec-3':0.9,enca:1,fLaC:0.9,// MP4-RA listed codec entry for FLAC
flac:0.9,// legacy browser codec name for FLAC
FLAC:0.9,// some manifests may list "FLAC" with Apple's tools
g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,'raw ':1,Opus:1,opus:1,// browsers expect this to be lowercase despite MP4RA says 'Opus'
samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:0.8,drac:1,dva1:1,dvav:1,dvh1:0.7,dvhe:0.7,encv:1,hev1:0.75,hvc1:0.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,'vc-1':1,vp08:1,vp09:0.9},text:{stpp:1,wvtt:1}};function isCodecType(codec,type){const typeCodes=sampleEntryCodesISO[type];return !!typeCodes&&!!typeCodes[codec.slice(0,4)];}function areCodecsMediaSourceSupported(codecs,type,preferManagedMediaSource=true){return !codecs.split(',').some(codec=>!isCodecMediaSourceSupported(codec,type,preferManagedMediaSource));}function isCodecMediaSourceSupported(codec,type,preferManagedMediaSource=true){var _MediaSource$isTypeSu;const MediaSource=getMediaSource(preferManagedMediaSource);return (_MediaSource$isTypeSu=MediaSource==null?void 0:MediaSource.isTypeSupported(mimeTypeForCodec(codec,type)))!=null?_MediaSource$isTypeSu:false;}function mimeTypeForCodec(codec,type){return `${type}/mp4;codecs="${codec}"`;}function videoCodecPreferenceValue(videoCodec){if(videoCodec){const fourCC=videoCodec.substring(0,4);return sampleEntryCodesISO.video[fourCC];}return 2;}function codecsSetSelectionPreferenceValue(codecSet){return codecSet.split(',').reduce((num,fourCC)=>{const preferenceValue=sampleEntryCodesISO.video[fourCC];if(preferenceValue){return (preferenceValue*2+num)/(num?3:2);}return (sampleEntryCodesISO.audio[fourCC]+num)/(num?2:1);},0);}const CODEC_COMPATIBLE_NAMES={};function getCodecCompatibleNameLower(lowerCaseCodec,preferManagedMediaSource=true){if(CODEC_COMPATIBLE_NAMES[lowerCaseCodec]){return CODEC_COMPATIBLE_NAMES[lowerCaseCodec];}// Idealy fLaC and Opus would be first (spec-compliant) but
// some browsers will report that fLaC is supported then fail.
// see: https://bugs.chromium.org/p/chromium/issues/detail?id=1422728
const codecsToCheck={flac:['flac','fLaC','FLAC'],opus:['opus','Opus']}[lowerCaseCodec];for(let i=0;i<codecsToCheck.length;i++){if(isCodecMediaSourceSupported(codecsToCheck[i],'audio',preferManagedMediaSource)){CODEC_COMPATIBLE_NAMES[lowerCaseCodec]=codecsToCheck[i];return codecsToCheck[i];}}return lowerCaseCodec;}const AUDIO_CODEC_REGEXP=/flac|opus/i;function getCodecCompatibleName(codec,preferManagedMediaSource=true){return codec.replace(AUDIO_CODEC_REGEXP,m=>getCodecCompatibleNameLower(m.toLowerCase(),preferManagedMediaSource));}function pickMostCompleteCodecName(parsedCodec,levelCodec){// Parsing of mp4a codecs strings in mp4-tools from media is incomplete as of d8c6c7a
// so use level codec is parsed codec is unavailable or incomplete
if(parsedCodec&&parsedCodec!=='mp4a'){return parsedCodec;}return levelCodec?levelCodec.split(',')[0]:levelCodec;}function convertAVC1ToAVCOTI(codec){// Convert avc1 codec string from RFC-4281 to RFC-6381 for MediaSource.isTypeSupported
const avcdata=codec.split('.');if(avcdata.length>2){let result=avcdata.shift()+'.';result+=parseInt(avcdata.shift()).toString(16);result+=('000'+parseInt(avcdata.shift()).toString(16)).slice(-4);return result;}return codec;}const MASTER_PLAYLIST_REGEX=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g;const MASTER_PLAYLIST_MEDIA_REGEX=/#EXT-X-MEDIA:(.*)/g;const IS_MEDIA_PLAYLIST=/^#EXT(?:INF|-X-TARGETDURATION):/m;// Handle empty Media Playlist (first EXTINF not signaled, but TARGETDURATION present)
const LEVEL_PLAYLIST_REGEX_FAST=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,// duration (#EXTINF:<duration>,<title>), group 1 => duration, group 2 => title
/(?!#) *(\S[^\r\n]*)/.source,// segment URI, group 3 => the URI (note newline is not eaten)
/#EXT-X-BYTERANGE:*(.+)/.source,// next segment's byterange, group 4 => range spec (x@y)
/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,// next segment's program date/time group 5 => the datetime spec
/#.*/.source// All other non-segment oriented tags will match with all groups empty
].join('|'),'g');const LEVEL_PLAYLIST_REGEX_SLOW=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join('|'));class M3U8Parser{static findGroup(groups,mediaGroupId){for(let i=0;i<groups.length;i++){const group=groups[i];if(group.id===mediaGroupId){return group;}}}static resolve(url,baseUrl){return urlToolkitExports.buildAbsoluteURL(baseUrl,url,{alwaysNormalize:true});}static isMediaPlaylist(str){return IS_MEDIA_PLAYLIST.test(str);}static parseMasterPlaylist(string,baseurl){const hasVariableRefs=hasVariableReferences(string);const parsed={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs};const levelsWithKnownCodecs=[];MASTER_PLAYLIST_REGEX.lastIndex=0;let result;while((result=MASTER_PLAYLIST_REGEX.exec(string))!=null){if(result[1]){var _level$unknownCodecs;// '#EXT-X-STREAM-INF' is found, parse level tag  in group 1
const attrs=new AttrList(result[1]);{substituteVariablesInAttributes(parsed,attrs,['CODECS','SUPPLEMENTAL-CODECS','ALLOWED-CPC','PATHWAY-ID','STABLE-VARIANT-ID','AUDIO','VIDEO','SUBTITLES','CLOSED-CAPTIONS','NAME']);}const uri=substituteVariables(parsed,result[2]);const level={attrs,bitrate:attrs.decimalInteger('BANDWIDTH')||attrs.decimalInteger('AVERAGE-BANDWIDTH'),name:attrs.NAME,url:M3U8Parser.resolve(uri,baseurl)};const resolution=attrs.decimalResolution('RESOLUTION');if(resolution){level.width=resolution.width;level.height=resolution.height;}setCodecs(attrs.CODECS,level);if(!((_level$unknownCodecs=level.unknownCodecs)!=null&&_level$unknownCodecs.length)){levelsWithKnownCodecs.push(level);}parsed.levels.push(level);}else if(result[3]){const tag=result[3];const attributes=result[4];switch(tag){case'SESSION-DATA':{// #EXT-X-SESSION-DATA
const sessionAttrs=new AttrList(attributes);{substituteVariablesInAttributes(parsed,sessionAttrs,['DATA-ID','LANGUAGE','VALUE','URI']);}const dataId=sessionAttrs['DATA-ID'];if(dataId){if(parsed.sessionData===null){parsed.sessionData={};}parsed.sessionData[dataId]=sessionAttrs;}break;}case'SESSION-KEY':{// #EXT-X-SESSION-KEY
const sessionKey=parseKey(attributes,baseurl,parsed);if(sessionKey.encrypted&&sessionKey.isSupported()){if(parsed.sessionKeys===null){parsed.sessionKeys=[];}parsed.sessionKeys.push(sessionKey);}else {logger.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${attributes}"`);}break;}case'DEFINE':{// #EXT-X-DEFINE
{const variableAttributes=new AttrList(attributes);substituteVariablesInAttributes(parsed,variableAttributes,['NAME','VALUE','QUERYPARAM']);addVariableDefinition(parsed,variableAttributes,baseurl);}break;}case'CONTENT-STEERING':{// #EXT-X-CONTENT-STEERING
const contentSteeringAttributes=new AttrList(attributes);{substituteVariablesInAttributes(parsed,contentSteeringAttributes,['SERVER-URI','PATHWAY-ID']);}parsed.contentSteering={uri:M3U8Parser.resolve(contentSteeringAttributes['SERVER-URI'],baseurl),pathwayId:contentSteeringAttributes['PATHWAY-ID']||'.'};break;}case'START':{// #EXT-X-START
parsed.startTimeOffset=parseStartTimeOffset(attributes);break;}}}}// Filter out levels with unknown codecs if it does not remove all levels
const stripUnknownCodecLevels=levelsWithKnownCodecs.length>0&&levelsWithKnownCodecs.length<parsed.levels.length;parsed.levels=stripUnknownCodecLevels?levelsWithKnownCodecs:parsed.levels;if(parsed.levels.length===0){parsed.playlistParsingError=new Error('no levels found in manifest');}return parsed;}static parseMasterPlaylistMedia(string,baseurl,parsed){let result;const results={};const levels=parsed.levels;const groupsByType={AUDIO:levels.map(level=>({id:level.attrs.AUDIO,audioCodec:level.audioCodec})),SUBTITLES:levels.map(level=>({id:level.attrs.SUBTITLES,textCodec:level.textCodec})),'CLOSED-CAPTIONS':[]};let id=0;MASTER_PLAYLIST_MEDIA_REGEX.lastIndex=0;while((result=MASTER_PLAYLIST_MEDIA_REGEX.exec(string))!==null){const attrs=new AttrList(result[1]);const type=attrs.TYPE;if(type){const groups=groupsByType[type];const medias=results[type]||[];results[type]=medias;{substituteVariablesInAttributes(parsed,attrs,['URI','GROUP-ID','LANGUAGE','ASSOC-LANGUAGE','STABLE-RENDITION-ID','NAME','INSTREAM-ID','CHARACTERISTICS','CHANNELS']);}const lang=attrs.LANGUAGE;const assocLang=attrs['ASSOC-LANGUAGE'];const channels=attrs.CHANNELS;const characteristics=attrs.CHARACTERISTICS;const instreamId=attrs['INSTREAM-ID'];const media={attrs,bitrate:0,id:id++,groupId:attrs['GROUP-ID']||'',name:attrs.NAME||lang||'',type,default:attrs.bool('DEFAULT'),autoselect:attrs.bool('AUTOSELECT'),forced:attrs.bool('FORCED'),lang,url:attrs.URI?M3U8Parser.resolve(attrs.URI,baseurl):''};if(assocLang){media.assocLang=assocLang;}if(channels){media.channels=channels;}if(characteristics){media.characteristics=characteristics;}if(instreamId){media.instreamId=instreamId;}if(groups!=null&&groups.length){// If there are audio or text groups signalled in the manifest, let's look for a matching codec string for this track
// If we don't find the track signalled, lets use the first audio groups codec we have
// Acting as a best guess
const groupCodec=M3U8Parser.findGroup(groups,media.groupId)||groups[0];assignCodec(media,groupCodec,'audioCodec');assignCodec(media,groupCodec,'textCodec');}medias.push(media);}}return results;}static parseLevelPlaylist(string,baseurl,id,type,levelUrlId,multivariantVariableList){const level=new LevelDetails(baseurl);const fragments=level.fragments;// The most recent init segment seen (applies to all subsequent segments)
let currentInitSegment=null;let currentSN=0;let currentPart=0;let totalduration=0;let discontinuityCounter=0;let prevFrag=null;let frag=new Fragment(type,baseurl);let result;let i;let levelkeys;let firstPdtIndex=-1;let createNextFrag=false;let nextByteRange=null;LEVEL_PLAYLIST_REGEX_FAST.lastIndex=0;level.m3u8=string;level.hasVariableRefs=hasVariableReferences(string);while((result=LEVEL_PLAYLIST_REGEX_FAST.exec(string))!==null){if(createNextFrag){createNextFrag=false;frag=new Fragment(type,baseurl);// setup the next fragment for part loading
frag.start=totalduration;frag.sn=currentSN;frag.cc=discontinuityCounter;frag.level=id;if(currentInitSegment){frag.initSegment=currentInitSegment;frag.rawProgramDateTime=currentInitSegment.rawProgramDateTime;currentInitSegment.rawProgramDateTime=null;if(nextByteRange){frag.setByteRange(nextByteRange);nextByteRange=null;}}}const duration=result[1];if(duration){// INF
frag.duration=parseFloat(duration);// avoid sliced strings    https://github.com/video-dev/hls.js/issues/939
const title=(' '+result[2]).slice(1);frag.title=title||null;frag.tagList.push(title?['INF',duration,title]:['INF',duration]);}else if(result[3]){// url
if(isFiniteNumber(frag.duration)){frag.start=totalduration;if(levelkeys){setFragLevelKeys(frag,levelkeys,level);}frag.sn=currentSN;frag.level=id;frag.cc=discontinuityCounter;fragments.push(frag);// avoid sliced strings    https://github.com/video-dev/hls.js/issues/939
const uri=(' '+result[3]).slice(1);frag.relurl=substituteVariables(level,uri);assignProgramDateTime(frag,prevFrag);prevFrag=frag;totalduration+=frag.duration;currentSN++;currentPart=0;createNextFrag=true;}}else if(result[4]){// X-BYTERANGE
const data=(' '+result[4]).slice(1);if(prevFrag){frag.setByteRange(data,prevFrag);}else {frag.setByteRange(data);}}else if(result[5]){// PROGRAM-DATE-TIME
// avoid sliced strings    https://github.com/video-dev/hls.js/issues/939
frag.rawProgramDateTime=(' '+result[5]).slice(1);frag.tagList.push(['PROGRAM-DATE-TIME',frag.rawProgramDateTime]);if(firstPdtIndex===-1){firstPdtIndex=fragments.length;}}else {result=result[0].match(LEVEL_PLAYLIST_REGEX_SLOW);if(!result){logger.warn('No matches on slow regex match for level playlist!');continue;}for(i=1;i<result.length;i++){if(typeof result[i]!=='undefined'){break;}}// avoid sliced strings    https://github.com/video-dev/hls.js/issues/939
const tag=(' '+result[i]).slice(1);const value1=(' '+result[i+1]).slice(1);const value2=result[i+2]?(' '+result[i+2]).slice(1):'';switch(tag){case'PLAYLIST-TYPE':level.type=value1.toUpperCase();break;case'MEDIA-SEQUENCE':currentSN=level.startSN=parseInt(value1);break;case'SKIP':{const skipAttrs=new AttrList(value1);{substituteVariablesInAttributes(level,skipAttrs,['RECENTLY-REMOVED-DATERANGES']);}const skippedSegments=skipAttrs.decimalInteger('SKIPPED-SEGMENTS');if(isFiniteNumber(skippedSegments)){level.skippedSegments=skippedSegments;// This will result in fragments[] containing undefined values, which we will fill in with `mergeDetails`
for(let _i=skippedSegments;_i--;){fragments.unshift(null);}currentSN+=skippedSegments;}const recentlyRemovedDateranges=skipAttrs.enumeratedString('RECENTLY-REMOVED-DATERANGES');if(recentlyRemovedDateranges){level.recentlyRemovedDateranges=recentlyRemovedDateranges.split('\t');}break;}case'TARGETDURATION':level.targetduration=Math.max(parseInt(value1),1);break;case'VERSION':level.version=parseInt(value1);break;case'INDEPENDENT-SEGMENTS':case'EXTM3U':break;case'ENDLIST':level.live=false;break;case'#':if(value1||value2){frag.tagList.push(value2?[value1,value2]:[value1]);}break;case'DISCONTINUITY':discontinuityCounter++;frag.tagList.push(['DIS']);break;case'GAP':frag.gap=true;frag.tagList.push([tag]);break;case'BITRATE':frag.tagList.push([tag,value1]);break;case'DATERANGE':{const dateRangeAttr=new AttrList(value1);{substituteVariablesInAttributes(level,dateRangeAttr,['ID','CLASS','START-DATE','END-DATE','SCTE35-CMD','SCTE35-OUT','SCTE35-IN']);substituteVariablesInAttributes(level,dateRangeAttr,dateRangeAttr.clientAttrs);}const dateRange=new DateRange(dateRangeAttr,level.dateRanges[dateRangeAttr.ID]);if(dateRange.isValid||level.skippedSegments){level.dateRanges[dateRange.id]=dateRange;}else {logger.warn(`Ignoring invalid DATERANGE tag: "${value1}"`);}// Add to fragment tag list for backwards compatibility (< v1.2.0)
frag.tagList.push(['EXT-X-DATERANGE',value1]);break;}case'DEFINE':{{const variableAttributes=new AttrList(value1);substituteVariablesInAttributes(level,variableAttributes,['NAME','VALUE','IMPORT','QUERYPARAM']);if('IMPORT'in variableAttributes){importVariableDefinition(level,variableAttributes,multivariantVariableList);}else {addVariableDefinition(level,variableAttributes,baseurl);}}break;}case'DISCONTINUITY-SEQUENCE':discontinuityCounter=parseInt(value1);break;case'KEY':{const levelKey=parseKey(value1,baseurl,level);if(levelKey.isSupported()){if(levelKey.method==='NONE'){levelkeys=undefined;break;}if(!levelkeys){levelkeys={};}if(levelkeys[levelKey.keyFormat]){levelkeys=_extends({},levelkeys);}levelkeys[levelKey.keyFormat]=levelKey;}else {logger.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${value1}"`);}break;}case'START':level.startTimeOffset=parseStartTimeOffset(value1);break;case'MAP':{const mapAttrs=new AttrList(value1);{substituteVariablesInAttributes(level,mapAttrs,['BYTERANGE','URI']);}if(frag.duration){// Initial segment tag is after segment duration tag.
//   #EXTINF: 6.0
//   #EXT-X-MAP:URI="init.mp4
const init=new Fragment(type,baseurl);setInitSegment(init,mapAttrs,id,levelkeys);currentInitSegment=init;frag.initSegment=currentInitSegment;if(currentInitSegment.rawProgramDateTime&&!frag.rawProgramDateTime){frag.rawProgramDateTime=currentInitSegment.rawProgramDateTime;}}else {// Initial segment tag is before segment duration tag
// Handle case where EXT-X-MAP is declared after EXT-X-BYTERANGE
const end=frag.byteRangeEndOffset;if(end){const start=frag.byteRangeStartOffset;nextByteRange=`${end-start}@${start}`;}else {nextByteRange=null;}setInitSegment(frag,mapAttrs,id,levelkeys);currentInitSegment=frag;createNextFrag=true;}break;}case'SERVER-CONTROL':{const serverControlAttrs=new AttrList(value1);level.canBlockReload=serverControlAttrs.bool('CAN-BLOCK-RELOAD');level.canSkipUntil=serverControlAttrs.optionalFloat('CAN-SKIP-UNTIL',0);level.canSkipDateRanges=level.canSkipUntil>0&&serverControlAttrs.bool('CAN-SKIP-DATERANGES');level.partHoldBack=serverControlAttrs.optionalFloat('PART-HOLD-BACK',0);level.holdBack=serverControlAttrs.optionalFloat('HOLD-BACK',0);break;}case'PART-INF':{const partInfAttrs=new AttrList(value1);level.partTarget=partInfAttrs.decimalFloatingPoint('PART-TARGET');break;}case'PART':{let partList=level.partList;if(!partList){partList=level.partList=[];}const previousFragmentPart=currentPart>0?partList[partList.length-1]:undefined;const index=currentPart++;const partAttrs=new AttrList(value1);{substituteVariablesInAttributes(level,partAttrs,['BYTERANGE','URI']);}const part=new Part(partAttrs,frag,baseurl,index,previousFragmentPart);partList.push(part);frag.duration+=part.duration;break;}case'PRELOAD-HINT':{const preloadHintAttrs=new AttrList(value1);{substituteVariablesInAttributes(level,preloadHintAttrs,['URI']);}level.preloadHint=preloadHintAttrs;break;}case'RENDITION-REPORT':{const renditionReportAttrs=new AttrList(value1);{substituteVariablesInAttributes(level,renditionReportAttrs,['URI']);}level.renditionReports=level.renditionReports||[];level.renditionReports.push(renditionReportAttrs);break;}default:logger.warn(`line parsed but not handled: ${result}`);break;}}}if(prevFrag&&!prevFrag.relurl){fragments.pop();totalduration-=prevFrag.duration;if(level.partList){level.fragmentHint=prevFrag;}}else if(level.partList){assignProgramDateTime(frag,prevFrag);frag.cc=discontinuityCounter;level.fragmentHint=frag;if(levelkeys){setFragLevelKeys(frag,levelkeys,level);}}const fragmentLength=fragments.length;const firstFragment=fragments[0];const lastFragment=fragments[fragmentLength-1];totalduration+=level.skippedSegments*level.targetduration;if(totalduration>0&&fragmentLength&&lastFragment){level.averagetargetduration=totalduration/fragmentLength;const lastSn=lastFragment.sn;level.endSN=lastSn!=='initSegment'?lastSn:0;if(!level.live){lastFragment.endList=true;}if(firstFragment){level.startCC=firstFragment.cc;}}else {level.endSN=0;level.startCC=0;}if(level.fragmentHint){totalduration+=level.fragmentHint.duration;}level.totalduration=totalduration;level.endCC=discontinuityCounter;/**
     * Backfill any missing PDT values
     * "If the first EXT-X-PROGRAM-DATE-TIME tag in a Playlist appears after
     * one or more Media Segment URIs, the client SHOULD extrapolate
     * backward from that tag (using EXTINF durations and/or media
     * timestamps) to associate dates with those segments."
     * We have already extrapolated forward, but all fragments up to the first instance of PDT do not have their PDTs
     * computed.
     */if(firstPdtIndex>0){backfillProgramDateTimes(fragments,firstPdtIndex);}return level;}}function parseKey(keyTagAttributes,baseurl,parsed){var _keyAttrs$METHOD,_keyAttrs$KEYFORMAT;// https://tools.ietf.org/html/rfc8216#section-4.3.2.4
const keyAttrs=new AttrList(keyTagAttributes);{substituteVariablesInAttributes(parsed,keyAttrs,['KEYFORMAT','KEYFORMATVERSIONS','URI','IV','URI']);}const decryptmethod=(_keyAttrs$METHOD=keyAttrs.METHOD)!=null?_keyAttrs$METHOD:'';const decrypturi=keyAttrs.URI;const decryptiv=keyAttrs.hexadecimalInteger('IV');const decryptkeyformatversions=keyAttrs.KEYFORMATVERSIONS;// From RFC: This attribute is OPTIONAL; its absence indicates an implicit value of "identity".
const decryptkeyformat=(_keyAttrs$KEYFORMAT=keyAttrs.KEYFORMAT)!=null?_keyAttrs$KEYFORMAT:'identity';if(decrypturi&&keyAttrs.IV&&!decryptiv){logger.error(`Invalid IV: ${keyAttrs.IV}`);}// If decrypturi is a URI with a scheme, then baseurl will be ignored
// No uri is allowed when METHOD is NONE
const resolvedUri=decrypturi?M3U8Parser.resolve(decrypturi,baseurl):'';const keyFormatVersions=(decryptkeyformatversions?decryptkeyformatversions:'1').split('/').map(Number).filter(Number.isFinite);return new LevelKey(decryptmethod,resolvedUri,decryptkeyformat,keyFormatVersions,decryptiv);}function parseStartTimeOffset(startAttributes){const startAttrs=new AttrList(startAttributes);const startTimeOffset=startAttrs.decimalFloatingPoint('TIME-OFFSET');if(isFiniteNumber(startTimeOffset)){return startTimeOffset;}return null;}function setCodecs(codecsAttributeValue,level){let codecs=(codecsAttributeValue||'').split(/[ ,]+/).filter(c=>c);['video','audio','text'].forEach(type=>{const filtered=codecs.filter(codec=>isCodecType(codec,type));if(filtered.length){// Comma separated list of all codecs for type
level[`${type}Codec`]=filtered.join(',');// Remove known codecs so that only unknownCodecs are left after iterating through each type
codecs=codecs.filter(codec=>filtered.indexOf(codec)===-1);}});level.unknownCodecs=codecs;}function assignCodec(media,groupItem,codecProperty){const codecValue=groupItem[codecProperty];if(codecValue){media[codecProperty]=codecValue;}}function backfillProgramDateTimes(fragments,firstPdtIndex){let fragPrev=fragments[firstPdtIndex];for(let i=firstPdtIndex;i--;){const frag=fragments[i];// Exit on delta-playlist skipped segments
if(!frag){return;}frag.programDateTime=fragPrev.programDateTime-frag.duration*1000;fragPrev=frag;}}function assignProgramDateTime(frag,prevFrag){if(frag.rawProgramDateTime){frag.programDateTime=Date.parse(frag.rawProgramDateTime);}else if(prevFrag!=null&&prevFrag.programDateTime){frag.programDateTime=prevFrag.endProgramDateTime;}if(!isFiniteNumber(frag.programDateTime)){frag.programDateTime=null;frag.rawProgramDateTime=null;}}function setInitSegment(frag,mapAttrs,id,levelkeys){frag.relurl=mapAttrs.URI;if(mapAttrs.BYTERANGE){frag.setByteRange(mapAttrs.BYTERANGE);}frag.level=id;frag.sn='initSegment';if(levelkeys){frag.levelkeys=levelkeys;}frag.initSegment=null;}function setFragLevelKeys(frag,levelkeys,level){frag.levelkeys=levelkeys;const{encryptedFragments}=level;if((!encryptedFragments.length||encryptedFragments[encryptedFragments.length-1].levelkeys!==levelkeys)&&Object.keys(levelkeys).some(format=>levelkeys[format].isCommonEncryption)){encryptedFragments.push(frag);}}var PlaylistContextType={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"};var PlaylistLevelType={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function mapContextToLevelType(context){const{type}=context;switch(type){case PlaylistContextType.AUDIO_TRACK:return PlaylistLevelType.AUDIO;case PlaylistContextType.SUBTITLE_TRACK:return PlaylistLevelType.SUBTITLE;default:return PlaylistLevelType.MAIN;}}function getResponseUrl(response,context){let url=response.url;// responseURL not supported on some browsers (it is used to detect URL redirection)
// data-uri mode also not supported (but no need to detect redirection)
if(url===undefined||url.indexOf('data:')===0){// fallback to initial URL
url=context.url;}return url;}class PlaylistLoader{constructor(hls){this.hls=void 0;this.loaders=Object.create(null);this.variableList=null;this.hls=hls;this.registerListeners();}startLoad(startPosition){}stopLoad(){this.destroyInternalLoaders();}registerListeners(){const{hls}=this;hls.on(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.on(Events$1.LEVEL_LOADING,this.onLevelLoading,this);hls.on(Events$1.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this);hls.on(Events$1.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this);}unregisterListeners(){const{hls}=this;hls.off(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.off(Events$1.LEVEL_LOADING,this.onLevelLoading,this);hls.off(Events$1.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this);hls.off(Events$1.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this);}/**
   * Returns defaults or configured loader-type overloads (pLoader and loader config params)
   */createInternalLoader(context){const config=this.hls.config;const PLoader=config.pLoader;const Loader=config.loader;const InternalLoader=PLoader||Loader;const loader=new InternalLoader(config);this.loaders[context.type]=loader;return loader;}getInternalLoader(context){return this.loaders[context.type];}resetInternalLoader(contextType){if(this.loaders[contextType]){delete this.loaders[contextType];}}/**
   * Call `destroy` on all internal loader instances mapped (one per context type)
   */destroyInternalLoaders(){for(const contextType in this.loaders){const loader=this.loaders[contextType];if(loader){loader.destroy();}this.resetInternalLoader(contextType);}}destroy(){this.variableList=null;this.unregisterListeners();this.destroyInternalLoaders();}onManifestLoading(event,data){const{url}=data;this.variableList=null;this.load({id:null,level:0,responseType:'text',type:PlaylistContextType.MANIFEST,url,deliveryDirectives:null});}onLevelLoading(event,data){const{id,level,pathwayId,url,deliveryDirectives}=data;this.load({id,level,pathwayId,responseType:'text',type:PlaylistContextType.LEVEL,url,deliveryDirectives});}onAudioTrackLoading(event,data){const{id,groupId,url,deliveryDirectives}=data;this.load({id,groupId,level:null,responseType:'text',type:PlaylistContextType.AUDIO_TRACK,url,deliveryDirectives});}onSubtitleTrackLoading(event,data){const{id,groupId,url,deliveryDirectives}=data;this.load({id,groupId,level:null,responseType:'text',type:PlaylistContextType.SUBTITLE_TRACK,url,deliveryDirectives});}load(context){var _context$deliveryDire;const config=this.hls.config;// logger.debug(`[playlist-loader]: Loading playlist of type ${context.type}, level: ${context.level}, id: ${context.id}`);
// Check if a loader for this context already exists
let loader=this.getInternalLoader(context);if(loader){const loaderContext=loader.context;if(loaderContext&&loaderContext.url===context.url&&loaderContext.level===context.level){// same URL can't overlap
logger.trace('[playlist-loader]: playlist request ongoing');return;}logger.log(`[playlist-loader]: aborting previous loader for type: ${context.type}`);loader.abort();}// apply different configs for retries depending on
// context (manifest, level, audio/subs playlist)
let loadPolicy;if(context.type===PlaylistContextType.MANIFEST){loadPolicy=config.manifestLoadPolicy.default;}else {loadPolicy=_extends({},config.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null});}loader=this.createInternalLoader(context);// Override level/track timeout for LL-HLS requests
// (the default of 10000ms is counter productive to blocking playlist reload requests)
if(isFiniteNumber((_context$deliveryDire=context.deliveryDirectives)==null?void 0:_context$deliveryDire.part)){let levelDetails;if(context.type===PlaylistContextType.LEVEL&&context.level!==null){levelDetails=this.hls.levels[context.level].details;}else if(context.type===PlaylistContextType.AUDIO_TRACK&&context.id!==null){levelDetails=this.hls.audioTracks[context.id].details;}else if(context.type===PlaylistContextType.SUBTITLE_TRACK&&context.id!==null){levelDetails=this.hls.subtitleTracks[context.id].details;}if(levelDetails){const partTarget=levelDetails.partTarget;const targetDuration=levelDetails.targetduration;if(partTarget&&targetDuration){const maxLowLatencyPlaylistRefresh=Math.max(partTarget*3,targetDuration*0.8)*1000;loadPolicy=_extends({},loadPolicy,{maxTimeToFirstByteMs:Math.min(maxLowLatencyPlaylistRefresh,loadPolicy.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(maxLowLatencyPlaylistRefresh,loadPolicy.maxTimeToFirstByteMs)});}}}const legacyRetryCompatibility=loadPolicy.errorRetry||loadPolicy.timeoutRetry||{};const loaderConfig={loadPolicy,timeout:loadPolicy.maxLoadTimeMs,maxRetry:legacyRetryCompatibility.maxNumRetry||0,retryDelay:legacyRetryCompatibility.retryDelayMs||0,maxRetryDelay:legacyRetryCompatibility.maxRetryDelayMs||0};const loaderCallbacks={onSuccess:(response,stats,context,networkDetails)=>{const loader=this.getInternalLoader(context);this.resetInternalLoader(context.type);const string=response.data;// Validate if it is an M3U8 at all
if(string.indexOf('#EXTM3U')!==0){this.handleManifestParsingError(response,context,new Error('no EXTM3U delimiter'),networkDetails||null,stats);return;}stats.parsing.start=performance.now();if(M3U8Parser.isMediaPlaylist(string)){this.handleTrackOrLevelPlaylist(response,stats,context,networkDetails||null,loader);}else {this.handleMasterPlaylist(response,stats,context,networkDetails);}},onError:(response,context,networkDetails,stats)=>{this.handleNetworkError(context,networkDetails,false,response,stats);},onTimeout:(stats,context,networkDetails)=>{this.handleNetworkError(context,networkDetails,true,undefined,stats);}};// logger.debug(`[playlist-loader]: Calling internal loader delegate for URL: ${context.url}`);
loader.load(context,loaderConfig,loaderCallbacks);}handleMasterPlaylist(response,stats,context,networkDetails){const hls=this.hls;const string=response.data;const url=getResponseUrl(response,context);const parsedResult=M3U8Parser.parseMasterPlaylist(string,url);if(parsedResult.playlistParsingError){this.handleManifestParsingError(response,context,parsedResult.playlistParsingError,networkDetails,stats);return;}const{contentSteering,levels,sessionData,sessionKeys,startTimeOffset,variableList}=parsedResult;this.variableList=variableList;const{AUDIO:audioTracks=[],SUBTITLES:subtitles,'CLOSED-CAPTIONS':captions}=M3U8Parser.parseMasterPlaylistMedia(string,url,parsedResult);if(audioTracks.length){// check if we have found an audio track embedded in main playlist (audio track without URI attribute)
const embeddedAudioFound=audioTracks.some(audioTrack=>!audioTrack.url);// if no embedded audio track defined, but audio codec signaled in quality level,
// we need to signal this main audio track this could happen with playlists with
// alt audio rendition in which quality levels (main)
// contains both audio+video. but with mixed audio track not signaled
if(!embeddedAudioFound&&levels[0].audioCodec&&!levels[0].attrs.AUDIO){logger.log('[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one');audioTracks.unshift({type:'main',name:'main',groupId:'main',default:false,autoselect:false,forced:false,id:-1,attrs:new AttrList({}),bitrate:0,url:''});}}hls.trigger(Events$1.MANIFEST_LOADED,{levels,audioTracks,subtitles,captions,contentSteering,url,stats,networkDetails,sessionData,sessionKeys,startTimeOffset,variableList});}handleTrackOrLevelPlaylist(response,stats,context,networkDetails,loader){const hls=this.hls;const{id,level,type}=context;const url=getResponseUrl(response,context);const levelUrlId=0;const levelId=isFiniteNumber(level)?level:isFiniteNumber(id)?id:0;const levelType=mapContextToLevelType(context);const levelDetails=M3U8Parser.parseLevelPlaylist(response.data,url,levelId,levelType,levelUrlId,this.variableList);// We have done our first request (Manifest-type) and receive
// not a master playlist but a chunk-list (track/level)
// We fire the manifest-loaded event anyway with the parsed level-details
// by creating a single-level structure for it.
if(type===PlaylistContextType.MANIFEST){const singleLevel={attrs:new AttrList({}),bitrate:0,details:levelDetails,name:'',url};hls.trigger(Events$1.MANIFEST_LOADED,{levels:[singleLevel],audioTracks:[],url,stats,networkDetails,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null});}// save parsing time
stats.parsing.end=performance.now();// extend the context with the new levelDetails property
context.levelDetails=levelDetails;this.handlePlaylistLoaded(levelDetails,response,stats,context,networkDetails,loader);}handleManifestParsingError(response,context,error,networkDetails,stats){this.hls.trigger(Events$1.ERROR,{type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.MANIFEST_PARSING_ERROR,fatal:context.type===PlaylistContextType.MANIFEST,url:response.url,err:error,error,reason:error.message,response,context,networkDetails,stats});}handleNetworkError(context,networkDetails,timeout=false,response,stats){let message=`A network ${timeout?'timeout':'error'+(response?' (status '+response.code+')':'')} occurred while loading ${context.type}`;if(context.type===PlaylistContextType.LEVEL){message+=`: ${context.level} id: ${context.id}`;}else if(context.type===PlaylistContextType.AUDIO_TRACK||context.type===PlaylistContextType.SUBTITLE_TRACK){message+=` id: ${context.id} group-id: "${context.groupId}"`;}const error=new Error(message);logger.warn(`[playlist-loader]: ${message}`);let details=ErrorDetails.UNKNOWN;let fatal=false;const loader=this.getInternalLoader(context);switch(context.type){case PlaylistContextType.MANIFEST:details=timeout?ErrorDetails.MANIFEST_LOAD_TIMEOUT:ErrorDetails.MANIFEST_LOAD_ERROR;fatal=true;break;case PlaylistContextType.LEVEL:details=timeout?ErrorDetails.LEVEL_LOAD_TIMEOUT:ErrorDetails.LEVEL_LOAD_ERROR;fatal=false;break;case PlaylistContextType.AUDIO_TRACK:details=timeout?ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:ErrorDetails.AUDIO_TRACK_LOAD_ERROR;fatal=false;break;case PlaylistContextType.SUBTITLE_TRACK:details=timeout?ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:ErrorDetails.SUBTITLE_LOAD_ERROR;fatal=false;break;}if(loader){this.resetInternalLoader(context.type);}const errorData={type:ErrorTypes.NETWORK_ERROR,details,fatal,url:context.url,loader,context,error,networkDetails,stats};if(response){const url=(networkDetails==null?void 0:networkDetails.url)||context.url;errorData.response=_objectSpread2({url,data:undefined},response);}this.hls.trigger(Events$1.ERROR,errorData);}handlePlaylistLoaded(levelDetails,response,stats,context,networkDetails,loader){const hls=this.hls;const{type,level,id,groupId,deliveryDirectives}=context;const url=getResponseUrl(response,context);const parent=mapContextToLevelType(context);const levelIndex=typeof context.level==='number'&&parent===PlaylistLevelType.MAIN?level:undefined;if(!levelDetails.fragments.length){const _error=new Error('No Segments found in Playlist');hls.trigger(Events$1.ERROR,{type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.LEVEL_EMPTY_ERROR,fatal:false,url,error:_error,reason:_error.message,response,context,level:levelIndex,parent,networkDetails,stats});return;}if(!levelDetails.targetduration){levelDetails.playlistParsingError=new Error('Missing Target Duration');}const error=levelDetails.playlistParsingError;if(error){hls.trigger(Events$1.ERROR,{type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.LEVEL_PARSING_ERROR,fatal:false,url,error,reason:error.message,response,context,level:levelIndex,parent,networkDetails,stats});return;}if(levelDetails.live&&loader){if(loader.getCacheAge){levelDetails.ageHeader=loader.getCacheAge()||0;}if(!loader.getCacheAge||isNaN(levelDetails.ageHeader)){levelDetails.ageHeader=0;}}switch(type){case PlaylistContextType.MANIFEST:case PlaylistContextType.LEVEL:hls.trigger(Events$1.LEVEL_LOADED,{details:levelDetails,level:levelIndex||0,id:id||0,stats,networkDetails,deliveryDirectives});break;case PlaylistContextType.AUDIO_TRACK:hls.trigger(Events$1.AUDIO_TRACK_LOADED,{details:levelDetails,id:id||0,groupId:groupId||'',stats,networkDetails,deliveryDirectives});break;case PlaylistContextType.SUBTITLE_TRACK:hls.trigger(Events$1.SUBTITLE_TRACK_LOADED,{details:levelDetails,id:id||0,groupId:groupId||'',stats,networkDetails,deliveryDirectives});break;}}}function sendAddTrackEvent(track,videoEl){let event;try{event=new Event('addtrack');}catch(err){// for IE11
event=document.createEvent('Event');event.initEvent('addtrack',false,false);}event.track=track;videoEl.dispatchEvent(event);}function addCueToTrack(track,cue){// Sometimes there are cue overlaps on segmented vtts so the same
// cue can appear more than once in different vtt files.
// This avoid showing duplicated cues with same timecode and text.
const mode=track.mode;if(mode==='disabled'){track.mode='hidden';}if(track.cues&&!track.cues.getCueById(cue.id)){try{track.addCue(cue);if(!track.cues.getCueById(cue.id)){throw new Error(`addCue is failed for: ${cue}`);}}catch(err){logger.debug(`[texttrack-utils]: ${err}`);try{const textTrackCue=new self.TextTrackCue(cue.startTime,cue.endTime,cue.text);textTrackCue.id=cue.id;track.addCue(textTrackCue);}catch(err2){logger.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${err2}`);}}}if(mode==='disabled'){track.mode=mode;}}function clearCurrentCues(track){// When track.mode is disabled, track.cues will be null.
// To guarantee the removal of cues, we need to temporarily
// change the mode to hidden
const mode=track.mode;if(mode==='disabled'){track.mode='hidden';}if(track.cues){for(let i=track.cues.length;i--;){track.removeCue(track.cues[i]);}}if(mode==='disabled'){track.mode=mode;}}function removeCuesInRange(track,start,end,predicate){const mode=track.mode;if(mode==='disabled'){track.mode='hidden';}if(track.cues&&track.cues.length>0){const cues=getCuesInRange(track.cues,start,end);for(let i=0;i<cues.length;i++){if(!predicate||predicate(cues[i])){track.removeCue(cues[i]);}}}if(mode==='disabled'){track.mode=mode;}}// Find first cue starting after given time.
// Modified version of binary search O(log(n)).
function getFirstCueIndexAfterTime(cues,time){// If first cue starts after time, start there
if(time<cues[0].startTime){return 0;}// If the last cue ends before time there is no overlap
const len=cues.length-1;if(time>cues[len].endTime){return -1;}let left=0;let right=len;while(left<=right){const mid=Math.floor((right+left)/2);if(time<cues[mid].startTime){right=mid-1;}else if(time>cues[mid].startTime&&left<len){left=mid+1;}else {// If it's not lower or higher, it must be equal.
return mid;}}// At this point, left and right have swapped.
// No direct match was found, left or right element must be the closest. Check which one has the smallest diff.
return cues[left].startTime-time<time-cues[right].startTime?left:right;}function getCuesInRange(cues,start,end){const cuesFound=[];const firstCueInRange=getFirstCueIndexAfterTime(cues,start);if(firstCueInRange>-1){for(let i=firstCueInRange,len=cues.length;i<len;i++){const cue=cues[i];if(cue.startTime>=start&&cue.endTime<=end){cuesFound.push(cue);}else if(cue.startTime>end){return cuesFound;}}}return cuesFound;}function filterSubtitleTracks(textTrackList){const tracks=[];for(let i=0;i<textTrackList.length;i++){const track=textTrackList[i];// Edge adds a track without a label; we don't want to use it
if((track.kind==='subtitles'||track.kind==='captions')&&track.label){tracks.push(textTrackList[i]);}}return tracks;}var MetadataSchema={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const MIN_CUE_DURATION=0.25;function getCueClass(){if(typeof self==='undefined')return undefined;return self.VTTCue||self.TextTrackCue;}function createCueWithDataFields(Cue,startTime,endTime,data,type){let cue=new Cue(startTime,endTime,'');try{cue.value=data;if(type){cue.type=type;}}catch(e){cue=new Cue(startTime,endTime,JSON.stringify(type?_objectSpread2({type},data):data));}return cue;}// VTTCue latest draft allows an infinite duration, fallback
// to MAX_VALUE if necessary
const MAX_CUE_ENDTIME=(()=>{const Cue=getCueClass();try{Cue&&new Cue(0,Number.POSITIVE_INFINITY,'');}catch(e){return Number.MAX_VALUE;}return Number.POSITIVE_INFINITY;})();function dateRangeDateToTimelineSeconds(date,offset){return date.getTime()/1000-offset;}function hexToArrayBuffer(str){return Uint8Array.from(str.replace(/^0x/,'').replace(/([\da-fA-F]{2}) ?/g,'0x$1 ').replace(/ +$/,'').split(' ')).buffer;}class ID3TrackController{constructor(hls){this.hls=void 0;this.id3Track=null;this.media=null;this.dateRangeCuesAppended={};this.hls=hls;this._registerListeners();}destroy(){this._unregisterListeners();this.id3Track=null;this.media=null;this.dateRangeCuesAppended={};// @ts-ignore
this.hls=null;}_registerListeners(){const{hls}=this;hls.on(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);hls.on(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);hls.on(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.on(Events$1.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this);hls.on(Events$1.BUFFER_FLUSHING,this.onBufferFlushing,this);hls.on(Events$1.LEVEL_UPDATED,this.onLevelUpdated,this);}_unregisterListeners(){const{hls}=this;hls.off(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);hls.off(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);hls.off(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.off(Events$1.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this);hls.off(Events$1.BUFFER_FLUSHING,this.onBufferFlushing,this);hls.off(Events$1.LEVEL_UPDATED,this.onLevelUpdated,this);}// Add ID3 metatadata text track.
onMediaAttached(event,data){this.media=data.media;}onMediaDetaching(){if(!this.id3Track){return;}clearCurrentCues(this.id3Track);this.id3Track=null;this.media=null;this.dateRangeCuesAppended={};}onManifestLoading(){this.dateRangeCuesAppended={};}createTrack(media){const track=this.getID3Track(media.textTracks);track.mode='hidden';return track;}getID3Track(textTracks){if(!this.media){return;}for(let i=0;i<textTracks.length;i++){const textTrack=textTracks[i];if(textTrack.kind==='metadata'&&textTrack.label==='id3'){// send 'addtrack' when reusing the textTrack for metadata,
// same as what we do for captions
sendAddTrackEvent(textTrack,this.media);return textTrack;}}return this.media.addTextTrack('metadata','id3');}onFragParsingMetadata(event,data){if(!this.media){return;}const{hls:{config:{enableEmsgMetadataCues,enableID3MetadataCues}}}=this;if(!enableEmsgMetadataCues&&!enableID3MetadataCues){return;}const{samples}=data;// create track dynamically
if(!this.id3Track){this.id3Track=this.createTrack(this.media);}const Cue=getCueClass();if(!Cue){return;}for(let i=0;i<samples.length;i++){const type=samples[i].type;if(type===MetadataSchema.emsg&&!enableEmsgMetadataCues||!enableID3MetadataCues){continue;}const frames=getID3Frames(samples[i].data);if(frames){const startTime=samples[i].pts;let endTime=startTime+samples[i].duration;if(endTime>MAX_CUE_ENDTIME){endTime=MAX_CUE_ENDTIME;}const timeDiff=endTime-startTime;if(timeDiff<=0){endTime=startTime+MIN_CUE_DURATION;}for(let j=0;j<frames.length;j++){const frame=frames[j];// Safari doesn't put the timestamp frame in the TextTrack
if(!isTimeStampFrame(frame)){// add a bounds to any unbounded cues
this.updateId3CueEnds(startTime,type);const cue=createCueWithDataFields(Cue,startTime,endTime,frame,type);if(cue){this.id3Track.addCue(cue);}}}}}}updateId3CueEnds(startTime,type){var _this$id3Track;const cues=(_this$id3Track=this.id3Track)==null?void 0:_this$id3Track.cues;if(cues){for(let i=cues.length;i--;){const cue=cues[i];if(cue.type===type&&cue.startTime<startTime&&cue.endTime===MAX_CUE_ENDTIME){cue.endTime=startTime;}}}}onBufferFlushing(event,{startOffset,endOffset,type}){const{id3Track,hls}=this;if(!hls){return;}const{config:{enableEmsgMetadataCues,enableID3MetadataCues}}=hls;if(id3Track&&(enableEmsgMetadataCues||enableID3MetadataCues)){let predicate;if(type==='audio'){predicate=cue=>cue.type===MetadataSchema.audioId3&&enableID3MetadataCues;}else if(type==='video'){predicate=cue=>cue.type===MetadataSchema.emsg&&enableEmsgMetadataCues;}else {predicate=cue=>cue.type===MetadataSchema.audioId3&&enableID3MetadataCues||cue.type===MetadataSchema.emsg&&enableEmsgMetadataCues;}removeCuesInRange(id3Track,startOffset,endOffset,predicate);}}onLevelUpdated(event,{details}){if(!this.media||!details.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues){return;}const{dateRangeCuesAppended,id3Track}=this;const{dateRanges}=details;const ids=Object.keys(dateRanges);// Remove cues from track not found in details.dateRanges
if(id3Track){const idsToRemove=Object.keys(dateRangeCuesAppended).filter(id=>!ids.includes(id));for(let i=idsToRemove.length;i--;){const id=idsToRemove[i];Object.keys(dateRangeCuesAppended[id].cues).forEach(key=>{id3Track.removeCue(dateRangeCuesAppended[id].cues[key]);});delete dateRangeCuesAppended[id];}}// Exit if the playlist does not have Date Ranges or does not have Program Date Time
const lastFragment=details.fragments[details.fragments.length-1];if(ids.length===0||!isFiniteNumber(lastFragment==null?void 0:lastFragment.programDateTime)){return;}if(!this.id3Track){this.id3Track=this.createTrack(this.media);}const dateTimeOffset=lastFragment.programDateTime/1000-lastFragment.start;const Cue=getCueClass();for(let i=0;i<ids.length;i++){const id=ids[i];const dateRange=dateRanges[id];const startTime=dateRangeDateToTimelineSeconds(dateRange.startDate,dateTimeOffset);// Process DateRanges to determine end-time (known DURATION, END-DATE, or END-ON-NEXT)
const appendedDateRangeCues=dateRangeCuesAppended[id];const cues=(appendedDateRangeCues==null?void 0:appendedDateRangeCues.cues)||{};let durationKnown=(appendedDateRangeCues==null?void 0:appendedDateRangeCues.durationKnown)||false;let endTime=MAX_CUE_ENDTIME;const endDate=dateRange.endDate;if(endDate){endTime=dateRangeDateToTimelineSeconds(endDate,dateTimeOffset);durationKnown=true;}else if(dateRange.endOnNext&&!durationKnown){const nextDateRangeWithSameClass=ids.reduce((candidateDateRange,id)=>{if(id!==dateRange.id){const otherDateRange=dateRanges[id];if(otherDateRange.class===dateRange.class&&otherDateRange.startDate>dateRange.startDate&&(!candidateDateRange||dateRange.startDate<candidateDateRange.startDate)){return otherDateRange;}}return candidateDateRange;},null);if(nextDateRangeWithSameClass){endTime=dateRangeDateToTimelineSeconds(nextDateRangeWithSameClass.startDate,dateTimeOffset);durationKnown=true;}}// Create TextTrack Cues for each MetadataGroup Item (select DateRange attribute)
// This is to emulate Safari HLS playback handling of DateRange tags
const attributes=Object.keys(dateRange.attr);for(let j=0;j<attributes.length;j++){const key=attributes[j];if(!isDateRangeCueAttribute(key)){continue;}const cue=cues[key];if(cue){if(durationKnown&&!appendedDateRangeCues.durationKnown){cue.endTime=endTime;}}else if(Cue){let data=dateRange.attr[key];if(isSCTE35Attribute(key)){data=hexToArrayBuffer(data);}const _cue=createCueWithDataFields(Cue,startTime,endTime,{key,data},MetadataSchema.dateRange);if(_cue){_cue.id=id;this.id3Track.addCue(_cue);cues[key]=_cue;}}}// Keep track of processed DateRanges by ID for updating cues with new DateRange tag attributes
dateRangeCuesAppended[id]={cues,dateRange,durationKnown};}}}class LatencyController{constructor(hls){this.hls=void 0;this.config=void 0;this.media=null;this.levelDetails=null;this.currentTime=0;this.stallCount=0;this._latency=null;this.timeupdateHandler=()=>this.timeupdate();this.hls=hls;this.config=hls.config;this.registerListeners();}get latency(){return this._latency||0;}get maxLatency(){const{config,levelDetails}=this;if(config.liveMaxLatencyDuration!==undefined){return config.liveMaxLatencyDuration;}return levelDetails?config.liveMaxLatencyDurationCount*levelDetails.targetduration:0;}get targetLatency(){const{levelDetails}=this;if(levelDetails===null){return null;}const{holdBack,partHoldBack,targetduration}=levelDetails;const{liveSyncDuration,liveSyncDurationCount,lowLatencyMode}=this.config;const userConfig=this.hls.userConfig;let targetLatency=lowLatencyMode?partHoldBack||holdBack:holdBack;if(userConfig.liveSyncDuration||userConfig.liveSyncDurationCount||targetLatency===0){targetLatency=liveSyncDuration!==undefined?liveSyncDuration:liveSyncDurationCount*targetduration;}const maxLiveSyncOnStallIncrease=targetduration;const liveSyncOnStallIncrease=1.0;return targetLatency+Math.min(this.stallCount*liveSyncOnStallIncrease,maxLiveSyncOnStallIncrease);}get liveSyncPosition(){const liveEdge=this.estimateLiveEdge();const targetLatency=this.targetLatency;const levelDetails=this.levelDetails;if(liveEdge===null||targetLatency===null||levelDetails===null){return null;}const edge=levelDetails.edge;const syncPosition=liveEdge-targetLatency-this.edgeStalled;const min=edge-levelDetails.totalduration;const max=edge-(this.config.lowLatencyMode&&levelDetails.partTarget||levelDetails.targetduration);return Math.min(Math.max(min,syncPosition),max);}get drift(){const{levelDetails}=this;if(levelDetails===null){return 1;}return levelDetails.drift;}get edgeStalled(){const{levelDetails}=this;if(levelDetails===null){return 0;}const maxLevelUpdateAge=(this.config.lowLatencyMode&&levelDetails.partTarget||levelDetails.targetduration)*3;return Math.max(levelDetails.age-maxLevelUpdateAge,0);}get forwardBufferLength(){const{media,levelDetails}=this;if(!media||!levelDetails){return 0;}const bufferedRanges=media.buffered.length;return (bufferedRanges?media.buffered.end(bufferedRanges-1):levelDetails.edge)-this.currentTime;}destroy(){this.unregisterListeners();this.onMediaDetaching();this.levelDetails=null;// @ts-ignore
this.hls=this.timeupdateHandler=null;}registerListeners(){this.hls.on(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);this.hls.on(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);this.hls.on(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);this.hls.on(Events$1.LEVEL_UPDATED,this.onLevelUpdated,this);this.hls.on(Events$1.ERROR,this.onError,this);}unregisterListeners(){this.hls.off(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);this.hls.off(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);this.hls.off(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);this.hls.off(Events$1.LEVEL_UPDATED,this.onLevelUpdated,this);this.hls.off(Events$1.ERROR,this.onError,this);}onMediaAttached(event,data){this.media=data.media;this.media.addEventListener('timeupdate',this.timeupdateHandler);}onMediaDetaching(){if(this.media){this.media.removeEventListener('timeupdate',this.timeupdateHandler);this.media=null;}}onManifestLoading(){this.levelDetails=null;this._latency=null;this.stallCount=0;}onLevelUpdated(event,{details}){this.levelDetails=details;if(details.advanced){this.timeupdate();}if(!details.live&&this.media){this.media.removeEventListener('timeupdate',this.timeupdateHandler);}}onError(event,data){var _this$levelDetails;if(data.details!==ErrorDetails.BUFFER_STALLED_ERROR){return;}this.stallCount++;if((_this$levelDetails=this.levelDetails)!=null&&_this$levelDetails.live){logger.warn('[playback-rate-controller]: Stall detected, adjusting target latency');}}timeupdate(){const{media,levelDetails}=this;if(!media||!levelDetails){return;}this.currentTime=media.currentTime;const latency=this.computeLatency();if(latency===null){return;}this._latency=latency;// Adapt playbackRate to meet target latency in low-latency mode
const{lowLatencyMode,maxLiveSyncPlaybackRate}=this.config;if(!lowLatencyMode||maxLiveSyncPlaybackRate===1||!levelDetails.live){return;}const targetLatency=this.targetLatency;if(targetLatency===null){return;}const distanceFromTarget=latency-targetLatency;// Only adjust playbackRate when within one target duration of targetLatency
// and more than one second from under-buffering.
// Playback further than one target duration from target can be considered DVR playback.
const liveMinLatencyDuration=Math.min(this.maxLatency,targetLatency+levelDetails.targetduration);const inLiveRange=distanceFromTarget<liveMinLatencyDuration;if(inLiveRange&&distanceFromTarget>0.05&&this.forwardBufferLength>1){const max=Math.min(2,Math.max(1.0,maxLiveSyncPlaybackRate));const rate=Math.round(2/(1+Math.exp(-0.75*distanceFromTarget-this.edgeStalled))*20)/20;media.playbackRate=Math.min(max,Math.max(1,rate));}else if(media.playbackRate!==1&&media.playbackRate!==0){media.playbackRate=1;}}estimateLiveEdge(){const{levelDetails}=this;if(levelDetails===null){return null;}return levelDetails.edge+levelDetails.age;}computeLatency(){const liveEdge=this.estimateLiveEdge();if(liveEdge===null){return null;}return liveEdge-this.currentTime;}}const HdcpLevels=['NONE','TYPE-0','TYPE-1',null];function isHdcpLevel(value){return HdcpLevels.indexOf(value)>-1;}const VideoRangeValues=['SDR','PQ','HLG'];function isVideoRange(value){return !!value&&VideoRangeValues.indexOf(value)>-1;}var HlsSkip={No:"",Yes:"YES",v2:"v2"};function getSkipValue(details){const{canSkipUntil,canSkipDateRanges,age}=details;// A Client SHOULD NOT request a Playlist Delta Update unless it already
// has a version of the Playlist that is no older than one-half of the Skip Boundary.
// @see: https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#section-6.3.7
const playlistRecentEnough=age<canSkipUntil/2;if(canSkipUntil&&playlistRecentEnough){if(canSkipDateRanges){return HlsSkip.v2;}return HlsSkip.Yes;}return HlsSkip.No;}class HlsUrlParameters{constructor(msn,part,skip){this.msn=void 0;this.part=void 0;this.skip=void 0;this.msn=msn;this.part=part;this.skip=skip;}addDirectives(uri){const url=new self.URL(uri);if(this.msn!==undefined){url.searchParams.set('_HLS_msn',this.msn.toString());}if(this.part!==undefined){url.searchParams.set('_HLS_part',this.part.toString());}if(this.skip){url.searchParams.set('_HLS_skip',this.skip);}return url.href;}}class Level{constructor(data){this._attrs=void 0;this.audioCodec=void 0;this.bitrate=void 0;this.codecSet=void 0;this.url=void 0;this.frameRate=void 0;this.height=void 0;this.id=void 0;this.name=void 0;this.videoCodec=void 0;this.width=void 0;this.details=void 0;this.fragmentError=0;this.loadError=0;this.loaded=void 0;this.realBitrate=0;this.supportedPromise=void 0;this.supportedResult=void 0;this._avgBitrate=0;this._audioGroups=void 0;this._subtitleGroups=void 0;// Deprecated (retained for backwards compatibility)
this._urlId=0;this.url=[data.url];this._attrs=[data.attrs];this.bitrate=data.bitrate;if(data.details){this.details=data.details;}this.id=data.id||0;this.name=data.name;this.width=data.width||0;this.height=data.height||0;this.frameRate=data.attrs.optionalFloat('FRAME-RATE',0);this._avgBitrate=data.attrs.decimalInteger('AVERAGE-BANDWIDTH');this.audioCodec=data.audioCodec;this.videoCodec=data.videoCodec;this.codecSet=[data.videoCodec,data.audioCodec].filter(c=>!!c).map(s=>s.substring(0,4)).join(',');this.addGroupId('audio',data.attrs.AUDIO);this.addGroupId('text',data.attrs.SUBTITLES);}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate);}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate;}get attrs(){return this._attrs[0];}get codecs(){return this.attrs.CODECS||'';}get pathwayId(){return this.attrs['PATHWAY-ID']||'.';}get videoRange(){return this.attrs['VIDEO-RANGE']||'SDR';}get score(){return this.attrs.optionalFloat('SCORE',0);}get uri(){return this.url[0]||'';}hasAudioGroup(groupId){return hasGroup(this._audioGroups,groupId);}hasSubtitleGroup(groupId){return hasGroup(this._subtitleGroups,groupId);}get audioGroups(){return this._audioGroups;}get subtitleGroups(){return this._subtitleGroups;}addGroupId(type,groupId){if(!groupId){return;}if(type==='audio'){let audioGroups=this._audioGroups;if(!audioGroups){audioGroups=this._audioGroups=[];}if(audioGroups.indexOf(groupId)===-1){audioGroups.push(groupId);}}else if(type==='text'){let subtitleGroups=this._subtitleGroups;if(!subtitleGroups){subtitleGroups=this._subtitleGroups=[];}if(subtitleGroups.indexOf(groupId)===-1){subtitleGroups.push(groupId);}}}// Deprecated methods (retained for backwards compatibility)
get urlId(){return 0;}set urlId(value){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:undefined;}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:undefined;}get audioGroupId(){var _this$audioGroups;return (_this$audioGroups=this.audioGroups)==null?void 0:_this$audioGroups[0];}get textGroupId(){var _this$subtitleGroups;return (_this$subtitleGroups=this.subtitleGroups)==null?void 0:_this$subtitleGroups[0];}addFallback(){}}function hasGroup(groups,groupId){if(!groupId||!groups){return false;}return groups.indexOf(groupId)!==-1;}function updateFromToPTS(fragFrom,fragTo){const fragToPTS=fragTo.startPTS;// if we know startPTS[toIdx]
if(isFiniteNumber(fragToPTS)){// update fragment duration.
// it helps to fix drifts between playlist reported duration and fragment real duration
let duration=0;let frag;if(fragTo.sn>fragFrom.sn){duration=fragToPTS-fragFrom.start;frag=fragFrom;}else {duration=fragFrom.start-fragToPTS;frag=fragTo;}if(frag.duration!==duration){frag.duration=duration;}// we dont know startPTS[toIdx]
}else if(fragTo.sn>fragFrom.sn){const contiguous=fragFrom.cc===fragTo.cc;// TODO: With part-loading end/durations we need to confirm the whole fragment is loaded before using (or setting) minEndPTS
if(contiguous&&fragFrom.minEndPTS){fragTo.start=fragFrom.start+(fragFrom.minEndPTS-fragFrom.start);}else {fragTo.start=fragFrom.start+fragFrom.duration;}}else {fragTo.start=Math.max(fragFrom.start-fragTo.duration,0);}}function updateFragPTSDTS(details,frag,startPTS,endPTS,startDTS,endDTS){const parsedMediaDuration=endPTS-startPTS;if(parsedMediaDuration<=0){logger.warn('Fragment should have a positive duration',frag);endPTS=startPTS+frag.duration;endDTS=startDTS+frag.duration;}let maxStartPTS=startPTS;let minEndPTS=endPTS;const fragStartPts=frag.startPTS;const fragEndPts=frag.endPTS;if(isFiniteNumber(fragStartPts)){// delta PTS between audio and video
const deltaPTS=Math.abs(fragStartPts-startPTS);if(!isFiniteNumber(frag.deltaPTS)){frag.deltaPTS=deltaPTS;}else {frag.deltaPTS=Math.max(deltaPTS,frag.deltaPTS);}maxStartPTS=Math.max(startPTS,fragStartPts);startPTS=Math.min(startPTS,fragStartPts);startDTS=Math.min(startDTS,frag.startDTS);minEndPTS=Math.min(endPTS,fragEndPts);endPTS=Math.max(endPTS,fragEndPts);endDTS=Math.max(endDTS,frag.endDTS);}const drift=startPTS-frag.start;if(frag.start!==0){frag.start=startPTS;}frag.duration=endPTS-frag.start;frag.startPTS=startPTS;frag.maxStartPTS=maxStartPTS;frag.startDTS=startDTS;frag.endPTS=endPTS;frag.minEndPTS=minEndPTS;frag.endDTS=endDTS;const sn=frag.sn;// 'initSegment'
// exit if sn out of range
if(!details||sn<details.startSN||sn>details.endSN){return 0;}let i;const fragIdx=sn-details.startSN;const fragments=details.fragments;// update frag reference in fragments array
// rationale is that fragments array might not contain this frag object.
// this will happen if playlist has been refreshed between frag loading and call to updateFragPTSDTS()
// if we don't update frag, we won't be able to propagate PTS info on the playlist
// resulting in invalid sliding computation
fragments[fragIdx]=frag;// adjust fragment PTS/duration from seqnum-1 to frag 0
for(i=fragIdx;i>0;i--){updateFromToPTS(fragments[i],fragments[i-1]);}// adjust fragment PTS/duration from seqnum to last frag
for(i=fragIdx;i<fragments.length-1;i++){updateFromToPTS(fragments[i],fragments[i+1]);}if(details.fragmentHint){updateFromToPTS(fragments[fragments.length-1],details.fragmentHint);}details.PTSKnown=details.alignedSliding=true;return drift;}function mergeDetails(oldDetails,newDetails){// Track the last initSegment processed. Initialize it to the last one on the timeline.
let currentInitSegment=null;const oldFragments=oldDetails.fragments;for(let i=oldFragments.length-1;i>=0;i--){const oldInit=oldFragments[i].initSegment;if(oldInit){currentInitSegment=oldInit;break;}}if(oldDetails.fragmentHint){// prevent PTS and duration from being adjusted on the next hint
delete oldDetails.fragmentHint.endPTS;}// check if old/new playlists have fragments in common
// loop through overlapping SN and update startPTS , cc, and duration if any found
let ccOffset=0;let PTSFrag;mapFragmentIntersection(oldDetails,newDetails,(oldFrag,newFrag)=>{if(oldFrag.relurl){// Do not compare CC if the old fragment has no url. This is a level.fragmentHint used by LL-HLS parts.
// It maybe be off by 1 if it was created before any parts or discontinuity tags were appended to the end
// of the playlist.
ccOffset=oldFrag.cc-newFrag.cc;}if(isFiniteNumber(oldFrag.startPTS)&&isFiniteNumber(oldFrag.endPTS)){newFrag.start=newFrag.startPTS=oldFrag.startPTS;newFrag.startDTS=oldFrag.startDTS;newFrag.maxStartPTS=oldFrag.maxStartPTS;newFrag.endPTS=oldFrag.endPTS;newFrag.endDTS=oldFrag.endDTS;newFrag.minEndPTS=oldFrag.minEndPTS;newFrag.duration=oldFrag.endPTS-oldFrag.startPTS;if(newFrag.duration){PTSFrag=newFrag;}// PTS is known when any segment has startPTS and endPTS
newDetails.PTSKnown=newDetails.alignedSliding=true;}newFrag.elementaryStreams=oldFrag.elementaryStreams;newFrag.loader=oldFrag.loader;newFrag.stats=oldFrag.stats;if(oldFrag.initSegment){newFrag.initSegment=oldFrag.initSegment;currentInitSegment=oldFrag.initSegment;}});if(currentInitSegment){const fragmentsToCheck=newDetails.fragmentHint?newDetails.fragments.concat(newDetails.fragmentHint):newDetails.fragments;fragmentsToCheck.forEach(frag=>{var _currentInitSegment;if(frag&&(!frag.initSegment||frag.initSegment.relurl===((_currentInitSegment=currentInitSegment)==null?void 0:_currentInitSegment.relurl))){frag.initSegment=currentInitSegment;}});}if(newDetails.skippedSegments){newDetails.deltaUpdateFailed=newDetails.fragments.some(frag=>!frag);if(newDetails.deltaUpdateFailed){logger.warn('[level-helper] Previous playlist missing segments skipped in delta playlist');for(let i=newDetails.skippedSegments;i--;){newDetails.fragments.shift();}newDetails.startSN=newDetails.fragments[0].sn;newDetails.startCC=newDetails.fragments[0].cc;}else if(newDetails.canSkipDateRanges){newDetails.dateRanges=mergeDateRanges(oldDetails.dateRanges,newDetails.dateRanges,newDetails.recentlyRemovedDateranges);}}const newFragments=newDetails.fragments;if(ccOffset){logger.warn('discontinuity sliding from playlist, take drift into account');for(let i=0;i<newFragments.length;i++){newFragments[i].cc+=ccOffset;}}if(newDetails.skippedSegments){newDetails.startCC=newDetails.fragments[0].cc;}// Merge parts
mapPartIntersection(oldDetails.partList,newDetails.partList,(oldPart,newPart)=>{newPart.elementaryStreams=oldPart.elementaryStreams;newPart.stats=oldPart.stats;});// if at least one fragment contains PTS info, recompute PTS information for all fragments
if(PTSFrag){updateFragPTSDTS(newDetails,PTSFrag,PTSFrag.startPTS,PTSFrag.endPTS,PTSFrag.startDTS,PTSFrag.endDTS);}else {// ensure that delta is within oldFragments range
// also adjust sliding in case delta is 0 (we could have old=[50-60] and new=old=[50-61])
// in that case we also need to adjust start offset of all fragments
adjustSliding(oldDetails,newDetails);}if(newFragments.length){newDetails.totalduration=newDetails.edge-newFragments[0].start;}newDetails.driftStartTime=oldDetails.driftStartTime;newDetails.driftStart=oldDetails.driftStart;const advancedDateTime=newDetails.advancedDateTime;if(newDetails.advanced&&advancedDateTime){const edge=newDetails.edge;if(!newDetails.driftStart){newDetails.driftStartTime=advancedDateTime;newDetails.driftStart=edge;}newDetails.driftEndTime=advancedDateTime;newDetails.driftEnd=edge;}else {newDetails.driftEndTime=oldDetails.driftEndTime;newDetails.driftEnd=oldDetails.driftEnd;newDetails.advancedDateTime=oldDetails.advancedDateTime;}}function mergeDateRanges(oldDateRanges,deltaDateRanges,recentlyRemovedDateranges){const dateRanges=_extends({},oldDateRanges);if(recentlyRemovedDateranges){recentlyRemovedDateranges.forEach(id=>{delete dateRanges[id];});}Object.keys(deltaDateRanges).forEach(id=>{const dateRange=new DateRange(deltaDateRanges[id].attr,dateRanges[id]);if(dateRange.isValid){dateRanges[id]=dateRange;}else {logger.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(deltaDateRanges[id].attr)}"`);}});return dateRanges;}function mapPartIntersection(oldParts,newParts,intersectionFn){if(oldParts&&newParts){let delta=0;for(let i=0,len=oldParts.length;i<=len;i++){const oldPart=oldParts[i];const newPart=newParts[i+delta];if(oldPart&&newPart&&oldPart.index===newPart.index&&oldPart.fragment.sn===newPart.fragment.sn){intersectionFn(oldPart,newPart);}else {delta--;}}}}function mapFragmentIntersection(oldDetails,newDetails,intersectionFn){const skippedSegments=newDetails.skippedSegments;const start=Math.max(oldDetails.startSN,newDetails.startSN)-newDetails.startSN;const end=(oldDetails.fragmentHint?1:0)+(skippedSegments?newDetails.endSN:Math.min(oldDetails.endSN,newDetails.endSN))-newDetails.startSN;const delta=newDetails.startSN-oldDetails.startSN;const newFrags=newDetails.fragmentHint?newDetails.fragments.concat(newDetails.fragmentHint):newDetails.fragments;const oldFrags=oldDetails.fragmentHint?oldDetails.fragments.concat(oldDetails.fragmentHint):oldDetails.fragments;for(let i=start;i<=end;i++){const oldFrag=oldFrags[delta+i];let newFrag=newFrags[i];if(skippedSegments&&!newFrag&&i<skippedSegments){// Fill in skipped segments in delta playlist
newFrag=newDetails.fragments[i]=oldFrag;}if(oldFrag&&newFrag){intersectionFn(oldFrag,newFrag);}}}function adjustSliding(oldDetails,newDetails){const delta=newDetails.startSN+newDetails.skippedSegments-oldDetails.startSN;const oldFragments=oldDetails.fragments;if(delta<0||delta>=oldFragments.length){return;}addSliding(newDetails,oldFragments[delta].start);}function addSliding(details,start){if(start){const fragments=details.fragments;for(let i=details.skippedSegments;i<fragments.length;i++){fragments[i].start+=start;}if(details.fragmentHint){details.fragmentHint.start+=start;}}}function computeReloadInterval(newDetails,distanceToLiveEdgeMs=Infinity){let reloadInterval=1000*newDetails.targetduration;if(newDetails.updated){// Use last segment duration when shorter than target duration and near live edge
const fragments=newDetails.fragments;const liveEdgeMaxTargetDurations=4;if(fragments.length&&reloadInterval*liveEdgeMaxTargetDurations>distanceToLiveEdgeMs){const lastSegmentDuration=fragments[fragments.length-1].duration*1000;if(lastSegmentDuration<reloadInterval){reloadInterval=lastSegmentDuration;}}}else {// estimate = 'miss half average';
// follow HLS Spec, If the client reloads a Playlist file and finds that it has not
// changed then it MUST wait for a period of one-half the target
// duration before retrying.
reloadInterval/=2;}return Math.round(reloadInterval);}function getFragmentWithSN(level,sn,fragCurrent){if(!(level!=null&&level.details)){return null;}const levelDetails=level.details;let fragment=levelDetails.fragments[sn-levelDetails.startSN];if(fragment){return fragment;}fragment=levelDetails.fragmentHint;if(fragment&&fragment.sn===sn){return fragment;}if(sn<levelDetails.startSN&&fragCurrent&&fragCurrent.sn===sn){return fragCurrent;}return null;}function getPartWith(level,sn,partIndex){var _level$details;if(!(level!=null&&level.details)){return null;}return findPart((_level$details=level.details)==null?void 0:_level$details.partList,sn,partIndex);}function findPart(partList,sn,partIndex){if(partList){for(let i=partList.length;i--;){const part=partList[i];if(part.index===partIndex&&part.fragment.sn===sn){return part;}}}return null;}function reassignFragmentLevelIndexes(levels){levels.forEach((level,index)=>{const{details}=level;if(details!=null&&details.fragments){details.fragments.forEach(fragment=>{fragment.level=index;});}});}function isTimeoutError(error){switch(error.details){case ErrorDetails.FRAG_LOAD_TIMEOUT:case ErrorDetails.KEY_LOAD_TIMEOUT:case ErrorDetails.LEVEL_LOAD_TIMEOUT:case ErrorDetails.MANIFEST_LOAD_TIMEOUT:return true;}return false;}function getRetryConfig(loadPolicy,error){const isTimeout=isTimeoutError(error);return loadPolicy.default[`${isTimeout?'timeout':'error'}Retry`];}function getRetryDelay(retryConfig,retryCount){// exponential backoff capped to max retry delay
const backoffFactor=retryConfig.backoff==='linear'?1:Math.pow(2,retryCount);return Math.min(backoffFactor*retryConfig.retryDelayMs,retryConfig.maxRetryDelayMs);}function getLoaderConfigWithoutReties(loderConfig){return _objectSpread2(_objectSpread2({},loderConfig),{errorRetry:null,timeoutRetry:null});}function shouldRetry(retryConfig,retryCount,isTimeout,loaderResponse){if(!retryConfig){return false;}const httpStatus=loaderResponse==null?void 0:loaderResponse.code;const retry=retryCount<retryConfig.maxNumRetry&&(retryForHttpStatus(httpStatus)||!!isTimeout);return retryConfig.shouldRetry?retryConfig.shouldRetry(retryConfig,retryCount,isTimeout,loaderResponse,retry):retry;}function retryForHttpStatus(httpStatus){// Do not retry on status 4xx, status 0 (CORS error), or undefined (decrypt/gap/parse error)
return httpStatus===0&&navigator.onLine===false||!!httpStatus&&(httpStatus<400||httpStatus>499);}const BinarySearch={/**
   * Searches for an item in an array which matches a certain condition.
   * This requires the condition to only match one item in the array,
   * and for the array to be ordered.
   *
   * @param list The array to search.
   * @param comparisonFn
   *      Called and provided a candidate item as the first argument.
   *      Should return:
   *          > -1 if the item should be located at a lower index than the provided item.
   *          > 1 if the item should be located at a higher index than the provided item.
   *          > 0 if the item is the item you're looking for.
   *
   * @returns the object if found, otherwise returns null
   */search:function(list,comparisonFn){let minIndex=0;let maxIndex=list.length-1;let currentIndex=null;let currentElement=null;while(minIndex<=maxIndex){currentIndex=(minIndex+maxIndex)/2|0;currentElement=list[currentIndex];const comparisonResult=comparisonFn(currentElement);if(comparisonResult>0){minIndex=currentIndex+1;}else if(comparisonResult<0){maxIndex=currentIndex-1;}else {return currentElement;}}return null;}};/**
 * Returns first fragment whose endPdt value exceeds the given PDT, or null.
 * @param fragments - The array of candidate fragments
 * @param PDTValue - The PDT value which must be exceeded
 * @param maxFragLookUpTolerance - The amount of time that a fragment's start/end can be within in order to be considered contiguous
 */function findFragmentByPDT(fragments,PDTValue,maxFragLookUpTolerance){if(PDTValue===null||!Array.isArray(fragments)||!fragments.length||!isFiniteNumber(PDTValue)){return null;}// if less than start
const startPDT=fragments[0].programDateTime;if(PDTValue<(startPDT||0)){return null;}const endPDT=fragments[fragments.length-1].endProgramDateTime;if(PDTValue>=(endPDT||0)){return null;}maxFragLookUpTolerance=maxFragLookUpTolerance||0;for(let seg=0;seg<fragments.length;++seg){const frag=fragments[seg];if(pdtWithinToleranceTest(PDTValue,maxFragLookUpTolerance,frag)){return frag;}}return null;}/**
 * Finds a fragment based on the SN of the previous fragment; or based on the needs of the current buffer.
 * This method compensates for small buffer gaps by applying a tolerance to the start of any candidate fragment, thus
 * breaking any traps which would cause the same fragment to be continuously selected within a small range.
 * @param fragPrevious - The last frag successfully appended
 * @param fragments - The array of candidate fragments
 * @param bufferEnd - The end of the contiguous buffered range the playhead is currently within
 * @param maxFragLookUpTolerance - The amount of time that a fragment's start/end can be within in order to be considered contiguous
 * @returns a matching fragment or null
 */function findFragmentByPTS(fragPrevious,fragments,bufferEnd=0,maxFragLookUpTolerance=0){let fragNext=null;if(fragPrevious){fragNext=fragments[fragPrevious.sn-fragments[0].sn+1]||null;// check for buffer-end rounding error
const bufferEdgeError=fragPrevious.endDTS-bufferEnd;if(bufferEdgeError>0&&bufferEdgeError<0.0000015){bufferEnd+=0.0000015;}}else if(bufferEnd===0&&fragments[0].start===0){fragNext=fragments[0];}// Prefer the next fragment if it's within tolerance
if(fragNext&&(!fragPrevious||fragPrevious.level===fragNext.level)&&fragmentWithinToleranceTest(bufferEnd,maxFragLookUpTolerance,fragNext)===0){return fragNext;}// We might be seeking past the tolerance so find the best match
const foundFragment=BinarySearch.search(fragments,fragmentWithinToleranceTest.bind(null,bufferEnd,maxFragLookUpTolerance));if(foundFragment&&(foundFragment!==fragPrevious||!fragNext)){return foundFragment;}// If no match was found return the next fragment after fragPrevious, or null
return fragNext;}/**
 * The test function used by the findFragmentBySn's BinarySearch to look for the best match to the current buffer conditions.
 * @param candidate - The fragment to test
 * @param bufferEnd - The end of the current buffered range the playhead is currently within
 * @param maxFragLookUpTolerance - The amount of time that a fragment's start can be within in order to be considered contiguous
 * @returns 0 if it matches, 1 if too low, -1 if too high
 */function fragmentWithinToleranceTest(bufferEnd=0,maxFragLookUpTolerance=0,candidate){// eagerly accept an accurate match (no tolerance)
if(candidate.start<=bufferEnd&&candidate.start+candidate.duration>bufferEnd){return 0;}// offset should be within fragment boundary - config.maxFragLookUpTolerance
// this is to cope with situations like
// bufferEnd = 9.991
// frag[Ø] : [0,10]
// frag[1] : [10,20]
// bufferEnd is within frag[0] range ... although what we are expecting is to return frag[1] here
//              frag start               frag start+duration
//                  |-----------------------------|
//              <--->                         <--->
//  ...--------><-----------------------------><---------....
// previous frag         matching fragment         next frag
//  return -1             return 0                 return 1
// logger.log(`level/sn/start/end/bufEnd:${level}/${candidate.sn}/${candidate.start}/${(candidate.start+candidate.duration)}/${bufferEnd}`);
// Set the lookup tolerance to be small enough to detect the current segment - ensures we don't skip over very small segments
const candidateLookupTolerance=Math.min(maxFragLookUpTolerance,candidate.duration+(candidate.deltaPTS?candidate.deltaPTS:0));if(candidate.start+candidate.duration-candidateLookupTolerance<=bufferEnd){return 1;}else if(candidate.start-candidateLookupTolerance>bufferEnd&&candidate.start){// if maxFragLookUpTolerance will have negative value then don't return -1 for first element
return -1;}return 0;}/**
 * The test function used by the findFragmentByPdt's BinarySearch to look for the best match to the current buffer conditions.
 * This function tests the candidate's program date time values, as represented in Unix time
 * @param candidate - The fragment to test
 * @param pdtBufferEnd - The Unix time representing the end of the current buffered range
 * @param maxFragLookUpTolerance - The amount of time that a fragment's start can be within in order to be considered contiguous
 * @returns true if contiguous, false otherwise
 */function pdtWithinToleranceTest(pdtBufferEnd,maxFragLookUpTolerance,candidate){const candidateLookupTolerance=Math.min(maxFragLookUpTolerance,candidate.duration+(candidate.deltaPTS?candidate.deltaPTS:0))*1000;// endProgramDateTime can be null, default to zero
const endProgramDateTime=candidate.endProgramDateTime||0;return endProgramDateTime-candidateLookupTolerance>pdtBufferEnd;}function findFragWithCC(fragments,cc){return BinarySearch.search(fragments,candidate=>{if(candidate.cc<cc){return 1;}else if(candidate.cc>cc){return -1;}else {return 0;}});}var NetworkErrorAction={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5};var ErrorActionFlags={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};// Reserved for future use
class ErrorController{constructor(hls){this.hls=void 0;this.playlistError=0;this.penalizedRenditions={};this.log=void 0;this.warn=void 0;this.error=void 0;this.hls=hls;this.log=logger.log.bind(logger,`[info]:`);this.warn=logger.warn.bind(logger,`[warning]:`);this.error=logger.error.bind(logger,`[error]:`);this.registerListeners();}registerListeners(){const hls=this.hls;hls.on(Events$1.ERROR,this.onError,this);hls.on(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.on(Events$1.LEVEL_UPDATED,this.onLevelUpdated,this);}unregisterListeners(){const hls=this.hls;if(!hls){return;}hls.off(Events$1.ERROR,this.onError,this);hls.off(Events$1.ERROR,this.onErrorOut,this);hls.off(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.off(Events$1.LEVEL_UPDATED,this.onLevelUpdated,this);}destroy(){this.unregisterListeners();// @ts-ignore
this.hls=null;this.penalizedRenditions={};}startLoad(startPosition){}stopLoad(){this.playlistError=0;}getVariantLevelIndex(frag){return (frag==null?void 0:frag.type)===PlaylistLevelType.MAIN?frag.level:this.hls.loadLevel;}onManifestLoading(){this.playlistError=0;this.penalizedRenditions={};}onLevelUpdated(){this.playlistError=0;}onError(event,data){var _data$frag,_data$level;if(data.fatal){return;}const hls=this.hls;const context=data.context;switch(data.details){case ErrorDetails.FRAG_LOAD_ERROR:case ErrorDetails.FRAG_LOAD_TIMEOUT:case ErrorDetails.KEY_LOAD_ERROR:case ErrorDetails.KEY_LOAD_TIMEOUT:data.errorAction=this.getFragRetryOrSwitchAction(data);return;case ErrorDetails.FRAG_PARSING_ERROR:// ignore empty segment errors marked as gap
if((_data$frag=data.frag)!=null&&_data$frag.gap){data.errorAction={action:NetworkErrorAction.DoNothing,flags:ErrorActionFlags.None};return;}// falls through
case ErrorDetails.FRAG_GAP:case ErrorDetails.FRAG_DECRYPT_ERROR:{// Switch level if possible, otherwise allow retry count to reach max error retries
data.errorAction=this.getFragRetryOrSwitchAction(data);data.errorAction.action=NetworkErrorAction.SendAlternateToPenaltyBox;return;}case ErrorDetails.LEVEL_EMPTY_ERROR:case ErrorDetails.LEVEL_PARSING_ERROR:{var _data$context,_data$context$levelDe;// Only retry when empty and live
const levelIndex=data.parent===PlaylistLevelType.MAIN?data.level:hls.loadLevel;if(data.details===ErrorDetails.LEVEL_EMPTY_ERROR&&!!((_data$context=data.context)!=null&&(_data$context$levelDe=_data$context.levelDetails)!=null&&_data$context$levelDe.live)){data.errorAction=this.getPlaylistRetryOrSwitchAction(data,levelIndex);}else {// Escalate to fatal if not retrying or switching
data.levelRetry=false;data.errorAction=this.getLevelSwitchAction(data,levelIndex);}}return;case ErrorDetails.LEVEL_LOAD_ERROR:case ErrorDetails.LEVEL_LOAD_TIMEOUT:if(typeof(context==null?void 0:context.level)==='number'){data.errorAction=this.getPlaylistRetryOrSwitchAction(data,context.level);}return;case ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case ErrorDetails.SUBTITLE_LOAD_ERROR:case ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:if(context){const level=hls.levels[hls.loadLevel];if(level&&(context.type===PlaylistContextType.AUDIO_TRACK&&level.hasAudioGroup(context.groupId)||context.type===PlaylistContextType.SUBTITLE_TRACK&&level.hasSubtitleGroup(context.groupId))){// Perform Pathway switch or Redundant failover if possible for fastest recovery
// otherwise allow playlist retry count to reach max error retries
data.errorAction=this.getPlaylistRetryOrSwitchAction(data,hls.loadLevel);data.errorAction.action=NetworkErrorAction.SendAlternateToPenaltyBox;data.errorAction.flags=ErrorActionFlags.MoveAllAlternatesMatchingHost;return;}}return;case ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const level=hls.levels[hls.loadLevel];const restrictedHdcpLevel=level==null?void 0:level.attrs['HDCP-LEVEL'];if(restrictedHdcpLevel){data.errorAction={action:NetworkErrorAction.SendAlternateToPenaltyBox,flags:ErrorActionFlags.MoveAllAlternatesMatchingHDCP,hdcpLevel:restrictedHdcpLevel};}else {this.keySystemError(data);}}return;case ErrorDetails.BUFFER_ADD_CODEC_ERROR:case ErrorDetails.REMUX_ALLOC_ERROR:case ErrorDetails.BUFFER_APPEND_ERROR:data.errorAction=this.getLevelSwitchAction(data,(_data$level=data.level)!=null?_data$level:hls.loadLevel);return;case ErrorDetails.INTERNAL_EXCEPTION:case ErrorDetails.BUFFER_APPENDING_ERROR:case ErrorDetails.BUFFER_FULL_ERROR:case ErrorDetails.LEVEL_SWITCH_ERROR:case ErrorDetails.BUFFER_STALLED_ERROR:case ErrorDetails.BUFFER_SEEK_OVER_HOLE:case ErrorDetails.BUFFER_NUDGE_ON_STALL:data.errorAction={action:NetworkErrorAction.DoNothing,flags:ErrorActionFlags.None};return;}if(data.type===ErrorTypes.KEY_SYSTEM_ERROR){this.keySystemError(data);}}keySystemError(data){const levelIndex=this.getVariantLevelIndex(data.frag);// Do not retry level. Escalate to fatal if switching levels fails.
data.levelRetry=false;data.errorAction=this.getLevelSwitchAction(data,levelIndex);}getPlaylistRetryOrSwitchAction(data,levelIndex){const hls=this.hls;const retryConfig=getRetryConfig(hls.config.playlistLoadPolicy,data);const retryCount=this.playlistError++;const retry=shouldRetry(retryConfig,retryCount,isTimeoutError(data),data.response);if(retry){return {action:NetworkErrorAction.RetryRequest,flags:ErrorActionFlags.None,retryConfig,retryCount};}const errorAction=this.getLevelSwitchAction(data,levelIndex);if(retryConfig){errorAction.retryConfig=retryConfig;errorAction.retryCount=retryCount;}return errorAction;}getFragRetryOrSwitchAction(data){const hls=this.hls;// Share fragment error count accross media options (main, audio, subs)
// This allows for level based rendition switching when media option assets fail
const variantLevelIndex=this.getVariantLevelIndex(data.frag);const level=hls.levels[variantLevelIndex];const{fragLoadPolicy,keyLoadPolicy}=hls.config;const retryConfig=getRetryConfig(data.details.startsWith('key')?keyLoadPolicy:fragLoadPolicy,data);const fragmentErrors=hls.levels.reduce((acc,level)=>acc+level.fragmentError,0);// Switch levels when out of retried or level index out of bounds
if(level){if(data.details!==ErrorDetails.FRAG_GAP){level.fragmentError++;}const retry=shouldRetry(retryConfig,fragmentErrors,isTimeoutError(data),data.response);if(retry){return {action:NetworkErrorAction.RetryRequest,flags:ErrorActionFlags.None,retryConfig,retryCount:fragmentErrors};}}// Reach max retry count, or Missing level reference
// Switch to valid index
const errorAction=this.getLevelSwitchAction(data,variantLevelIndex);// Add retry details to allow skipping of FRAG_PARSING_ERROR
if(retryConfig){errorAction.retryConfig=retryConfig;errorAction.retryCount=fragmentErrors;}return errorAction;}getLevelSwitchAction(data,levelIndex){const hls=this.hls;if(levelIndex===null||levelIndex===undefined){levelIndex=hls.loadLevel;}const level=this.hls.levels[levelIndex];if(level){var _data$frag2,_data$context2;const errorDetails=data.details;level.loadError++;if(errorDetails===ErrorDetails.BUFFER_APPEND_ERROR){level.fragmentError++;}// Search for next level to retry
let nextLevel=-1;const{levels,loadLevel,minAutoLevel,maxAutoLevel}=hls;if(!hls.autoLevelEnabled){hls.loadLevel=-1;}const fragErrorType=(_data$frag2=data.frag)==null?void 0:_data$frag2.type;// Find alternate audio codec if available on audio codec error
const isAudioCodecError=fragErrorType===PlaylistLevelType.AUDIO&&errorDetails===ErrorDetails.FRAG_PARSING_ERROR||data.sourceBufferName==='audio'&&(errorDetails===ErrorDetails.BUFFER_ADD_CODEC_ERROR||errorDetails===ErrorDetails.BUFFER_APPEND_ERROR);const findAudioCodecAlternate=isAudioCodecError&&levels.some(({audioCodec})=>level.audioCodec!==audioCodec);// Find alternate video codec if available on video codec error
const isVideoCodecError=data.sourceBufferName==='video'&&(errorDetails===ErrorDetails.BUFFER_ADD_CODEC_ERROR||errorDetails===ErrorDetails.BUFFER_APPEND_ERROR);const findVideoCodecAlternate=isVideoCodecError&&levels.some(({codecSet,audioCodec})=>level.codecSet!==codecSet&&level.audioCodec===audioCodec);const{type:playlistErrorType,groupId:playlistErrorGroupId}=(_data$context2=data.context)!=null?_data$context2:{};for(let i=levels.length;i--;){const candidate=(i+loadLevel)%levels.length;if(candidate!==loadLevel&&candidate>=minAutoLevel&&candidate<=maxAutoLevel&&levels[candidate].loadError===0){var _level$audioGroups,_level$subtitleGroups;const levelCandidate=levels[candidate];// Skip level switch if GAP tag is found in next level at same position
if(errorDetails===ErrorDetails.FRAG_GAP&&data.frag){const levelDetails=levels[candidate].details;if(levelDetails){const fragCandidate=findFragmentByPTS(data.frag,levelDetails.fragments,data.frag.start);if(fragCandidate!=null&&fragCandidate.gap){continue;}}}else if(playlistErrorType===PlaylistContextType.AUDIO_TRACK&&levelCandidate.hasAudioGroup(playlistErrorGroupId)||playlistErrorType===PlaylistContextType.SUBTITLE_TRACK&&levelCandidate.hasSubtitleGroup(playlistErrorGroupId)){// For audio/subs playlist errors find another group ID or fallthrough to redundant fail-over
continue;}else if(fragErrorType===PlaylistLevelType.AUDIO&&(_level$audioGroups=level.audioGroups)!=null&&_level$audioGroups.some(groupId=>levelCandidate.hasAudioGroup(groupId))||fragErrorType===PlaylistLevelType.SUBTITLE&&(_level$subtitleGroups=level.subtitleGroups)!=null&&_level$subtitleGroups.some(groupId=>levelCandidate.hasSubtitleGroup(groupId))||findAudioCodecAlternate&&level.audioCodec===levelCandidate.audioCodec||!findAudioCodecAlternate&&level.audioCodec!==levelCandidate.audioCodec||findVideoCodecAlternate&&level.codecSet===levelCandidate.codecSet){// For video/audio/subs frag errors find another group ID or fallthrough to redundant fail-over
continue;}nextLevel=candidate;break;}}if(nextLevel>-1&&hls.loadLevel!==nextLevel){data.levelRetry=true;this.playlistError=0;return {action:NetworkErrorAction.SendAlternateToPenaltyBox,flags:ErrorActionFlags.None,nextAutoLevel:nextLevel};}}// No levels to switch / Manual level selection / Level not found
// Resolve with Pathway switch, Redundant fail-over, or stay on lowest Level
return {action:NetworkErrorAction.SendAlternateToPenaltyBox,flags:ErrorActionFlags.MoveAllAlternatesMatchingHost};}onErrorOut(event,data){var _data$errorAction;switch((_data$errorAction=data.errorAction)==null?void 0:_data$errorAction.action){case NetworkErrorAction.DoNothing:break;case NetworkErrorAction.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(data);if(!data.errorAction.resolved&&data.details!==ErrorDetails.FRAG_GAP){data.fatal=true;}else if(/MediaSource readyState: ended/.test(data.error.message)){this.warn(`MediaSource ended after "${data.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`);this.hls.recoverMediaError();}break;case NetworkErrorAction.RetryRequest:// handled by stream and playlist/level controllers
break;}if(data.fatal){this.hls.stopLoad();return;}}sendAlternateToPenaltyBox(data){const hls=this.hls;const errorAction=data.errorAction;if(!errorAction){return;}const{flags,hdcpLevel,nextAutoLevel}=errorAction;switch(flags){case ErrorActionFlags.None:this.switchLevel(data,nextAutoLevel);break;case ErrorActionFlags.MoveAllAlternatesMatchingHDCP:if(hdcpLevel){hls.maxHdcpLevel=HdcpLevels[HdcpLevels.indexOf(hdcpLevel)-1];errorAction.resolved=true;}this.warn(`Restricting playback to HDCP-LEVEL of "${hls.maxHdcpLevel}" or lower`);break;}// If not resolved by previous actions try to switch to next level
if(!errorAction.resolved){this.switchLevel(data,nextAutoLevel);}}switchLevel(data,levelIndex){if(levelIndex!==undefined&&data.errorAction){this.warn(`switching to level ${levelIndex} after ${data.details}`);this.hls.nextAutoLevel=levelIndex;data.errorAction.resolved=true;// Stream controller is responsible for this but won't switch on false start
this.hls.nextLoadLevel=this.hls.nextAutoLevel;}}}class BasePlaylistController{constructor(hls,logPrefix){this.hls=void 0;this.timer=-1;this.requestScheduled=-1;this.canLoad=false;this.log=void 0;this.warn=void 0;this.log=logger.log.bind(logger,`${logPrefix}:`);this.warn=logger.warn.bind(logger,`${logPrefix}:`);this.hls=hls;}destroy(){this.clearTimer();// @ts-ignore
this.hls=this.log=this.warn=null;}clearTimer(){if(this.timer!==-1){self.clearTimeout(this.timer);this.timer=-1;}}startLoad(){this.canLoad=true;this.requestScheduled=-1;this.loadPlaylist();}stopLoad(){this.canLoad=false;this.clearTimer();}switchParams(playlistUri,previous,current){const renditionReports=previous==null?void 0:previous.renditionReports;if(renditionReports){let foundIndex=-1;for(let i=0;i<renditionReports.length;i++){const attr=renditionReports[i];let uri;try{uri=new self.URL(attr.URI,previous.url).href;}catch(error){logger.warn(`Could not construct new URL for Rendition Report: ${error}`);uri=attr.URI||'';}// Use exact match. Otherwise, the last partial match, if any, will be used
// (Playlist URI includes a query string that the Rendition Report does not)
if(uri===playlistUri){foundIndex=i;break;}else if(uri===playlistUri.substring(0,uri.length)){foundIndex=i;}}if(foundIndex!==-1){const attr=renditionReports[foundIndex];const msn=parseInt(attr['LAST-MSN'])||(previous==null?void 0:previous.lastPartSn);let part=parseInt(attr['LAST-PART'])||(previous==null?void 0:previous.lastPartIndex);if(this.hls.config.lowLatencyMode){const currentGoal=Math.min(previous.age-previous.partTarget,previous.targetduration);if(part>=0&&currentGoal>previous.partTarget){part+=1;}}const skip=current&&getSkipValue(current);return new HlsUrlParameters(msn,part>=0?part:undefined,skip);}}}loadPlaylist(hlsUrlParameters){if(this.requestScheduled===-1){this.requestScheduled=self.performance.now();}// Loading is handled by the subclasses
}shouldLoadPlaylist(playlist){return this.canLoad&&!!playlist&&!!playlist.url&&(!playlist.details||playlist.details.live);}shouldReloadPlaylist(playlist){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(playlist);}playlistLoaded(index,data,previousDetails){const{details,stats}=data;// Set last updated date-time
const now=self.performance.now();const elapsed=stats.loading.first?Math.max(0,now-stats.loading.first):0;details.advancedDateTime=Date.now()-elapsed;// if current playlist is a live playlist, arm a timer to reload it
if(details.live||previousDetails!=null&&previousDetails.live){details.reloaded(previousDetails);if(previousDetails){this.log(`live playlist ${index} ${details.advanced?'REFRESHED '+details.lastPartSn+'-'+details.lastPartIndex:details.updated?'UPDATED':'MISSED'}`);}// Merge live playlists to adjust fragment starts and fill in delta playlist skipped segments
if(previousDetails&&details.fragments.length>0){mergeDetails(previousDetails,details);}if(!this.canLoad||!details.live){return;}let deliveryDirectives;let msn=undefined;let part=undefined;if(details.canBlockReload&&details.endSN&&details.advanced){// Load level with LL-HLS delivery directives
const lowLatencyMode=this.hls.config.lowLatencyMode;const lastPartSn=details.lastPartSn;const endSn=details.endSN;const lastPartIndex=details.lastPartIndex;const hasParts=lastPartIndex!==-1;const lastPart=lastPartSn===endSn;// When low latency mode is disabled, we'll skip part requests once the last part index is found
const nextSnStartIndex=lowLatencyMode?0:lastPartIndex;if(hasParts){msn=lastPart?endSn+1:lastPartSn;part=lastPart?nextSnStartIndex:lastPartIndex+1;}else {msn=endSn+1;}// Low-Latency CDN Tune-in: "age" header and time since load indicates we're behind by more than one part
// Update directives to obtain the Playlist that has the estimated additional duration of media
const lastAdvanced=details.age;const cdnAge=lastAdvanced+details.ageHeader;let currentGoal=Math.min(cdnAge-details.partTarget,details.targetduration*1.5);if(currentGoal>0){if(previousDetails&&currentGoal>previousDetails.tuneInGoal){// If we attempted to get the next or latest playlist update, but currentGoal increased,
// then we either can't catchup, or the "age" header cannot be trusted.
this.warn(`CDN Tune-in goal increased from: ${previousDetails.tuneInGoal} to: ${currentGoal} with playlist age: ${details.age}`);currentGoal=0;}else {const segments=Math.floor(currentGoal/details.targetduration);msn+=segments;if(part!==undefined){const parts=Math.round(currentGoal%details.targetduration/details.partTarget);part+=parts;}this.log(`CDN Tune-in age: ${details.ageHeader}s last advanced ${lastAdvanced.toFixed(2)}s goal: ${currentGoal} skip sn ${segments} to part ${part}`);}details.tuneInGoal=currentGoal;}deliveryDirectives=this.getDeliveryDirectives(details,data.deliveryDirectives,msn,part);if(lowLatencyMode||!lastPart){this.loadPlaylist(deliveryDirectives);return;}}else if(details.canBlockReload||details.canSkipUntil){deliveryDirectives=this.getDeliveryDirectives(details,data.deliveryDirectives,msn,part);}const bufferInfo=this.hls.mainForwardBufferInfo;const position=bufferInfo?bufferInfo.end-bufferInfo.len:0;const distanceToLiveEdgeMs=(details.edge-position)*1000;const reloadInterval=computeReloadInterval(details,distanceToLiveEdgeMs);if(details.updated&&now>this.requestScheduled+reloadInterval){this.requestScheduled=stats.loading.start;}if(msn!==undefined&&details.canBlockReload){this.requestScheduled=stats.loading.first+reloadInterval-(details.partTarget*1000||1000);}else if(this.requestScheduled===-1||this.requestScheduled+reloadInterval<now){this.requestScheduled=now;}else if(this.requestScheduled-now<=0){this.requestScheduled+=reloadInterval;}let estimatedTimeUntilUpdate=this.requestScheduled-now;estimatedTimeUntilUpdate=Math.max(0,estimatedTimeUntilUpdate);this.log(`reload live playlist ${index} in ${Math.round(estimatedTimeUntilUpdate)} ms`);// this.log(
//   `live reload ${details.updated ? 'REFRESHED' : 'MISSED'}
// reload in ${estimatedTimeUntilUpdate / 1000}
// round trip ${(stats.loading.end - stats.loading.start) / 1000}
// diff ${
//   (reloadInterval -
//     (estimatedTimeUntilUpdate +
//       stats.loading.end -
//       stats.loading.start)) /
//   1000
// }
// reload interval ${reloadInterval / 1000}
// target duration ${details.targetduration}
// distance to edge ${distanceToLiveEdgeMs / 1000}`
// );
this.timer=self.setTimeout(()=>this.loadPlaylist(deliveryDirectives),estimatedTimeUntilUpdate);}else {this.clearTimer();}}getDeliveryDirectives(details,previousDeliveryDirectives,msn,part){let skip=getSkipValue(details);if(previousDeliveryDirectives!=null&&previousDeliveryDirectives.skip&&details.deltaUpdateFailed){msn=previousDeliveryDirectives.msn;part=previousDeliveryDirectives.part;skip=HlsSkip.No;}return new HlsUrlParameters(msn,part,skip);}checkRetry(errorEvent){const errorDetails=errorEvent.details;const isTimeout=isTimeoutError(errorEvent);const errorAction=errorEvent.errorAction;const{action,retryCount=0,retryConfig}=errorAction||{};const retry=!!errorAction&&!!retryConfig&&(action===NetworkErrorAction.RetryRequest||!errorAction.resolved&&action===NetworkErrorAction.SendAlternateToPenaltyBox);if(retry){var _errorEvent$context;this.requestScheduled=-1;if(retryCount>=retryConfig.maxNumRetry){return false;}if(isTimeout&&(_errorEvent$context=errorEvent.context)!=null&&_errorEvent$context.deliveryDirectives){// The LL-HLS request already timed out so retry immediately
this.warn(`Retrying playlist loading ${retryCount+1}/${retryConfig.maxNumRetry} after "${errorDetails}" without delivery-directives`);this.loadPlaylist();}else {const delay=getRetryDelay(retryConfig,retryCount);// Schedule level/track reload
this.timer=self.setTimeout(()=>this.loadPlaylist(),delay);this.warn(`Retrying playlist loading ${retryCount+1}/${retryConfig.maxNumRetry} after "${errorDetails}" in ${delay}ms`);}// `levelRetry = true` used to inform other controllers that a retry is happening
errorEvent.levelRetry=true;errorAction.resolved=true;}return retry;}}/*
 * compute an Exponential Weighted moving average
 * - https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average
 *  - heavily inspired from shaka-player
 */class EWMA{//  About half of the estimated value will be from the last |halfLife| samples by weight.
constructor(halfLife,estimate=0,weight=0){this.halfLife=void 0;this.alpha_=void 0;this.estimate_=void 0;this.totalWeight_=void 0;this.halfLife=halfLife;// Larger values of alpha expire historical data more slowly.
this.alpha_=halfLife?Math.exp(Math.log(0.5)/halfLife):0;this.estimate_=estimate;this.totalWeight_=weight;}sample(weight,value){const adjAlpha=Math.pow(this.alpha_,weight);this.estimate_=value*(1-adjAlpha)+adjAlpha*this.estimate_;this.totalWeight_+=weight;}getTotalWeight(){return this.totalWeight_;}getEstimate(){if(this.alpha_){const zeroFactor=1-Math.pow(this.alpha_,this.totalWeight_);if(zeroFactor){return this.estimate_/zeroFactor;}}return this.estimate_;}}/*
 * EWMA Bandwidth Estimator
 *  - heavily inspired from shaka-player
 * Tracks bandwidth samples and estimates available bandwidth.
 * Based on the minimum of two exponentially-weighted moving averages with
 * different half-lives.
 */class EwmaBandWidthEstimator{constructor(slow,fast,defaultEstimate,defaultTTFB=100){this.defaultEstimate_=void 0;this.minWeight_=void 0;this.minDelayMs_=void 0;this.slow_=void 0;this.fast_=void 0;this.defaultTTFB_=void 0;this.ttfb_=void 0;this.defaultEstimate_=defaultEstimate;this.minWeight_=0.001;this.minDelayMs_=50;this.slow_=new EWMA(slow);this.fast_=new EWMA(fast);this.defaultTTFB_=defaultTTFB;this.ttfb_=new EWMA(slow);}update(slow,fast){const{slow_,fast_,ttfb_}=this;if(slow_.halfLife!==slow){this.slow_=new EWMA(slow,slow_.getEstimate(),slow_.getTotalWeight());}if(fast_.halfLife!==fast){this.fast_=new EWMA(fast,fast_.getEstimate(),fast_.getTotalWeight());}if(ttfb_.halfLife!==slow){this.ttfb_=new EWMA(slow,ttfb_.getEstimate(),ttfb_.getTotalWeight());}}sample(durationMs,numBytes){durationMs=Math.max(durationMs,this.minDelayMs_);const numBits=8*numBytes;// weight is duration in seconds
const durationS=durationMs/1000;// value is bandwidth in bits/s
const bandwidthInBps=numBits/durationS;this.fast_.sample(durationS,bandwidthInBps);this.slow_.sample(durationS,bandwidthInBps);}sampleTTFB(ttfb){// weight is frequency curve applied to TTFB in seconds
// (longer times have less weight with expected input under 1 second)
const seconds=ttfb/1000;const weight=Math.sqrt(2)*Math.exp(-Math.pow(seconds,2)/2);this.ttfb_.sample(weight,Math.max(ttfb,5));}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_;}getEstimate(){if(this.canEstimate()){// console.log('slow estimate:'+ Math.round(this.slow_.getEstimate()));
// console.log('fast estimate:'+ Math.round(this.fast_.getEstimate()));
// Take the minimum of these two estimates.  This should have the effect of
// adapting down quickly, but up more slowly.
return Math.min(this.fast_.getEstimate(),this.slow_.getEstimate());}else {return this.defaultEstimate_;}}getEstimateTTFB(){if(this.ttfb_.getTotalWeight()>=this.minWeight_){return this.ttfb_.getEstimate();}else {return this.defaultTTFB_;}}destroy(){}}const SUPPORTED_INFO_DEFAULT={supported:true,configurations:[],decodingInfoResults:[{supported:true,powerEfficient:true,smooth:true}]};const SUPPORTED_INFO_CACHE={};function requiresMediaCapabilitiesDecodingInfo(level,audioTracksByGroup,currentVideoRange,currentFrameRate,currentBw,audioPreference){// Only test support when configuration is exceeds minimum options
const audioGroups=level.audioCodec?level.audioGroups:null;const audioCodecPreference=audioPreference==null?void 0:audioPreference.audioCodec;const channelsPreference=audioPreference==null?void 0:audioPreference.channels;const maxChannels=channelsPreference?parseInt(channelsPreference):audioCodecPreference?Infinity:2;let audioChannels=null;if(audioGroups!=null&&audioGroups.length){try{if(audioGroups.length===1&&audioGroups[0]){audioChannels=audioTracksByGroup.groups[audioGroups[0]].channels;}else {audioChannels=audioGroups.reduce((acc,groupId)=>{if(groupId){const audioTrackGroup=audioTracksByGroup.groups[groupId];if(!audioTrackGroup){throw new Error(`Audio track group ${groupId} not found`);}// Sum all channel key values
Object.keys(audioTrackGroup.channels).forEach(key=>{acc[key]=(acc[key]||0)+audioTrackGroup.channels[key];});}return acc;},{2:0});}}catch(error){return true;}}return level.videoCodec!==undefined&&(level.width>1920&&level.height>1088||level.height>1920&&level.width>1088||level.frameRate>Math.max(currentFrameRate,30)||level.videoRange!=='SDR'&&level.videoRange!==currentVideoRange||level.bitrate>Math.max(currentBw,8e6))||!!audioChannels&&isFiniteNumber(maxChannels)&&Object.keys(audioChannels).some(channels=>parseInt(channels)>maxChannels);}function getMediaDecodingInfoPromise(level,audioTracksByGroup,mediaCapabilities){const videoCodecs=level.videoCodec;const audioCodecs=level.audioCodec;if(!videoCodecs||!audioCodecs||!mediaCapabilities){return Promise.resolve(SUPPORTED_INFO_DEFAULT);}const baseVideoConfiguration={width:level.width,height:level.height,bitrate:Math.ceil(Math.max(level.bitrate*0.9,level.averageBitrate)),// Assume a framerate of 30fps since MediaCapabilities will not accept Level default of 0.
framerate:level.frameRate||30};const videoRange=level.videoRange;if(videoRange!=='SDR'){baseVideoConfiguration.transferFunction=videoRange.toLowerCase();}const configurations=videoCodecs.split(',').map(videoCodec=>({type:'media-source',video:_objectSpread2(_objectSpread2({},baseVideoConfiguration),{},{contentType:mimeTypeForCodec(videoCodec,'video')})}));if(audioCodecs&&level.audioGroups){level.audioGroups.forEach(audioGroupId=>{var _audioTracksByGroup$g;if(!audioGroupId){return;}(_audioTracksByGroup$g=audioTracksByGroup.groups[audioGroupId])==null?void 0:_audioTracksByGroup$g.tracks.forEach(audioTrack=>{if(audioTrack.groupId===audioGroupId){const channels=audioTrack.channels||'';const channelsNumber=parseFloat(channels);if(isFiniteNumber(channelsNumber)&&channelsNumber>2){configurations.push.apply(configurations,audioCodecs.split(',').map(audioCodec=>({type:'media-source',audio:{contentType:mimeTypeForCodec(audioCodec,'audio'),channels:''+channelsNumber// spatialRendering:
//   audioCodec === 'ec-3' && channels.indexOf('JOC'),
}})));}}});});}return Promise.all(configurations.map(configuration=>{// Cache MediaCapabilities promises
const decodingInfoKey=getMediaDecodingInfoKey(configuration);return SUPPORTED_INFO_CACHE[decodingInfoKey]||(SUPPORTED_INFO_CACHE[decodingInfoKey]=mediaCapabilities.decodingInfo(configuration));})).then(decodingInfoResults=>({supported:!decodingInfoResults.some(info=>!info.supported),configurations,decodingInfoResults})).catch(error=>({supported:false,configurations,decodingInfoResults:[],error}));}function getMediaDecodingInfoKey(config){const{audio,video}=config;const mediaConfig=video||audio;if(mediaConfig){const codec=mediaConfig.contentType.split('"')[1];if(video){return `r${video.height}x${video.width}f${Math.ceil(video.framerate)}${video.transferFunction||'sd'}_${codec}_${Math.ceil(video.bitrate/1e5)}`;}if(audio){return `c${audio.channels}${audio.spatialRendering?'s':'n'}_${codec}`;}}return '';}/**
 * @returns Whether we can detect and validate HDR capability within the window context
 */function isHdrSupported(){if(typeof matchMedia==='function'){const mediaQueryList=matchMedia('(dynamic-range: high)');const badQuery=matchMedia('bad query');if(mediaQueryList.media!==badQuery.media){return mediaQueryList.matches===true;}}return false;}/**
 * Sanitizes inputs to return the active video selection options for HDR/SDR.
 * When both inputs are null:
 *
 *    `{ preferHDR: false, allowedVideoRanges: [] }`
 *
 * When `currentVideoRange` non-null, maintain the active range:
 *
 *    `{ preferHDR: currentVideoRange !== 'SDR', allowedVideoRanges: [currentVideoRange] }`
 *
 * When VideoSelectionOption non-null:
 *
 *  - Allow all video ranges if `allowedVideoRanges` unspecified.
 *  - If `preferHDR` is non-null use the value to filter `allowedVideoRanges`.
 *  - Else check window for HDR support and set `preferHDR` to the result.
 *
 * @param currentVideoRange
 * @param videoPreference
 */function getVideoSelectionOptions(currentVideoRange,videoPreference){let preferHDR=false;let allowedVideoRanges=[];if(currentVideoRange){preferHDR=currentVideoRange!=='SDR';allowedVideoRanges=[currentVideoRange];}if(videoPreference){allowedVideoRanges=videoPreference.allowedVideoRanges||VideoRangeValues.slice(0);preferHDR=videoPreference.preferHDR!==undefined?videoPreference.preferHDR:isHdrSupported();if(preferHDR){allowedVideoRanges=allowedVideoRanges.filter(range=>range!=='SDR');}else {allowedVideoRanges=['SDR'];}}return {preferHDR,allowedVideoRanges};}function getStartCodecTier(codecTiers,currentVideoRange,currentBw,audioPreference,videoPreference){const codecSets=Object.keys(codecTiers);const channelsPreference=audioPreference==null?void 0:audioPreference.channels;const audioCodecPreference=audioPreference==null?void 0:audioPreference.audioCodec;const preferStereo=channelsPreference&&parseInt(channelsPreference)===2;// Use first level set to determine stereo, and minimum resolution and framerate
let hasStereo=true;let hasCurrentVideoRange=false;let minHeight=Infinity;let minFramerate=Infinity;let minBitrate=Infinity;let selectedScore=0;let videoRanges=[];const{preferHDR,allowedVideoRanges}=getVideoSelectionOptions(currentVideoRange,videoPreference);for(let i=codecSets.length;i--;){const tier=codecTiers[codecSets[i]];hasStereo=tier.channels[2]>0;minHeight=Math.min(minHeight,tier.minHeight);minFramerate=Math.min(minFramerate,tier.minFramerate);minBitrate=Math.min(minBitrate,tier.minBitrate);const matchingVideoRanges=allowedVideoRanges.filter(range=>tier.videoRanges[range]>0);if(matchingVideoRanges.length>0){hasCurrentVideoRange=true;videoRanges=matchingVideoRanges;}}minHeight=isFiniteNumber(minHeight)?minHeight:0;minFramerate=isFiniteNumber(minFramerate)?minFramerate:0;const maxHeight=Math.max(1080,minHeight);const maxFramerate=Math.max(30,minFramerate);minBitrate=isFiniteNumber(minBitrate)?minBitrate:currentBw;currentBw=Math.max(minBitrate,currentBw);// If there are no variants with matching preference, set currentVideoRange to undefined
if(!hasCurrentVideoRange){currentVideoRange=undefined;videoRanges=[];}const codecSet=codecSets.reduce((selected,candidate)=>{// Remove candiates which do not meet bitrate, default audio, stereo or channels preference, 1080p or lower, 30fps or lower, or SDR/HDR selection if present
const candidateTier=codecTiers[candidate];if(candidate===selected){return selected;}if(candidateTier.minBitrate>currentBw){logStartCodecCandidateIgnored(candidate,`min bitrate of ${candidateTier.minBitrate} > current estimate of ${currentBw}`);return selected;}if(!candidateTier.hasDefaultAudio){logStartCodecCandidateIgnored(candidate,`no renditions with default or auto-select sound found`);return selected;}if(audioCodecPreference&&candidate.indexOf(audioCodecPreference.substring(0,4))%5!==0){logStartCodecCandidateIgnored(candidate,`audio codec preference "${audioCodecPreference}" not found`);return selected;}if(channelsPreference&&!preferStereo){if(!candidateTier.channels[channelsPreference]){logStartCodecCandidateIgnored(candidate,`no renditions with ${channelsPreference} channel sound found (channels options: ${Object.keys(candidateTier.channels)})`);return selected;}}else if((!audioCodecPreference||preferStereo)&&hasStereo&&candidateTier.channels['2']===0){logStartCodecCandidateIgnored(candidate,`no renditions with stereo sound found`);return selected;}if(candidateTier.minHeight>maxHeight){logStartCodecCandidateIgnored(candidate,`min resolution of ${candidateTier.minHeight} > maximum of ${maxHeight}`);return selected;}if(candidateTier.minFramerate>maxFramerate){logStartCodecCandidateIgnored(candidate,`min framerate of ${candidateTier.minFramerate} > maximum of ${maxFramerate}`);return selected;}if(!videoRanges.some(range=>candidateTier.videoRanges[range]>0)){logStartCodecCandidateIgnored(candidate,`no variants with VIDEO-RANGE of ${JSON.stringify(videoRanges)} found`);return selected;}if(candidateTier.maxScore<selectedScore){logStartCodecCandidateIgnored(candidate,`max score of ${candidateTier.maxScore} < selected max of ${selectedScore}`);return selected;}// Remove candiates with less preferred codecs or more errors
if(selected&&(codecsSetSelectionPreferenceValue(candidate)>=codecsSetSelectionPreferenceValue(selected)||candidateTier.fragmentError>codecTiers[selected].fragmentError)){return selected;}selectedScore=candidateTier.maxScore;return candidate;},undefined);return {codecSet,videoRanges,preferHDR,minFramerate,minBitrate};}function logStartCodecCandidateIgnored(codeSet,reason){logger.log(`[abr] start candidates with "${codeSet}" ignored because ${reason}`);}function getAudioTracksByGroup(allAudioTracks){return allAudioTracks.reduce((audioTracksByGroup,track)=>{let trackGroup=audioTracksByGroup.groups[track.groupId];if(!trackGroup){trackGroup=audioTracksByGroup.groups[track.groupId]={tracks:[],channels:{2:0},hasDefault:false,hasAutoSelect:false};}trackGroup.tracks.push(track);const channelsKey=track.channels||'2';trackGroup.channels[channelsKey]=(trackGroup.channels[channelsKey]||0)+1;trackGroup.hasDefault=trackGroup.hasDefault||track.default;trackGroup.hasAutoSelect=trackGroup.hasAutoSelect||track.autoselect;if(trackGroup.hasDefault){audioTracksByGroup.hasDefaultAudio=true;}if(trackGroup.hasAutoSelect){audioTracksByGroup.hasAutoSelectAudio=true;}return audioTracksByGroup;},{hasDefaultAudio:false,hasAutoSelectAudio:false,groups:{}});}function getCodecTiers(levels,audioTracksByGroup,minAutoLevel,maxAutoLevel){return levels.slice(minAutoLevel,maxAutoLevel+1).reduce((tiers,level)=>{if(!level.codecSet){return tiers;}const audioGroups=level.audioGroups;let tier=tiers[level.codecSet];if(!tier){tiers[level.codecSet]=tier={minBitrate:Infinity,minHeight:Infinity,minFramerate:Infinity,maxScore:0,videoRanges:{SDR:0},channels:{'2':0},hasDefaultAudio:!audioGroups,fragmentError:0};}tier.minBitrate=Math.min(tier.minBitrate,level.bitrate);const lesserWidthOrHeight=Math.min(level.height,level.width);tier.minHeight=Math.min(tier.minHeight,lesserWidthOrHeight);tier.minFramerate=Math.min(tier.minFramerate,level.frameRate);tier.maxScore=Math.max(tier.maxScore,level.score);tier.fragmentError+=level.fragmentError;tier.videoRanges[level.videoRange]=(tier.videoRanges[level.videoRange]||0)+1;if(audioGroups){audioGroups.forEach(audioGroupId=>{if(!audioGroupId){return;}const audioGroup=audioTracksByGroup.groups[audioGroupId];if(!audioGroup){return;}// Default audio is any group with DEFAULT=YES, or if missing then any group with AUTOSELECT=YES, or all variants
tier.hasDefaultAudio=tier.hasDefaultAudio||audioTracksByGroup.hasDefaultAudio?audioGroup.hasDefault:audioGroup.hasAutoSelect||!audioTracksByGroup.hasDefaultAudio&&!audioTracksByGroup.hasAutoSelectAudio;Object.keys(audioGroup.channels).forEach(channels=>{tier.channels[channels]=(tier.channels[channels]||0)+audioGroup.channels[channels];});});}return tiers;},{});}function findMatchingOption(option,tracks,matchPredicate){if('attrs'in option){const index=tracks.indexOf(option);if(index!==-1){return index;}}for(let i=0;i<tracks.length;i++){const track=tracks[i];if(matchesOption(option,track,matchPredicate)){return i;}}return -1;}function matchesOption(option,track,matchPredicate){const{groupId,name,lang,assocLang,characteristics,default:isDefault}=option;const forced=option.forced;return (groupId===undefined||track.groupId===groupId)&&(name===undefined||track.name===name)&&(lang===undefined||track.lang===lang)&&(lang===undefined||track.assocLang===assocLang)&&(isDefault===undefined||track.default===isDefault)&&(forced===undefined||track.forced===forced)&&(characteristics===undefined||characteristicsMatch(characteristics,track.characteristics))&&(matchPredicate===undefined||matchPredicate(option,track));}function characteristicsMatch(characteristicsA,characteristicsB=''){const arrA=characteristicsA.split(',');const arrB=characteristicsB.split(',');// Expects each item to be unique:
return arrA.length===arrB.length&&!arrA.some(el=>arrB.indexOf(el)===-1);}function audioMatchPredicate(option,track){const{audioCodec,channels}=option;return (audioCodec===undefined||(track.audioCodec||'').substring(0,4)===audioCodec.substring(0,4))&&(channels===undefined||channels===(track.channels||'2'));}function findClosestLevelWithAudioGroup(option,levels,allAudioTracks,searchIndex,matchPredicate){const currentLevel=levels[searchIndex];// Are there variants with same URI as current level?
// If so, find a match that does not require any level URI change
const variants=levels.reduce((variantMap,level,index)=>{const uri=level.uri;const renditions=variantMap[uri]||(variantMap[uri]=[]);renditions.push(index);return variantMap;},{});const renditions=variants[currentLevel.uri];if(renditions.length>1){searchIndex=Math.max.apply(Math,renditions);}// Find best match
const currentVideoRange=currentLevel.videoRange;const currentFrameRate=currentLevel.frameRate;const currentVideoCodec=currentLevel.codecSet.substring(0,4);const matchingVideo=searchDownAndUpList(levels,searchIndex,level=>{if(level.videoRange!==currentVideoRange||level.frameRate!==currentFrameRate||level.codecSet.substring(0,4)!==currentVideoCodec){return false;}const audioGroups=level.audioGroups;const tracks=allAudioTracks.filter(track=>!audioGroups||audioGroups.indexOf(track.groupId)!==-1);return findMatchingOption(option,tracks,matchPredicate)>-1;});if(matchingVideo>-1){return matchingVideo;}return searchDownAndUpList(levels,searchIndex,level=>{const audioGroups=level.audioGroups;const tracks=allAudioTracks.filter(track=>!audioGroups||audioGroups.indexOf(track.groupId)!==-1);return findMatchingOption(option,tracks,matchPredicate)>-1;});}function searchDownAndUpList(arr,searchIndex,predicate){for(let i=searchIndex;i;i--){if(predicate(arr[i])){return i;}}for(let i=searchIndex+1;i<arr.length;i++){if(predicate(arr[i])){return i;}}return -1;}class AbrController{constructor(_hls){this.hls=void 0;this.lastLevelLoadSec=0;this.lastLoadedFragLevel=-1;this.firstSelection=-1;this._nextAutoLevel=-1;this.nextAutoLevelKey='';this.audioTracksByGroup=null;this.codecTiers=null;this.timer=-1;this.fragCurrent=null;this.partCurrent=null;this.bitrateTestDelay=0;this.bwEstimator=void 0;/*
        This method monitors the download rate of the current fragment, and will downswitch if that fragment will not load
        quickly enough to prevent underbuffering
      */this._abandonRulesCheck=()=>{const{fragCurrent:frag,partCurrent:part,hls}=this;const{autoLevelEnabled,media}=hls;if(!frag||!media){return;}const now=performance.now();const stats=part?part.stats:frag.stats;const duration=part?part.duration:frag.duration;const timeLoading=now-stats.loading.start;const minAutoLevel=hls.minAutoLevel;// If frag loading is aborted, complete, or from lowest level, stop timer and return
if(stats.aborted||stats.loaded&&stats.loaded===stats.total||frag.level<=minAutoLevel){this.clearTimer();// reset forced auto level value so that next level will be selected
this._nextAutoLevel=-1;return;}// This check only runs if we're in ABR mode and actually playing
if(!autoLevelEnabled||media.paused||!media.playbackRate||!media.readyState){return;}const bufferInfo=hls.mainForwardBufferInfo;if(bufferInfo===null){return;}const ttfbEstimate=this.bwEstimator.getEstimateTTFB();const playbackRate=Math.abs(media.playbackRate);// To maintain stable adaptive playback, only begin monitoring frag loading after half or more of its playback duration has passed
if(timeLoading<=Math.max(ttfbEstimate,1000*(duration/(playbackRate*2)))){return;}// bufferStarvationDelay is an estimate of the amount time (in seconds) it will take to exhaust the buffer
const bufferStarvationDelay=bufferInfo.len/playbackRate;const ttfb=stats.loading.first?stats.loading.first-stats.loading.start:-1;const loadedFirstByte=stats.loaded&&ttfb>-1;const bwEstimate=this.getBwEstimate();const levels=hls.levels;const level=levels[frag.level];const expectedLen=stats.total||Math.max(stats.loaded,Math.round(duration*level.averageBitrate/8));let timeStreaming=loadedFirstByte?timeLoading-ttfb:timeLoading;if(timeStreaming<1&&loadedFirstByte){timeStreaming=Math.min(timeLoading,stats.loaded*8/bwEstimate);}const loadRate=loadedFirstByte?stats.loaded*1000/timeStreaming:0;// fragLoadDelay is an estimate of the time (in seconds) it will take to buffer the remainder of the fragment
const fragLoadedDelay=loadRate?(expectedLen-stats.loaded)/loadRate:expectedLen*8/bwEstimate+ttfbEstimate/1000;// Only downswitch if the time to finish loading the current fragment is greater than the amount of buffer left
if(fragLoadedDelay<=bufferStarvationDelay){return;}const bwe=loadRate?loadRate*8:bwEstimate;let fragLevelNextLoadedDelay=Number.POSITIVE_INFINITY;let nextLoadLevel;// Iterate through lower level and try to find the largest one that avoids rebuffering
for(nextLoadLevel=frag.level-1;nextLoadLevel>minAutoLevel;nextLoadLevel--){// compute time to load next fragment at lower level
// 8 = bits per byte (bps/Bps)
const levelNextBitrate=levels[nextLoadLevel].maxBitrate;fragLevelNextLoadedDelay=this.getTimeToLoadFrag(ttfbEstimate/1000,bwe,duration*levelNextBitrate,!levels[nextLoadLevel].details);if(fragLevelNextLoadedDelay<bufferStarvationDelay){break;}}// Only emergency switch down if it takes less time to load a new fragment at lowest level instead of continuing
// to load the current one
if(fragLevelNextLoadedDelay>=fragLoadedDelay){return;}// if estimated load time of new segment is completely unreasonable, ignore and do not emergency switch down
if(fragLevelNextLoadedDelay>duration*10){return;}hls.nextLoadLevel=hls.nextAutoLevel=nextLoadLevel;if(loadedFirstByte){// If there has been loading progress, sample bandwidth using loading time offset by minimum TTFB time
this.bwEstimator.sample(timeLoading-Math.min(ttfbEstimate,ttfb),stats.loaded);}else {// If there has been no loading progress, sample TTFB
this.bwEstimator.sampleTTFB(timeLoading);}const nextLoadLevelBitrate=levels[nextLoadLevel].maxBitrate;if(this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>nextLoadLevelBitrate){this.resetEstimator(nextLoadLevelBitrate);}this.clearTimer();logger.warn(`[abr] Fragment ${frag.sn}${part?' part '+part.index:''} of level ${frag.level} is loading too slowly;
      Time to underbuffer: ${bufferStarvationDelay.toFixed(3)} s
      Estimated load time for current fragment: ${fragLoadedDelay.toFixed(3)} s
      Estimated load time for down switch fragment: ${fragLevelNextLoadedDelay.toFixed(3)} s
      TTFB estimate: ${ttfb|0} ms
      Current BW estimate: ${isFiniteNumber(bwEstimate)?bwEstimate|0:'Unknown'} bps
      New BW estimate: ${this.getBwEstimate()|0} bps
      Switching to level ${nextLoadLevel} @ ${nextLoadLevelBitrate|0} bps`);hls.trigger(Events$1.FRAG_LOAD_EMERGENCY_ABORTED,{frag,part,stats});};this.hls=_hls;this.bwEstimator=this.initEstimator();this.registerListeners();}resetEstimator(abrEwmaDefaultEstimate){if(abrEwmaDefaultEstimate){logger.log(`setting initial bwe to ${abrEwmaDefaultEstimate}`);this.hls.config.abrEwmaDefaultEstimate=abrEwmaDefaultEstimate;}this.firstSelection=-1;this.bwEstimator=this.initEstimator();}initEstimator(){const config=this.hls.config;return new EwmaBandWidthEstimator(config.abrEwmaSlowVoD,config.abrEwmaFastVoD,config.abrEwmaDefaultEstimate);}registerListeners(){const{hls}=this;hls.on(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.on(Events$1.FRAG_LOADING,this.onFragLoading,this);hls.on(Events$1.FRAG_LOADED,this.onFragLoaded,this);hls.on(Events$1.FRAG_BUFFERED,this.onFragBuffered,this);hls.on(Events$1.LEVEL_SWITCHING,this.onLevelSwitching,this);hls.on(Events$1.LEVEL_LOADED,this.onLevelLoaded,this);hls.on(Events$1.LEVELS_UPDATED,this.onLevelsUpdated,this);hls.on(Events$1.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this);hls.on(Events$1.ERROR,this.onError,this);}unregisterListeners(){const{hls}=this;if(!hls){return;}hls.off(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.off(Events$1.FRAG_LOADING,this.onFragLoading,this);hls.off(Events$1.FRAG_LOADED,this.onFragLoaded,this);hls.off(Events$1.FRAG_BUFFERED,this.onFragBuffered,this);hls.off(Events$1.LEVEL_SWITCHING,this.onLevelSwitching,this);hls.off(Events$1.LEVEL_LOADED,this.onLevelLoaded,this);hls.off(Events$1.LEVELS_UPDATED,this.onLevelsUpdated,this);hls.off(Events$1.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this);hls.off(Events$1.ERROR,this.onError,this);}destroy(){this.unregisterListeners();this.clearTimer();// @ts-ignore
this.hls=this._abandonRulesCheck=null;this.fragCurrent=this.partCurrent=null;}onManifestLoading(event,data){this.lastLoadedFragLevel=-1;this.firstSelection=-1;this.lastLevelLoadSec=0;this.fragCurrent=this.partCurrent=null;this.onLevelsUpdated();this.clearTimer();}onLevelsUpdated(){if(this.lastLoadedFragLevel>-1&&this.fragCurrent){this.lastLoadedFragLevel=this.fragCurrent.level;}this._nextAutoLevel=-1;this.onMaxAutoLevelUpdated();this.codecTiers=null;this.audioTracksByGroup=null;}onMaxAutoLevelUpdated(){this.firstSelection=-1;this.nextAutoLevelKey='';}onFragLoading(event,data){const frag=data.frag;if(this.ignoreFragment(frag)){return;}if(!frag.bitrateTest){var _data$part;this.fragCurrent=frag;this.partCurrent=(_data$part=data.part)!=null?_data$part:null;}this.clearTimer();this.timer=self.setInterval(this._abandonRulesCheck,100);}onLevelSwitching(event,data){this.clearTimer();}onError(event,data){if(data.fatal){return;}switch(data.details){case ErrorDetails.BUFFER_ADD_CODEC_ERROR:case ErrorDetails.BUFFER_APPEND_ERROR:// Reset last loaded level so that a new selection can be made after calling recoverMediaError
this.lastLoadedFragLevel=-1;this.firstSelection=-1;break;case ErrorDetails.FRAG_LOAD_TIMEOUT:{const frag=data.frag;const{fragCurrent,partCurrent:part}=this;if(frag&&fragCurrent&&frag.sn===fragCurrent.sn&&frag.level===fragCurrent.level){const now=performance.now();const stats=part?part.stats:frag.stats;const timeLoading=now-stats.loading.start;const ttfb=stats.loading.first?stats.loading.first-stats.loading.start:-1;const loadedFirstByte=stats.loaded&&ttfb>-1;if(loadedFirstByte){const ttfbEstimate=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(timeLoading-Math.min(ttfbEstimate,ttfb),stats.loaded);}else {this.bwEstimator.sampleTTFB(timeLoading);}}break;}}}getTimeToLoadFrag(timeToFirstByteSec,bandwidth,fragSizeBits,isSwitch){const fragLoadSec=timeToFirstByteSec+fragSizeBits/bandwidth;const playlistLoadSec=isSwitch?this.lastLevelLoadSec:0;return fragLoadSec+playlistLoadSec;}onLevelLoaded(event,data){const config=this.hls.config;const{loading}=data.stats;const timeLoadingMs=loading.end-loading.start;if(isFiniteNumber(timeLoadingMs)){this.lastLevelLoadSec=timeLoadingMs/1000;}if(data.details.live){this.bwEstimator.update(config.abrEwmaSlowLive,config.abrEwmaFastLive);}else {this.bwEstimator.update(config.abrEwmaSlowVoD,config.abrEwmaFastVoD);}}onFragLoaded(event,{frag,part}){const stats=part?part.stats:frag.stats;if(frag.type===PlaylistLevelType.MAIN){this.bwEstimator.sampleTTFB(stats.loading.first-stats.loading.start);}if(this.ignoreFragment(frag)){return;}// stop monitoring bw once frag loaded
this.clearTimer();// reset forced auto level value so that next level will be selected
if(frag.level===this._nextAutoLevel){this._nextAutoLevel=-1;}this.firstSelection=-1;// compute level average bitrate
if(this.hls.config.abrMaxWithRealBitrate){const duration=part?part.duration:frag.duration;const level=this.hls.levels[frag.level];const loadedBytes=(level.loaded?level.loaded.bytes:0)+stats.loaded;const loadedDuration=(level.loaded?level.loaded.duration:0)+duration;level.loaded={bytes:loadedBytes,duration:loadedDuration};level.realBitrate=Math.round(8*loadedBytes/loadedDuration);}if(frag.bitrateTest){const fragBufferedData={stats,frag,part,id:frag.type};this.onFragBuffered(Events$1.FRAG_BUFFERED,fragBufferedData);frag.bitrateTest=false;}else {// store level id after successful fragment load for playback
this.lastLoadedFragLevel=frag.level;}}onFragBuffered(event,data){const{frag,part}=data;const stats=part!=null&&part.stats.loaded?part.stats:frag.stats;if(stats.aborted){return;}if(this.ignoreFragment(frag)){return;}// Use the difference between parsing and request instead of buffering and request to compute fragLoadingProcessing;
// rationale is that buffer appending only happens once media is attached. This can happen when config.startFragPrefetch
// is used. If we used buffering in that case, our BW estimate sample will be very large.
const processingMs=stats.parsing.end-stats.loading.start-Math.min(stats.loading.first-stats.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(processingMs,stats.loaded);stats.bwEstimate=this.getBwEstimate();if(frag.bitrateTest){this.bitrateTestDelay=processingMs/1000;}else {this.bitrateTestDelay=0;}}ignoreFragment(frag){// Only count non-alt-audio frags which were actually buffered in our BW calculations
return frag.type!==PlaylistLevelType.MAIN||frag.sn==='initSegment';}clearTimer(){if(this.timer>-1){self.clearInterval(this.timer);this.timer=-1;}}get firstAutoLevel(){const{maxAutoLevel,minAutoLevel}=this.hls;const bwEstimate=this.getBwEstimate();const maxStartDelay=this.hls.config.maxStarvationDelay;const abrAutoLevel=this.findBestLevel(bwEstimate,minAutoLevel,maxAutoLevel,0,maxStartDelay,1,1);if(abrAutoLevel>-1){return abrAutoLevel;}const firstLevel=this.hls.firstLevel;const clamped=Math.min(Math.max(firstLevel,minAutoLevel),maxAutoLevel);logger.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${firstLevel} clamped to ${clamped}`);return clamped;}get forcedAutoLevel(){if(this.nextAutoLevelKey){return -1;}return this._nextAutoLevel;}// return next auto level
get nextAutoLevel(){const forcedAutoLevel=this.forcedAutoLevel;const bwEstimator=this.bwEstimator;const useEstimate=bwEstimator.canEstimate();const loadedFirstFrag=this.lastLoadedFragLevel>-1;// in case next auto level has been forced, and bw not available or not reliable, return forced value
if(forcedAutoLevel!==-1&&(!useEstimate||!loadedFirstFrag||this.nextAutoLevelKey===this.getAutoLevelKey())){return forcedAutoLevel;}// compute next level using ABR logic
const nextABRAutoLevel=useEstimate&&loadedFirstFrag?this.getNextABRAutoLevel():this.firstAutoLevel;// use forced auto level while it hasn't errored more than ABR selection
if(forcedAutoLevel!==-1){const levels=this.hls.levels;if(levels.length>Math.max(forcedAutoLevel,nextABRAutoLevel)&&levels[forcedAutoLevel].loadError<=levels[nextABRAutoLevel].loadError){return forcedAutoLevel;}}// save result until state has changed
this._nextAutoLevel=nextABRAutoLevel;this.nextAutoLevelKey=this.getAutoLevelKey();return nextABRAutoLevel;}getAutoLevelKey(){return `${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`;}getNextABRAutoLevel(){const{fragCurrent,partCurrent,hls}=this;const{maxAutoLevel,config,minAutoLevel}=hls;const currentFragDuration=partCurrent?partCurrent.duration:fragCurrent?fragCurrent.duration:0;const avgbw=this.getBwEstimate();// bufferStarvationDelay is the wall-clock time left until the playback buffer is exhausted.
const bufferStarvationDelay=this.getStarvationDelay();let bwFactor=config.abrBandWidthFactor;let bwUpFactor=config.abrBandWidthUpFactor;// First, look to see if we can find a level matching with our avg bandwidth AND that could also guarantee no rebuffering at all
if(bufferStarvationDelay){const _bestLevel=this.findBestLevel(avgbw,minAutoLevel,maxAutoLevel,bufferStarvationDelay,0,bwFactor,bwUpFactor);if(_bestLevel>=0){return _bestLevel;}}// not possible to get rid of rebuffering... try to find level that will guarantee less than maxStarvationDelay of rebuffering
let maxStarvationDelay=currentFragDuration?Math.min(currentFragDuration,config.maxStarvationDelay):config.maxStarvationDelay;if(!bufferStarvationDelay){// in case buffer is empty, let's check if previous fragment was loaded to perform a bitrate test
const bitrateTestDelay=this.bitrateTestDelay;if(bitrateTestDelay){// if it is the case, then we need to adjust our max starvation delay using maxLoadingDelay config value
// max video loading delay used in  automatic start level selection :
// in that mode ABR controller will ensure that video loading time (ie the time to fetch the first fragment at lowest quality level +
// the time to fetch the fragment at the appropriate quality level is less than ```maxLoadingDelay``` )
// cap maxLoadingDelay and ensure it is not bigger 'than bitrate test' frag duration
const maxLoadingDelay=currentFragDuration?Math.min(currentFragDuration,config.maxLoadingDelay):config.maxLoadingDelay;maxStarvationDelay=maxLoadingDelay-bitrateTestDelay;logger.info(`[abr] bitrate test took ${Math.round(1000*bitrateTestDelay)}ms, set first fragment max fetchDuration to ${Math.round(1000*maxStarvationDelay)} ms`);// don't use conservative factor on bitrate test
bwFactor=bwUpFactor=1;}}const bestLevel=this.findBestLevel(avgbw,minAutoLevel,maxAutoLevel,bufferStarvationDelay,maxStarvationDelay,bwFactor,bwUpFactor);logger.info(`[abr] ${bufferStarvationDelay?'rebuffering expected':'buffer is empty'}, optimal quality level ${bestLevel}`);if(bestLevel>-1){return bestLevel;}// If no matching level found, see if min auto level would be a better option
const minLevel=hls.levels[minAutoLevel];const autoLevel=hls.levels[hls.loadLevel];if((minLevel==null?void 0:minLevel.bitrate)<(autoLevel==null?void 0:autoLevel.bitrate)){return minAutoLevel;}// or if bitrate is not lower, continue to use loadLevel
return hls.loadLevel;}getStarvationDelay(){const hls=this.hls;const media=hls.media;if(!media){return Infinity;}// playbackRate is the absolute value of the playback rate; if media.playbackRate is 0, we use 1 to load as
// if we're playing back at the normal rate.
const playbackRate=media&&media.playbackRate!==0?Math.abs(media.playbackRate):1.0;const bufferInfo=hls.mainForwardBufferInfo;return (bufferInfo?bufferInfo.len:0)/playbackRate;}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate;}findBestLevel(currentBw,minAutoLevel,maxAutoLevel,bufferStarvationDelay,maxStarvationDelay,bwFactor,bwUpFactor){var _level$details;const maxFetchDuration=bufferStarvationDelay+maxStarvationDelay;const lastLoadedFragLevel=this.lastLoadedFragLevel;const selectionBaseLevel=lastLoadedFragLevel===-1?this.hls.firstLevel:lastLoadedFragLevel;const{fragCurrent,partCurrent}=this;const{levels,allAudioTracks,loadLevel,config}=this.hls;if(levels.length===1){return 0;}const level=levels[selectionBaseLevel];const live=!!(level!=null&&(_level$details=level.details)!=null&&_level$details.live);const firstSelection=loadLevel===-1||lastLoadedFragLevel===-1;let currentCodecSet;let currentVideoRange='SDR';let currentFrameRate=(level==null?void 0:level.frameRate)||0;const{audioPreference,videoPreference}=config;const audioTracksByGroup=this.audioTracksByGroup||(this.audioTracksByGroup=getAudioTracksByGroup(allAudioTracks));if(firstSelection){if(this.firstSelection!==-1){return this.firstSelection;}const codecTiers=this.codecTiers||(this.codecTiers=getCodecTiers(levels,audioTracksByGroup,minAutoLevel,maxAutoLevel));const startTier=getStartCodecTier(codecTiers,currentVideoRange,currentBw,audioPreference,videoPreference);const{codecSet,videoRanges,minFramerate,minBitrate,preferHDR}=startTier;currentCodecSet=codecSet;currentVideoRange=preferHDR?videoRanges[videoRanges.length-1]:videoRanges[0];currentFrameRate=minFramerate;currentBw=Math.max(currentBw,minBitrate);logger.log(`[abr] picked start tier ${JSON.stringify(startTier)}`);}else {currentCodecSet=level==null?void 0:level.codecSet;currentVideoRange=level==null?void 0:level.videoRange;}const currentFragDuration=partCurrent?partCurrent.duration:fragCurrent?fragCurrent.duration:0;const ttfbEstimateSec=this.bwEstimator.getEstimateTTFB()/1000;const levelsSkipped=[];for(let i=maxAutoLevel;i>=minAutoLevel;i--){var _levelInfo$supportedR;const levelInfo=levels[i];const upSwitch=i>selectionBaseLevel;if(!levelInfo){continue;}if(config.useMediaCapabilities&&!levelInfo.supportedResult&&!levelInfo.supportedPromise){const mediaCapabilities=navigator.mediaCapabilities;if(typeof(mediaCapabilities==null?void 0:mediaCapabilities.decodingInfo)==='function'&&requiresMediaCapabilitiesDecodingInfo(levelInfo,audioTracksByGroup,currentVideoRange,currentFrameRate,currentBw,audioPreference)){levelInfo.supportedPromise=getMediaDecodingInfoPromise(levelInfo,audioTracksByGroup,mediaCapabilities);levelInfo.supportedPromise.then(decodingInfo=>{if(!this.hls){return;}levelInfo.supportedResult=decodingInfo;const levels=this.hls.levels;const index=levels.indexOf(levelInfo);if(decodingInfo.error){logger.warn(`[abr] MediaCapabilities decodingInfo error: "${decodingInfo.error}" for level ${index} ${JSON.stringify(decodingInfo)}`);}else if(!decodingInfo.supported){logger.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${index} ${JSON.stringify(decodingInfo)}`);if(index>-1&&levels.length>1){logger.log(`[abr] Removing unsupported level ${index}`);this.hls.removeLevel(index);}}});}else {levelInfo.supportedResult=SUPPORTED_INFO_DEFAULT;}}// skip candidates which change codec-family or video-range,
// and which decrease or increase frame-rate for up and down-switch respectfully
if(currentCodecSet&&levelInfo.codecSet!==currentCodecSet||currentVideoRange&&levelInfo.videoRange!==currentVideoRange||upSwitch&&currentFrameRate>levelInfo.frameRate||!upSwitch&&currentFrameRate>0&&currentFrameRate<levelInfo.frameRate||levelInfo.supportedResult&&!((_levelInfo$supportedR=levelInfo.supportedResult.decodingInfoResults)!=null&&_levelInfo$supportedR[0].smooth)){levelsSkipped.push(i);continue;}const levelDetails=levelInfo.details;const avgDuration=(partCurrent?levelDetails==null?void 0:levelDetails.partTarget:levelDetails==null?void 0:levelDetails.averagetargetduration)||currentFragDuration;let adjustedbw;// follow algorithm captured from stagefright :
// https://android.googlesource.com/platform/frameworks/av/+/master/media/libstagefright/httplive/LiveSession.cpp
// Pick the highest bandwidth stream below or equal to estimated bandwidth.
// consider only 80% of the available bandwidth, but if we are switching up,
// be even more conservative (70%) to avoid overestimating and immediately
// switching back.
if(!upSwitch){adjustedbw=bwFactor*currentBw;}else {adjustedbw=bwUpFactor*currentBw;}// Use average bitrate when starvation delay (buffer length) is gt or eq two segment durations and rebuffering is not expected (maxStarvationDelay > 0)
const bitrate=currentFragDuration&&bufferStarvationDelay>=currentFragDuration*2&&maxStarvationDelay===0?levels[i].averageBitrate:levels[i].maxBitrate;const fetchDuration=this.getTimeToLoadFrag(ttfbEstimateSec,adjustedbw,bitrate*avgDuration,levelDetails===undefined);const canSwitchWithinTolerance=// if adjusted bw is greater than level bitrate AND
adjustedbw>=bitrate&&(// no level change, or new level has no error history
i===lastLoadedFragLevel||levelInfo.loadError===0&&levelInfo.fragmentError===0)&&(// fragment fetchDuration unknown OR live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches
// we don't account for max Fetch Duration for live streams, this is to avoid switching down when near the edge of live sliding window ...
// special case to support startLevel = -1 (bitrateTest) on live streams : in that case we should not exit loop so that findBestLevel will return -1
fetchDuration<=ttfbEstimateSec||!isFiniteNumber(fetchDuration)||live&&!this.bitrateTestDelay||fetchDuration<maxFetchDuration);if(canSwitchWithinTolerance){const forcedAutoLevel=this.forcedAutoLevel;if(i!==loadLevel&&(forcedAutoLevel===-1||forcedAutoLevel!==loadLevel)){if(levelsSkipped.length){logger.trace(`[abr] Skipped level(s) ${levelsSkipped.join(',')} of ${maxAutoLevel} max with CODECS and VIDEO-RANGE:"${levels[levelsSkipped[0]].codecs}" ${levels[levelsSkipped[0]].videoRange}; not compatible with "${level.codecs}" ${currentVideoRange}`);}logger.info(`[abr] switch candidate:${selectionBaseLevel}->${i} adjustedbw(${Math.round(adjustedbw)})-bitrate=${Math.round(adjustedbw-bitrate)} ttfb:${ttfbEstimateSec.toFixed(1)} avgDuration:${avgDuration.toFixed(1)} maxFetchDuration:${maxFetchDuration.toFixed(1)} fetchDuration:${fetchDuration.toFixed(1)} firstSelection:${firstSelection} codecSet:${currentCodecSet} videoRange:${currentVideoRange} hls.loadLevel:${loadLevel}`);}if(firstSelection){this.firstSelection=i;}// as we are looping from highest to lowest, this will return the best achievable quality level
return i;}}// not enough time budget even with quality level 0 ... rebuffering might happen
return -1;}set nextAutoLevel(nextLevel){const{maxAutoLevel,minAutoLevel}=this.hls;const value=Math.min(Math.max(nextLevel,minAutoLevel),maxAutoLevel);if(this._nextAutoLevel!==value){this.nextAutoLevelKey='';this._nextAutoLevel=value;}}}/**
 * @ignore
 * Sub-class specialization of EventHandler base class.
 *
 * TaskLoop allows to schedule a task function being called (optionnaly repeatedly) on the main loop,
 * scheduled asynchroneously, avoiding recursive calls in the same tick.
 *
 * The task itself is implemented in `doTick`. It can be requested and called for single execution
 * using the `tick` method.
 *
 * It will be assured that the task execution method (`tick`) only gets called once per main loop "tick",
 * no matter how often it gets requested for execution. Execution in further ticks will be scheduled accordingly.
 *
 * If further execution requests have already been scheduled on the next tick, it can be checked with `hasNextTick`,
 * and cancelled with `clearNextTick`.
 *
 * The task can be scheduled as an interval repeatedly with a period as parameter (see `setInterval`, `clearInterval`).
 *
 * Sub-classes need to implement the `doTick` method which will effectively have the task execution routine.
 *
 * Further explanations:
 *
 * The baseclass has a `tick` method that will schedule the doTick call. It may be called synchroneously
 * only for a stack-depth of one. On re-entrant calls, sub-sequent calls are scheduled for next main loop ticks.
 *
 * When the task execution (`tick` method) is called in re-entrant way this is detected and
 * we are limiting the task execution per call stack to exactly one, but scheduling/post-poning further
 * task processing on the next main loop iteration (also known as "next tick" in the Node/JS runtime lingo).
 */class TaskLoop{constructor(){this._boundTick=void 0;this._tickTimer=null;this._tickInterval=null;this._tickCallCount=0;this._boundTick=this.tick.bind(this);}destroy(){this.onHandlerDestroying();this.onHandlerDestroyed();}onHandlerDestroying(){// clear all timers before unregistering from event bus
this.clearNextTick();this.clearInterval();}onHandlerDestroyed(){}hasInterval(){return !!this._tickInterval;}hasNextTick(){return !!this._tickTimer;}/**
   * @param millis - Interval time (ms)
   * @eturns True when interval has been scheduled, false when already scheduled (no effect)
   */setInterval(millis){if(!this._tickInterval){this._tickCallCount=0;this._tickInterval=self.setInterval(this._boundTick,millis);return true;}return false;}/**
   * @returns True when interval was cleared, false when none was set (no effect)
   */clearInterval(){if(this._tickInterval){self.clearInterval(this._tickInterval);this._tickInterval=null;return true;}return false;}/**
   * @returns True when timeout was cleared, false when none was set (no effect)
   */clearNextTick(){if(this._tickTimer){self.clearTimeout(this._tickTimer);this._tickTimer=null;return true;}return false;}/**
   * Will call the subclass doTick implementation in this main loop tick
   * or in the next one (via setTimeout(,0)) in case it has already been called
   * in this tick (in case this is a re-entrant call).
   */tick(){this._tickCallCount++;if(this._tickCallCount===1){this.doTick();// re-entrant call to tick from previous doTick call stack
// -> schedule a call on the next main loop iteration to process this task processing request
if(this._tickCallCount>1){// make sure only one timer exists at any time at max
this.tickImmediate();}this._tickCallCount=0;}}tickImmediate(){this.clearNextTick();this._tickTimer=self.setTimeout(this._boundTick,0);}/**
   * For subclass to implement task logic
   * @abstract
   */doTick(){}}var FragmentState={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class FragmentTracker{constructor(hls){this.activePartLists=Object.create(null);this.endListFragments=Object.create(null);this.fragments=Object.create(null);this.timeRanges=Object.create(null);this.bufferPadding=0.2;this.hls=void 0;this.hasGaps=false;this.hls=hls;this._registerListeners();}_registerListeners(){const{hls}=this;hls.on(Events$1.BUFFER_APPENDED,this.onBufferAppended,this);hls.on(Events$1.FRAG_BUFFERED,this.onFragBuffered,this);hls.on(Events$1.FRAG_LOADED,this.onFragLoaded,this);}_unregisterListeners(){const{hls}=this;hls.off(Events$1.BUFFER_APPENDED,this.onBufferAppended,this);hls.off(Events$1.FRAG_BUFFERED,this.onFragBuffered,this);hls.off(Events$1.FRAG_LOADED,this.onFragLoaded,this);}destroy(){this._unregisterListeners();// @ts-ignore
this.fragments=// @ts-ignore
this.activePartLists=// @ts-ignore
this.endListFragments=this.timeRanges=null;}/**
   * Return a Fragment or Part with an appended range that matches the position and levelType
   * Otherwise, return null
   */getAppendedFrag(position,levelType){const activeParts=this.activePartLists[levelType];if(activeParts){for(let i=activeParts.length;i--;){const activePart=activeParts[i];if(!activePart){break;}const appendedPTS=activePart.end;if(activePart.start<=position&&appendedPTS!==null&&position<=appendedPTS){return activePart;}}}return this.getBufferedFrag(position,levelType);}/**
   * Return a buffered Fragment that matches the position and levelType.
   * A buffered Fragment is one whose loading, parsing and appending is done (completed or "partial" meaning aborted).
   * If not found any Fragment, return null
   */getBufferedFrag(position,levelType){const{fragments}=this;const keys=Object.keys(fragments);for(let i=keys.length;i--;){const fragmentEntity=fragments[keys[i]];if((fragmentEntity==null?void 0:fragmentEntity.body.type)===levelType&&fragmentEntity.buffered){const frag=fragmentEntity.body;if(frag.start<=position&&position<=frag.end){return frag;}}}return null;}/**
   * Partial fragments effected by coded frame eviction will be removed
   * The browser will unload parts of the buffer to free up memory for new buffer data
   * Fragments will need to be reloaded when the buffer is freed up, removing partial fragments will allow them to reload(since there might be parts that are still playable)
   */detectEvictedFragments(elementaryStream,timeRange,playlistType,appendedPart){if(this.timeRanges){this.timeRanges[elementaryStream]=timeRange;}// Check if any flagged fragments have been unloaded
// excluding anything newer than appendedPartSn
const appendedPartSn=(appendedPart==null?void 0:appendedPart.fragment.sn)||-1;Object.keys(this.fragments).forEach(key=>{const fragmentEntity=this.fragments[key];if(!fragmentEntity){return;}if(appendedPartSn>=fragmentEntity.body.sn){return;}if(!fragmentEntity.buffered&&!fragmentEntity.loaded){if(fragmentEntity.body.type===playlistType){this.removeFragment(fragmentEntity.body);}return;}const esData=fragmentEntity.range[elementaryStream];if(!esData){return;}esData.time.some(time=>{const isNotBuffered=!this.isTimeBuffered(time.startPTS,time.endPTS,timeRange);if(isNotBuffered){// Unregister partial fragment as it needs to load again to be reused
this.removeFragment(fragmentEntity.body);}return isNotBuffered;});});}/**
   * Checks if the fragment passed in is loaded in the buffer properly
   * Partially loaded fragments will be registered as a partial fragment
   */detectPartialFragments(data){const timeRanges=this.timeRanges;const{frag,part}=data;if(!timeRanges||frag.sn==='initSegment'){return;}const fragKey=getFragmentKey(frag);const fragmentEntity=this.fragments[fragKey];if(!fragmentEntity||fragmentEntity.buffered&&frag.gap){return;}const isFragHint=!frag.relurl;Object.keys(timeRanges).forEach(elementaryStream=>{const streamInfo=frag.elementaryStreams[elementaryStream];if(!streamInfo){return;}const timeRange=timeRanges[elementaryStream];const partial=isFragHint||streamInfo.partial===true;fragmentEntity.range[elementaryStream]=this.getBufferedTimes(frag,part,partial,timeRange);});fragmentEntity.loaded=null;if(Object.keys(fragmentEntity.range).length){fragmentEntity.buffered=true;const endList=fragmentEntity.body.endList=frag.endList||fragmentEntity.body.endList;if(endList){this.endListFragments[fragmentEntity.body.type]=fragmentEntity;}if(!isPartial(fragmentEntity)){// Remove older fragment parts from lookup after frag is tracked as buffered
this.removeParts(frag.sn-1,frag.type);}}else {// remove fragment if nothing was appended
this.removeFragment(fragmentEntity.body);}}removeParts(snToKeep,levelType){const activeParts=this.activePartLists[levelType];if(!activeParts){return;}this.activePartLists[levelType]=activeParts.filter(part=>part.fragment.sn>=snToKeep);}fragBuffered(frag,force){const fragKey=getFragmentKey(frag);let fragmentEntity=this.fragments[fragKey];if(!fragmentEntity&&force){fragmentEntity=this.fragments[fragKey]={body:frag,appendedPTS:null,loaded:null,buffered:false,range:Object.create(null)};if(frag.gap){this.hasGaps=true;}}if(fragmentEntity){fragmentEntity.loaded=null;fragmentEntity.buffered=true;}}getBufferedTimes(fragment,part,partial,timeRange){const buffered={time:[],partial};const startPTS=fragment.start;const endPTS=fragment.end;const minEndPTS=fragment.minEndPTS||endPTS;const maxStartPTS=fragment.maxStartPTS||startPTS;for(let i=0;i<timeRange.length;i++){const startTime=timeRange.start(i)-this.bufferPadding;const endTime=timeRange.end(i)+this.bufferPadding;if(maxStartPTS>=startTime&&minEndPTS<=endTime){// Fragment is entirely contained in buffer
// No need to check the other timeRange times since it's completely playable
buffered.time.push({startPTS:Math.max(startPTS,timeRange.start(i)),endPTS:Math.min(endPTS,timeRange.end(i))});break;}else if(startPTS<endTime&&endPTS>startTime){const start=Math.max(startPTS,timeRange.start(i));const end=Math.min(endPTS,timeRange.end(i));if(end>start){buffered.partial=true;// Check for intersection with buffer
// Get playable sections of the fragment
buffered.time.push({startPTS:start,endPTS:end});}}else if(endPTS<=startTime){// No need to check the rest of the timeRange as it is in order
break;}}return buffered;}/**
   * Gets the partial fragment for a certain time
   */getPartialFragment(time){let bestFragment=null;let timePadding;let startTime;let endTime;let bestOverlap=0;const{bufferPadding,fragments}=this;Object.keys(fragments).forEach(key=>{const fragmentEntity=fragments[key];if(!fragmentEntity){return;}if(isPartial(fragmentEntity)){startTime=fragmentEntity.body.start-bufferPadding;endTime=fragmentEntity.body.end+bufferPadding;if(time>=startTime&&time<=endTime){// Use the fragment that has the most padding from start and end time
timePadding=Math.min(time-startTime,endTime-time);if(bestOverlap<=timePadding){bestFragment=fragmentEntity.body;bestOverlap=timePadding;}}}});return bestFragment;}isEndListAppended(type){const lastFragmentEntity=this.endListFragments[type];return lastFragmentEntity!==undefined&&(lastFragmentEntity.buffered||isPartial(lastFragmentEntity));}getState(fragment){const fragKey=getFragmentKey(fragment);const fragmentEntity=this.fragments[fragKey];if(fragmentEntity){if(!fragmentEntity.buffered){return FragmentState.APPENDING;}else if(isPartial(fragmentEntity)){return FragmentState.PARTIAL;}else {return FragmentState.OK;}}return FragmentState.NOT_LOADED;}isTimeBuffered(startPTS,endPTS,timeRange){let startTime;let endTime;for(let i=0;i<timeRange.length;i++){startTime=timeRange.start(i)-this.bufferPadding;endTime=timeRange.end(i)+this.bufferPadding;if(startPTS>=startTime&&endPTS<=endTime){return true;}if(endPTS<=startTime){// No need to check the rest of the timeRange as it is in order
return false;}}return false;}onFragLoaded(event,data){const{frag,part}=data;// don't track initsegment (for which sn is not a number)
// don't track frags used for bitrateTest, they're irrelevant.
if(frag.sn==='initSegment'||frag.bitrateTest){return;}// Fragment entity `loaded` FragLoadedData is null when loading parts
const loaded=part?null:data;const fragKey=getFragmentKey(frag);this.fragments[fragKey]={body:frag,appendedPTS:null,loaded,buffered:false,range:Object.create(null)};}onBufferAppended(event,data){const{frag,part,timeRanges}=data;if(frag.sn==='initSegment'){return;}const playlistType=frag.type;if(part){let activeParts=this.activePartLists[playlistType];if(!activeParts){this.activePartLists[playlistType]=activeParts=[];}activeParts.push(part);}// Store the latest timeRanges loaded in the buffer
this.timeRanges=timeRanges;Object.keys(timeRanges).forEach(elementaryStream=>{const timeRange=timeRanges[elementaryStream];this.detectEvictedFragments(elementaryStream,timeRange,playlistType,part);});}onFragBuffered(event,data){this.detectPartialFragments(data);}hasFragment(fragment){const fragKey=getFragmentKey(fragment);return !!this.fragments[fragKey];}hasParts(type){var _this$activePartLists;return !!((_this$activePartLists=this.activePartLists[type])!=null&&_this$activePartLists.length);}removeFragmentsInRange(start,end,playlistType,withGapOnly,unbufferedOnly){if(withGapOnly&&!this.hasGaps){return;}Object.keys(this.fragments).forEach(key=>{const fragmentEntity=this.fragments[key];if(!fragmentEntity){return;}const frag=fragmentEntity.body;if(frag.type!==playlistType||withGapOnly&&!frag.gap){return;}if(frag.start<end&&frag.end>start&&(fragmentEntity.buffered||unbufferedOnly)){this.removeFragment(frag);}});}removeFragment(fragment){const fragKey=getFragmentKey(fragment);fragment.stats.loaded=0;fragment.clearElementaryStreamInfo();const activeParts=this.activePartLists[fragment.type];if(activeParts){const snToRemove=fragment.sn;this.activePartLists[fragment.type]=activeParts.filter(part=>part.fragment.sn!==snToRemove);}delete this.fragments[fragKey];if(fragment.endList){delete this.endListFragments[fragment.type];}}removeAllFragments(){this.fragments=Object.create(null);this.endListFragments=Object.create(null);this.activePartLists=Object.create(null);this.hasGaps=false;}}function isPartial(fragmentEntity){var _fragmentEntity$range,_fragmentEntity$range2,_fragmentEntity$range3;return fragmentEntity.buffered&&(fragmentEntity.body.gap||((_fragmentEntity$range=fragmentEntity.range.video)==null?void 0:_fragmentEntity$range.partial)||((_fragmentEntity$range2=fragmentEntity.range.audio)==null?void 0:_fragmentEntity$range2.partial)||((_fragmentEntity$range3=fragmentEntity.range.audiovideo)==null?void 0:_fragmentEntity$range3.partial));}function getFragmentKey(fragment){return `${fragment.type}_${fragment.level}_${fragment.sn}`;}/**
 * Provides methods dealing with buffer length retrieval for example.
 *
 * In general, a helper around HTML5 MediaElement TimeRanges gathered from `buffered` property.
 *
 * Also @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/buffered
 */const noopBuffered={length:0,start:()=>0,end:()=>0};class BufferHelper{/**
   * Return true if `media`'s buffered include `position`
   */static isBuffered(media,position){try{if(media){const buffered=BufferHelper.getBuffered(media);for(let i=0;i<buffered.length;i++){if(position>=buffered.start(i)&&position<=buffered.end(i)){return true;}}}}catch(error){// this is to catch
// InvalidStateError: Failed to read the 'buffered' property from 'SourceBuffer':
// This SourceBuffer has been removed from the parent media source
}return false;}static bufferInfo(media,pos,maxHoleDuration){try{if(media){const vbuffered=BufferHelper.getBuffered(media);const buffered=[];let i;for(i=0;i<vbuffered.length;i++){buffered.push({start:vbuffered.start(i),end:vbuffered.end(i)});}return this.bufferedInfo(buffered,pos,maxHoleDuration);}}catch(error){// this is to catch
// InvalidStateError: Failed to read the 'buffered' property from 'SourceBuffer':
// This SourceBuffer has been removed from the parent media source
}return {len:0,start:pos,end:pos,nextStart:undefined};}static bufferedInfo(buffered,pos,maxHoleDuration){pos=Math.max(0,pos);// sort on buffer.start/smaller end (IE does not always return sorted buffered range)
buffered.sort(function(a,b){const diff=a.start-b.start;if(diff){return diff;}else {return b.end-a.end;}});let buffered2=[];if(maxHoleDuration){// there might be some small holes between buffer time range
// consider that holes smaller than maxHoleDuration are irrelevant and build another
// buffer time range representations that discards those holes
for(let i=0;i<buffered.length;i++){const buf2len=buffered2.length;if(buf2len){const buf2end=buffered2[buf2len-1].end;// if small hole (value between 0 or maxHoleDuration ) or overlapping (negative)
if(buffered[i].start-buf2end<maxHoleDuration){// merge overlapping time ranges
// update lastRange.end only if smaller than item.end
// e.g.  [ 1, 15] with  [ 2,8] => [ 1,15] (no need to modify lastRange.end)
// whereas [ 1, 8] with  [ 2,15] => [ 1,15] ( lastRange should switch from [1,8] to [1,15])
if(buffered[i].end>buf2end){buffered2[buf2len-1].end=buffered[i].end;}}else {// big hole
buffered2.push(buffered[i]);}}else {// first value
buffered2.push(buffered[i]);}}}else {buffered2=buffered;}let bufferLen=0;// bufferStartNext can possibly be undefined based on the conditional logic below
let bufferStartNext;// bufferStart and bufferEnd are buffer boundaries around current video position
let bufferStart=pos;let bufferEnd=pos;for(let i=0;i<buffered2.length;i++){const start=buffered2[i].start;const end=buffered2[i].end;// logger.log('buf start/end:' + buffered.start(i) + '/' + buffered.end(i));
if(pos+maxHoleDuration>=start&&pos<end){// play position is inside this buffer TimeRange, retrieve end of buffer position and buffer length
bufferStart=start;bufferEnd=end;bufferLen=bufferEnd-pos;}else if(pos+maxHoleDuration<start){bufferStartNext=start;break;}}return {len:bufferLen,start:bufferStart||0,end:bufferEnd||0,nextStart:bufferStartNext};}/**
   * Safe method to get buffered property.
   * SourceBuffer.buffered may throw if SourceBuffer is removed from it's MediaSource
   */static getBuffered(media){try{return media.buffered;}catch(e){logger.log('failed to get media.buffered',e);return noopBuffered;}}}class ChunkMetadata{constructor(level,sn,id,size=0,part=-1,partial=false){this.level=void 0;this.sn=void 0;this.part=void 0;this.id=void 0;this.size=void 0;this.partial=void 0;this.transmuxing=getNewPerformanceTiming();this.buffering={audio:getNewPerformanceTiming(),video:getNewPerformanceTiming(),audiovideo:getNewPerformanceTiming()};this.level=level;this.sn=sn;this.id=id;this.size=size;this.part=part;this.partial=partial;}}function getNewPerformanceTiming(){return {start:0,executeStart:0,executeEnd:0,end:0};}function findFirstFragWithCC(fragments,cc){for(let i=0,len=fragments.length;i<len;i++){var _fragments$i;if(((_fragments$i=fragments[i])==null?void 0:_fragments$i.cc)===cc){return fragments[i];}}return null;}function shouldAlignOnDiscontinuities(lastFrag,switchDetails,details){if(switchDetails){if(details.endCC>details.startCC||lastFrag&&lastFrag.cc<details.startCC){return true;}}return false;}// Find the first frag in the previous level which matches the CC of the first frag of the new level
function findDiscontinuousReferenceFrag(prevDetails,curDetails){const prevFrags=prevDetails.fragments;const curFrags=curDetails.fragments;if(!curFrags.length||!prevFrags.length){logger.log('No fragments to align');return;}const prevStartFrag=findFirstFragWithCC(prevFrags,curFrags[0].cc);if(!prevStartFrag||prevStartFrag&&!prevStartFrag.startPTS){logger.log('No frag in previous level to align on');return;}return prevStartFrag;}function adjustFragmentStart(frag,sliding){if(frag){const start=frag.start+sliding;frag.start=frag.startPTS=start;frag.endPTS=start+frag.duration;}}function adjustSlidingStart(sliding,details){// Update segments
const fragments=details.fragments;for(let i=0,len=fragments.length;i<len;i++){adjustFragmentStart(fragments[i],sliding);}// Update LL-HLS parts at the end of the playlist
if(details.fragmentHint){adjustFragmentStart(details.fragmentHint,sliding);}details.alignedSliding=true;}/**
 * Using the parameters of the last level, this function computes PTS' of the new fragments so that they form a
 * contiguous stream with the last fragments.
 * The PTS of a fragment lets Hls.js know where it fits into a stream - by knowing every PTS, we know which fragment to
 * download at any given time. PTS is normally computed when the fragment is demuxed, so taking this step saves us time
 * and an extra download.
 * @param lastFrag
 * @param lastLevel
 * @param details
 */function alignStream(lastFrag,switchDetails,details){if(!switchDetails){return;}alignDiscontinuities(lastFrag,details,switchDetails);if(!details.alignedSliding&&switchDetails){// If the PTS wasn't figured out via discontinuity sequence that means there was no CC increase within the level.
// Aligning via Program Date Time should therefore be reliable, since PDT should be the same within the same
// discontinuity sequence.
alignMediaPlaylistByPDT(details,switchDetails);}if(!details.alignedSliding&&switchDetails&&!details.skippedSegments){// Try to align on sn so that we pick a better start fragment.
// Do not perform this on playlists with delta updates as this is only to align levels on switch
// and adjustSliding only adjusts fragments after skippedSegments.
adjustSliding(switchDetails,details);}}/**
 * Computes the PTS if a new level's fragments using the PTS of a fragment in the last level which shares the same
 * discontinuity sequence.
 * @param lastFrag - The last Fragment which shares the same discontinuity sequence
 * @param lastLevel - The details of the last loaded level
 * @param details - The details of the new level
 */function alignDiscontinuities(lastFrag,details,switchDetails){if(shouldAlignOnDiscontinuities(lastFrag,switchDetails,details)){const referenceFrag=findDiscontinuousReferenceFrag(switchDetails,details);if(referenceFrag&&isFiniteNumber(referenceFrag.start)){logger.log(`Adjusting PTS using last level due to CC increase within current level ${details.url}`);adjustSlidingStart(referenceFrag.start,details);}}}/**
 * Ensures appropriate time-alignment between renditions based on PDT.
 * This function assumes the timelines represented in `refDetails` are accurate, including the PDTs
 * for the last discontinuity sequence number shared by both playlists when present,
 * and uses the "wallclock"/PDT timeline as a cross-reference to `details`, adjusting the presentation
 * times/timelines of `details` accordingly.
 * Given the asynchronous nature of fetches and initial loads of live `main` and audio/subtitle tracks,
 * the primary purpose of this function is to ensure the "local timelines" of audio/subtitle tracks
 * are aligned to the main/video timeline, using PDT as the cross-reference/"anchor" that should
 * be consistent across playlists, per the HLS spec.
 * @param details - The details of the rendition you'd like to time-align (e.g. an audio rendition).
 * @param refDetails - The details of the reference rendition with start and PDT times for alignment.
 */function alignMediaPlaylistByPDT(details,refDetails){if(!details.hasProgramDateTime||!refDetails.hasProgramDateTime){return;}const fragments=details.fragments;const refFragments=refDetails.fragments;if(!fragments.length||!refFragments.length){return;}// Calculate a delta to apply to all fragments according to the delta in PDT times and start times
// of a fragment in the reference details, and a fragment in the target details of the same discontinuity.
// If a fragment of the same discontinuity was not found use the middle fragment of both.
let refFrag;let frag;const targetCC=Math.min(refDetails.endCC,details.endCC);if(refDetails.startCC<targetCC&&details.startCC<targetCC){refFrag=findFirstFragWithCC(refFragments,targetCC);frag=findFirstFragWithCC(fragments,targetCC);}if(!refFrag||!frag){refFrag=refFragments[Math.floor(refFragments.length/2)];frag=findFirstFragWithCC(fragments,refFrag.cc)||fragments[Math.floor(fragments.length/2)];}const refPDT=refFrag.programDateTime;const targetPDT=frag.programDateTime;if(!refPDT||!targetPDT){return;}const delta=(targetPDT-refPDT)/1000-(frag.start-refFrag.start);adjustSlidingStart(delta,details);}const MIN_CHUNK_SIZE=Math.pow(2,17);// 128kb
class FragmentLoader{constructor(config){this.config=void 0;this.loader=null;this.partLoadTimeout=-1;this.config=config;}destroy(){if(this.loader){this.loader.destroy();this.loader=null;}}abort(){if(this.loader){// Abort the loader for current fragment. Only one may load at any given time
this.loader.abort();}}load(frag,onProgress){const url=frag.url;if(!url){return Promise.reject(new LoadError({type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.FRAG_LOAD_ERROR,fatal:false,frag,error:new Error(`Fragment does not have a ${url?'part list':'url'}`),networkDetails:null}));}this.abort();const config=this.config;const FragmentILoader=config.fLoader;const DefaultILoader=config.loader;return new Promise((resolve,reject)=>{if(this.loader){this.loader.destroy();}if(frag.gap){if(frag.tagList.some(tags=>tags[0]==='GAP')){reject(createGapLoadError(frag));return;}else {// Reset temporary treatment as GAP tag
frag.gap=false;}}const loader=this.loader=frag.loader=FragmentILoader?new FragmentILoader(config):new DefaultILoader(config);const loaderContext=createLoaderContext(frag);const loadPolicy=getLoaderConfigWithoutReties(config.fragLoadPolicy.default);const loaderConfig={loadPolicy,timeout:loadPolicy.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:frag.sn==='initSegment'?Infinity:MIN_CHUNK_SIZE};// Assign frag stats to the loader's stats reference
frag.stats=loader.stats;loader.load(loaderContext,loaderConfig,{onSuccess:(response,stats,context,networkDetails)=>{this.resetLoader(frag,loader);let payload=response.data;if(context.resetIV&&frag.decryptdata){frag.decryptdata.iv=new Uint8Array(payload.slice(0,16));payload=payload.slice(16);}resolve({frag,part:null,payload,networkDetails});},onError:(response,context,networkDetails,stats)=>{this.resetLoader(frag,loader);reject(new LoadError({type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.FRAG_LOAD_ERROR,fatal:false,frag,response:_objectSpread2({url,data:undefined},response),error:new Error(`HTTP Error ${response.code} ${response.text}`),networkDetails,stats}));},onAbort:(stats,context,networkDetails)=>{this.resetLoader(frag,loader);reject(new LoadError({type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.INTERNAL_ABORTED,fatal:false,frag,error:new Error('Aborted'),networkDetails,stats}));},onTimeout:(stats,context,networkDetails)=>{this.resetLoader(frag,loader);reject(new LoadError({type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:false,frag,error:new Error(`Timeout after ${loaderConfig.timeout}ms`),networkDetails,stats}));},onProgress:(stats,context,data,networkDetails)=>{if(onProgress){onProgress({frag,part:null,payload:data,networkDetails});}}});});}loadPart(frag,part,onProgress){this.abort();const config=this.config;const FragmentILoader=config.fLoader;const DefaultILoader=config.loader;return new Promise((resolve,reject)=>{if(this.loader){this.loader.destroy();}if(frag.gap||part.gap){reject(createGapLoadError(frag,part));return;}const loader=this.loader=frag.loader=FragmentILoader?new FragmentILoader(config):new DefaultILoader(config);const loaderContext=createLoaderContext(frag,part);// Should we define another load policy for parts?
const loadPolicy=getLoaderConfigWithoutReties(config.fragLoadPolicy.default);const loaderConfig={loadPolicy,timeout:loadPolicy.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:MIN_CHUNK_SIZE};// Assign part stats to the loader's stats reference
part.stats=loader.stats;loader.load(loaderContext,loaderConfig,{onSuccess:(response,stats,context,networkDetails)=>{this.resetLoader(frag,loader);this.updateStatsFromPart(frag,part);const partLoadedData={frag,part,payload:response.data,networkDetails};onProgress(partLoadedData);resolve(partLoadedData);},onError:(response,context,networkDetails,stats)=>{this.resetLoader(frag,loader);reject(new LoadError({type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.FRAG_LOAD_ERROR,fatal:false,frag,part,response:_objectSpread2({url:loaderContext.url,data:undefined},response),error:new Error(`HTTP Error ${response.code} ${response.text}`),networkDetails,stats}));},onAbort:(stats,context,networkDetails)=>{frag.stats.aborted=part.stats.aborted;this.resetLoader(frag,loader);reject(new LoadError({type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.INTERNAL_ABORTED,fatal:false,frag,part,error:new Error('Aborted'),networkDetails,stats}));},onTimeout:(stats,context,networkDetails)=>{this.resetLoader(frag,loader);reject(new LoadError({type:ErrorTypes.NETWORK_ERROR,details:ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:false,frag,part,error:new Error(`Timeout after ${loaderConfig.timeout}ms`),networkDetails,stats}));}});});}updateStatsFromPart(frag,part){const fragStats=frag.stats;const partStats=part.stats;const partTotal=partStats.total;fragStats.loaded+=partStats.loaded;if(partTotal){const estTotalParts=Math.round(frag.duration/part.duration);const estLoadedParts=Math.min(Math.round(fragStats.loaded/partTotal),estTotalParts);const estRemainingParts=estTotalParts-estLoadedParts;const estRemainingBytes=estRemainingParts*Math.round(fragStats.loaded/estLoadedParts);fragStats.total=fragStats.loaded+estRemainingBytes;}else {fragStats.total=Math.max(fragStats.loaded,fragStats.total);}const fragLoading=fragStats.loading;const partLoading=partStats.loading;if(fragLoading.start){// add to fragment loader latency
fragLoading.first+=partLoading.first-partLoading.start;}else {fragLoading.start=partLoading.start;fragLoading.first=partLoading.first;}fragLoading.end=partLoading.end;}resetLoader(frag,loader){frag.loader=null;if(this.loader===loader){self.clearTimeout(this.partLoadTimeout);this.loader=null;}loader.destroy();}}function createLoaderContext(frag,part=null){const segment=part||frag;const loaderContext={frag,part,responseType:'arraybuffer',url:segment.url,headers:{},rangeStart:0,rangeEnd:0};const start=segment.byteRangeStartOffset;const end=segment.byteRangeEndOffset;if(isFiniteNumber(start)&&isFiniteNumber(end)){var _frag$decryptdata;let byteRangeStart=start;let byteRangeEnd=end;if(frag.sn==='initSegment'&&((_frag$decryptdata=frag.decryptdata)==null?void 0:_frag$decryptdata.method)==='AES-128'){// MAP segment encrypted with method 'AES-128', when served with HTTP Range,
// has the unencrypted size specified in the range.
// Ref: https://tools.ietf.org/html/draft-pantos-hls-rfc8216bis-08#section-6.3.6
const fragmentLen=end-start;if(fragmentLen%16){byteRangeEnd=end+(16-fragmentLen%16);}if(start!==0){loaderContext.resetIV=true;byteRangeStart=start-16;}}loaderContext.rangeStart=byteRangeStart;loaderContext.rangeEnd=byteRangeEnd;}return loaderContext;}function createGapLoadError(frag,part){const error=new Error(`GAP ${frag.gap?'tag':'attribute'} found`);const errorData={type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_GAP,fatal:false,frag,error,networkDetails:null};if(part){errorData.part=part;}(part?part:frag).stats.aborted=true;return new LoadError(errorData);}class LoadError extends Error{constructor(data){super(data.error.message);this.data=void 0;this.data=data;}}class AESCrypto{constructor(subtle,iv){this.subtle=void 0;this.aesIV=void 0;this.subtle=subtle;this.aesIV=iv;}decrypt(data,key){return this.subtle.decrypt({name:'AES-CBC',iv:this.aesIV},key,data);}}class FastAESKey{constructor(subtle,key){this.subtle=void 0;this.key=void 0;this.subtle=subtle;this.key=key;}expandKey(){return this.subtle.importKey('raw',this.key,{name:'AES-CBC'},false,['encrypt','decrypt']);}}// PKCS7
function removePadding(array){const outputBytes=array.byteLength;const paddingBytes=outputBytes&&new DataView(array.buffer).getUint8(outputBytes-1);if(paddingBytes){return sliceUint8(array,0,outputBytes-paddingBytes);}return array;}class AESDecryptor{constructor(){this.rcon=[0x0,0x1,0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x1b,0x36];this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)];this.sBox=new Uint32Array(256);this.invSBox=new Uint32Array(256);this.key=new Uint32Array(0);this.ksRows=0;this.keySize=0;this.keySchedule=void 0;this.invKeySchedule=void 0;this.initTable();}// Using view.getUint32() also swaps the byte order.
uint8ArrayToUint32Array_(arrayBuffer){const view=new DataView(arrayBuffer);const newArray=new Uint32Array(4);for(let i=0;i<4;i++){newArray[i]=view.getUint32(i*4);}return newArray;}initTable(){const sBox=this.sBox;const invSBox=this.invSBox;const subMix=this.subMix;const subMix0=subMix[0];const subMix1=subMix[1];const subMix2=subMix[2];const subMix3=subMix[3];const invSubMix=this.invSubMix;const invSubMix0=invSubMix[0];const invSubMix1=invSubMix[1];const invSubMix2=invSubMix[2];const invSubMix3=invSubMix[3];const d=new Uint32Array(256);let x=0;let xi=0;let i=0;for(i=0;i<256;i++){if(i<128){d[i]=i<<1;}else {d[i]=i<<1^0x11b;}}for(i=0;i<256;i++){let sx=xi^xi<<1^xi<<2^xi<<3^xi<<4;sx=sx>>>8^sx&0xff^0x63;sBox[x]=sx;invSBox[sx]=x;// Compute multiplication
const x2=d[x];const x4=d[x2];const x8=d[x4];// Compute sub/invSub bytes, mix columns tables
let t=d[sx]*0x101^sx*0x1010100;subMix0[x]=t<<24|t>>>8;subMix1[x]=t<<16|t>>>16;subMix2[x]=t<<8|t>>>24;subMix3[x]=t;// Compute inv sub bytes, inv mix columns tables
t=x8*0x1010101^x4*0x10001^x2*0x101^x*0x1010100;invSubMix0[sx]=t<<24|t>>>8;invSubMix1[sx]=t<<16|t>>>16;invSubMix2[sx]=t<<8|t>>>24;invSubMix3[sx]=t;// Compute next counter
if(!x){x=xi=1;}else {x=x2^d[d[d[x8^x2]]];xi^=d[d[xi]];}}}expandKey(keyBuffer){// convert keyBuffer to Uint32Array
const key=this.uint8ArrayToUint32Array_(keyBuffer);let sameKey=true;let offset=0;while(offset<key.length&&sameKey){sameKey=key[offset]===this.key[offset];offset++;}if(sameKey){return;}this.key=key;const keySize=this.keySize=key.length;if(keySize!==4&&keySize!==6&&keySize!==8){throw new Error('Invalid aes key size='+keySize);}const ksRows=this.ksRows=(keySize+6+1)*4;let ksRow;let invKsRow;const keySchedule=this.keySchedule=new Uint32Array(ksRows);const invKeySchedule=this.invKeySchedule=new Uint32Array(ksRows);const sbox=this.sBox;const rcon=this.rcon;const invSubMix=this.invSubMix;const invSubMix0=invSubMix[0];const invSubMix1=invSubMix[1];const invSubMix2=invSubMix[2];const invSubMix3=invSubMix[3];let prev;let t;for(ksRow=0;ksRow<ksRows;ksRow++){if(ksRow<keySize){prev=keySchedule[ksRow]=key[ksRow];continue;}t=prev;if(ksRow%keySize===0){// Rot word
t=t<<8|t>>>24;// Sub word
t=sbox[t>>>24]<<24|sbox[t>>>16&0xff]<<16|sbox[t>>>8&0xff]<<8|sbox[t&0xff];// Mix Rcon
t^=rcon[ksRow/keySize|0]<<24;}else if(keySize>6&&ksRow%keySize===4){// Sub word
t=sbox[t>>>24]<<24|sbox[t>>>16&0xff]<<16|sbox[t>>>8&0xff]<<8|sbox[t&0xff];}keySchedule[ksRow]=prev=(keySchedule[ksRow-keySize]^t)>>>0;}for(invKsRow=0;invKsRow<ksRows;invKsRow++){ksRow=ksRows-invKsRow;if(invKsRow&3){t=keySchedule[ksRow];}else {t=keySchedule[ksRow-4];}if(invKsRow<4||ksRow<=4){invKeySchedule[invKsRow]=t;}else {invKeySchedule[invKsRow]=invSubMix0[sbox[t>>>24]]^invSubMix1[sbox[t>>>16&0xff]]^invSubMix2[sbox[t>>>8&0xff]]^invSubMix3[sbox[t&0xff]];}invKeySchedule[invKsRow]=invKeySchedule[invKsRow]>>>0;}}// Adding this as a method greatly improves performance.
networkToHostOrderSwap(word){return word<<24|(word&0xff00)<<8|(word&0xff0000)>>8|word>>>24;}decrypt(inputArrayBuffer,offset,aesIV){const nRounds=this.keySize+6;const invKeySchedule=this.invKeySchedule;const invSBOX=this.invSBox;const invSubMix=this.invSubMix;const invSubMix0=invSubMix[0];const invSubMix1=invSubMix[1];const invSubMix2=invSubMix[2];const invSubMix3=invSubMix[3];const initVector=this.uint8ArrayToUint32Array_(aesIV);let initVector0=initVector[0];let initVector1=initVector[1];let initVector2=initVector[2];let initVector3=initVector[3];const inputInt32=new Int32Array(inputArrayBuffer);const outputInt32=new Int32Array(inputInt32.length);let t0,t1,t2,t3;let s0,s1,s2,s3;let inputWords0,inputWords1,inputWords2,inputWords3;let ksRow,i;const swapWord=this.networkToHostOrderSwap;while(offset<inputInt32.length){inputWords0=swapWord(inputInt32[offset]);inputWords1=swapWord(inputInt32[offset+1]);inputWords2=swapWord(inputInt32[offset+2]);inputWords3=swapWord(inputInt32[offset+3]);s0=inputWords0^invKeySchedule[0];s1=inputWords3^invKeySchedule[1];s2=inputWords2^invKeySchedule[2];s3=inputWords1^invKeySchedule[3];ksRow=4;// Iterate through the rounds of decryption
for(i=1;i<nRounds;i++){t0=invSubMix0[s0>>>24]^invSubMix1[s1>>16&0xff]^invSubMix2[s2>>8&0xff]^invSubMix3[s3&0xff]^invKeySchedule[ksRow];t1=invSubMix0[s1>>>24]^invSubMix1[s2>>16&0xff]^invSubMix2[s3>>8&0xff]^invSubMix3[s0&0xff]^invKeySchedule[ksRow+1];t2=invSubMix0[s2>>>24]^invSubMix1[s3>>16&0xff]^invSubMix2[s0>>8&0xff]^invSubMix3[s1&0xff]^invKeySchedule[ksRow+2];t3=invSubMix0[s3>>>24]^invSubMix1[s0>>16&0xff]^invSubMix2[s1>>8&0xff]^invSubMix3[s2&0xff]^invKeySchedule[ksRow+3];// Update state
s0=t0;s1=t1;s2=t2;s3=t3;ksRow=ksRow+4;}// Shift rows, sub bytes, add round key
t0=invSBOX[s0>>>24]<<24^invSBOX[s1>>16&0xff]<<16^invSBOX[s2>>8&0xff]<<8^invSBOX[s3&0xff]^invKeySchedule[ksRow];t1=invSBOX[s1>>>24]<<24^invSBOX[s2>>16&0xff]<<16^invSBOX[s3>>8&0xff]<<8^invSBOX[s0&0xff]^invKeySchedule[ksRow+1];t2=invSBOX[s2>>>24]<<24^invSBOX[s3>>16&0xff]<<16^invSBOX[s0>>8&0xff]<<8^invSBOX[s1&0xff]^invKeySchedule[ksRow+2];t3=invSBOX[s3>>>24]<<24^invSBOX[s0>>16&0xff]<<16^invSBOX[s1>>8&0xff]<<8^invSBOX[s2&0xff]^invKeySchedule[ksRow+3];// Write
outputInt32[offset]=swapWord(t0^initVector0);outputInt32[offset+1]=swapWord(t3^initVector1);outputInt32[offset+2]=swapWord(t2^initVector2);outputInt32[offset+3]=swapWord(t1^initVector3);// reset initVector to last 4 unsigned int
initVector0=inputWords0;initVector1=inputWords1;initVector2=inputWords2;initVector3=inputWords3;offset=offset+4;}return outputInt32.buffer;}}const CHUNK_SIZE=16;// 16 bytes, 128 bits
class Decrypter{constructor(config,{removePKCS7Padding=true}={}){this.logEnabled=true;this.removePKCS7Padding=void 0;this.subtle=null;this.softwareDecrypter=null;this.key=null;this.fastAesKey=null;this.remainderData=null;this.currentIV=null;this.currentResult=null;this.useSoftware=void 0;this.useSoftware=config.enableSoftwareAES;this.removePKCS7Padding=removePKCS7Padding;// built in decryptor expects PKCS7 padding
if(removePKCS7Padding){try{const browserCrypto=self.crypto;if(browserCrypto){this.subtle=browserCrypto.subtle||browserCrypto.webkitSubtle;}}catch(e){/* no-op */}}this.useSoftware=!this.subtle;}destroy(){this.subtle=null;this.softwareDecrypter=null;this.key=null;this.fastAesKey=null;this.remainderData=null;this.currentIV=null;this.currentResult=null;}isSync(){return this.useSoftware;}flush(){const{currentResult,remainderData}=this;if(!currentResult||remainderData){this.reset();return null;}const data=new Uint8Array(currentResult);this.reset();if(this.removePKCS7Padding){return removePadding(data);}return data;}reset(){this.currentResult=null;this.currentIV=null;this.remainderData=null;if(this.softwareDecrypter){this.softwareDecrypter=null;}}decrypt(data,key,iv){if(this.useSoftware){return new Promise((resolve,reject)=>{this.softwareDecrypt(new Uint8Array(data),key,iv);const decryptResult=this.flush();if(decryptResult){resolve(decryptResult.buffer);}else {reject(new Error('[softwareDecrypt] Failed to decrypt data'));}});}return this.webCryptoDecrypt(new Uint8Array(data),key,iv);}// Software decryption is progressive. Progressive decryption may not return a result on each call. Any cached
// data is handled in the flush() call
softwareDecrypt(data,key,iv){const{currentIV,currentResult,remainderData}=this;this.logOnce('JS AES decrypt');// The output is staggered during progressive parsing - the current result is cached, and emitted on the next call
// This is done in order to strip PKCS7 padding, which is found at the end of each segment. We only know we've reached
// the end on flush(), but by that time we have already received all bytes for the segment.
// Progressive decryption does not work with WebCrypto
if(remainderData){data=appendUint8Array(remainderData,data);this.remainderData=null;}// Byte length must be a multiple of 16 (AES-128 = 128 bit blocks = 16 bytes)
const currentChunk=this.getValidChunk(data);if(!currentChunk.length){return null;}if(currentIV){iv=currentIV;}let softwareDecrypter=this.softwareDecrypter;if(!softwareDecrypter){softwareDecrypter=this.softwareDecrypter=new AESDecryptor();}softwareDecrypter.expandKey(key);const result=currentResult;this.currentResult=softwareDecrypter.decrypt(currentChunk.buffer,0,iv);this.currentIV=sliceUint8(currentChunk,-16).buffer;if(!result){return null;}return result;}webCryptoDecrypt(data,key,iv){if(this.key!==key||!this.fastAesKey){if(!this.subtle){return Promise.resolve(this.onWebCryptoError(data,key,iv));}this.key=key;this.fastAesKey=new FastAESKey(this.subtle,key);}return this.fastAesKey.expandKey().then(aesKey=>{// decrypt using web crypto
if(!this.subtle){return Promise.reject(new Error('web crypto not initialized'));}this.logOnce('WebCrypto AES decrypt');const crypto=new AESCrypto(this.subtle,new Uint8Array(iv));return crypto.decrypt(data.buffer,aesKey);}).catch(err=>{logger.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${err.name}: ${err.message}`);return this.onWebCryptoError(data,key,iv);});}onWebCryptoError(data,key,iv){this.useSoftware=true;this.logEnabled=true;this.softwareDecrypt(data,key,iv);const decryptResult=this.flush();if(decryptResult){return decryptResult.buffer;}throw new Error('WebCrypto and softwareDecrypt: failed to decrypt data');}getValidChunk(data){let currentChunk=data;const splitPoint=data.length-data.length%CHUNK_SIZE;if(splitPoint!==data.length){currentChunk=sliceUint8(data,0,splitPoint);this.remainderData=sliceUint8(data,splitPoint);}return currentChunk;}logOnce(msg){if(!this.logEnabled){return;}logger.log(`[decrypter]: ${msg}`);this.logEnabled=false;}}/**
 *  TimeRanges to string helper
 */const TimeRanges={toString:function(r){let log='';const len=r.length;for(let i=0;i<len;i++){log+=`[${r.start(i).toFixed(3)}-${r.end(i).toFixed(3)}]`;}return log;}};const State={STOPPED:'STOPPED',IDLE:'IDLE',KEY_LOADING:'KEY_LOADING',FRAG_LOADING:'FRAG_LOADING',FRAG_LOADING_WAITING_RETRY:'FRAG_LOADING_WAITING_RETRY',WAITING_TRACK:'WAITING_TRACK',PARSING:'PARSING',PARSED:'PARSED',ENDED:'ENDED',ERROR:'ERROR',WAITING_INIT_PTS:'WAITING_INIT_PTS',WAITING_LEVEL:'WAITING_LEVEL'};class BaseStreamController extends TaskLoop{constructor(hls,fragmentTracker,keyLoader,logPrefix,playlistType){super();this.hls=void 0;this.fragPrevious=null;this.fragCurrent=null;this.fragmentTracker=void 0;this.transmuxer=null;this._state=State.STOPPED;this.playlistType=void 0;this.media=null;this.mediaBuffer=null;this.config=void 0;this.bitrateTest=false;this.lastCurrentTime=0;this.nextLoadPosition=0;this.startPosition=0;this.startTimeOffset=null;this.loadedmetadata=false;this.retryDate=0;this.levels=null;this.fragmentLoader=void 0;this.keyLoader=void 0;this.levelLastLoaded=null;this.startFragRequested=false;this.decrypter=void 0;this.initPTS=[];this.onvseeking=null;this.onvended=null;this.logPrefix='';this.log=void 0;this.warn=void 0;this.playlistType=playlistType;this.logPrefix=logPrefix;this.log=logger.log.bind(logger,`${logPrefix}:`);this.warn=logger.warn.bind(logger,`${logPrefix}:`);this.hls=hls;this.fragmentLoader=new FragmentLoader(hls.config);this.keyLoader=keyLoader;this.fragmentTracker=fragmentTracker;this.config=hls.config;this.decrypter=new Decrypter(hls.config);hls.on(Events$1.MANIFEST_LOADED,this.onManifestLoaded,this);}doTick(){this.onTickEnd();}onTickEnd(){}// eslint-disable-next-line @typescript-eslint/no-unused-vars
startLoad(startPosition){}stopLoad(){this.fragmentLoader.abort();this.keyLoader.abort(this.playlistType);const frag=this.fragCurrent;if(frag!=null&&frag.loader){frag.abortRequests();this.fragmentTracker.removeFragment(frag);}this.resetTransmuxer();this.fragCurrent=null;this.fragPrevious=null;this.clearInterval();this.clearNextTick();this.state=State.STOPPED;}_streamEnded(bufferInfo,levelDetails){// If playlist is live, there is another buffered range after the current range, nothing buffered, media is detached,
// of nothing loading/loaded return false
if(levelDetails.live||bufferInfo.nextStart||!bufferInfo.end||!this.media){return false;}const partList=levelDetails.partList;// Since the last part isn't guaranteed to correspond to the last playlist segment for Low-Latency HLS,
// check instead if the last part is buffered.
if(partList!=null&&partList.length){const lastPart=partList[partList.length-1];// Checking the midpoint of the part for potential margin of error and related issues.
// NOTE: Technically I believe parts could yield content that is < the computed duration (including potential a duration of 0)
// and still be spec-compliant, so there may still be edge cases here. Likewise, there could be issues in end of stream
// part mismatches for independent audio and video playlists/segments.
const lastPartBuffered=BufferHelper.isBuffered(this.media,lastPart.start+lastPart.duration/2);return lastPartBuffered;}const playlistType=levelDetails.fragments[levelDetails.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(playlistType);}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var _this$levelLastLoaded;return (_this$levelLastLoaded=this.levelLastLoaded)==null?void 0:_this$levelLastLoaded.details;}}onMediaAttached(event,data){const media=this.media=this.mediaBuffer=data.media;this.onvseeking=this.onMediaSeeking.bind(this);this.onvended=this.onMediaEnded.bind(this);media.addEventListener('seeking',this.onvseeking);media.addEventListener('ended',this.onvended);const config=this.config;if(this.levels&&config.autoStartLoad&&this.state===State.STOPPED){this.startLoad(config.startPosition);}}onMediaDetaching(){const media=this.media;if(media!=null&&media.ended){this.log('MSE detaching and video ended, reset startPosition');this.startPosition=this.lastCurrentTime=0;}// remove video listeners
if(media&&this.onvseeking&&this.onvended){media.removeEventListener('seeking',this.onvseeking);media.removeEventListener('ended',this.onvended);this.onvseeking=this.onvended=null;}if(this.keyLoader){this.keyLoader.detach();}this.media=this.mediaBuffer=null;this.loadedmetadata=false;this.fragmentTracker.removeAllFragments();this.stopLoad();}onMediaSeeking(){const{config,fragCurrent,media,mediaBuffer,state}=this;const currentTime=media?media.currentTime:0;const bufferInfo=BufferHelper.bufferInfo(mediaBuffer?mediaBuffer:media,currentTime,config.maxBufferHole);this.log(`media seeking to ${isFiniteNumber(currentTime)?currentTime.toFixed(3):currentTime}, state: ${state}`);if(this.state===State.ENDED){this.resetLoadingState();}else if(fragCurrent){// Seeking while frag load is in progress
const tolerance=config.maxFragLookUpTolerance;const fragStartOffset=fragCurrent.start-tolerance;const fragEndOffset=fragCurrent.start+fragCurrent.duration+tolerance;// if seeking out of buffered range or into new one
if(!bufferInfo.len||fragEndOffset<bufferInfo.start||fragStartOffset>bufferInfo.end){const pastFragment=currentTime>fragEndOffset;// if the seek position is outside the current fragment range
if(currentTime<fragStartOffset||pastFragment){if(pastFragment&&fragCurrent.loader){this.log('seeking outside of buffer while fragment load in progress, cancel fragment load');fragCurrent.abortRequests();this.resetLoadingState();}this.fragPrevious=null;}}}if(media){// Remove gap fragments
this.fragmentTracker.removeFragmentsInRange(currentTime,Infinity,this.playlistType,true);this.lastCurrentTime=currentTime;}// in case seeking occurs although no media buffered, adjust startPosition and nextLoadPosition to seek target
if(!this.loadedmetadata&&!bufferInfo.len){this.nextLoadPosition=this.startPosition=currentTime;}// Async tick to speed up processing
this.tickImmediate();}onMediaEnded(){// reset startPosition and lastCurrentTime to restart playback @ stream beginning
this.startPosition=this.lastCurrentTime=0;}onManifestLoaded(event,data){this.startTimeOffset=data.startTimeOffset;this.initPTS=[];}onHandlerDestroying(){this.hls.off(Events$1.MANIFEST_LOADED,this.onManifestLoaded,this);this.stopLoad();super.onHandlerDestroying();// @ts-ignore
this.hls=null;}onHandlerDestroyed(){this.state=State.STOPPED;if(this.fragmentLoader){this.fragmentLoader.destroy();}if(this.keyLoader){this.keyLoader.destroy();}if(this.decrypter){this.decrypter.destroy();}this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null;super.onHandlerDestroyed();}loadFragment(frag,level,targetBufferTime){this._loadFragForPlayback(frag,level,targetBufferTime);}_loadFragForPlayback(frag,level,targetBufferTime){const progressCallback=data=>{if(this.fragContextChanged(frag)){this.warn(`Fragment ${frag.sn}${data.part?' p: '+data.part.index:''} of level ${frag.level} was dropped during download.`);this.fragmentTracker.removeFragment(frag);return;}frag.stats.chunkCount++;this._handleFragmentLoadProgress(data);};this._doFragLoad(frag,level,targetBufferTime,progressCallback).then(data=>{if(!data){// if we're here we probably needed to backtrack or are waiting for more parts
return;}const state=this.state;if(this.fragContextChanged(frag)){if(state===State.FRAG_LOADING||!this.fragCurrent&&state===State.PARSING){this.fragmentTracker.removeFragment(frag);this.state=State.IDLE;}return;}if('payload'in data){this.log(`Loaded fragment ${frag.sn} of level ${frag.level}`);this.hls.trigger(Events$1.FRAG_LOADED,data);}// Pass through the whole payload; controllers not implementing progressive loading receive data from this callback
this._handleFragmentLoadComplete(data);}).catch(reason=>{if(this.state===State.STOPPED||this.state===State.ERROR){return;}this.warn(reason);this.resetFragmentLoading(frag);});}clearTrackerIfNeeded(frag){var _this$mediaBuffer;const{fragmentTracker}=this;const fragState=fragmentTracker.getState(frag);if(fragState===FragmentState.APPENDING){// Lower the max buffer length and try again
const playlistType=frag.type;const bufferedInfo=this.getFwdBufferInfo(this.mediaBuffer,playlistType);const minForwardBufferLength=Math.max(frag.duration,bufferedInfo?bufferedInfo.len:this.config.maxBufferLength);// If backtracking, always remove from the tracker without reducing max buffer length
const backtrackFragment=this.backtrackFragment;const backtracked=backtrackFragment?frag.sn-backtrackFragment.sn:0;if(backtracked===1||this.reduceMaxBufferLength(minForwardBufferLength)){fragmentTracker.removeFragment(frag);}}else if(((_this$mediaBuffer=this.mediaBuffer)==null?void 0:_this$mediaBuffer.buffered.length)===0){// Stop gap for bad tracker / buffer flush behavior
fragmentTracker.removeAllFragments();}else if(fragmentTracker.hasParts(frag.type)){// In low latency mode, remove fragments for which only some parts were buffered
fragmentTracker.detectPartialFragments({frag,part:null,stats:frag.stats,id:frag.type});if(fragmentTracker.getState(frag)===FragmentState.PARTIAL){fragmentTracker.removeFragment(frag);}}}checkLiveUpdate(details){if(details.updated&&!details.live){// Live stream ended, update fragment tracker
const lastFragment=details.fragments[details.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:lastFragment,part:null,stats:lastFragment.stats,id:lastFragment.type});}if(!details.fragments[0]){details.deltaUpdateFailed=true;}}flushMainBuffer(startOffset,endOffset,type=null){if(!(startOffset-endOffset)){return;}// When alternate audio is playing, the audio-stream-controller is responsible for the audio buffer. Otherwise,
// passing a null type flushes both buffers
const flushScope={startOffset,endOffset,type};this.hls.trigger(Events$1.BUFFER_FLUSHING,flushScope);}_loadInitSegment(frag,level){this._doFragLoad(frag,level).then(data=>{if(!data||this.fragContextChanged(frag)||!this.levels){throw new Error('init load aborted');}return data;}).then(data=>{const{hls}=this;const{payload}=data;const decryptData=frag.decryptdata;// check to see if the payload needs to be decrypted
if(payload&&payload.byteLength>0&&decryptData!=null&&decryptData.key&&decryptData.iv&&decryptData.method==='AES-128'){const startTime=self.performance.now();// decrypt init segment data
return this.decrypter.decrypt(new Uint8Array(payload),decryptData.key.buffer,decryptData.iv.buffer).catch(err=>{hls.trigger(Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_DECRYPT_ERROR,fatal:false,error:err,reason:err.message,frag});throw err;}).then(decryptedData=>{const endTime=self.performance.now();hls.trigger(Events$1.FRAG_DECRYPTED,{frag,payload:decryptedData,stats:{tstart:startTime,tdecrypt:endTime}});data.payload=decryptedData;return this.completeInitSegmentLoad(data);});}return this.completeInitSegmentLoad(data);}).catch(reason=>{if(this.state===State.STOPPED||this.state===State.ERROR){return;}this.warn(reason);this.resetFragmentLoading(frag);});}completeInitSegmentLoad(data){const{levels}=this;if(!levels){throw new Error('init load aborted, missing levels');}const stats=data.frag.stats;this.state=State.IDLE;data.frag.data=new Uint8Array(data.payload);stats.parsing.start=stats.buffering.start=self.performance.now();stats.parsing.end=stats.buffering.end=self.performance.now();this.tick();}fragContextChanged(frag){const{fragCurrent}=this;return !frag||!fragCurrent||frag.sn!==fragCurrent.sn||frag.level!==fragCurrent.level;}fragBufferedComplete(frag,part){var _frag$startPTS,_frag$endPTS,_this$fragCurrent,_this$fragPrevious;const media=this.mediaBuffer?this.mediaBuffer:this.media;this.log(`Buffered ${frag.type} sn: ${frag.sn}${part?' part: '+part.index:''} of ${this.playlistType===PlaylistLevelType.MAIN?'level':'track'} ${frag.level} (frag:[${((_frag$startPTS=frag.startPTS)!=null?_frag$startPTS:NaN).toFixed(3)}-${((_frag$endPTS=frag.endPTS)!=null?_frag$endPTS:NaN).toFixed(3)}] > buffer:${media?TimeRanges.toString(BufferHelper.getBuffered(media)):'(detached)'})`);if(frag.sn!=='initSegment'){var _this$levels;if(frag.type!==PlaylistLevelType.SUBTITLE){const el=frag.elementaryStreams;if(!Object.keys(el).some(type=>!!el[type])){// empty segment
this.state=State.IDLE;return;}}const level=(_this$levels=this.levels)==null?void 0:_this$levels[frag.level];if(level!=null&&level.fragmentError){this.log(`Resetting level fragment error count of ${level.fragmentError} on frag buffered`);level.fragmentError=0;}}this.state=State.IDLE;if(!media){return;}if(!this.loadedmetadata&&frag.type==PlaylistLevelType.MAIN&&media.buffered.length&&((_this$fragCurrent=this.fragCurrent)==null?void 0:_this$fragCurrent.sn)===((_this$fragPrevious=this.fragPrevious)==null?void 0:_this$fragPrevious.sn)){this.loadedmetadata=true;this.seekToStartPos();}this.tick();}seekToStartPos(){}_handleFragmentLoadComplete(fragLoadedEndData){const{transmuxer}=this;if(!transmuxer){return;}const{frag,part,partsLoaded}=fragLoadedEndData;// If we did not load parts, or loaded all parts, we have complete (not partial) fragment data
const complete=!partsLoaded||partsLoaded.length===0||partsLoaded.some(fragLoaded=>!fragLoaded);const chunkMeta=new ChunkMetadata(frag.level,frag.sn,frag.stats.chunkCount+1,0,part?part.index:-1,!complete);transmuxer.flush(chunkMeta);}// eslint-disable-next-line @typescript-eslint/no-unused-vars
_handleFragmentLoadProgress(frag){}_doFragLoad(frag,level,targetBufferTime=null,progressCallback){var _frag$decryptdata;const details=level==null?void 0:level.details;if(!this.levels||!details){throw new Error(`frag load aborted, missing level${details?'':' detail'}s`);}let keyLoadingPromise=null;if(frag.encrypted&&!((_frag$decryptdata=frag.decryptdata)!=null&&_frag$decryptdata.key)){this.log(`Loading key for ${frag.sn} of [${details.startSN}-${details.endSN}], ${this.logPrefix==='[stream-controller]'?'level':'track'} ${frag.level}`);this.state=State.KEY_LOADING;this.fragCurrent=frag;keyLoadingPromise=this.keyLoader.load(frag).then(keyLoadedData=>{if(!this.fragContextChanged(keyLoadedData.frag)){this.hls.trigger(Events$1.KEY_LOADED,keyLoadedData);if(this.state===State.KEY_LOADING){this.state=State.IDLE;}return keyLoadedData;}});this.hls.trigger(Events$1.KEY_LOADING,{frag});if(this.fragCurrent===null){keyLoadingPromise=Promise.reject(new Error(`frag load aborted, context changed in KEY_LOADING`));}}else if(!frag.encrypted&&details.encryptedFragments.length){this.keyLoader.loadClear(frag,details.encryptedFragments);}targetBufferTime=Math.max(frag.start,targetBufferTime||0);if(this.config.lowLatencyMode&&frag.sn!=='initSegment'){const partList=details.partList;if(partList&&progressCallback){if(targetBufferTime>frag.end&&details.fragmentHint){frag=details.fragmentHint;}const partIndex=this.getNextPart(partList,frag,targetBufferTime);if(partIndex>-1){const part=partList[partIndex];this.log(`Loading part sn: ${frag.sn} p: ${part.index} cc: ${frag.cc} of playlist [${details.startSN}-${details.endSN}] parts [0-${partIndex}-${partList.length-1}] ${this.logPrefix==='[stream-controller]'?'level':'track'}: ${frag.level}, target: ${parseFloat(targetBufferTime.toFixed(3))}`);this.nextLoadPosition=part.start+part.duration;this.state=State.FRAG_LOADING;let _result;if(keyLoadingPromise){_result=keyLoadingPromise.then(keyLoadedData=>{if(!keyLoadedData||this.fragContextChanged(keyLoadedData.frag)){return null;}return this.doFragPartsLoad(frag,part,level,progressCallback);}).catch(error=>this.handleFragLoadError(error));}else {_result=this.doFragPartsLoad(frag,part,level,progressCallback).catch(error=>this.handleFragLoadError(error));}this.hls.trigger(Events$1.FRAG_LOADING,{frag,part,targetBufferTime});if(this.fragCurrent===null){return Promise.reject(new Error(`frag load aborted, context changed in FRAG_LOADING parts`));}return _result;}else if(!frag.url||this.loadedEndOfParts(partList,targetBufferTime)){// Fragment hint has no parts
return Promise.resolve(null);}}}this.log(`Loading fragment ${frag.sn} cc: ${frag.cc} ${details?'of ['+details.startSN+'-'+details.endSN+'] ':''}${this.logPrefix==='[stream-controller]'?'level':'track'}: ${frag.level}, target: ${parseFloat(targetBufferTime.toFixed(3))}`);// Don't update nextLoadPosition for fragments which are not buffered
if(isFiniteNumber(frag.sn)&&!this.bitrateTest){this.nextLoadPosition=frag.start+frag.duration;}this.state=State.FRAG_LOADING;// Load key before streaming fragment data
const dataOnProgress=this.config.progressive;let result;if(dataOnProgress&&keyLoadingPromise){result=keyLoadingPromise.then(keyLoadedData=>{if(!keyLoadedData||this.fragContextChanged(keyLoadedData==null?void 0:keyLoadedData.frag)){return null;}return this.fragmentLoader.load(frag,progressCallback);}).catch(error=>this.handleFragLoadError(error));}else {// load unencrypted fragment data with progress event,
// or handle fragment result after key and fragment are finished loading
result=Promise.all([this.fragmentLoader.load(frag,dataOnProgress?progressCallback:undefined),keyLoadingPromise]).then(([fragLoadedData])=>{if(!dataOnProgress&&fragLoadedData&&progressCallback){progressCallback(fragLoadedData);}return fragLoadedData;}).catch(error=>this.handleFragLoadError(error));}this.hls.trigger(Events$1.FRAG_LOADING,{frag,targetBufferTime});if(this.fragCurrent===null){return Promise.reject(new Error(`frag load aborted, context changed in FRAG_LOADING`));}return result;}doFragPartsLoad(frag,fromPart,level,progressCallback){return new Promise((resolve,reject)=>{var _level$details;const partsLoaded=[];const initialPartList=(_level$details=level.details)==null?void 0:_level$details.partList;const loadPart=part=>{this.fragmentLoader.loadPart(frag,part,progressCallback).then(partLoadedData=>{partsLoaded[part.index]=partLoadedData;const loadedPart=partLoadedData.part;this.hls.trigger(Events$1.FRAG_LOADED,partLoadedData);const nextPart=getPartWith(level,frag.sn,part.index+1)||findPart(initialPartList,frag.sn,part.index+1);if(nextPart){loadPart(nextPart);}else {return resolve({frag,part:loadedPart,partsLoaded});}}).catch(reject);};loadPart(fromPart);});}handleFragLoadError(error){if('data'in error){const data=error.data;if(error.data&&data.details===ErrorDetails.INTERNAL_ABORTED){this.handleFragLoadAborted(data.frag,data.part);}else {this.hls.trigger(Events$1.ERROR,data);}}else {this.hls.trigger(Events$1.ERROR,{type:ErrorTypes.OTHER_ERROR,details:ErrorDetails.INTERNAL_EXCEPTION,err:error,error,fatal:true});}return null;}_handleTransmuxerFlush(chunkMeta){const context=this.getCurrentContext(chunkMeta);if(!context||this.state!==State.PARSING){if(!this.fragCurrent&&this.state!==State.STOPPED&&this.state!==State.ERROR){this.state=State.IDLE;}return;}const{frag,part,level}=context;const now=self.performance.now();frag.stats.parsing.end=now;if(part){part.stats.parsing.end=now;}this.updateLevelTiming(frag,part,level,chunkMeta.partial);}getCurrentContext(chunkMeta){const{levels,fragCurrent}=this;const{level:levelIndex,sn,part:partIndex}=chunkMeta;if(!(levels!=null&&levels[levelIndex])){this.warn(`Levels object was unset while buffering fragment ${sn} of level ${levelIndex}. The current chunk will not be buffered.`);return null;}const level=levels[levelIndex];const part=partIndex>-1?getPartWith(level,sn,partIndex):null;const frag=part?part.fragment:getFragmentWithSN(level,sn,fragCurrent);if(!frag){return null;}if(fragCurrent&&fragCurrent!==frag){frag.stats=fragCurrent.stats;}return {frag,part,level};}bufferFragmentData(data,frag,part,chunkMeta,noBacktracking){var _buffer;if(!data||this.state!==State.PARSING){return;}const{data1,data2}=data;let buffer=data1;if(data1&&data2){// Combine the moof + mdat so that we buffer with a single append
buffer=appendUint8Array(data1,data2);}if(!((_buffer=buffer)!=null&&_buffer.length)){return;}const segment={type:data.type,frag,part,chunkMeta,parent:frag.type,data:buffer};this.hls.trigger(Events$1.BUFFER_APPENDING,segment);if(data.dropped&&data.independent&&!part){if(noBacktracking){return;}// Clear buffer so that we reload previous segments sequentially if required
this.flushBufferGap(frag);}}flushBufferGap(frag){const media=this.media;if(!media){return;}// If currentTime is not buffered, clear the back buffer so that we can backtrack as much as needed
if(!BufferHelper.isBuffered(media,media.currentTime)){this.flushMainBuffer(0,frag.start);return;}// Remove back-buffer without interrupting playback to allow back tracking
const currentTime=media.currentTime;const bufferInfo=BufferHelper.bufferInfo(media,currentTime,0);const fragDuration=frag.duration;const segmentFraction=Math.min(this.config.maxFragLookUpTolerance*2,fragDuration*0.25);const start=Math.max(Math.min(frag.start-segmentFraction,bufferInfo.end-segmentFraction),currentTime+segmentFraction);if(frag.start-start>segmentFraction){this.flushMainBuffer(start,frag.start);}}getFwdBufferInfo(bufferable,type){const pos=this.getLoadPosition();if(!isFiniteNumber(pos)){return null;}return this.getFwdBufferInfoAtPos(bufferable,pos,type);}getFwdBufferInfoAtPos(bufferable,pos,type){const{config:{maxBufferHole}}=this;const bufferInfo=BufferHelper.bufferInfo(bufferable,pos,maxBufferHole);// Workaround flaw in getting forward buffer when maxBufferHole is smaller than gap at current pos
if(bufferInfo.len===0&&bufferInfo.nextStart!==undefined){const bufferedFragAtPos=this.fragmentTracker.getBufferedFrag(pos,type);if(bufferedFragAtPos&&bufferInfo.nextStart<bufferedFragAtPos.end){return BufferHelper.bufferInfo(bufferable,pos,Math.max(bufferInfo.nextStart,maxBufferHole));}}return bufferInfo;}getMaxBufferLength(levelBitrate){const{config}=this;let maxBufLen;if(levelBitrate){maxBufLen=Math.max(8*config.maxBufferSize/levelBitrate,config.maxBufferLength);}else {maxBufLen=config.maxBufferLength;}return Math.min(maxBufLen,config.maxMaxBufferLength);}reduceMaxBufferLength(threshold){const config=this.config;const minLength=threshold||config.maxBufferLength;const reducedLength=config.maxMaxBufferLength/2;if(reducedLength>=minLength){// reduce max buffer length as it might be too high. we do this to avoid loop flushing ...
config.maxMaxBufferLength=reducedLength;this.warn(`Reduce max buffer length to ${reducedLength}s`);return true;}return false;}getAppendedFrag(position,playlistType=PlaylistLevelType.MAIN){const fragOrPart=this.fragmentTracker.getAppendedFrag(position,PlaylistLevelType.MAIN);if(fragOrPart&&'fragment'in fragOrPart){return fragOrPart.fragment;}return fragOrPart;}getNextFragment(pos,levelDetails){const fragments=levelDetails.fragments;const fragLen=fragments.length;if(!fragLen){return null;}// find fragment index, contiguous with end of buffer position
const{config}=this;const start=fragments[0].start;let frag;if(levelDetails.live){const initialLiveManifestSize=config.initialLiveManifestSize;if(fragLen<initialLiveManifestSize){this.warn(`Not enough fragments to start playback (have: ${fragLen}, need: ${initialLiveManifestSize})`);return null;}// The real fragment start times for a live stream are only known after the PTS range for that level is known.
// In order to discover the range, we load the best matching fragment for that level and demux it.
// Do not load using live logic if the starting frag is requested - we want to use getFragmentAtPosition() so that
// we get the fragment matching that start time
if(!levelDetails.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||pos<start){frag=this.getInitialLiveFragment(levelDetails,fragments);this.startPosition=this.nextLoadPosition=frag?this.hls.liveSyncPosition||frag.start:pos;}}else if(pos<=start){// VoD playlist: if loadPosition before start of playlist, load first fragment
frag=fragments[0];}// If we haven't run into any special cases already, just load the fragment most closely matching the requested position
if(!frag){const end=config.lowLatencyMode?levelDetails.partEnd:levelDetails.fragmentEnd;frag=this.getFragmentAtPosition(pos,end,levelDetails);}return this.mapToInitFragWhenRequired(frag);}isLoopLoading(frag,targetBufferTime){const trackerState=this.fragmentTracker.getState(frag);return (trackerState===FragmentState.OK||trackerState===FragmentState.PARTIAL&&!!frag.gap)&&this.nextLoadPosition>targetBufferTime;}getNextFragmentLoopLoading(frag,levelDetails,bufferInfo,playlistType,maxBufLen){const gapStart=frag.gap;const nextFragment=this.getNextFragment(this.nextLoadPosition,levelDetails);if(nextFragment===null){return nextFragment;}frag=nextFragment;if(gapStart&&frag&&!frag.gap&&bufferInfo.nextStart){// Media buffered after GAP tags should not make the next buffer timerange exceed forward buffer length
const nextbufferInfo=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,bufferInfo.nextStart,playlistType);if(nextbufferInfo!==null&&bufferInfo.len+nextbufferInfo.len>=maxBufLen){// Returning here might result in not finding an audio and video candiate to skip to
this.log(`buffer full after gaps in "${playlistType}" playlist starting at sn: ${frag.sn}`);return null;}}return frag;}mapToInitFragWhenRequired(frag){// If an initSegment is present, it must be buffered first
if(frag!=null&&frag.initSegment&&!(frag!=null&&frag.initSegment.data)&&!this.bitrateTest){return frag.initSegment;}return frag;}getNextPart(partList,frag,targetBufferTime){let nextPart=-1;let contiguous=false;let independentAttrOmitted=true;for(let i=0,len=partList.length;i<len;i++){const part=partList[i];independentAttrOmitted=independentAttrOmitted&&!part.independent;if(nextPart>-1&&targetBufferTime<part.start){break;}const loaded=part.loaded;if(loaded){nextPart=-1;}else if((contiguous||part.independent||independentAttrOmitted)&&part.fragment===frag){nextPart=i;}contiguous=loaded;}return nextPart;}loadedEndOfParts(partList,targetBufferTime){const lastPart=partList[partList.length-1];return lastPart&&targetBufferTime>lastPart.start&&lastPart.loaded;}/*
   This method is used find the best matching first fragment for a live playlist. This fragment is used to calculate the
   "sliding" of the playlist, which is its offset from the start of playback. After sliding we can compute the real
   start and end times for each fragment in the playlist (after which this method will not need to be called).
  */getInitialLiveFragment(levelDetails,fragments){const fragPrevious=this.fragPrevious;let frag=null;if(fragPrevious){if(levelDetails.hasProgramDateTime){// Prefer using PDT, because it can be accurate enough to choose the correct fragment without knowing the level sliding
this.log(`Live playlist, switching playlist, load frag with same PDT: ${fragPrevious.programDateTime}`);frag=findFragmentByPDT(fragments,fragPrevious.endProgramDateTime,this.config.maxFragLookUpTolerance);}if(!frag){// SN does not need to be accurate between renditions, but depending on the packaging it may be so.
const targetSN=fragPrevious.sn+1;if(targetSN>=levelDetails.startSN&&targetSN<=levelDetails.endSN){const fragNext=fragments[targetSN-levelDetails.startSN];// Ensure that we're staying within the continuity range, since PTS resets upon a new range
if(fragPrevious.cc===fragNext.cc){frag=fragNext;this.log(`Live playlist, switching playlist, load frag with next SN: ${frag.sn}`);}}// It's important to stay within the continuity range if available; otherwise the fragments in the playlist
// will have the wrong start times
if(!frag){frag=findFragWithCC(fragments,fragPrevious.cc);if(frag){this.log(`Live playlist, switching playlist, load frag with same CC: ${frag.sn}`);}}}}else {// Find a new start fragment when fragPrevious is null
const liveStart=this.hls.liveSyncPosition;if(liveStart!==null){frag=this.getFragmentAtPosition(liveStart,this.bitrateTest?levelDetails.fragmentEnd:levelDetails.edge,levelDetails);}}return frag;}/*
  This method finds the best matching fragment given the provided position.
   */getFragmentAtPosition(bufferEnd,end,levelDetails){const{config}=this;let{fragPrevious}=this;let{fragments,endSN}=levelDetails;const{fragmentHint}=levelDetails;const tolerance=config.maxFragLookUpTolerance;const partList=levelDetails.partList;const loadingParts=!!(config.lowLatencyMode&&partList!=null&&partList.length&&fragmentHint);if(loadingParts&&fragmentHint&&!this.bitrateTest){// Include incomplete fragment with parts at end
fragments=fragments.concat(fragmentHint);endSN=fragmentHint.sn;}let frag;if(bufferEnd<end){const lookupTolerance=bufferEnd>end-tolerance?0:tolerance;// Remove the tolerance if it would put the bufferEnd past the actual end of stream
// Uses buffer and sequence number to calculate switch segment (required if using EXT-X-DISCONTINUITY-SEQUENCE)
frag=findFragmentByPTS(fragPrevious,fragments,bufferEnd,lookupTolerance);}else {// reach end of playlist
frag=fragments[fragments.length-1];}if(frag){const curSNIdx=frag.sn-levelDetails.startSN;// Move fragPrevious forward to support forcing the next fragment to load
// when the buffer catches up to a previously buffered range.
const fragState=this.fragmentTracker.getState(frag);if(fragState===FragmentState.OK||fragState===FragmentState.PARTIAL&&frag.gap){fragPrevious=frag;}if(fragPrevious&&frag.sn===fragPrevious.sn&&(!loadingParts||partList[0].fragment.sn>frag.sn)){// Force the next fragment to load if the previous one was already selected. This can occasionally happen with
// non-uniform fragment durations
const sameLevel=fragPrevious&&frag.level===fragPrevious.level;if(sameLevel){const nextFrag=fragments[curSNIdx+1];if(frag.sn<endSN&&this.fragmentTracker.getState(nextFrag)!==FragmentState.OK){frag=nextFrag;}else {frag=null;}}}}return frag;}synchronizeToLiveEdge(levelDetails){const{config,media}=this;if(!media){return;}const liveSyncPosition=this.hls.liveSyncPosition;const currentTime=media.currentTime;const start=levelDetails.fragments[0].start;const end=levelDetails.edge;const withinSlidingWindow=currentTime>=start-config.maxFragLookUpTolerance&&currentTime<=end;// Continue if we can seek forward to sync position or if current time is outside of sliding window
if(liveSyncPosition!==null&&media.duration>liveSyncPosition&&(currentTime<liveSyncPosition||!withinSlidingWindow)){// Continue if buffer is starving or if current time is behind max latency
const maxLatency=config.liveMaxLatencyDuration!==undefined?config.liveMaxLatencyDuration:config.liveMaxLatencyDurationCount*levelDetails.targetduration;if(!withinSlidingWindow&&media.readyState<4||currentTime<end-maxLatency){if(!this.loadedmetadata){this.nextLoadPosition=liveSyncPosition;}// Only seek if ready and there is not a significant forward buffer available for playback
if(media.readyState){this.warn(`Playback: ${currentTime.toFixed(3)} is located too far from the end of live sliding playlist: ${end}, reset currentTime to : ${liveSyncPosition.toFixed(3)}`);media.currentTime=liveSyncPosition;}}}}alignPlaylists(details,previousDetails,switchDetails){// FIXME: If not for `shouldAlignOnDiscontinuities` requiring fragPrevious.cc,
//  this could all go in level-helper mergeDetails()
const length=details.fragments.length;if(!length){this.warn(`No fragments in live playlist`);return 0;}const slidingStart=details.fragments[0].start;const firstLevelLoad=!previousDetails;const aligned=details.alignedSliding&&isFiniteNumber(slidingStart);if(firstLevelLoad||!aligned&&!slidingStart){const{fragPrevious}=this;alignStream(fragPrevious,switchDetails,details);const alignedSlidingStart=details.fragments[0].start;this.log(`Live playlist sliding: ${alignedSlidingStart.toFixed(2)} start-sn: ${previousDetails?previousDetails.startSN:'na'}->${details.startSN} prev-sn: ${fragPrevious?fragPrevious.sn:'na'} fragments: ${length}`);return alignedSlidingStart;}return slidingStart;}waitForCdnTuneIn(details){// Wait for Low-Latency CDN Tune-in to get an updated playlist
const advancePartLimit=3;return details.live&&details.canBlockReload&&details.partTarget&&details.tuneInGoal>Math.max(details.partHoldBack,details.partTarget*advancePartLimit);}setStartPosition(details,sliding){// compute start position if set to -1. use it straight away if value is defined
let startPosition=this.startPosition;if(startPosition<sliding){startPosition=-1;}if(startPosition===-1||this.lastCurrentTime===-1){// Use Playlist EXT-X-START:TIME-OFFSET when set
// Prioritize Multivariant Playlist offset so that main, audio, and subtitle stream-controller start times match
const offsetInMultivariantPlaylist=this.startTimeOffset!==null;const startTimeOffset=offsetInMultivariantPlaylist?this.startTimeOffset:details.startTimeOffset;if(startTimeOffset!==null&&isFiniteNumber(startTimeOffset)){startPosition=sliding+startTimeOffset;if(startTimeOffset<0){startPosition+=details.totalduration;}startPosition=Math.min(Math.max(sliding,startPosition),sliding+details.totalduration);this.log(`Start time offset ${startTimeOffset} found in ${offsetInMultivariantPlaylist?'multivariant':'media'} playlist, adjust startPosition to ${startPosition}`);this.startPosition=startPosition;}else if(details.live){// Leave this.startPosition at -1, so that we can use `getInitialLiveFragment` logic when startPosition has
// not been specified via the config or an as an argument to startLoad (#3736).
startPosition=this.hls.liveSyncPosition||sliding;}else {this.startPosition=startPosition=0;}this.lastCurrentTime=startPosition;}this.nextLoadPosition=startPosition;}getLoadPosition(){const{media}=this;// if we have not yet loaded any fragment, start loading from start position
let pos=0;if(this.loadedmetadata&&media){pos=media.currentTime;}else if(this.nextLoadPosition){pos=this.nextLoadPosition;}return pos;}handleFragLoadAborted(frag,part){if(this.transmuxer&&frag.sn!=='initSegment'&&frag.stats.aborted){this.warn(`Fragment ${frag.sn}${part?' part '+part.index:''} of level ${frag.level} was aborted`);this.resetFragmentLoading(frag);}}resetFragmentLoading(frag){if(!this.fragCurrent||!this.fragContextChanged(frag)&&this.state!==State.FRAG_LOADING_WAITING_RETRY){this.state=State.IDLE;}}onFragmentOrKeyLoadError(filterType,data){if(data.chunkMeta&&!data.frag){const context=this.getCurrentContext(data.chunkMeta);if(context){data.frag=context.frag;}}const frag=data.frag;// Handle frag error related to caller's filterType
if(!frag||frag.type!==filterType||!this.levels){return;}if(this.fragContextChanged(frag)){var _this$fragCurrent2;this.warn(`Frag load error must match current frag to retry ${frag.url} > ${(_this$fragCurrent2=this.fragCurrent)==null?void 0:_this$fragCurrent2.url}`);return;}const gapTagEncountered=data.details===ErrorDetails.FRAG_GAP;if(gapTagEncountered){this.fragmentTracker.fragBuffered(frag,true);}// keep retrying until the limit will be reached
const errorAction=data.errorAction;const{action,retryCount=0,retryConfig}=errorAction||{};if(errorAction&&action===NetworkErrorAction.RetryRequest&&retryConfig){this.resetStartWhenNotLoaded(this.levelLastLoaded);const delay=getRetryDelay(retryConfig,retryCount);this.warn(`Fragment ${frag.sn} of ${filterType} ${frag.level} errored with ${data.details}, retrying loading ${retryCount+1}/${retryConfig.maxNumRetry} in ${delay}ms`);errorAction.resolved=true;this.retryDate=self.performance.now()+delay;this.state=State.FRAG_LOADING_WAITING_RETRY;}else if(retryConfig&&errorAction){this.resetFragmentErrors(filterType);if(retryCount<retryConfig.maxNumRetry){// Network retry is skipped when level switch is preferred
if(!gapTagEncountered&&action!==NetworkErrorAction.RemoveAlternatePermanently){errorAction.resolved=true;}}else {logger.warn(`${data.details} reached or exceeded max retry (${retryCount})`);return;}}else if((errorAction==null?void 0:errorAction.action)===NetworkErrorAction.SendAlternateToPenaltyBox){this.state=State.WAITING_LEVEL;}else {this.state=State.ERROR;}// Perform next async tick sooner to speed up error action resolution
this.tickImmediate();}reduceLengthAndFlushBuffer(data){// if in appending state
if(this.state===State.PARSING||this.state===State.PARSED){const playlistType=data.parent;const bufferedInfo=this.getFwdBufferInfo(this.mediaBuffer,playlistType);// 0.5 : tolerance needed as some browsers stalls playback before reaching buffered end
// reduce max buf len if current position is buffered
const buffered=bufferedInfo&&bufferedInfo.len>0.5;if(buffered){this.reduceMaxBufferLength(bufferedInfo.len);}const flushBuffer=!buffered;if(flushBuffer){// current position is not buffered, but browser is still complaining about buffer full error
// this happens on IE/Edge, refer to https://github.com/video-dev/hls.js/pull/708
// in that case flush the whole audio buffer to recover
this.warn(`Buffer full error while media.currentTime is not buffered, flush ${playlistType} buffer`);}if(data.frag){this.fragmentTracker.removeFragment(data.frag);this.nextLoadPosition=data.frag.start;}this.resetLoadingState();return flushBuffer;}return false;}resetFragmentErrors(filterType){if(filterType===PlaylistLevelType.AUDIO){// Reset current fragment since audio track audio is essential and may not have a fail-over track
this.fragCurrent=null;}// Fragment errors that result in a level switch or redundant fail-over
// should reset the stream controller state to idle
if(!this.loadedmetadata){this.startFragRequested=false;}if(this.state!==State.STOPPED){this.state=State.IDLE;}}afterBufferFlushed(media,bufferType,playlistType){if(!media){return;}// After successful buffer flushing, filter flushed fragments from bufferedFrags use mediaBuffered instead of media
// (so that we will check against video.buffered ranges in case of alt audio track)
const bufferedTimeRanges=BufferHelper.getBuffered(media);this.fragmentTracker.detectEvictedFragments(bufferType,bufferedTimeRanges,playlistType);if(this.state===State.ENDED){this.resetLoadingState();}}resetLoadingState(){this.log('Reset loading state');this.fragCurrent=null;this.fragPrevious=null;this.state=State.IDLE;}resetStartWhenNotLoaded(level){// if loadedmetadata is not set, it means that first frag request failed
// in that case, reset startFragRequested flag
if(!this.loadedmetadata){this.startFragRequested=false;const details=level?level.details:null;if(details!=null&&details.live){// Update the start position and return to IDLE to recover live start
this.startPosition=-1;this.setStartPosition(details,0);this.resetLoadingState();}else {this.nextLoadPosition=this.startPosition;}}}resetWhenMissingContext(chunkMeta){this.warn(`The loading context changed while buffering fragment ${chunkMeta.sn} of level ${chunkMeta.level}. This chunk will not be buffered.`);this.removeUnbufferedFrags();this.resetStartWhenNotLoaded(this.levelLastLoaded);this.resetLoadingState();}removeUnbufferedFrags(start=0){this.fragmentTracker.removeFragmentsInRange(start,Infinity,this.playlistType,false,true);}updateLevelTiming(frag,part,level,partial){var _this$transmuxer;const details=level.details;if(!details){this.warn('level.details undefined');return;}const parsed=Object.keys(frag.elementaryStreams).reduce((result,type)=>{const info=frag.elementaryStreams[type];if(info){const parsedDuration=info.endPTS-info.startPTS;if(parsedDuration<=0){// Destroy the transmuxer after it's next time offset failed to advance because duration was <= 0.
// The new transmuxer will be configured with a time offset matching the next fragment start,
// preventing the timeline from shifting.
this.warn(`Could not parse fragment ${frag.sn} ${type} duration reliably (${parsedDuration})`);return result||false;}const drift=partial?0:updateFragPTSDTS(details,frag,info.startPTS,info.endPTS,info.startDTS,info.endDTS);this.hls.trigger(Events$1.LEVEL_PTS_UPDATED,{details,level,drift,type,frag,start:info.startPTS,end:info.endPTS});return true;}return result;},false);if(!parsed&&((_this$transmuxer=this.transmuxer)==null?void 0:_this$transmuxer.error)===null){const error=new Error(`Found no media in fragment ${frag.sn} of level ${frag.level} resetting transmuxer to fallback to playlist timing`);if(level.fragmentError===0){// Mark and track the odd empty segment as a gap to avoid reloading
level.fragmentError++;frag.gap=true;this.fragmentTracker.removeFragment(frag);this.fragmentTracker.fragBuffered(frag,true);}this.warn(error.message);this.hls.trigger(Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_PARSING_ERROR,fatal:false,error,frag,reason:`Found no media in msn ${frag.sn} of level "${level.url}"`});if(!this.hls){return;}this.resetTransmuxer();// For this error fallthrough. Marking parsed will allow advancing to next fragment.
}this.state=State.PARSED;this.hls.trigger(Events$1.FRAG_PARSED,{frag,part});}resetTransmuxer(){if(this.transmuxer){this.transmuxer.destroy();this.transmuxer=null;}}recoverWorkerError(data){if(data.event==='demuxerWorker'){this.fragmentTracker.removeAllFragments();this.resetTransmuxer();this.resetStartWhenNotLoaded(this.levelLastLoaded);this.resetLoadingState();}}set state(nextState){const previousState=this._state;if(previousState!==nextState){this._state=nextState;this.log(`${previousState}->${nextState}`);}}get state(){return this._state;}}class ChunkCache{constructor(){this.chunks=[];this.dataLength=0;}push(chunk){this.chunks.push(chunk);this.dataLength+=chunk.length;}flush(){const{chunks,dataLength}=this;let result;if(!chunks.length){return new Uint8Array(0);}else if(chunks.length===1){result=chunks[0];}else {result=concatUint8Arrays(chunks,dataLength);}this.reset();return result;}reset(){this.chunks.length=0;this.dataLength=0;}}function concatUint8Arrays(chunks,dataLength){const result=new Uint8Array(dataLength);let offset=0;for(let i=0;i<chunks.length;i++){const chunk=chunks[i];result.set(chunk,offset);offset+=chunk.length;}return result;}// ensure the worker ends up in the bundle
// If the worker should not be included this gets aliased to empty.js
function hasUMDWorker(){return typeof __HLS_WORKER_BUNDLE__==='function';}function injectWorker(){const blob=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:'text/javascript'});const objectURL=self.URL.createObjectURL(blob);const worker=new self.Worker(objectURL);return {worker,objectURL};}function loadWorker(path){const scriptURL=new self.URL(path,self.location.href).href;const worker=new self.Worker(scriptURL);return {worker,scriptURL};}function dummyTrack(type='',inputTimeScale=90000){return {type,id:-1,pid:-1,inputTimeScale,sequenceNumber:-1,samples:[],dropped:0};}class BaseAudioDemuxer{constructor(){this._audioTrack=void 0;this._id3Track=void 0;this.frameIndex=0;this.cachedData=null;this.basePTS=null;this.initPTS=null;this.lastPTS=null;}resetInitSegment(initSegment,audioCodec,videoCodec,trackDuration){this._id3Track={type:'id3',id:3,pid:-1,inputTimeScale:90000,sequenceNumber:0,samples:[],dropped:0};}resetTimeStamp(deaultTimestamp){this.initPTS=deaultTimestamp;this.resetContiguity();}resetContiguity(){this.basePTS=null;this.lastPTS=null;this.frameIndex=0;}canParse(data,offset){return false;}appendFrame(track,data,offset){}// feed incoming data to the front of the parsing pipeline
demux(data,timeOffset){if(this.cachedData){data=appendUint8Array(this.cachedData,data);this.cachedData=null;}let id3Data=getID3Data(data,0);let offset=id3Data?id3Data.length:0;let lastDataIndex;const track=this._audioTrack;const id3Track=this._id3Track;const timestamp=id3Data?getTimeStamp(id3Data):undefined;const length=data.length;if(this.basePTS===null||this.frameIndex===0&&isFiniteNumber(timestamp)){this.basePTS=initPTSFn(timestamp,timeOffset,this.initPTS);this.lastPTS=this.basePTS;}if(this.lastPTS===null){this.lastPTS=this.basePTS;}// more expressive than alternative: id3Data?.length
if(id3Data&&id3Data.length>0){id3Track.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:id3Data,type:MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});}while(offset<length){if(this.canParse(data,offset)){const frame=this.appendFrame(track,data,offset);if(frame){this.frameIndex++;this.lastPTS=frame.sample.pts;offset+=frame.length;lastDataIndex=offset;}else {offset=length;}}else if(canParse$2(data,offset)){// after a ID3.canParse, a call to ID3.getID3Data *should* always returns some data
id3Data=getID3Data(data,offset);id3Track.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:id3Data,type:MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});offset+=id3Data.length;lastDataIndex=offset;}else {offset++;}if(offset===length&&lastDataIndex!==length){const partialData=sliceUint8(data,lastDataIndex);if(this.cachedData){this.cachedData=appendUint8Array(this.cachedData,partialData);}else {this.cachedData=partialData;}}}return {audioTrack:track,videoTrack:dummyTrack(),id3Track,textTrack:dummyTrack()};}demuxSampleAes(data,keyData,timeOffset){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`));}flush(timeOffset){// Parse cache in case of remaining frames.
const cachedData=this.cachedData;if(cachedData){this.cachedData=null;this.demux(cachedData,0);}return {audioTrack:this._audioTrack,videoTrack:dummyTrack(),id3Track:this._id3Track,textTrack:dummyTrack()};}destroy(){}}/**
 * Initialize PTS
 * <p>
 *    use timestamp unless it is undefined, NaN or Infinity
 * </p>
 */const initPTSFn=(timestamp,timeOffset,initPTS)=>{if(isFiniteNumber(timestamp)){return timestamp*90;}const init90kHz=initPTS?initPTS.baseTime*90000/initPTS.timescale:0;return timeOffset*90000+init90kHz;};/**
 * ADTS parser helper
 * @link https://wiki.multimedia.cx/index.php?title=ADTS
 */function getAudioConfig(observer,data,offset,audioCodec){let adtsObjectType;let adtsExtensionSamplingIndex;let adtsChannelConfig;let config;const userAgent=navigator.userAgent.toLowerCase();const manifestCodec=audioCodec;const adtsSamplingRates=[96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000,7350];// byte 2
adtsObjectType=((data[offset+2]&0xc0)>>>6)+1;const adtsSamplingIndex=(data[offset+2]&0x3c)>>>2;if(adtsSamplingIndex>adtsSamplingRates.length-1){const error=new Error(`invalid ADTS sampling index:${adtsSamplingIndex}`);observer.emit(Events$1.ERROR,Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_PARSING_ERROR,fatal:true,error,reason:error.message});return;}adtsChannelConfig=(data[offset+2]&0x01)<<2;// byte 3
adtsChannelConfig|=(data[offset+3]&0xc0)>>>6;logger.log(`manifest codec:${audioCodec}, ADTS type:${adtsObjectType}, samplingIndex:${adtsSamplingIndex}`);// firefox: freq less than 24kHz = AAC SBR (HE-AAC)
if(/firefox/i.test(userAgent)){if(adtsSamplingIndex>=6){adtsObjectType=5;config=new Array(4);// HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies
// there is a factor 2 between frame sample rate and output sample rate
// multiply frequency by 2 (see table below, equivalent to substract 3)
adtsExtensionSamplingIndex=adtsSamplingIndex-3;}else {adtsObjectType=2;config=new Array(2);adtsExtensionSamplingIndex=adtsSamplingIndex;}// Android : always use AAC
}else if(userAgent.indexOf('android')!==-1){adtsObjectType=2;config=new Array(2);adtsExtensionSamplingIndex=adtsSamplingIndex;}else {/*  for other browsers (Chrome/Vivaldi/Opera ...)
        always force audio type to be HE-AAC SBR, as some browsers do not support audio codec switch properly (like Chrome ...)
    */adtsObjectType=5;config=new Array(4);// if (manifest codec is HE-AAC or HE-AACv2) OR (manifest codec not specified AND frequency less than 24kHz)
if(audioCodec&&(audioCodec.indexOf('mp4a.40.29')!==-1||audioCodec.indexOf('mp4a.40.5')!==-1)||!audioCodec&&adtsSamplingIndex>=6){// HE-AAC uses SBR (Spectral Band Replication) , high frequencies are constructed from low frequencies
// there is a factor 2 between frame sample rate and output sample rate
// multiply frequency by 2 (see table below, equivalent to substract 3)
adtsExtensionSamplingIndex=adtsSamplingIndex-3;}else {// if (manifest codec is AAC) AND (frequency less than 24kHz AND nb channel is 1) OR (manifest codec not specified and mono audio)
// Chrome fails to play back with low frequency AAC LC mono when initialized with HE-AAC.  This is not a problem with stereo.
if(audioCodec&&audioCodec.indexOf('mp4a.40.2')!==-1&&(adtsSamplingIndex>=6&&adtsChannelConfig===1||/vivaldi/i.test(userAgent))||!audioCodec&&adtsChannelConfig===1){adtsObjectType=2;config=new Array(2);}adtsExtensionSamplingIndex=adtsSamplingIndex;}}/* refer to http://wiki.multimedia.cx/index.php?title=MPEG-4_Audio#Audio_Specific_Config
      ISO 14496-3 (AAC).pdf - Table 1.13 — Syntax of AudioSpecificConfig()
    Audio Profile / Audio Object Type
    0: Null
    1: AAC Main
    2: AAC LC (Low Complexity)
    3: AAC SSR (Scalable Sample Rate)
    4: AAC LTP (Long Term Prediction)
    5: SBR (Spectral Band Replication)
    6: AAC Scalable
   sampling freq
    0: 96000 Hz
    1: 88200 Hz
    2: 64000 Hz
    3: 48000 Hz
    4: 44100 Hz
    5: 32000 Hz
    6: 24000 Hz
    7: 22050 Hz
    8: 16000 Hz
    9: 12000 Hz
    10: 11025 Hz
    11: 8000 Hz
    12: 7350 Hz
    13: Reserved
    14: Reserved
    15: frequency is written explictly
    Channel Configurations
    These are the channel configurations:
    0: Defined in AOT Specifc Config
    1: 1 channel: front-center
    2: 2 channels: front-left, front-right
  */ // audioObjectType = profile => profile, the MPEG-4 Audio Object Type minus 1
config[0]=adtsObjectType<<3;// samplingFrequencyIndex
config[0]|=(adtsSamplingIndex&0x0e)>>1;config[1]|=(adtsSamplingIndex&0x01)<<7;// channelConfiguration
config[1]|=adtsChannelConfig<<3;if(adtsObjectType===5){// adtsExtensionSamplingIndex
config[1]|=(adtsExtensionSamplingIndex&0x0e)>>1;config[2]=(adtsExtensionSamplingIndex&0x01)<<7;// adtsObjectType (force to 2, chrome is checking that object type is less than 5 ???
//    https://chromium.googlesource.com/chromium/src.git/+/master/media/formats/mp4/aac.cc
config[2]|=2<<2;config[3]=0;}return {config,samplerate:adtsSamplingRates[adtsSamplingIndex],channelCount:adtsChannelConfig,codec:'mp4a.40.'+adtsObjectType,manifestCodec};}function isHeaderPattern$1(data,offset){return data[offset]===0xff&&(data[offset+1]&0xf6)===0xf0;}function getHeaderLength(data,offset){return data[offset+1]&0x01?7:9;}function getFullFrameLength(data,offset){return (data[offset+3]&0x03)<<11|data[offset+4]<<3|(data[offset+5]&0xe0)>>>5;}function canGetFrameLength(data,offset){return offset+5<data.length;}function isHeader$1(data,offset){// Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1
// Layer bits (position 14 and 15) in header should be always 0 for ADTS
// More info https://wiki.multimedia.cx/index.php?title=ADTS
return offset+1<data.length&&isHeaderPattern$1(data,offset);}function canParse$1(data,offset){return canGetFrameLength(data,offset)&&isHeaderPattern$1(data,offset)&&getFullFrameLength(data,offset)<=data.length-offset;}function probe$1(data,offset){// same as isHeader but we also check that ADTS frame follows last ADTS frame
// or end of data is reached
if(isHeader$1(data,offset)){// ADTS header Length
const headerLength=getHeaderLength(data,offset);if(offset+headerLength>=data.length){return false;}// ADTS frame Length
const frameLength=getFullFrameLength(data,offset);if(frameLength<=headerLength){return false;}const newOffset=offset+frameLength;return newOffset===data.length||isHeader$1(data,newOffset);}return false;}function initTrackConfig(track,observer,data,offset,audioCodec){if(!track.samplerate){const config=getAudioConfig(observer,data,offset,audioCodec);if(!config){return;}track.config=config.config;track.samplerate=config.samplerate;track.channelCount=config.channelCount;track.codec=config.codec;track.manifestCodec=config.manifestCodec;logger.log(`parsed codec:${track.codec}, rate:${config.samplerate}, channels:${config.channelCount}`);}}function getFrameDuration(samplerate){return 1024*90000/samplerate;}function parseFrameHeader(data,offset){// The protection skip bit tells us if we have 2 bytes of CRC data at the end of the ADTS header
const headerLength=getHeaderLength(data,offset);if(offset+headerLength<=data.length){// retrieve frame size
const frameLength=getFullFrameLength(data,offset)-headerLength;if(frameLength>0){// logger.log(`AAC frame, offset/length/total/pts:${offset+headerLength}/${frameLength}/${data.byteLength}`);
return {headerLength,frameLength};}}}function appendFrame$2(track,data,offset,pts,frameIndex){const frameDuration=getFrameDuration(track.samplerate);const stamp=pts+frameIndex*frameDuration;const header=parseFrameHeader(data,offset);let unit;if(header){const{frameLength,headerLength}=header;const _length=headerLength+frameLength;const missing=Math.max(0,offset+_length-data.length);// logger.log(`AAC frame ${frameIndex}, pts:${stamp} length@offset/total: ${frameLength}@${offset+headerLength}/${data.byteLength} missing: ${missing}`);
if(missing){unit=new Uint8Array(_length-headerLength);unit.set(data.subarray(offset+headerLength,data.length),0);}else {unit=data.subarray(offset+headerLength,offset+_length);}const _sample={unit,pts:stamp};if(!missing){track.samples.push(_sample);}return {sample:_sample,length:_length,missing};}// overflow incomplete header
const length=data.length-offset;unit=new Uint8Array(length);unit.set(data.subarray(offset,data.length),0);const sample={unit,pts:stamp};return {sample,length,missing:-1};}/**
 *  MPEG parser helper
 */let chromeVersion$1=null;const BitratesMap=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160];const SamplingRateMap=[44100,48000,32000,22050,24000,16000,11025,12000,8000];const SamplesCoefficients=[// MPEG 2.5
[0,// Reserved
72,// Layer3
144,// Layer2
12// Layer1
],// Reserved
[0,// Reserved
0,// Layer3
0,// Layer2
0// Layer1
],// MPEG 2
[0,// Reserved
72,// Layer3
144,// Layer2
12// Layer1
],// MPEG 1
[0,// Reserved
144,// Layer3
144,// Layer2
12// Layer1
]];const BytesInSlot=[0,// Reserved
1,// Layer3
1,// Layer2
4// Layer1
];function appendFrame$1(track,data,offset,pts,frameIndex){// Using http://www.datavoyage.com/mpgscript/mpeghdr.htm as a reference
if(offset+24>data.length){return;}const header=parseHeader(data,offset);if(header&&offset+header.frameLength<=data.length){const frameDuration=header.samplesPerFrame*90000/header.sampleRate;const stamp=pts+frameIndex*frameDuration;const sample={unit:data.subarray(offset,offset+header.frameLength),pts:stamp,dts:stamp};track.config=[];track.channelCount=header.channelCount;track.samplerate=header.sampleRate;track.samples.push(sample);return {sample,length:header.frameLength,missing:0};}}function parseHeader(data,offset){const mpegVersion=data[offset+1]>>3&3;const mpegLayer=data[offset+1]>>1&3;const bitRateIndex=data[offset+2]>>4&15;const sampleRateIndex=data[offset+2]>>2&3;if(mpegVersion!==1&&bitRateIndex!==0&&bitRateIndex!==15&&sampleRateIndex!==3){const paddingBit=data[offset+2]>>1&1;const channelMode=data[offset+3]>>6;const columnInBitrates=mpegVersion===3?3-mpegLayer:mpegLayer===3?3:4;const bitRate=BitratesMap[columnInBitrates*14+bitRateIndex-1]*1000;const columnInSampleRates=mpegVersion===3?0:mpegVersion===2?1:2;const sampleRate=SamplingRateMap[columnInSampleRates*3+sampleRateIndex];const channelCount=channelMode===3?1:2;// If bits of channel mode are `11` then it is a single channel (Mono)
const sampleCoefficient=SamplesCoefficients[mpegVersion][mpegLayer];const bytesInSlot=BytesInSlot[mpegLayer];const samplesPerFrame=sampleCoefficient*8*bytesInSlot;const frameLength=Math.floor(sampleCoefficient*bitRate/sampleRate+paddingBit)*bytesInSlot;if(chromeVersion$1===null){const userAgent=navigator.userAgent||'';const result=userAgent.match(/Chrome\/(\d+)/i);chromeVersion$1=result?parseInt(result[1]):0;}const needChromeFix=!!chromeVersion$1&&chromeVersion$1<=87;if(needChromeFix&&mpegLayer===2&&bitRate>=224000&&channelMode===0){// Work around bug in Chromium by setting channelMode to dual-channel (01) instead of stereo (00)
data[offset+3]=data[offset+3]|0x80;}return {sampleRate,channelCount,frameLength,samplesPerFrame};}}function isHeaderPattern(data,offset){return data[offset]===0xff&&(data[offset+1]&0xe0)===0xe0&&(data[offset+1]&0x06)!==0x00;}function isHeader(data,offset){// Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1
// Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)
// More info http://www.mp3-tech.org/programmer/frame_header.html
return offset+1<data.length&&isHeaderPattern(data,offset);}function canParse(data,offset){const headerSize=4;return isHeaderPattern(data,offset)&&headerSize<=data.length-offset;}function probe(data,offset){// same as isHeader but we also check that MPEG frame follows last MPEG frame
// or end of data is reached
if(offset+1<data.length&&isHeaderPattern(data,offset)){// MPEG header Length
const headerLength=4;// MPEG frame Length
const header=parseHeader(data,offset);let frameLength=headerLength;if(header!=null&&header.frameLength){frameLength=header.frameLength;}const newOffset=offset+frameLength;return newOffset===data.length||isHeader(data,newOffset);}return false;}/**
 * AAC demuxer
 */class AACDemuxer extends BaseAudioDemuxer{constructor(observer,config){super();this.observer=void 0;this.config=void 0;this.observer=observer;this.config=config;}resetInitSegment(initSegment,audioCodec,videoCodec,trackDuration){super.resetInitSegment(initSegment,audioCodec,videoCodec,trackDuration);this._audioTrack={container:'audio/adts',type:'audio',id:2,pid:-1,sequenceNumber:0,segmentCodec:'aac',samples:[],manifestCodec:audioCodec,duration:trackDuration,inputTimeScale:90000,dropped:0};}// Source for probe info - https://wiki.multimedia.cx/index.php?title=ADTS
static probe(data){if(!data){return false;}// Check for the ADTS sync word
// Look for ADTS header | 1111 1111 | 1111 X00X | where X can be either 0 or 1
// Layer bits (position 14 and 15) in header should be always 0 for ADTS
// More info https://wiki.multimedia.cx/index.php?title=ADTS
const id3Data=getID3Data(data,0);let offset=(id3Data==null?void 0:id3Data.length)||0;if(probe(data,offset)){return false;}for(let length=data.length;offset<length;offset++){if(probe$1(data,offset)){logger.log('ADTS sync word found !');return true;}}return false;}canParse(data,offset){return canParse$1(data,offset);}appendFrame(track,data,offset){initTrackConfig(track,this.observer,data,offset,track.manifestCodec);const frame=appendFrame$2(track,data,offset,this.basePTS,this.frameIndex);if(frame&&frame.missing===0){return frame;}}}const emsgSchemePattern=/\/emsg[-/]ID3/i;class MP4Demuxer{constructor(observer,config){this.remainderData=null;this.timeOffset=0;this.config=void 0;this.videoTrack=void 0;this.audioTrack=void 0;this.id3Track=void 0;this.txtTrack=void 0;this.config=config;}resetTimeStamp(){}resetInitSegment(initSegment,audioCodec,videoCodec,trackDuration){const videoTrack=this.videoTrack=dummyTrack('video',1);const audioTrack=this.audioTrack=dummyTrack('audio',1);const captionTrack=this.txtTrack=dummyTrack('text',1);this.id3Track=dummyTrack('id3',1);this.timeOffset=0;if(!(initSegment!=null&&initSegment.byteLength)){return;}const initData=parseInitSegment(initSegment);if(initData.video){const{id,timescale,codec}=initData.video;videoTrack.id=id;videoTrack.timescale=captionTrack.timescale=timescale;videoTrack.codec=codec;}if(initData.audio){const{id,timescale,codec}=initData.audio;audioTrack.id=id;audioTrack.timescale=timescale;audioTrack.codec=codec;}captionTrack.id=RemuxerTrackIdConfig.text;videoTrack.sampleDuration=0;videoTrack.duration=audioTrack.duration=trackDuration;}resetContiguity(){this.remainderData=null;}static probe(data){return hasMoofData(data);}demux(data,timeOffset){this.timeOffset=timeOffset;// Load all data into the avc track. The CMAF remuxer will look for the data in the samples object; the rest of the fields do not matter
let videoSamples=data;const videoTrack=this.videoTrack;const textTrack=this.txtTrack;if(this.config.progressive){// Split the bytestream into two ranges: one encompassing all data up until the start of the last moof, and everything else.
// This is done to guarantee that we're sending valid data to MSE - when demuxing progressively, we have no guarantee
// that the fetch loader gives us flush moof+mdat pairs. If we push jagged data to MSE, it will throw an exception.
if(this.remainderData){videoSamples=appendUint8Array(this.remainderData,data);}const segmentedData=segmentValidRange(videoSamples);this.remainderData=segmentedData.remainder;videoTrack.samples=segmentedData.valid||new Uint8Array();}else {videoTrack.samples=videoSamples;}const id3Track=this.extractID3Track(videoTrack,timeOffset);textTrack.samples=parseSamples(timeOffset,videoTrack);return {videoTrack,audioTrack:this.audioTrack,id3Track,textTrack:this.txtTrack};}flush(){const timeOffset=this.timeOffset;const videoTrack=this.videoTrack;const textTrack=this.txtTrack;videoTrack.samples=this.remainderData||new Uint8Array();this.remainderData=null;const id3Track=this.extractID3Track(videoTrack,this.timeOffset);textTrack.samples=parseSamples(timeOffset,videoTrack);return {videoTrack,audioTrack:dummyTrack(),id3Track,textTrack:dummyTrack()};}extractID3Track(videoTrack,timeOffset){const id3Track=this.id3Track;if(videoTrack.samples.length){const emsgs=findBox(videoTrack.samples,['emsg']);if(emsgs){emsgs.forEach(data=>{const emsgInfo=parseEmsg(data);if(emsgSchemePattern.test(emsgInfo.schemeIdUri)){const pts=isFiniteNumber(emsgInfo.presentationTime)?emsgInfo.presentationTime/emsgInfo.timeScale:timeOffset+emsgInfo.presentationTimeDelta/emsgInfo.timeScale;let duration=emsgInfo.eventDuration===0xffffffff?Number.POSITIVE_INFINITY:emsgInfo.eventDuration/emsgInfo.timeScale;// Safari takes anything <= 0.001 seconds and maps it to Infinity
if(duration<=0.001){duration=Number.POSITIVE_INFINITY;}const payload=emsgInfo.payload;id3Track.samples.push({data:payload,len:payload.byteLength,dts:pts,pts:pts,type:MetadataSchema.emsg,duration:duration});}});}}return id3Track;}demuxSampleAes(data,keyData,timeOffset){return Promise.reject(new Error('The MP4 demuxer does not support SAMPLE-AES decryption'));}destroy(){}}const getAudioBSID=(data,offset)=>{// check the bsid to confirm ac-3 | ec-3
let bsid=0;let numBits=5;offset+=numBits;const temp=new Uint32Array(1);// unsigned 32 bit for temporary storage
const mask=new Uint32Array(1);// unsigned 32 bit mask value
const byte=new Uint8Array(1);// unsigned 8 bit for temporary storage
while(numBits>0){byte[0]=data[offset];// read remaining bits, upto 8 bits at a time
const bits=Math.min(numBits,8);const shift=8-bits;mask[0]=0xff000000>>>24+shift<<shift;temp[0]=(byte[0]&mask[0])>>shift;bsid=!bsid?temp[0]:bsid<<bits|temp[0];offset+=1;numBits-=bits;}return bsid;};class AC3Demuxer extends BaseAudioDemuxer{constructor(observer){super();this.observer=void 0;this.observer=observer;}resetInitSegment(initSegment,audioCodec,videoCodec,trackDuration){super.resetInitSegment(initSegment,audioCodec,videoCodec,trackDuration);this._audioTrack={container:'audio/ac-3',type:'audio',id:2,pid:-1,sequenceNumber:0,segmentCodec:'ac3',samples:[],manifestCodec:audioCodec,duration:trackDuration,inputTimeScale:90000,dropped:0};}canParse(data,offset){return offset+64<data.length;}appendFrame(track,data,offset){const frameLength=appendFrame(track,data,offset,this.basePTS,this.frameIndex);if(frameLength!==-1){const sample=track.samples[track.samples.length-1];return {sample,length:frameLength,missing:0};}}static probe(data){if(!data){return false;}const id3Data=getID3Data(data,0);if(!id3Data){return false;}// look for the ac-3 sync bytes
const offset=id3Data.length;if(data[offset]===0x0b&&data[offset+1]===0x77&&getTimeStamp(id3Data)!==undefined&&// check the bsid to confirm ac-3
getAudioBSID(data,offset)<16){return true;}return false;}}function appendFrame(track,data,start,pts,frameIndex){if(start+8>data.length){return -1;// not enough bytes left
}if(data[start]!==0x0b||data[start+1]!==0x77){return -1;// invalid magic
}// get sample rate
const samplingRateCode=data[start+4]>>6;if(samplingRateCode>=3){return -1;// invalid sampling rate
}const samplingRateMap=[48000,44100,32000];const sampleRate=samplingRateMap[samplingRateCode];// get frame size
const frameSizeCode=data[start+4]&0x3f;const frameSizeMap=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920];const frameLength=frameSizeMap[frameSizeCode*3+samplingRateCode]*2;if(start+frameLength>data.length){return -1;}// get channel count
const channelMode=data[start+6]>>5;let skipCount=0;if(channelMode===2){skipCount+=2;}else {if(channelMode&1&&channelMode!==1){skipCount+=2;}if(channelMode&4){skipCount+=2;}}const lfeon=(data[start+6]<<8|data[start+7])>>12-skipCount&1;const channelsMap=[2,1,2,3,3,4,4,5];const channelCount=channelsMap[channelMode]+lfeon;// build dac3 box
const bsid=data[start+5]>>3;const bsmod=data[start+5]&7;const config=new Uint8Array([samplingRateCode<<6|bsid<<1|bsmod>>2,(bsmod&3)<<6|channelMode<<3|lfeon<<2|frameSizeCode>>4,frameSizeCode<<4&0xe0]);const frameDuration=1536/sampleRate*90000;const stamp=pts+frameIndex*frameDuration;const unit=data.subarray(start,start+frameLength);track.config=config;track.channelCount=channelCount;track.samplerate=sampleRate;track.samples.push({unit,pts:stamp});return frameLength;}class BaseVideoParser{constructor(){this.VideoSample=null;}createVideoSample(key,pts,dts,debug){return {key,frame:false,pts,dts,units:[],debug,length:0};}getLastNalUnit(samples){var _VideoSample;let VideoSample=this.VideoSample;let lastUnit;// try to fallback to previous sample if current one is empty
if(!VideoSample||VideoSample.units.length===0){VideoSample=samples[samples.length-1];}if((_VideoSample=VideoSample)!=null&&_VideoSample.units){const units=VideoSample.units;lastUnit=units[units.length-1];}return lastUnit;}pushAccessUnit(VideoSample,videoTrack){if(VideoSample.units.length&&VideoSample.frame){// if sample does not have PTS/DTS, patch with last sample PTS/DTS
if(VideoSample.pts===undefined){const samples=videoTrack.samples;const nbSamples=samples.length;if(nbSamples){const lastSample=samples[nbSamples-1];VideoSample.pts=lastSample.pts;VideoSample.dts=lastSample.dts;}else {// dropping samples, no timestamp found
videoTrack.dropped++;return;}}videoTrack.samples.push(VideoSample);}if(VideoSample.debug.length){logger.log(VideoSample.pts+'/'+VideoSample.dts+':'+VideoSample.debug);}}}/**
 * Parser for exponential Golomb codes, a variable-bitwidth number encoding scheme used by h264.
 */class ExpGolomb{constructor(data){this.data=void 0;this.bytesAvailable=void 0;this.word=void 0;this.bitsAvailable=void 0;this.data=data;// the number of bytes left to examine in this.data
this.bytesAvailable=data.byteLength;// the current word being examined
this.word=0;// :uint
// the number of bits left to examine in the current word
this.bitsAvailable=0;// :uint
}// ():void
loadWord(){const data=this.data;const bytesAvailable=this.bytesAvailable;const position=data.byteLength-bytesAvailable;const workingBytes=new Uint8Array(4);const availableBytes=Math.min(4,bytesAvailable);if(availableBytes===0){throw new Error('no bytes available');}workingBytes.set(data.subarray(position,position+availableBytes));this.word=new DataView(workingBytes.buffer).getUint32(0);// track the amount of this.data that has been processed
this.bitsAvailable=availableBytes*8;this.bytesAvailable-=availableBytes;}// (count:int):void
skipBits(count){let skipBytes;// :int
count=Math.min(count,this.bytesAvailable*8+this.bitsAvailable);if(this.bitsAvailable>count){this.word<<=count;this.bitsAvailable-=count;}else {count-=this.bitsAvailable;skipBytes=count>>3;count-=skipBytes<<3;this.bytesAvailable-=skipBytes;this.loadWord();this.word<<=count;this.bitsAvailable-=count;}}// (size:int):uint
readBits(size){let bits=Math.min(this.bitsAvailable,size);// :uint
const valu=this.word>>>32-bits;// :uint
if(size>32){logger.error('Cannot read more than 32 bits at a time');}this.bitsAvailable-=bits;if(this.bitsAvailable>0){this.word<<=bits;}else if(this.bytesAvailable>0){this.loadWord();}else {throw new Error('no bits available');}bits=size-bits;if(bits>0&&this.bitsAvailable){return valu<<bits|this.readBits(bits);}else {return valu;}}// ():uint
skipLZ(){let leadingZeroCount;// :uint
for(leadingZeroCount=0;leadingZeroCount<this.bitsAvailable;++leadingZeroCount){if((this.word&0x80000000>>>leadingZeroCount)!==0){// the first bit of working word is 1
this.word<<=leadingZeroCount;this.bitsAvailable-=leadingZeroCount;return leadingZeroCount;}}// we exhausted word and still have not found a 1
this.loadWord();return leadingZeroCount+this.skipLZ();}// ():void
skipUEG(){this.skipBits(1+this.skipLZ());}// ():void
skipEG(){this.skipBits(1+this.skipLZ());}// ():uint
readUEG(){const clz=this.skipLZ();// :uint
return this.readBits(clz+1)-1;}// ():int
readEG(){const valu=this.readUEG();// :int
if(0x01&valu){// the number is odd if the low order bit is set
return 1+valu>>>1;// add 1 to make it even, and divide by 2
}else {return -1*(valu>>>1);// divide by two then make it negative
}}// Some convenience functions
// :Boolean
readBoolean(){return this.readBits(1)===1;}// ():int
readUByte(){return this.readBits(8);}// ():int
readUShort(){return this.readBits(16);}// ():int
readUInt(){return this.readBits(32);}/**
   * Advance the ExpGolomb decoder past a scaling list. The scaling
   * list is optionally transmitted as part of a sequence parameter
   * set and is not relevant to transmuxing.
   * @param count the number of entries in this scaling list
   * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1
   */skipScalingList(count){let lastScale=8;let nextScale=8;let deltaScale;for(let j=0;j<count;j++){if(nextScale!==0){deltaScale=this.readEG();nextScale=(lastScale+deltaScale+256)%256;}lastScale=nextScale===0?lastScale:nextScale;}}/**
   * Read a sequence parameter set and return some interesting video
   * properties. A sequence parameter set is the H264 metadata that
   * describes the properties of upcoming video frames.
   * @returns an object with configuration parsed from the
   * sequence parameter set, including the dimensions of the
   * associated video frames.
   */readSPS(){let frameCropLeftOffset=0;let frameCropRightOffset=0;let frameCropTopOffset=0;let frameCropBottomOffset=0;let numRefFramesInPicOrderCntCycle;let scalingListCount;let i;const readUByte=this.readUByte.bind(this);const readBits=this.readBits.bind(this);const readUEG=this.readUEG.bind(this);const readBoolean=this.readBoolean.bind(this);const skipBits=this.skipBits.bind(this);const skipEG=this.skipEG.bind(this);const skipUEG=this.skipUEG.bind(this);const skipScalingList=this.skipScalingList.bind(this);readUByte();const profileIdc=readUByte();// profile_idc
readBits(5);// profileCompat constraint_set[0-4]_flag, u(5)
skipBits(3);// reserved_zero_3bits u(3),
readUByte();// level_idc u(8)
skipUEG();// seq_parameter_set_id
// some profiles have more optional data we don't need
if(profileIdc===100||profileIdc===110||profileIdc===122||profileIdc===244||profileIdc===44||profileIdc===83||profileIdc===86||profileIdc===118||profileIdc===128){const chromaFormatIdc=readUEG();if(chromaFormatIdc===3){skipBits(1);}// separate_colour_plane_flag
skipUEG();// bit_depth_luma_minus8
skipUEG();// bit_depth_chroma_minus8
skipBits(1);// qpprime_y_zero_transform_bypass_flag
if(readBoolean()){// seq_scaling_matrix_present_flag
scalingListCount=chromaFormatIdc!==3?8:12;for(i=0;i<scalingListCount;i++){if(readBoolean()){// seq_scaling_list_present_flag[ i ]
if(i<6){skipScalingList(16);}else {skipScalingList(64);}}}}}skipUEG();// log2_max_frame_num_minus4
const picOrderCntType=readUEG();if(picOrderCntType===0){readUEG();// log2_max_pic_order_cnt_lsb_minus4
}else if(picOrderCntType===1){skipBits(1);// delta_pic_order_always_zero_flag
skipEG();// offset_for_non_ref_pic
skipEG();// offset_for_top_to_bottom_field
numRefFramesInPicOrderCntCycle=readUEG();for(i=0;i<numRefFramesInPicOrderCntCycle;i++){skipEG();}// offset_for_ref_frame[ i ]
}skipUEG();// max_num_ref_frames
skipBits(1);// gaps_in_frame_num_value_allowed_flag
const picWidthInMbsMinus1=readUEG();const picHeightInMapUnitsMinus1=readUEG();const frameMbsOnlyFlag=readBits(1);if(frameMbsOnlyFlag===0){skipBits(1);}// mb_adaptive_frame_field_flag
skipBits(1);// direct_8x8_inference_flag
if(readBoolean()){// frame_cropping_flag
frameCropLeftOffset=readUEG();frameCropRightOffset=readUEG();frameCropTopOffset=readUEG();frameCropBottomOffset=readUEG();}let pixelRatio=[1,1];if(readBoolean()){// vui_parameters_present_flag
if(readBoolean()){// aspect_ratio_info_present_flag
const aspectRatioIdc=readUByte();switch(aspectRatioIdc){case 1:pixelRatio=[1,1];break;case 2:pixelRatio=[12,11];break;case 3:pixelRatio=[10,11];break;case 4:pixelRatio=[16,11];break;case 5:pixelRatio=[40,33];break;case 6:pixelRatio=[24,11];break;case 7:pixelRatio=[20,11];break;case 8:pixelRatio=[32,11];break;case 9:pixelRatio=[80,33];break;case 10:pixelRatio=[18,11];break;case 11:pixelRatio=[15,11];break;case 12:pixelRatio=[64,33];break;case 13:pixelRatio=[160,99];break;case 14:pixelRatio=[4,3];break;case 15:pixelRatio=[3,2];break;case 16:pixelRatio=[2,1];break;case 255:{pixelRatio=[readUByte()<<8|readUByte(),readUByte()<<8|readUByte()];break;}}}}return {width:Math.ceil((picWidthInMbsMinus1+1)*16-frameCropLeftOffset*2-frameCropRightOffset*2),height:(2-frameMbsOnlyFlag)*(picHeightInMapUnitsMinus1+1)*16-(frameMbsOnlyFlag?2:4)*(frameCropTopOffset+frameCropBottomOffset),pixelRatio:pixelRatio};}readSliceType(){// skip NALu type
this.readUByte();// discard first_mb_in_slice
this.readUEG();// return slice_type
return this.readUEG();}}class AvcVideoParser extends BaseVideoParser{parseAVCPES(track,textTrack,pes,last,duration){const units=this.parseAVCNALu(track,pes.data);let VideoSample=this.VideoSample;let push;let spsfound=false;// free pes.data to save up some memory
pes.data=null;// if new NAL units found and last sample still there, let's push ...
// this helps parsing streams with missing AUD (only do this if AUD never found)
if(VideoSample&&units.length&&!track.audFound){this.pushAccessUnit(VideoSample,track);VideoSample=this.VideoSample=this.createVideoSample(false,pes.pts,pes.dts,'');}units.forEach(unit=>{var _VideoSample2;switch(unit.type){// NDR
case 1:{let iskey=false;push=true;const data=unit.data;// only check slice type to detect KF in case SPS found in same packet (any keyframe is preceded by SPS ...)
if(spsfound&&data.length>4){// retrieve slice type by parsing beginning of NAL unit (follow H264 spec, slice_header definition) to detect keyframe embedded in NDR
const sliceType=new ExpGolomb(data).readSliceType();// 2 : I slice, 4 : SI slice, 7 : I slice, 9: SI slice
// SI slice : A slice that is coded using intra prediction only and using quantisation of the prediction samples.
// An SI slice can be coded such that its decoded samples can be constructed identically to an SP slice.
// I slice: A slice that is not an SI slice that is decoded using intra prediction only.
// if (sliceType === 2 || sliceType === 7) {
if(sliceType===2||sliceType===4||sliceType===7||sliceType===9){iskey=true;}}if(iskey){var _VideoSample;// if we have non-keyframe data already, that cannot belong to the same frame as a keyframe, so force a push
if((_VideoSample=VideoSample)!=null&&_VideoSample.frame&&!VideoSample.key){this.pushAccessUnit(VideoSample,track);VideoSample=this.VideoSample=null;}}if(!VideoSample){VideoSample=this.VideoSample=this.createVideoSample(true,pes.pts,pes.dts,'');}VideoSample.frame=true;VideoSample.key=iskey;break;// IDR
}case 5:push=true;// handle PES not starting with AUD
// if we have frame data already, that cannot belong to the same frame, so force a push
if((_VideoSample2=VideoSample)!=null&&_VideoSample2.frame&&!VideoSample.key){this.pushAccessUnit(VideoSample,track);VideoSample=this.VideoSample=null;}if(!VideoSample){VideoSample=this.VideoSample=this.createVideoSample(true,pes.pts,pes.dts,'');}VideoSample.key=true;VideoSample.frame=true;break;// SEI
case 6:{push=true;parseSEIMessageFromNALu(unit.data,1,pes.pts,textTrack.samples);break;// SPS
}case 7:{var _track$pixelRatio,_track$pixelRatio2;push=true;spsfound=true;const sps=unit.data;const expGolombDecoder=new ExpGolomb(sps);const config=expGolombDecoder.readSPS();if(!track.sps||track.width!==config.width||track.height!==config.height||((_track$pixelRatio=track.pixelRatio)==null?void 0:_track$pixelRatio[0])!==config.pixelRatio[0]||((_track$pixelRatio2=track.pixelRatio)==null?void 0:_track$pixelRatio2[1])!==config.pixelRatio[1]){track.width=config.width;track.height=config.height;track.pixelRatio=config.pixelRatio;track.sps=[sps];track.duration=duration;const codecarray=sps.subarray(1,4);let codecstring='avc1.';for(let i=0;i<3;i++){let h=codecarray[i].toString(16);if(h.length<2){h='0'+h;}codecstring+=h;}track.codec=codecstring;}break;}// PPS
case 8:push=true;track.pps=[unit.data];break;// AUD
case 9:push=true;track.audFound=true;if(VideoSample){this.pushAccessUnit(VideoSample,track);}VideoSample=this.VideoSample=this.createVideoSample(false,pes.pts,pes.dts,'');break;// Filler Data
case 12:push=true;break;default:push=false;if(VideoSample){VideoSample.debug+='unknown NAL '+unit.type+' ';}break;}if(VideoSample&&push){const units=VideoSample.units;units.push(unit);}});// if last PES packet, push samples
if(last&&VideoSample){this.pushAccessUnit(VideoSample,track);this.VideoSample=null;}}parseAVCNALu(track,array){const len=array.byteLength;let state=track.naluState||0;const lastState=state;const units=[];let i=0;let value;let overflow;let unitType;let lastUnitStart=-1;let lastUnitType=0;// logger.log('PES:' + Hex.hexDump(array));
if(state===-1){// special use case where we found 3 or 4-byte start codes exactly at the end of previous PES packet
lastUnitStart=0;// NALu type is value read from offset 0
lastUnitType=array[0]&0x1f;state=0;i=1;}while(i<len){value=array[i++];// optimization. state 0 and 1 are the predominant case. let's handle them outside of the switch/case
if(!state){state=value?0:1;continue;}if(state===1){state=value?0:2;continue;}// here we have state either equal to 2 or 3
if(!value){state=3;}else if(value===1){overflow=i-state-1;if(lastUnitStart>=0){const unit={data:array.subarray(lastUnitStart,overflow),type:lastUnitType};// logger.log('pushing NALU, type/size:' + unit.type + '/' + unit.data.byteLength);
units.push(unit);}else {// lastUnitStart is undefined => this is the first start code found in this PES packet
// first check if start code delimiter is overlapping between 2 PES packets,
// ie it started in last packet (lastState not zero)
// and ended at the beginning of this PES packet (i <= 4 - lastState)
const lastUnit=this.getLastNalUnit(track.samples);if(lastUnit){if(lastState&&i<=4-lastState){// start delimiter overlapping between PES packets
// strip start delimiter bytes from the end of last NAL unit
// check if lastUnit had a state different from zero
if(lastUnit.state){// strip last bytes
lastUnit.data=lastUnit.data.subarray(0,lastUnit.data.byteLength-lastState);}}// If NAL units are not starting right at the beginning of the PES packet, push preceding data into previous NAL unit.
if(overflow>0){// logger.log('first NALU found with overflow:' + overflow);
lastUnit.data=appendUint8Array(lastUnit.data,array.subarray(0,overflow));lastUnit.state=0;}}}// check if we can read unit type
if(i<len){unitType=array[i]&0x1f;// logger.log('find NALU @ offset:' + i + ',type:' + unitType);
lastUnitStart=i;lastUnitType=unitType;state=0;}else {// not enough byte to read unit type. let's read it on next PES parsing
state=-1;}}else {state=0;}}if(lastUnitStart>=0&&state>=0){const unit={data:array.subarray(lastUnitStart,len),type:lastUnitType,state:state};units.push(unit);// logger.log('pushing NALU, type/size/state:' + unit.type + '/' + unit.data.byteLength + '/' + state);
}// no NALu found
if(units.length===0){// append pes.data to previous NAL unit
const lastUnit=this.getLastNalUnit(track.samples);if(lastUnit){lastUnit.data=appendUint8Array(lastUnit.data,array);}}track.naluState=state;return units;}}/**
 * SAMPLE-AES decrypter
 */class SampleAesDecrypter{constructor(observer,config,keyData){this.keyData=void 0;this.decrypter=void 0;this.keyData=keyData;this.decrypter=new Decrypter(config,{removePKCS7Padding:false});}decryptBuffer(encryptedData){return this.decrypter.decrypt(encryptedData,this.keyData.key.buffer,this.keyData.iv.buffer);}// AAC - encrypt all full 16 bytes blocks starting from offset 16
decryptAacSample(samples,sampleIndex,callback){const curUnit=samples[sampleIndex].unit;if(curUnit.length<=16){// No encrypted portion in this sample (first 16 bytes is not
// encrypted, see https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/HLS_Sample_Encryption/Encryption/Encryption.html),
return;}const encryptedData=curUnit.subarray(16,curUnit.length-curUnit.length%16);const encryptedBuffer=encryptedData.buffer.slice(encryptedData.byteOffset,encryptedData.byteOffset+encryptedData.length);this.decryptBuffer(encryptedBuffer).then(decryptedBuffer=>{const decryptedData=new Uint8Array(decryptedBuffer);curUnit.set(decryptedData,16);if(!this.decrypter.isSync()){this.decryptAacSamples(samples,sampleIndex+1,callback);}});}decryptAacSamples(samples,sampleIndex,callback){for(;;sampleIndex++){if(sampleIndex>=samples.length){callback();return;}if(samples[sampleIndex].unit.length<32){continue;}this.decryptAacSample(samples,sampleIndex,callback);if(!this.decrypter.isSync()){return;}}}// AVC - encrypt one 16 bytes block out of ten, starting from offset 32
getAvcEncryptedData(decodedData){const encryptedDataLen=Math.floor((decodedData.length-48)/160)*16+16;const encryptedData=new Int8Array(encryptedDataLen);let outputPos=0;for(let inputPos=32;inputPos<decodedData.length-16;inputPos+=160,outputPos+=16){encryptedData.set(decodedData.subarray(inputPos,inputPos+16),outputPos);}return encryptedData;}getAvcDecryptedUnit(decodedData,decryptedData){const uint8DecryptedData=new Uint8Array(decryptedData);let inputPos=0;for(let outputPos=32;outputPos<decodedData.length-16;outputPos+=160,inputPos+=16){decodedData.set(uint8DecryptedData.subarray(inputPos,inputPos+16),outputPos);}return decodedData;}decryptAvcSample(samples,sampleIndex,unitIndex,callback,curUnit){const decodedData=discardEPB(curUnit.data);const encryptedData=this.getAvcEncryptedData(decodedData);this.decryptBuffer(encryptedData.buffer).then(decryptedBuffer=>{curUnit.data=this.getAvcDecryptedUnit(decodedData,decryptedBuffer);if(!this.decrypter.isSync()){this.decryptAvcSamples(samples,sampleIndex,unitIndex+1,callback);}});}decryptAvcSamples(samples,sampleIndex,unitIndex,callback){if(samples instanceof Uint8Array){throw new Error('Cannot decrypt samples of type Uint8Array');}for(;;sampleIndex++,unitIndex=0){if(sampleIndex>=samples.length){callback();return;}const curUnits=samples[sampleIndex].units;for(;;unitIndex++){if(unitIndex>=curUnits.length){break;}const curUnit=curUnits[unitIndex];if(curUnit.data.length<=48||curUnit.type!==1&&curUnit.type!==5){continue;}this.decryptAvcSample(samples,sampleIndex,unitIndex,callback,curUnit);if(!this.decrypter.isSync()){return;}}}}}const PACKET_LENGTH=188;class TSDemuxer{constructor(observer,config,typeSupported){this.observer=void 0;this.config=void 0;this.typeSupported=void 0;this.sampleAes=null;this.pmtParsed=false;this.audioCodec=void 0;this.videoCodec=void 0;this._duration=0;this._pmtId=-1;this._videoTrack=void 0;this._audioTrack=void 0;this._id3Track=void 0;this._txtTrack=void 0;this.aacOverFlow=null;this.remainderData=null;this.videoParser=void 0;this.observer=observer;this.config=config;this.typeSupported=typeSupported;this.videoParser=new AvcVideoParser();}static probe(data){const syncOffset=TSDemuxer.syncOffset(data);if(syncOffset>0){logger.warn(`MPEG2-TS detected but first sync word found @ offset ${syncOffset}`);}return syncOffset!==-1;}static syncOffset(data){const length=data.length;let scanwindow=Math.min(PACKET_LENGTH*5,length-PACKET_LENGTH)+1;let i=0;while(i<scanwindow){// a TS init segment should contain at least 2 TS packets: PAT and PMT, each starting with 0x47
let foundPat=false;let packetStart=-1;let tsPackets=0;for(let j=i;j<length;j+=PACKET_LENGTH){if(data[j]===0x47&&(length-j===PACKET_LENGTH||data[j+PACKET_LENGTH]===0x47)){tsPackets++;if(packetStart===-1){packetStart=j;// First sync word found at offset, increase scan length (#5251)
if(packetStart!==0){scanwindow=Math.min(packetStart+PACKET_LENGTH*99,data.length-PACKET_LENGTH)+1;}}if(!foundPat){foundPat=parsePID(data,j)===0;}// Sync word found at 0 with 3 packets, or found at offset least 2 packets up to scanwindow (#5501)
if(foundPat&&tsPackets>1&&(packetStart===0&&tsPackets>2||j+PACKET_LENGTH>scanwindow)){return packetStart;}}else if(tsPackets){// Exit if sync word found, but does not contain contiguous packets
return -1;}else {break;}}i++;}return -1;}/**
   * Creates a track model internal to demuxer used to drive remuxing input
   */static createTrack(type,duration){return {container:type==='video'||type==='audio'?'video/mp2t':undefined,type,id:RemuxerTrackIdConfig[type],pid:-1,inputTimeScale:90000,sequenceNumber:0,samples:[],dropped:0,duration:type==='audio'?duration:undefined};}/**
   * Initializes a new init segment on the demuxer/remuxer interface. Needed for discontinuities/track-switches (or at stream start)
   * Resets all internal track instances of the demuxer.
   */resetInitSegment(initSegment,audioCodec,videoCodec,trackDuration){this.pmtParsed=false;this._pmtId=-1;this._videoTrack=TSDemuxer.createTrack('video');this._audioTrack=TSDemuxer.createTrack('audio',trackDuration);this._id3Track=TSDemuxer.createTrack('id3');this._txtTrack=TSDemuxer.createTrack('text');this._audioTrack.segmentCodec='aac';// flush any partial content
this.aacOverFlow=null;this.remainderData=null;this.audioCodec=audioCodec;this.videoCodec=videoCodec;this._duration=trackDuration;}resetTimeStamp(){}resetContiguity(){const{_audioTrack,_videoTrack,_id3Track}=this;if(_audioTrack){_audioTrack.pesData=null;}if(_videoTrack){_videoTrack.pesData=null;}if(_id3Track){_id3Track.pesData=null;}this.aacOverFlow=null;this.remainderData=null;}demux(data,timeOffset,isSampleAes=false,flush=false){if(!isSampleAes){this.sampleAes=null;}let pes;const videoTrack=this._videoTrack;const audioTrack=this._audioTrack;const id3Track=this._id3Track;const textTrack=this._txtTrack;let videoPid=videoTrack.pid;let videoData=videoTrack.pesData;let audioPid=audioTrack.pid;let id3Pid=id3Track.pid;let audioData=audioTrack.pesData;let id3Data=id3Track.pesData;let unknownPID=null;let pmtParsed=this.pmtParsed;let pmtId=this._pmtId;let len=data.length;if(this.remainderData){data=appendUint8Array(this.remainderData,data);len=data.length;this.remainderData=null;}if(len<PACKET_LENGTH&&!flush){this.remainderData=data;return {audioTrack,videoTrack,id3Track,textTrack};}const syncOffset=Math.max(0,TSDemuxer.syncOffset(data));len-=(len-syncOffset)%PACKET_LENGTH;if(len<data.byteLength&&!flush){this.remainderData=new Uint8Array(data.buffer,len,data.buffer.byteLength-len);}// loop through TS packets
let tsPacketErrors=0;for(let start=syncOffset;start<len;start+=PACKET_LENGTH){if(data[start]===0x47){const stt=!!(data[start+1]&0x40);const pid=parsePID(data,start);const atf=(data[start+3]&0x30)>>4;// if an adaption field is present, its length is specified by the fifth byte of the TS packet header.
let offset;if(atf>1){offset=start+5+data[start+4];// continue if there is only adaptation field
if(offset===start+PACKET_LENGTH){continue;}}else {offset=start+4;}switch(pid){case videoPid:if(stt){if(videoData&&(pes=parsePES(videoData))){this.videoParser.parseAVCPES(videoTrack,textTrack,pes,false,this._duration);}videoData={data:[],size:0};}if(videoData){videoData.data.push(data.subarray(offset,start+PACKET_LENGTH));videoData.size+=start+PACKET_LENGTH-offset;}break;case audioPid:if(stt){if(audioData&&(pes=parsePES(audioData))){switch(audioTrack.segmentCodec){case'aac':this.parseAACPES(audioTrack,pes);break;case'mp3':this.parseMPEGPES(audioTrack,pes);break;case'ac3':{this.parseAC3PES(audioTrack,pes);}break;}}audioData={data:[],size:0};}if(audioData){audioData.data.push(data.subarray(offset,start+PACKET_LENGTH));audioData.size+=start+PACKET_LENGTH-offset;}break;case id3Pid:if(stt){if(id3Data&&(pes=parsePES(id3Data))){this.parseID3PES(id3Track,pes);}id3Data={data:[],size:0};}if(id3Data){id3Data.data.push(data.subarray(offset,start+PACKET_LENGTH));id3Data.size+=start+PACKET_LENGTH-offset;}break;case 0:if(stt){offset+=data[offset]+1;}pmtId=this._pmtId=parsePAT(data,offset);// logger.log('PMT PID:'  + this._pmtId);
break;case pmtId:{if(stt){offset+=data[offset]+1;}const parsedPIDs=parsePMT(data,offset,this.typeSupported,isSampleAes);// only update track id if track PID found while parsing PMT
// this is to avoid resetting the PID to -1 in case
// track PID transiently disappears from the stream
// this could happen in case of transient missing audio samples for example
// NOTE this is only the PID of the track as found in TS,
// but we are not using this for MP4 track IDs.
videoPid=parsedPIDs.videoPid;if(videoPid>0){videoTrack.pid=videoPid;videoTrack.segmentCodec=parsedPIDs.segmentVideoCodec;}audioPid=parsedPIDs.audioPid;if(audioPid>0){audioTrack.pid=audioPid;audioTrack.segmentCodec=parsedPIDs.segmentAudioCodec;}id3Pid=parsedPIDs.id3Pid;if(id3Pid>0){id3Track.pid=id3Pid;}if(unknownPID!==null&&!pmtParsed){logger.warn(`MPEG-TS PMT found at ${start} after unknown PID '${unknownPID}'. Backtracking to sync byte @${syncOffset} to parse all TS packets.`);unknownPID=null;// we set it to -188, the += 188 in the for loop will reset start to 0
start=syncOffset-188;}pmtParsed=this.pmtParsed=true;break;}case 0x11:case 0x1fff:break;default:unknownPID=pid;break;}}else {tsPacketErrors++;}}if(tsPacketErrors>0){const error=new Error(`Found ${tsPacketErrors} TS packet/s that do not start with 0x47`);this.observer.emit(Events$1.ERROR,Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_PARSING_ERROR,fatal:false,error,reason:error.message});}videoTrack.pesData=videoData;audioTrack.pesData=audioData;id3Track.pesData=id3Data;const demuxResult={audioTrack,videoTrack,id3Track,textTrack};if(flush){this.extractRemainingSamples(demuxResult);}return demuxResult;}flush(){const{remainderData}=this;this.remainderData=null;let result;if(remainderData){result=this.demux(remainderData,-1,false,true);}else {result={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack};}this.extractRemainingSamples(result);if(this.sampleAes){return this.decrypt(result,this.sampleAes);}return result;}extractRemainingSamples(demuxResult){const{audioTrack,videoTrack,id3Track,textTrack}=demuxResult;const videoData=videoTrack.pesData;const audioData=audioTrack.pesData;const id3Data=id3Track.pesData;// try to parse last PES packets
let pes;if(videoData&&(pes=parsePES(videoData))){this.videoParser.parseAVCPES(videoTrack,textTrack,pes,true,this._duration);videoTrack.pesData=null;}else {// either avcData null or PES truncated, keep it for next frag parsing
videoTrack.pesData=videoData;}if(audioData&&(pes=parsePES(audioData))){switch(audioTrack.segmentCodec){case'aac':this.parseAACPES(audioTrack,pes);break;case'mp3':this.parseMPEGPES(audioTrack,pes);break;case'ac3':{this.parseAC3PES(audioTrack,pes);}break;}audioTrack.pesData=null;}else {if(audioData!=null&&audioData.size){logger.log('last AAC PES packet truncated,might overlap between fragments');}// either audioData null or PES truncated, keep it for next frag parsing
audioTrack.pesData=audioData;}if(id3Data&&(pes=parsePES(id3Data))){this.parseID3PES(id3Track,pes);id3Track.pesData=null;}else {// either id3Data null or PES truncated, keep it for next frag parsing
id3Track.pesData=id3Data;}}demuxSampleAes(data,keyData,timeOffset){const demuxResult=this.demux(data,timeOffset,true,!this.config.progressive);const sampleAes=this.sampleAes=new SampleAesDecrypter(this.observer,this.config,keyData);return this.decrypt(demuxResult,sampleAes);}decrypt(demuxResult,sampleAes){return new Promise(resolve=>{const{audioTrack,videoTrack}=demuxResult;if(audioTrack.samples&&audioTrack.segmentCodec==='aac'){sampleAes.decryptAacSamples(audioTrack.samples,0,()=>{if(videoTrack.samples){sampleAes.decryptAvcSamples(videoTrack.samples,0,0,()=>{resolve(demuxResult);});}else {resolve(demuxResult);}});}else if(videoTrack.samples){sampleAes.decryptAvcSamples(videoTrack.samples,0,0,()=>{resolve(demuxResult);});}});}destroy(){this._duration=0;}parseAACPES(track,pes){let startOffset=0;const aacOverFlow=this.aacOverFlow;let data=pes.data;if(aacOverFlow){this.aacOverFlow=null;const frameMissingBytes=aacOverFlow.missing;const sampleLength=aacOverFlow.sample.unit.byteLength;// logger.log(`AAC: append overflowing ${sampleLength} bytes to beginning of new PES`);
if(frameMissingBytes===-1){data=appendUint8Array(aacOverFlow.sample.unit,data);}else {const frameOverflowBytes=sampleLength-frameMissingBytes;aacOverFlow.sample.unit.set(data.subarray(0,frameMissingBytes),frameOverflowBytes);track.samples.push(aacOverFlow.sample);startOffset=aacOverFlow.missing;}}// look for ADTS header (0xFFFx)
let offset;let len;for(offset=startOffset,len=data.length;offset<len-1;offset++){if(isHeader$1(data,offset)){break;}}// if ADTS header does not start straight from the beginning of the PES payload, raise an error
if(offset!==startOffset){let reason;const recoverable=offset<len-1;if(recoverable){reason=`AAC PES did not start with ADTS header,offset:${offset}`;}else {reason='No ADTS header found in AAC PES';}const error=new Error(reason);logger.warn(`parsing error: ${reason}`);this.observer.emit(Events$1.ERROR,Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_PARSING_ERROR,fatal:false,levelRetry:recoverable,error,reason});if(!recoverable){return;}}initTrackConfig(track,this.observer,data,offset,this.audioCodec);let pts;if(pes.pts!==undefined){pts=pes.pts;}else if(aacOverFlow){// if last AAC frame is overflowing, we should ensure timestamps are contiguous:
// first sample PTS should be equal to last sample PTS + frameDuration
const frameDuration=getFrameDuration(track.samplerate);pts=aacOverFlow.sample.pts+frameDuration;}else {logger.warn('[tsdemuxer]: AAC PES unknown PTS');return;}// scan for aac samples
let frameIndex=0;let frame;while(offset<len){frame=appendFrame$2(track,data,offset,pts,frameIndex);offset+=frame.length;if(!frame.missing){frameIndex++;for(;offset<len-1;offset++){if(isHeader$1(data,offset)){break;}}}else {this.aacOverFlow=frame;break;}}}parseMPEGPES(track,pes){const data=pes.data;const length=data.length;let frameIndex=0;let offset=0;const pts=pes.pts;if(pts===undefined){logger.warn('[tsdemuxer]: MPEG PES unknown PTS');return;}while(offset<length){if(isHeader(data,offset)){const frame=appendFrame$1(track,data,offset,pts,frameIndex);if(frame){offset+=frame.length;frameIndex++;}else {// logger.log('Unable to parse Mpeg audio frame');
break;}}else {// nothing found, keep looking
offset++;}}}parseAC3PES(track,pes){{const data=pes.data;const pts=pes.pts;if(pts===undefined){logger.warn('[tsdemuxer]: AC3 PES unknown PTS');return;}const length=data.length;let frameIndex=0;let offset=0;let parsed;while(offset<length&&(parsed=appendFrame(track,data,offset,pts,frameIndex++))>0){offset+=parsed;}}}parseID3PES(id3Track,pes){if(pes.pts===undefined){logger.warn('[tsdemuxer]: ID3 PES unknown PTS');return;}const id3Sample=_extends({},pes,{type:this._videoTrack?MetadataSchema.emsg:MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});id3Track.samples.push(id3Sample);}}function parsePID(data,offset){// pid is a 13-bit field starting at the last bit of TS[1]
return ((data[offset+1]&0x1f)<<8)+data[offset+2];}function parsePAT(data,offset){// skip the PSI header and parse the first PMT entry
return (data[offset+10]&0x1f)<<8|data[offset+11];}function parsePMT(data,offset,typeSupported,isSampleAes){const result={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:'avc',segmentAudioCodec:'aac'};const sectionLength=(data[offset+1]&0x0f)<<8|data[offset+2];const tableEnd=offset+3+sectionLength-4;// to determine where the table is, we have to figure out how
// long the program info descriptors are
const programInfoLength=(data[offset+10]&0x0f)<<8|data[offset+11];// advance the offset to the first entry in the mapping table
offset+=12+programInfoLength;while(offset<tableEnd){const pid=parsePID(data,offset);const esInfoLength=(data[offset+3]&0x0f)<<8|data[offset+4];switch(data[offset]){case 0xcf:// SAMPLE-AES AAC
if(!isSampleAes){logEncryptedSamplesFoundInUnencryptedStream('ADTS AAC');break;}/* falls through */case 0x0f:// ISO/IEC 13818-7 ADTS AAC (MPEG-2 lower bit-rate audio)
// logger.log('AAC PID:'  + pid);
if(result.audioPid===-1){result.audioPid=pid;}break;// Packetized metadata (ID3)
case 0x15:// logger.log('ID3 PID:'  + pid);
if(result.id3Pid===-1){result.id3Pid=pid;}break;case 0xdb:// SAMPLE-AES AVC
if(!isSampleAes){logEncryptedSamplesFoundInUnencryptedStream('H.264');break;}/* falls through */case 0x1b:// ITU-T Rec. H.264 and ISO/IEC 14496-10 (lower bit-rate video)
// logger.log('AVC PID:'  + pid);
if(result.videoPid===-1){result.videoPid=pid;result.segmentVideoCodec='avc';}break;// ISO/IEC 11172-3 (MPEG-1 audio)
// or ISO/IEC 13818-3 (MPEG-2 halved sample rate audio)
case 0x03:case 0x04:// logger.log('MPEG PID:'  + pid);
if(!typeSupported.mpeg&&!typeSupported.mp3){logger.log('MPEG audio found, not supported in this browser');}else if(result.audioPid===-1){result.audioPid=pid;result.segmentAudioCodec='mp3';}break;case 0xc1:// SAMPLE-AES AC3
if(!isSampleAes){logEncryptedSamplesFoundInUnencryptedStream('AC-3');break;}/* falls through */case 0x81:{if(!typeSupported.ac3){logger.log('AC-3 audio found, not supported in this browser');}else if(result.audioPid===-1){result.audioPid=pid;result.segmentAudioCodec='ac3';}}break;case 0x06:// stream_type 6 can mean a lot of different things in case of DVB.
// We need to look at the descriptors. Right now, we're only interested
// in AC-3 audio, so we do the descriptor parsing only when we don't have
// an audio PID yet.
if(result.audioPid===-1&&esInfoLength>0){let parsePos=offset+5;let remaining=esInfoLength;while(remaining>2){const descriptorId=data[parsePos];switch(descriptorId){case 0x6a:// DVB Descriptor for AC-3
{if(typeSupported.ac3!==true){logger.log('AC-3 audio found, not supported in this browser for now');}else {result.audioPid=pid;result.segmentAudioCodec='ac3';}}break;}const descriptorLen=data[parsePos+1]+2;parsePos+=descriptorLen;remaining-=descriptorLen;}}break;case 0xc2:// SAMPLE-AES EC3
/* falls through */case 0x87:throw new Error('Unsupported EC-3 in M2TS found');case 0x24:throw new Error('Unsupported HEVC in M2TS found');}// move to the next table entry
// skip past the elementary stream descriptors, if present
offset+=esInfoLength+5;}return result;}function logEncryptedSamplesFoundInUnencryptedStream(type){logger.log(`${type} with AES-128-CBC encryption found in unencrypted stream`);}function parsePES(stream){let i=0;let frag;let pesLen;let pesHdrLen;let pesPts;let pesDts;const data=stream.data;// safety check
if(!stream||stream.size===0){return null;}// we might need up to 19 bytes to read PES header
// if first chunk of data is less than 19 bytes, let's merge it with following ones until we get 19 bytes
// usually only one merge is needed (and this is rare ...)
while(data[0].length<19&&data.length>1){data[0]=appendUint8Array(data[0],data[1]);data.splice(1,1);}// retrieve PTS/DTS from first fragment
frag=data[0];const pesPrefix=(frag[0]<<16)+(frag[1]<<8)+frag[2];if(pesPrefix===1){pesLen=(frag[4]<<8)+frag[5];// if PES parsed length is not zero and greater than total received length, stop parsing. PES might be truncated
// minus 6 : PES header size
if(pesLen&&pesLen>stream.size-6){return null;}const pesFlags=frag[7];if(pesFlags&0xc0){/* PES header described here : http://dvd.sourceforge.net/dvdinfo/pes-hdr.html
          as PTS / DTS is 33 bit we cannot use bitwise operator in JS,
          as Bitwise operators treat their operands as a sequence of 32 bits */pesPts=(frag[9]&0x0e)*536870912+// 1 << 29
(frag[10]&0xff)*4194304+// 1 << 22
(frag[11]&0xfe)*16384+// 1 << 14
(frag[12]&0xff)*128+// 1 << 7
(frag[13]&0xfe)/2;if(pesFlags&0x40){pesDts=(frag[14]&0x0e)*536870912+// 1 << 29
(frag[15]&0xff)*4194304+// 1 << 22
(frag[16]&0xfe)*16384+// 1 << 14
(frag[17]&0xff)*128+// 1 << 7
(frag[18]&0xfe)/2;if(pesPts-pesDts>60*90000){logger.warn(`${Math.round((pesPts-pesDts)/90000)}s delta between PTS and DTS, align them`);pesPts=pesDts;}}else {pesDts=pesPts;}}pesHdrLen=frag[8];// 9 bytes : 6 bytes for PES header + 3 bytes for PES extension
let payloadStartOffset=pesHdrLen+9;if(stream.size<=payloadStartOffset){return null;}stream.size-=payloadStartOffset;// reassemble PES packet
const pesData=new Uint8Array(stream.size);for(let j=0,dataLen=data.length;j<dataLen;j++){frag=data[j];let len=frag.byteLength;if(payloadStartOffset){if(payloadStartOffset>len){// trim full frag if PES header bigger than frag
payloadStartOffset-=len;continue;}else {// trim partial frag if PES header smaller than frag
frag=frag.subarray(payloadStartOffset);len-=payloadStartOffset;payloadStartOffset=0;}}pesData.set(frag,i);i+=len;}if(pesLen){// payload size : remove PES header + PES extension
pesLen-=pesHdrLen+3;}return {data:pesData,pts:pesPts,dts:pesDts,len:pesLen};}return null;}/**
 * MP3 demuxer
 */class MP3Demuxer extends BaseAudioDemuxer{resetInitSegment(initSegment,audioCodec,videoCodec,trackDuration){super.resetInitSegment(initSegment,audioCodec,videoCodec,trackDuration);this._audioTrack={container:'audio/mpeg',type:'audio',id:2,pid:-1,sequenceNumber:0,segmentCodec:'mp3',samples:[],manifestCodec:audioCodec,duration:trackDuration,inputTimeScale:90000,dropped:0};}static probe(data){if(!data){return false;}// check if data contains ID3 timestamp and MPEG sync word
// Look for MPEG header | 1111 1111 | 111X XYZX | where X can be either 0 or 1 and Y or Z should be 1
// Layer bits (position 14 and 15) in header should be always different from 0 (Layer I or Layer II or Layer III)
// More info http://www.mp3-tech.org/programmer/frame_header.html
const id3Data=getID3Data(data,0);let offset=(id3Data==null?void 0:id3Data.length)||0;// Check for ac-3|ec-3 sync bytes and return false if present
if(id3Data&&data[offset]===0x0b&&data[offset+1]===0x77&&getTimeStamp(id3Data)!==undefined&&// check the bsid to confirm ac-3 or ec-3 (not mp3)
getAudioBSID(data,offset)<=16){return false;}for(let length=data.length;offset<length;offset++){if(probe(data,offset)){logger.log('MPEG Audio sync word found !');return true;}}return false;}canParse(data,offset){return canParse(data,offset);}appendFrame(track,data,offset){if(this.basePTS===null){return;}return appendFrame$1(track,data,offset,this.basePTS,this.frameIndex);}}/**
 *  AAC helper
 */class AAC{static getSilentFrame(codec,channelCount){switch(codec){case'mp4a.40.2':if(channelCount===1){return new Uint8Array([0x00,0xc8,0x00,0x80,0x23,0x80]);}else if(channelCount===2){return new Uint8Array([0x21,0x00,0x49,0x90,0x02,0x19,0x00,0x23,0x80]);}else if(channelCount===3){return new Uint8Array([0x00,0xc8,0x00,0x80,0x20,0x84,0x01,0x26,0x40,0x08,0x64,0x00,0x8e]);}else if(channelCount===4){return new Uint8Array([0x00,0xc8,0x00,0x80,0x20,0x84,0x01,0x26,0x40,0x08,0x64,0x00,0x80,0x2c,0x80,0x08,0x02,0x38]);}else if(channelCount===5){return new Uint8Array([0x00,0xc8,0x00,0x80,0x20,0x84,0x01,0x26,0x40,0x08,0x64,0x00,0x82,0x30,0x04,0x99,0x00,0x21,0x90,0x02,0x38]);}else if(channelCount===6){return new Uint8Array([0x00,0xc8,0x00,0x80,0x20,0x84,0x01,0x26,0x40,0x08,0x64,0x00,0x82,0x30,0x04,0x99,0x00,0x21,0x90,0x02,0x00,0xb2,0x00,0x20,0x08,0xe0]);}break;// handle HE-AAC below (mp4a.40.5 / mp4a.40.29)
default:if(channelCount===1){// ffmpeg -y -f lavfi -i "aevalsrc=0:d=0.05" -c:a libfdk_aac -profile:a aac_he -b:a 4k output.aac && hexdump -v -e '16/1 "0x%x," "\n"' -v output.aac
return new Uint8Array([0x1,0x40,0x22,0x80,0xa3,0x4e,0xe6,0x80,0xba,0x8,0x0,0x0,0x0,0x1c,0x6,0xf1,0xc1,0xa,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5e]);}else if(channelCount===2){// ffmpeg -y -f lavfi -i "aevalsrc=0|0:d=0.05" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 "0x%x," "\n"' -v output.aac
return new Uint8Array([0x1,0x40,0x22,0x80,0xa3,0x5e,0xe6,0x80,0xba,0x8,0x0,0x0,0x0,0x0,0x95,0x0,0x6,0xf1,0xa1,0xa,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5e]);}else if(channelCount===3){// ffmpeg -y -f lavfi -i "aevalsrc=0|0|0:d=0.05" -c:a libfdk_aac -profile:a aac_he_v2 -b:a 4k output.aac && hexdump -v -e '16/1 "0x%x," "\n"' -v output.aac
return new Uint8Array([0x1,0x40,0x22,0x80,0xa3,0x5e,0xe6,0x80,0xba,0x8,0x0,0x0,0x0,0x0,0x95,0x0,0x6,0xf1,0xa1,0xa,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5a,0x5e]);}break;}return undefined;}}/**
 * Generate MP4 Box
 */const UINT32_MAX=Math.pow(2,32)-1;class MP4{static init(){MP4.types={avc1:[],// codingname
avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],'.mp3':[],dac3:[],'ac-3':[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let i;for(i in MP4.types){if(MP4.types.hasOwnProperty(i)){MP4.types[i]=[i.charCodeAt(0),i.charCodeAt(1),i.charCodeAt(2),i.charCodeAt(3)];}}const videoHdlr=new Uint8Array([0x00,// version 0
0x00,0x00,0x00,// flags
0x00,0x00,0x00,0x00,// pre_defined
0x76,0x69,0x64,0x65,// handler_type: 'vide'
0x00,0x00,0x00,0x00,// reserved
0x00,0x00,0x00,0x00,// reserved
0x00,0x00,0x00,0x00,// reserved
0x56,0x69,0x64,0x65,0x6f,0x48,0x61,0x6e,0x64,0x6c,0x65,0x72,0x00// name: 'VideoHandler'
]);const audioHdlr=new Uint8Array([0x00,// version 0
0x00,0x00,0x00,// flags
0x00,0x00,0x00,0x00,// pre_defined
0x73,0x6f,0x75,0x6e,// handler_type: 'soun'
0x00,0x00,0x00,0x00,// reserved
0x00,0x00,0x00,0x00,// reserved
0x00,0x00,0x00,0x00,// reserved
0x53,0x6f,0x75,0x6e,0x64,0x48,0x61,0x6e,0x64,0x6c,0x65,0x72,0x00// name: 'SoundHandler'
]);MP4.HDLR_TYPES={video:videoHdlr,audio:audioHdlr};const dref=new Uint8Array([0x00,// version 0
0x00,0x00,0x00,// flags
0x00,0x00,0x00,0x01,// entry_count
0x00,0x00,0x00,0x0c,// entry_size
0x75,0x72,0x6c,0x20,// 'url' type
0x00,// version 0
0x00,0x00,0x01// entry_flags
]);const stco=new Uint8Array([0x00,// version
0x00,0x00,0x00,// flags
0x00,0x00,0x00,0x00// entry_count
]);MP4.STTS=MP4.STSC=MP4.STCO=stco;MP4.STSZ=new Uint8Array([0x00,// version
0x00,0x00,0x00,// flags
0x00,0x00,0x00,0x00,// sample_size
0x00,0x00,0x00,0x00// sample_count
]);MP4.VMHD=new Uint8Array([0x00,// version
0x00,0x00,0x01,// flags
0x00,0x00,// graphicsmode
0x00,0x00,0x00,0x00,0x00,0x00// opcolor
]);MP4.SMHD=new Uint8Array([0x00,// version
0x00,0x00,0x00,// flags
0x00,0x00,// balance
0x00,0x00// reserved
]);MP4.STSD=new Uint8Array([0x00,// version 0
0x00,0x00,0x00,// flags
0x00,0x00,0x00,0x01]);// entry_count
const majorBrand=new Uint8Array([105,115,111,109]);// isom
const avc1Brand=new Uint8Array([97,118,99,49]);// avc1
const minorVersion=new Uint8Array([0,0,0,1]);MP4.FTYP=MP4.box(MP4.types.ftyp,majorBrand,minorVersion,majorBrand,avc1Brand);MP4.DINF=MP4.box(MP4.types.dinf,MP4.box(MP4.types.dref,dref));}static box(type,...payload){let size=8;let i=payload.length;const len=i;// calculate the total size we need to allocate
while(i--){size+=payload[i].byteLength;}const result=new Uint8Array(size);result[0]=size>>24&0xff;result[1]=size>>16&0xff;result[2]=size>>8&0xff;result[3]=size&0xff;result.set(type,4);// copy the payload into the result
for(i=0,size=8;i<len;i++){// copy payload[i] array @ offset size
result.set(payload[i],size);size+=payload[i].byteLength;}return result;}static hdlr(type){return MP4.box(MP4.types.hdlr,MP4.HDLR_TYPES[type]);}static mdat(data){return MP4.box(MP4.types.mdat,data);}static mdhd(timescale,duration){duration*=timescale;const upperWordDuration=Math.floor(duration/(UINT32_MAX+1));const lowerWordDuration=Math.floor(duration%(UINT32_MAX+1));return MP4.box(MP4.types.mdhd,new Uint8Array([0x01,// version 1
0x00,0x00,0x00,// flags
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,// creation_time
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,// modification_time
timescale>>24&0xff,timescale>>16&0xff,timescale>>8&0xff,timescale&0xff,// timescale
upperWordDuration>>24,upperWordDuration>>16&0xff,upperWordDuration>>8&0xff,upperWordDuration&0xff,lowerWordDuration>>24,lowerWordDuration>>16&0xff,lowerWordDuration>>8&0xff,lowerWordDuration&0xff,0x55,0xc4,// 'und' language (undetermined)
0x00,0x00]));}static mdia(track){return MP4.box(MP4.types.mdia,MP4.mdhd(track.timescale,track.duration),MP4.hdlr(track.type),MP4.minf(track));}static mfhd(sequenceNumber){return MP4.box(MP4.types.mfhd,new Uint8Array([0x00,0x00,0x00,0x00,// flags
sequenceNumber>>24,sequenceNumber>>16&0xff,sequenceNumber>>8&0xff,sequenceNumber&0xff// sequence_number
]));}static minf(track){if(track.type==='audio'){return MP4.box(MP4.types.minf,MP4.box(MP4.types.smhd,MP4.SMHD),MP4.DINF,MP4.stbl(track));}else {return MP4.box(MP4.types.minf,MP4.box(MP4.types.vmhd,MP4.VMHD),MP4.DINF,MP4.stbl(track));}}static moof(sn,baseMediaDecodeTime,track){return MP4.box(MP4.types.moof,MP4.mfhd(sn),MP4.traf(track,baseMediaDecodeTime));}static moov(tracks){let i=tracks.length;const boxes=[];while(i--){boxes[i]=MP4.trak(tracks[i]);}return MP4.box.apply(null,[MP4.types.moov,MP4.mvhd(tracks[0].timescale,tracks[0].duration)].concat(boxes).concat(MP4.mvex(tracks)));}static mvex(tracks){let i=tracks.length;const boxes=[];while(i--){boxes[i]=MP4.trex(tracks[i]);}return MP4.box.apply(null,[MP4.types.mvex,...boxes]);}static mvhd(timescale,duration){duration*=timescale;const upperWordDuration=Math.floor(duration/(UINT32_MAX+1));const lowerWordDuration=Math.floor(duration%(UINT32_MAX+1));const bytes=new Uint8Array([0x01,// version 1
0x00,0x00,0x00,// flags
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,// creation_time
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,// modification_time
timescale>>24&0xff,timescale>>16&0xff,timescale>>8&0xff,timescale&0xff,// timescale
upperWordDuration>>24,upperWordDuration>>16&0xff,upperWordDuration>>8&0xff,upperWordDuration&0xff,lowerWordDuration>>24,lowerWordDuration>>16&0xff,lowerWordDuration>>8&0xff,lowerWordDuration&0xff,0x00,0x01,0x00,0x00,// 1.0 rate
0x01,0x00,// 1.0 volume
0x00,0x00,// reserved
0x00,0x00,0x00,0x00,// reserved
0x00,0x00,0x00,0x00,// reserved
0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,// transformation: unity matrix
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// pre_defined
0xff,0xff,0xff,0xff// next_track_ID
]);return MP4.box(MP4.types.mvhd,bytes);}static sdtp(track){const samples=track.samples||[];const bytes=new Uint8Array(4+samples.length);let i;let flags;// leave the full box header (4 bytes) all zero
// write the sample table
for(i=0;i<samples.length;i++){flags=samples[i].flags;bytes[i+4]=flags.dependsOn<<4|flags.isDependedOn<<2|flags.hasRedundancy;}return MP4.box(MP4.types.sdtp,bytes);}static stbl(track){return MP4.box(MP4.types.stbl,MP4.stsd(track),MP4.box(MP4.types.stts,MP4.STTS),MP4.box(MP4.types.stsc,MP4.STSC),MP4.box(MP4.types.stsz,MP4.STSZ),MP4.box(MP4.types.stco,MP4.STCO));}static avc1(track){let sps=[];let pps=[];let i;let data;let len;// assemble the SPSs
for(i=0;i<track.sps.length;i++){data=track.sps[i];len=data.byteLength;sps.push(len>>>8&0xff);sps.push(len&0xff);// SPS
sps=sps.concat(Array.prototype.slice.call(data));}// assemble the PPSs
for(i=0;i<track.pps.length;i++){data=track.pps[i];len=data.byteLength;pps.push(len>>>8&0xff);pps.push(len&0xff);pps=pps.concat(Array.prototype.slice.call(data));}const avcc=MP4.box(MP4.types.avcC,new Uint8Array([0x01,// version
sps[3],// profile
sps[4],// profile compat
sps[5],// level
0xfc|3,// lengthSizeMinusOne, hard-coded to 4 bytes
0xe0|track.sps.length// 3bit reserved (111) + numOfSequenceParameterSets
].concat(sps).concat([track.pps.length// numOfPictureParameterSets
]).concat(pps)));// "PPS"
const width=track.width;const height=track.height;const hSpacing=track.pixelRatio[0];const vSpacing=track.pixelRatio[1];return MP4.box(MP4.types.avc1,new Uint8Array([0x00,0x00,0x00,// reserved
0x00,0x00,0x00,// reserved
0x00,0x01,// data_reference_index
0x00,0x00,// pre_defined
0x00,0x00,// reserved
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// pre_defined
width>>8&0xff,width&0xff,// width
height>>8&0xff,height&0xff,// height
0x00,0x48,0x00,0x00,// horizresolution
0x00,0x48,0x00,0x00,// vertresolution
0x00,0x00,0x00,0x00,// reserved
0x00,0x01,// frame_count
0x12,0x64,0x61,0x69,0x6c,// dailymotion/hls.js
0x79,0x6d,0x6f,0x74,0x69,0x6f,0x6e,0x2f,0x68,0x6c,0x73,0x2e,0x6a,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// compressorname
0x00,0x18,// depth = 24
0x11,0x11]),// pre_defined = -1
avcc,MP4.box(MP4.types.btrt,new Uint8Array([0x00,0x1c,0x9c,0x80,// bufferSizeDB
0x00,0x2d,0xc6,0xc0,// maxBitrate
0x00,0x2d,0xc6,0xc0])),// avgBitrate
MP4.box(MP4.types.pasp,new Uint8Array([hSpacing>>24,// hSpacing
hSpacing>>16&0xff,hSpacing>>8&0xff,hSpacing&0xff,vSpacing>>24,// vSpacing
vSpacing>>16&0xff,vSpacing>>8&0xff,vSpacing&0xff])));}static esds(track){const configlen=track.config.length;return new Uint8Array([0x00,// version 0
0x00,0x00,0x00,// flags
0x03,// descriptor_type
0x17+configlen,// length
0x00,0x01,// es_id
0x00,// stream_priority
0x04,// descriptor_type
0x0f+configlen,// length
0x40,// codec : mpeg4_audio
0x15,// stream_type
0x00,0x00,0x00,// buffer_size
0x00,0x00,0x00,0x00,// maxBitrate
0x00,0x00,0x00,0x00,// avgBitrate
0x05// descriptor_type
].concat([configlen]).concat(track.config).concat([0x06,0x01,0x02]));// GASpecificConfig)); // length + audio config descriptor
}static audioStsd(track){const samplerate=track.samplerate;return new Uint8Array([0x00,0x00,0x00,// reserved
0x00,0x00,0x00,// reserved
0x00,0x01,// data_reference_index
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// reserved
0x00,track.channelCount,// channelcount
0x00,0x10,// sampleSize:16bits
0x00,0x00,0x00,0x00,// reserved2
samplerate>>8&0xff,samplerate&0xff,//
0x00,0x00]);}static mp4a(track){return MP4.box(MP4.types.mp4a,MP4.audioStsd(track),MP4.box(MP4.types.esds,MP4.esds(track)));}static mp3(track){return MP4.box(MP4.types['.mp3'],MP4.audioStsd(track));}static ac3(track){return MP4.box(MP4.types['ac-3'],MP4.audioStsd(track),MP4.box(MP4.types.dac3,track.config));}static stsd(track){if(track.type==='audio'){if(track.segmentCodec==='mp3'&&track.codec==='mp3'){return MP4.box(MP4.types.stsd,MP4.STSD,MP4.mp3(track));}if(track.segmentCodec==='ac3'){return MP4.box(MP4.types.stsd,MP4.STSD,MP4.ac3(track));}return MP4.box(MP4.types.stsd,MP4.STSD,MP4.mp4a(track));}else {return MP4.box(MP4.types.stsd,MP4.STSD,MP4.avc1(track));}}static tkhd(track){const id=track.id;const duration=track.duration*track.timescale;const width=track.width;const height=track.height;const upperWordDuration=Math.floor(duration/(UINT32_MAX+1));const lowerWordDuration=Math.floor(duration%(UINT32_MAX+1));return MP4.box(MP4.types.tkhd,new Uint8Array([0x01,// version 1
0x00,0x00,0x07,// flags
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,// creation_time
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,// modification_time
id>>24&0xff,id>>16&0xff,id>>8&0xff,id&0xff,// track_ID
0x00,0x00,0x00,0x00,// reserved
upperWordDuration>>24,upperWordDuration>>16&0xff,upperWordDuration>>8&0xff,upperWordDuration&0xff,lowerWordDuration>>24,lowerWordDuration>>16&0xff,lowerWordDuration>>8&0xff,lowerWordDuration&0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// reserved
0x00,0x00,// layer
0x00,0x00,// alternate_group
0x00,0x00,// non-audio track volume
0x00,0x00,// reserved
0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,// transformation: unity matrix
width>>8&0xff,width&0xff,0x00,0x00,// width
height>>8&0xff,height&0xff,0x00,0x00// height
]));}static traf(track,baseMediaDecodeTime){const sampleDependencyTable=MP4.sdtp(track);const id=track.id;const upperWordBaseMediaDecodeTime=Math.floor(baseMediaDecodeTime/(UINT32_MAX+1));const lowerWordBaseMediaDecodeTime=Math.floor(baseMediaDecodeTime%(UINT32_MAX+1));return MP4.box(MP4.types.traf,MP4.box(MP4.types.tfhd,new Uint8Array([0x00,// version 0
0x00,0x00,0x00,// flags
id>>24,id>>16&0xff,id>>8&0xff,id&0xff// track_ID
])),MP4.box(MP4.types.tfdt,new Uint8Array([0x01,// version 1
0x00,0x00,0x00,// flags
upperWordBaseMediaDecodeTime>>24,upperWordBaseMediaDecodeTime>>16&0xff,upperWordBaseMediaDecodeTime>>8&0xff,upperWordBaseMediaDecodeTime&0xff,lowerWordBaseMediaDecodeTime>>24,lowerWordBaseMediaDecodeTime>>16&0xff,lowerWordBaseMediaDecodeTime>>8&0xff,lowerWordBaseMediaDecodeTime&0xff])),MP4.trun(track,sampleDependencyTable.length+16+// tfhd
20+// tfdt
8+// traf header
16+// mfhd
8+// moof header
8),// mdat header
sampleDependencyTable);}/**
   * Generate a track box.
   * @param track a track definition
   */static trak(track){track.duration=track.duration||0xffffffff;return MP4.box(MP4.types.trak,MP4.tkhd(track),MP4.mdia(track));}static trex(track){const id=track.id;return MP4.box(MP4.types.trex,new Uint8Array([0x00,// version 0
0x00,0x00,0x00,// flags
id>>24,id>>16&0xff,id>>8&0xff,id&0xff,// track_ID
0x00,0x00,0x00,0x01,// default_sample_description_index
0x00,0x00,0x00,0x00,// default_sample_duration
0x00,0x00,0x00,0x00,// default_sample_size
0x00,0x01,0x00,0x01// default_sample_flags
]));}static trun(track,offset){const samples=track.samples||[];const len=samples.length;const arraylen=12+16*len;const array=new Uint8Array(arraylen);let i;let sample;let duration;let size;let flags;let cts;offset+=8+arraylen;array.set([track.type==='video'?0x01:0x00,// version 1 for video with signed-int sample_composition_time_offset
0x00,0x0f,0x01,// flags
len>>>24&0xff,len>>>16&0xff,len>>>8&0xff,len&0xff,// sample_count
offset>>>24&0xff,offset>>>16&0xff,offset>>>8&0xff,offset&0xff// data_offset
],0);for(i=0;i<len;i++){sample=samples[i];duration=sample.duration;size=sample.size;flags=sample.flags;cts=sample.cts;array.set([duration>>>24&0xff,duration>>>16&0xff,duration>>>8&0xff,duration&0xff,// sample_duration
size>>>24&0xff,size>>>16&0xff,size>>>8&0xff,size&0xff,// sample_size
flags.isLeading<<2|flags.dependsOn,flags.isDependedOn<<6|flags.hasRedundancy<<4|flags.paddingValue<<1|flags.isNonSync,flags.degradPrio&0xf0<<8,flags.degradPrio&0x0f,// sample_flags
cts>>>24&0xff,cts>>>16&0xff,cts>>>8&0xff,cts&0xff// sample_composition_time_offset
],12+16*i);}return MP4.box(MP4.types.trun,array);}static initSegment(tracks){if(!MP4.types){MP4.init();}const movie=MP4.moov(tracks);const result=appendUint8Array(MP4.FTYP,movie);return result;}}MP4.types=void 0;MP4.HDLR_TYPES=void 0;MP4.STTS=void 0;MP4.STSC=void 0;MP4.STCO=void 0;MP4.STSZ=void 0;MP4.VMHD=void 0;MP4.SMHD=void 0;MP4.STSD=void 0;MP4.FTYP=void 0;MP4.DINF=void 0;const MPEG_TS_CLOCK_FREQ_HZ=90000;function toTimescaleFromBase(baseTime,destScale,srcBase=1,round=false){const result=baseTime*destScale*srcBase;// equivalent to `(value * scale) / (1 / base)`
return round?Math.round(result):result;}function toTimescaleFromScale(baseTime,destScale,srcScale=1,round=false){return toTimescaleFromBase(baseTime,destScale,1/srcScale,round);}function toMsFromMpegTsClock(baseTime,round=false){return toTimescaleFromBase(baseTime,1000,1/MPEG_TS_CLOCK_FREQ_HZ,round);}function toMpegTsClockFromTimescale(baseTime,srcScale=1){return toTimescaleFromBase(baseTime,MPEG_TS_CLOCK_FREQ_HZ,1/srcScale);}const MAX_SILENT_FRAME_DURATION=10*1000;// 10 seconds
const AAC_SAMPLES_PER_FRAME=1024;const MPEG_AUDIO_SAMPLE_PER_FRAME=1152;const AC3_SAMPLES_PER_FRAME=1536;let chromeVersion=null;let safariWebkitVersion=null;class MP4Remuxer{constructor(observer,config,typeSupported,vendor=''){this.observer=void 0;this.config=void 0;this.typeSupported=void 0;this.ISGenerated=false;this._initPTS=null;this._initDTS=null;this.nextAvcDts=null;this.nextAudioPts=null;this.videoSampleDuration=null;this.isAudioContiguous=false;this.isVideoContiguous=false;this.videoTrackConfig=void 0;this.observer=observer;this.config=config;this.typeSupported=typeSupported;this.ISGenerated=false;if(chromeVersion===null){const userAgent=navigator.userAgent||'';const result=userAgent.match(/Chrome\/(\d+)/i);chromeVersion=result?parseInt(result[1]):0;}if(safariWebkitVersion===null){const result=navigator.userAgent.match(/Safari\/(\d+)/i);safariWebkitVersion=result?parseInt(result[1]):0;}}destroy(){// @ts-ignore
this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null;}resetTimeStamp(defaultTimeStamp){logger.log('[mp4-remuxer]: initPTS & initDTS reset');this._initPTS=this._initDTS=defaultTimeStamp;}resetNextTimestamp(){logger.log('[mp4-remuxer]: reset next timestamp');this.isVideoContiguous=false;this.isAudioContiguous=false;}resetInitSegment(){logger.log('[mp4-remuxer]: ISGenerated flag reset');this.ISGenerated=false;this.videoTrackConfig=undefined;}getVideoStartPts(videoSamples){let rolloverDetected=false;const startPTS=videoSamples.reduce((minPTS,sample)=>{const delta=sample.pts-minPTS;if(delta<-4294967296){// 2^32, see PTSNormalize for reasoning, but we're hitting a rollover here, and we don't want that to impact the timeOffset calculation
rolloverDetected=true;return normalizePts(minPTS,sample.pts);}else if(delta>0){return minPTS;}else {return sample.pts;}},videoSamples[0].pts);if(rolloverDetected){logger.debug('PTS rollover detected');}return startPTS;}remux(audioTrack,videoTrack,id3Track,textTrack,timeOffset,accurateTimeOffset,flush,playlistType){let video;let audio;let initSegment;let text;let id3;let independent;let audioTimeOffset=timeOffset;let videoTimeOffset=timeOffset;// If we're remuxing audio and video progressively, wait until we've received enough samples for each track before proceeding.
// This is done to synchronize the audio and video streams. We know if the current segment will have samples if the "pid"
// parameter is greater than -1. The pid is set when the PMT is parsed, which contains the tracks list.
// However, if the initSegment has already been generated, or we've reached the end of a segment (flush),
// then we can remux one track without waiting for the other.
const hasAudio=audioTrack.pid>-1;const hasVideo=videoTrack.pid>-1;const length=videoTrack.samples.length;const enoughAudioSamples=audioTrack.samples.length>0;const enoughVideoSamples=flush&&length>0||length>1;const canRemuxAvc=(!hasAudio||enoughAudioSamples)&&(!hasVideo||enoughVideoSamples)||this.ISGenerated||flush;if(canRemuxAvc){if(this.ISGenerated){var _videoTrack$pixelRati,_config$pixelRatio,_videoTrack$pixelRati2,_config$pixelRatio2;const config=this.videoTrackConfig;if(config&&(videoTrack.width!==config.width||videoTrack.height!==config.height||((_videoTrack$pixelRati=videoTrack.pixelRatio)==null?void 0:_videoTrack$pixelRati[0])!==((_config$pixelRatio=config.pixelRatio)==null?void 0:_config$pixelRatio[0])||((_videoTrack$pixelRati2=videoTrack.pixelRatio)==null?void 0:_videoTrack$pixelRati2[1])!==((_config$pixelRatio2=config.pixelRatio)==null?void 0:_config$pixelRatio2[1]))){this.resetInitSegment();}}else {initSegment=this.generateIS(audioTrack,videoTrack,timeOffset,accurateTimeOffset);}const isVideoContiguous=this.isVideoContiguous;let firstKeyFrameIndex=-1;let firstKeyFramePTS;if(enoughVideoSamples){firstKeyFrameIndex=findKeyframeIndex(videoTrack.samples);if(!isVideoContiguous&&this.config.forceKeyFrameOnDiscontinuity){independent=true;if(firstKeyFrameIndex>0){logger.warn(`[mp4-remuxer]: Dropped ${firstKeyFrameIndex} out of ${length} video samples due to a missing keyframe`);const startPTS=this.getVideoStartPts(videoTrack.samples);videoTrack.samples=videoTrack.samples.slice(firstKeyFrameIndex);videoTrack.dropped+=firstKeyFrameIndex;videoTimeOffset+=(videoTrack.samples[0].pts-startPTS)/videoTrack.inputTimeScale;firstKeyFramePTS=videoTimeOffset;}else if(firstKeyFrameIndex===-1){logger.warn(`[mp4-remuxer]: No keyframe found out of ${length} video samples`);independent=false;}}}if(this.ISGenerated){if(enoughAudioSamples&&enoughVideoSamples){// timeOffset is expected to be the offset of the first timestamp of this fragment (first DTS)
// if first audio DTS is not aligned with first video DTS then we need to take that into account
// when providing timeOffset to remuxAudio / remuxVideo. if we don't do that, there might be a permanent / small
// drift between audio and video streams
const startPTS=this.getVideoStartPts(videoTrack.samples);const tsDelta=normalizePts(audioTrack.samples[0].pts,startPTS)-startPTS;const audiovideoTimestampDelta=tsDelta/videoTrack.inputTimeScale;audioTimeOffset+=Math.max(0,audiovideoTimestampDelta);videoTimeOffset+=Math.max(0,-audiovideoTimestampDelta);}// Purposefully remuxing audio before video, so that remuxVideo can use nextAudioPts, which is calculated in remuxAudio.
if(enoughAudioSamples){// if initSegment was generated without audio samples, regenerate it again
if(!audioTrack.samplerate){logger.warn('[mp4-remuxer]: regenerate InitSegment as audio detected');initSegment=this.generateIS(audioTrack,videoTrack,timeOffset,accurateTimeOffset);}audio=this.remuxAudio(audioTrack,audioTimeOffset,this.isAudioContiguous,accurateTimeOffset,hasVideo||enoughVideoSamples||playlistType===PlaylistLevelType.AUDIO?videoTimeOffset:undefined);if(enoughVideoSamples){const audioTrackLength=audio?audio.endPTS-audio.startPTS:0;// if initSegment was generated without video samples, regenerate it again
if(!videoTrack.inputTimeScale){logger.warn('[mp4-remuxer]: regenerate InitSegment as video detected');initSegment=this.generateIS(audioTrack,videoTrack,timeOffset,accurateTimeOffset);}video=this.remuxVideo(videoTrack,videoTimeOffset,isVideoContiguous,audioTrackLength);}}else if(enoughVideoSamples){video=this.remuxVideo(videoTrack,videoTimeOffset,isVideoContiguous,0);}if(video){video.firstKeyFrame=firstKeyFrameIndex;video.independent=firstKeyFrameIndex!==-1;video.firstKeyFramePTS=firstKeyFramePTS;}}}// Allow ID3 and text to remux, even if more audio/video samples are required
if(this.ISGenerated&&this._initPTS&&this._initDTS){if(id3Track.samples.length){id3=flushTextTrackMetadataCueSamples(id3Track,timeOffset,this._initPTS,this._initDTS);}if(textTrack.samples.length){text=flushTextTrackUserdataCueSamples(textTrack,timeOffset,this._initPTS);}}return {audio,video,initSegment,independent,text,id3};}generateIS(audioTrack,videoTrack,timeOffset,accurateTimeOffset){const audioSamples=audioTrack.samples;const videoSamples=videoTrack.samples;const typeSupported=this.typeSupported;const tracks={};const _initPTS=this._initPTS;let computePTSDTS=!_initPTS||accurateTimeOffset;let container='audio/mp4';let initPTS;let initDTS;let timescale;if(computePTSDTS){initPTS=initDTS=Infinity;}if(audioTrack.config&&audioSamples.length){// let's use audio sampling rate as MP4 time scale.
// rationale is that there is a integer nb of audio frames per audio sample (1024 for AAC)
// using audio sampling rate here helps having an integer MP4 frame duration
// this avoids potential rounding issue and AV sync issue
audioTrack.timescale=audioTrack.samplerate;switch(audioTrack.segmentCodec){case'mp3':if(typeSupported.mpeg){// Chrome and Safari
container='audio/mpeg';audioTrack.codec='';}else if(typeSupported.mp3){// Firefox
audioTrack.codec='mp3';}break;case'ac3':audioTrack.codec='ac-3';break;}tracks.audio={id:'audio',container:container,codec:audioTrack.codec,initSegment:audioTrack.segmentCodec==='mp3'&&typeSupported.mpeg?new Uint8Array(0):MP4.initSegment([audioTrack]),metadata:{channelCount:audioTrack.channelCount}};if(computePTSDTS){timescale=audioTrack.inputTimeScale;if(!_initPTS||timescale!==_initPTS.timescale){// remember first PTS of this demuxing context. for audio, PTS = DTS
initPTS=initDTS=audioSamples[0].pts-Math.round(timescale*timeOffset);}else {computePTSDTS=false;}}}if(videoTrack.sps&&videoTrack.pps&&videoSamples.length){// let's use input time scale as MP4 video timescale
// we use input time scale straight away to avoid rounding issues on frame duration / cts computation
videoTrack.timescale=videoTrack.inputTimeScale;tracks.video={id:'main',container:'video/mp4',codec:videoTrack.codec,initSegment:MP4.initSegment([videoTrack]),metadata:{width:videoTrack.width,height:videoTrack.height}};if(computePTSDTS){timescale=videoTrack.inputTimeScale;if(!_initPTS||timescale!==_initPTS.timescale){const startPTS=this.getVideoStartPts(videoSamples);const startOffset=Math.round(timescale*timeOffset);initDTS=Math.min(initDTS,normalizePts(videoSamples[0].dts,startPTS)-startOffset);initPTS=Math.min(initPTS,startPTS-startOffset);}else {computePTSDTS=false;}}this.videoTrackConfig={width:videoTrack.width,height:videoTrack.height,pixelRatio:videoTrack.pixelRatio};}if(Object.keys(tracks).length){this.ISGenerated=true;if(computePTSDTS){this._initPTS={baseTime:initPTS,timescale:timescale};this._initDTS={baseTime:initDTS,timescale:timescale};}else {initPTS=timescale=undefined;}return {tracks,initPTS,timescale};}}remuxVideo(track,timeOffset,contiguous,audioTrackLength){const timeScale=track.inputTimeScale;const inputSamples=track.samples;const outputSamples=[];const nbSamples=inputSamples.length;const initPTS=this._initPTS;let nextAvcDts=this.nextAvcDts;let offset=8;let mp4SampleDuration=this.videoSampleDuration;let firstDTS;let lastDTS;let minPTS=Number.POSITIVE_INFINITY;let maxPTS=Number.NEGATIVE_INFINITY;let sortSamples=false;// if parsed fragment is contiguous with last one, let's use last DTS value as reference
if(!contiguous||nextAvcDts===null){const pts=timeOffset*timeScale;const cts=inputSamples[0].pts-normalizePts(inputSamples[0].dts,inputSamples[0].pts);if(chromeVersion&&nextAvcDts!==null&&Math.abs(pts-cts-nextAvcDts)<15000){// treat as contigous to adjust samples that would otherwise produce video buffer gaps in Chrome
contiguous=true;}else {// if not contiguous, let's use target timeOffset
nextAvcDts=pts-cts;}}// PTS is coded on 33bits, and can loop from -2^32 to 2^32
// PTSNormalize will make PTS/DTS value monotonic, we use last known DTS value as reference value
const initTime=initPTS.baseTime*timeScale/initPTS.timescale;for(let i=0;i<nbSamples;i++){const sample=inputSamples[i];sample.pts=normalizePts(sample.pts-initTime,nextAvcDts);sample.dts=normalizePts(sample.dts-initTime,nextAvcDts);if(sample.dts<inputSamples[i>0?i-1:i].dts){sortSamples=true;}}// sort video samples by DTS then PTS then demux id order
if(sortSamples){inputSamples.sort(function(a,b){const deltadts=a.dts-b.dts;const deltapts=a.pts-b.pts;return deltadts||deltapts;});}// Get first/last DTS
firstDTS=inputSamples[0].dts;lastDTS=inputSamples[inputSamples.length-1].dts;// Sample duration (as expected by trun MP4 boxes), should be the delta between sample DTS
// set this constant duration as being the avg delta between consecutive DTS.
const inputDuration=lastDTS-firstDTS;const averageSampleDuration=inputDuration?Math.round(inputDuration/(nbSamples-1)):mp4SampleDuration||track.inputTimeScale/30;// if fragment are contiguous, detect hole/overlapping between fragments
if(contiguous){// check timestamp continuity across consecutive fragments (this is to remove inter-fragment gap/hole)
const delta=firstDTS-nextAvcDts;const foundHole=delta>averageSampleDuration;const foundOverlap=delta<-1;if(foundHole||foundOverlap){if(foundHole){logger.warn(`AVC: ${toMsFromMpegTsClock(delta,true)} ms (${delta}dts) hole between fragments detected at ${timeOffset.toFixed(3)}`);}else {logger.warn(`AVC: ${toMsFromMpegTsClock(-delta,true)} ms (${delta}dts) overlapping between fragments detected at ${timeOffset.toFixed(3)}`);}if(!foundOverlap||nextAvcDts>=inputSamples[0].pts||chromeVersion){firstDTS=nextAvcDts;const firstPTS=inputSamples[0].pts-delta;if(foundHole){inputSamples[0].dts=firstDTS;inputSamples[0].pts=firstPTS;}else {for(let i=0;i<inputSamples.length;i++){if(inputSamples[i].dts>firstPTS){break;}inputSamples[i].dts-=delta;inputSamples[i].pts-=delta;}}logger.log(`Video: Initial PTS/DTS adjusted: ${toMsFromMpegTsClock(firstPTS,true)}/${toMsFromMpegTsClock(firstDTS,true)}, delta: ${toMsFromMpegTsClock(delta,true)} ms`);}}}firstDTS=Math.max(0,firstDTS);let nbNalu=0;let naluLen=0;let dtsStep=firstDTS;for(let i=0;i<nbSamples;i++){// compute total/avc sample length and nb of NAL units
const sample=inputSamples[i];const units=sample.units;const nbUnits=units.length;let sampleLen=0;for(let j=0;j<nbUnits;j++){sampleLen+=units[j].data.length;}naluLen+=sampleLen;nbNalu+=nbUnits;sample.length=sampleLen;// ensure sample monotonic DTS
if(sample.dts<dtsStep){sample.dts=dtsStep;dtsStep+=averageSampleDuration/4|0||1;}else {dtsStep=sample.dts;}minPTS=Math.min(sample.pts,minPTS);maxPTS=Math.max(sample.pts,maxPTS);}lastDTS=inputSamples[nbSamples-1].dts;/* concatenate the video data and construct the mdat in place
      (need 8 more bytes to fill length and mpdat type) */const mdatSize=naluLen+4*nbNalu+8;let mdat;try{mdat=new Uint8Array(mdatSize);}catch(err){this.observer.emit(Events$1.ERROR,Events$1.ERROR,{type:ErrorTypes.MUX_ERROR,details:ErrorDetails.REMUX_ALLOC_ERROR,fatal:false,error:err,bytes:mdatSize,reason:`fail allocating video mdat ${mdatSize}`});return;}const view=new DataView(mdat.buffer);view.setUint32(0,mdatSize);mdat.set(MP4.types.mdat,4);let stretchedLastFrame=false;let minDtsDelta=Number.POSITIVE_INFINITY;let minPtsDelta=Number.POSITIVE_INFINITY;let maxDtsDelta=Number.NEGATIVE_INFINITY;let maxPtsDelta=Number.NEGATIVE_INFINITY;for(let i=0;i<nbSamples;i++){const VideoSample=inputSamples[i];const VideoSampleUnits=VideoSample.units;let mp4SampleLength=0;// convert NALU bitstream to MP4 format (prepend NALU with size field)
for(let j=0,nbUnits=VideoSampleUnits.length;j<nbUnits;j++){const unit=VideoSampleUnits[j];const unitData=unit.data;const unitDataLen=unit.data.byteLength;view.setUint32(offset,unitDataLen);offset+=4;mdat.set(unitData,offset);offset+=unitDataLen;mp4SampleLength+=4+unitDataLen;}// expected sample duration is the Decoding Timestamp diff of consecutive samples
let ptsDelta;if(i<nbSamples-1){mp4SampleDuration=inputSamples[i+1].dts-VideoSample.dts;ptsDelta=inputSamples[i+1].pts-VideoSample.pts;}else {const config=this.config;const lastFrameDuration=i>0?VideoSample.dts-inputSamples[i-1].dts:averageSampleDuration;ptsDelta=i>0?VideoSample.pts-inputSamples[i-1].pts:averageSampleDuration;if(config.stretchShortVideoTrack&&this.nextAudioPts!==null){// In some cases, a segment's audio track duration may exceed the video track duration.
// Since we've already remuxed audio, and we know how long the audio track is, we look to
// see if the delta to the next segment is longer than maxBufferHole.
// If so, playback would potentially get stuck, so we artificially inflate
// the duration of the last frame to minimize any potential gap between segments.
const gapTolerance=Math.floor(config.maxBufferHole*timeScale);const deltaToFrameEnd=(audioTrackLength?minPTS+audioTrackLength*timeScale:this.nextAudioPts)-VideoSample.pts;if(deltaToFrameEnd>gapTolerance){// We subtract lastFrameDuration from deltaToFrameEnd to try to prevent any video
// frame overlap. maxBufferHole should be >> lastFrameDuration anyway.
mp4SampleDuration=deltaToFrameEnd-lastFrameDuration;if(mp4SampleDuration<0){mp4SampleDuration=lastFrameDuration;}else {stretchedLastFrame=true;}logger.log(`[mp4-remuxer]: It is approximately ${deltaToFrameEnd/90} ms to the next segment; using duration ${mp4SampleDuration/90} ms for the last video frame.`);}else {mp4SampleDuration=lastFrameDuration;}}else {mp4SampleDuration=lastFrameDuration;}}const compositionTimeOffset=Math.round(VideoSample.pts-VideoSample.dts);minDtsDelta=Math.min(minDtsDelta,mp4SampleDuration);maxDtsDelta=Math.max(maxDtsDelta,mp4SampleDuration);minPtsDelta=Math.min(minPtsDelta,ptsDelta);maxPtsDelta=Math.max(maxPtsDelta,ptsDelta);outputSamples.push(new Mp4Sample(VideoSample.key,mp4SampleDuration,mp4SampleLength,compositionTimeOffset));}if(outputSamples.length){if(chromeVersion){if(chromeVersion<70){// Chrome workaround, mark first sample as being a Random Access Point (keyframe) to avoid sourcebuffer append issue
// https://code.google.com/p/chromium/issues/detail?id=229412
const flags=outputSamples[0].flags;flags.dependsOn=2;flags.isNonSync=0;}}else if(safariWebkitVersion){// Fix for "CNN special report, with CC" in test-streams (Safari browser only)
// Ignore DTS when frame durations are irregular. Safari MSE does not handle this leading to gaps.
if(maxPtsDelta-minPtsDelta<maxDtsDelta-minDtsDelta&&averageSampleDuration/maxDtsDelta<0.025&&outputSamples[0].cts===0){logger.warn('Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.');let dts=firstDTS;for(let i=0,len=outputSamples.length;i<len;i++){const nextDts=dts+outputSamples[i].duration;const pts=dts+outputSamples[i].cts;if(i<len-1){const nextPts=nextDts+outputSamples[i+1].cts;outputSamples[i].duration=nextPts-pts;}else {outputSamples[i].duration=i?outputSamples[i-1].duration:averageSampleDuration;}outputSamples[i].cts=0;dts=nextDts;}}}}// next AVC sample DTS should be equal to last sample DTS + last sample duration (in PES timescale)
mp4SampleDuration=stretchedLastFrame||!mp4SampleDuration?averageSampleDuration:mp4SampleDuration;this.nextAvcDts=nextAvcDts=lastDTS+mp4SampleDuration;this.videoSampleDuration=mp4SampleDuration;this.isVideoContiguous=true;const moof=MP4.moof(track.sequenceNumber++,firstDTS,_extends({},track,{samples:outputSamples}));const type='video';const data={data1:moof,data2:mdat,startPTS:minPTS/timeScale,endPTS:(maxPTS+mp4SampleDuration)/timeScale,startDTS:firstDTS/timeScale,endDTS:nextAvcDts/timeScale,type,hasAudio:false,hasVideo:true,nb:outputSamples.length,dropped:track.dropped};track.samples=[];track.dropped=0;return data;}getSamplesPerFrame(track){switch(track.segmentCodec){case'mp3':return MPEG_AUDIO_SAMPLE_PER_FRAME;case'ac3':return AC3_SAMPLES_PER_FRAME;default:return AAC_SAMPLES_PER_FRAME;}}remuxAudio(track,timeOffset,contiguous,accurateTimeOffset,videoTimeOffset){const inputTimeScale=track.inputTimeScale;const mp4timeScale=track.samplerate?track.samplerate:inputTimeScale;const scaleFactor=inputTimeScale/mp4timeScale;const mp4SampleDuration=this.getSamplesPerFrame(track);const inputSampleDuration=mp4SampleDuration*scaleFactor;const initPTS=this._initPTS;const rawMPEG=track.segmentCodec==='mp3'&&this.typeSupported.mpeg;const outputSamples=[];const alignedWithVideo=videoTimeOffset!==undefined;let inputSamples=track.samples;let offset=rawMPEG?0:8;let nextAudioPts=this.nextAudioPts||-1;// window.audioSamples ? window.audioSamples.push(inputSamples.map(s => s.pts)) : (window.audioSamples = [inputSamples.map(s => s.pts)]);
// for audio samples, also consider consecutive fragments as being contiguous (even if a level switch occurs),
// for sake of clarity:
// consecutive fragments are frags with
//  - less than 100ms gaps between new time offset (if accurate) and next expected PTS OR
//  - less than 20 audio frames distance
// contiguous fragments are consecutive fragments from same quality level (same level, new SN = old SN + 1)
// this helps ensuring audio continuity
// and this also avoids audio glitches/cut when switching quality, or reporting wrong duration on first audio frame
const timeOffsetMpegTS=timeOffset*inputTimeScale;const initTime=initPTS.baseTime*inputTimeScale/initPTS.timescale;this.isAudioContiguous=contiguous=contiguous||inputSamples.length&&nextAudioPts>0&&(accurateTimeOffset&&Math.abs(timeOffsetMpegTS-nextAudioPts)<9000||Math.abs(normalizePts(inputSamples[0].pts-initTime,timeOffsetMpegTS)-nextAudioPts)<20*inputSampleDuration);// compute normalized PTS
inputSamples.forEach(function(sample){sample.pts=normalizePts(sample.pts-initTime,timeOffsetMpegTS);});if(!contiguous||nextAudioPts<0){// filter out sample with negative PTS that are not playable anyway
// if we don't remove these negative samples, they will shift all audio samples forward.
// leading to audio overlap between current / next fragment
inputSamples=inputSamples.filter(sample=>sample.pts>=0);// in case all samples have negative PTS, and have been filtered out, return now
if(!inputSamples.length){return;}if(videoTimeOffset===0){// Set the start to 0 to match video so that start gaps larger than inputSampleDuration are filled with silence
nextAudioPts=0;}else if(accurateTimeOffset&&!alignedWithVideo){// When not seeking, not live, and LevelDetails.PTSKnown, use fragment start as predicted next audio PTS
nextAudioPts=Math.max(0,timeOffsetMpegTS);}else {// if frags are not contiguous and if we cant trust time offset, let's use first sample PTS as next audio PTS
nextAudioPts=inputSamples[0].pts;}}// If the audio track is missing samples, the frames seem to get "left-shifted" within the
// resulting mp4 segment, causing sync issues and leaving gaps at the end of the audio segment.
// In an effort to prevent this from happening, we inject frames here where there are gaps.
// When possible, we inject a silent frame; when that's not possible, we duplicate the last
// frame.
if(track.segmentCodec==='aac'){const maxAudioFramesDrift=this.config.maxAudioFramesDrift;for(let i=0,nextPts=nextAudioPts;i<inputSamples.length;i++){// First, let's see how far off this frame is from where we expect it to be
const sample=inputSamples[i];const pts=sample.pts;const delta=pts-nextPts;const duration=Math.abs(1000*delta/inputTimeScale);// When remuxing with video, if we're overlapping by more than a duration, drop this sample to stay in sync
if(delta<=-maxAudioFramesDrift*inputSampleDuration&&alignedWithVideo){if(i===0){logger.warn(`Audio frame @ ${(pts/inputTimeScale).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1000*delta/inputTimeScale)} ms.`);this.nextAudioPts=nextAudioPts=nextPts=pts;}}// eslint-disable-line brace-style
// Insert missing frames if:
// 1: We're more than maxAudioFramesDrift frame away
// 2: Not more than MAX_SILENT_FRAME_DURATION away
// 3: currentTime (aka nextPtsNorm) is not 0
// 4: remuxing with video (videoTimeOffset !== undefined)
else if(delta>=maxAudioFramesDrift*inputSampleDuration&&duration<MAX_SILENT_FRAME_DURATION&&alignedWithVideo){let missing=Math.round(delta/inputSampleDuration);// Adjust nextPts so that silent samples are aligned with media pts. This will prevent media samples from
// later being shifted if nextPts is based on timeOffset and delta is not a multiple of inputSampleDuration.
nextPts=pts-missing*inputSampleDuration;if(nextPts<0){missing--;nextPts+=inputSampleDuration;}if(i===0){this.nextAudioPts=nextAudioPts=nextPts;}logger.warn(`[mp4-remuxer]: Injecting ${missing} audio frame @ ${(nextPts/inputTimeScale).toFixed(3)}s due to ${Math.round(1000*delta/inputTimeScale)} ms gap.`);for(let j=0;j<missing;j++){const newStamp=Math.max(nextPts,0);let fillFrame=AAC.getSilentFrame(track.manifestCodec||track.codec,track.channelCount);if(!fillFrame){logger.log('[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead.');fillFrame=sample.unit.subarray();}inputSamples.splice(i,0,{unit:fillFrame,pts:newStamp});nextPts+=inputSampleDuration;i++;}}sample.pts=nextPts;nextPts+=inputSampleDuration;}}let firstPTS=null;let lastPTS=null;let mdat;let mdatSize=0;let sampleLength=inputSamples.length;while(sampleLength--){mdatSize+=inputSamples[sampleLength].unit.byteLength;}for(let j=0,_nbSamples=inputSamples.length;j<_nbSamples;j++){const audioSample=inputSamples[j];const unit=audioSample.unit;let pts=audioSample.pts;if(lastPTS!==null){// If we have more than one sample, set the duration of the sample to the "real" duration; the PTS diff with
// the previous sample
const prevSample=outputSamples[j-1];prevSample.duration=Math.round((pts-lastPTS)/scaleFactor);}else {if(contiguous&&track.segmentCodec==='aac'){// set PTS/DTS to expected PTS/DTS
pts=nextAudioPts;}// remember first PTS of our audioSamples
firstPTS=pts;if(mdatSize>0){/* concatenate the audio data and construct the mdat in place
            (need 8 more bytes to fill length and mdat type) */mdatSize+=offset;try{mdat=new Uint8Array(mdatSize);}catch(err){this.observer.emit(Events$1.ERROR,Events$1.ERROR,{type:ErrorTypes.MUX_ERROR,details:ErrorDetails.REMUX_ALLOC_ERROR,fatal:false,error:err,bytes:mdatSize,reason:`fail allocating audio mdat ${mdatSize}`});return;}if(!rawMPEG){const view=new DataView(mdat.buffer);view.setUint32(0,mdatSize);mdat.set(MP4.types.mdat,4);}}else {// no audio samples
return;}}mdat.set(unit,offset);const unitLen=unit.byteLength;offset+=unitLen;// Default the sample's duration to the computed mp4SampleDuration, which will either be 1024 for AAC or 1152 for MPEG
// In the case that we have 1 sample, this will be the duration. If we have more than one sample, the duration
// becomes the PTS diff with the previous sample
outputSamples.push(new Mp4Sample(true,mp4SampleDuration,unitLen,0));lastPTS=pts;}// We could end up with no audio samples if all input samples were overlapping with the previously remuxed ones
const nbSamples=outputSamples.length;if(!nbSamples){return;}// The next audio sample PTS should be equal to last sample PTS + duration
const lastSample=outputSamples[outputSamples.length-1];this.nextAudioPts=nextAudioPts=lastPTS+scaleFactor*lastSample.duration;// Set the track samples from inputSamples to outputSamples before remuxing
const moof=rawMPEG?new Uint8Array(0):MP4.moof(track.sequenceNumber++,firstPTS/scaleFactor,_extends({},track,{samples:outputSamples}));// Clear the track samples. This also clears the samples array in the demuxer, since the reference is shared
track.samples=[];const start=firstPTS/inputTimeScale;const end=nextAudioPts/inputTimeScale;const type='audio';const audioData={data1:moof,data2:mdat,startPTS:start,endPTS:end,startDTS:start,endDTS:end,type,hasAudio:true,hasVideo:false,nb:nbSamples};this.isAudioContiguous=true;return audioData;}remuxEmptyAudio(track,timeOffset,contiguous,videoData){const inputTimeScale=track.inputTimeScale;const mp4timeScale=track.samplerate?track.samplerate:inputTimeScale;const scaleFactor=inputTimeScale/mp4timeScale;const nextAudioPts=this.nextAudioPts;// sync with video's timestamp
const initDTS=this._initDTS;const init90kHz=initDTS.baseTime*90000/initDTS.timescale;const startDTS=(nextAudioPts!==null?nextAudioPts:videoData.startDTS*inputTimeScale)+init90kHz;const endDTS=videoData.endDTS*inputTimeScale+init90kHz;// one sample's duration value
const frameDuration=scaleFactor*AAC_SAMPLES_PER_FRAME;// samples count of this segment's duration
const nbSamples=Math.ceil((endDTS-startDTS)/frameDuration);// silent frame
const silentFrame=AAC.getSilentFrame(track.manifestCodec||track.codec,track.channelCount);logger.warn('[mp4-remuxer]: remux empty Audio');// Can't remux if we can't generate a silent frame...
if(!silentFrame){logger.trace('[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec');return;}const samples=[];for(let i=0;i<nbSamples;i++){const stamp=startDTS+i*frameDuration;samples.push({unit:silentFrame,pts:stamp,dts:stamp});}track.samples=samples;return this.remuxAudio(track,timeOffset,contiguous,false);}}function normalizePts(value,reference){let offset;if(reference===null){return value;}if(reference<value){// - 2^33
offset=-8589934592;}else {// + 2^33
offset=8589934592;}/* PTS is 33bit (from 0 to 2^33 -1)
    if diff between value and reference is bigger than half of the amplitude (2^32) then it means that
    PTS looping occured. fill the gap */while(Math.abs(value-reference)>4294967296){value+=offset;}return value;}function findKeyframeIndex(samples){for(let i=0;i<samples.length;i++){if(samples[i].key){return i;}}return -1;}function flushTextTrackMetadataCueSamples(track,timeOffset,initPTS,initDTS){const length=track.samples.length;if(!length){return;}const inputTimeScale=track.inputTimeScale;for(let index=0;index<length;index++){const sample=track.samples[index];// setting id3 pts, dts to relative time
// using this._initPTS and this._initDTS to calculate relative time
sample.pts=normalizePts(sample.pts-initPTS.baseTime*inputTimeScale/initPTS.timescale,timeOffset*inputTimeScale)/inputTimeScale;sample.dts=normalizePts(sample.dts-initDTS.baseTime*inputTimeScale/initDTS.timescale,timeOffset*inputTimeScale)/inputTimeScale;}const samples=track.samples;track.samples=[];return {samples};}function flushTextTrackUserdataCueSamples(track,timeOffset,initPTS){const length=track.samples.length;if(!length){return;}const inputTimeScale=track.inputTimeScale;for(let index=0;index<length;index++){const sample=track.samples[index];// setting text pts, dts to relative time
// using this._initPTS and this._initDTS to calculate relative time
sample.pts=normalizePts(sample.pts-initPTS.baseTime*inputTimeScale/initPTS.timescale,timeOffset*inputTimeScale)/inputTimeScale;}track.samples.sort((a,b)=>a.pts-b.pts);const samples=track.samples;track.samples=[];return {samples};}class Mp4Sample{constructor(isKeyframe,duration,size,cts){this.size=void 0;this.duration=void 0;this.cts=void 0;this.flags=void 0;this.duration=duration;this.size=size;this.cts=cts;this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:isKeyframe?2:1,isNonSync:isKeyframe?0:1};}}class PassThroughRemuxer{constructor(){this.emitInitSegment=false;this.audioCodec=void 0;this.videoCodec=void 0;this.initData=void 0;this.initPTS=null;this.initTracks=void 0;this.lastEndTime=null;}destroy(){}resetTimeStamp(defaultInitPTS){this.initPTS=defaultInitPTS;this.lastEndTime=null;}resetNextTimestamp(){this.lastEndTime=null;}resetInitSegment(initSegment,audioCodec,videoCodec,decryptdata){this.audioCodec=audioCodec;this.videoCodec=videoCodec;this.generateInitSegment(patchEncyptionData(initSegment,decryptdata));this.emitInitSegment=true;}generateInitSegment(initSegment){let{audioCodec,videoCodec}=this;if(!(initSegment!=null&&initSegment.byteLength)){this.initTracks=undefined;this.initData=undefined;return;}const initData=this.initData=parseInitSegment(initSegment);// Get codec from initSegment or fallback to default
if(initData.audio){audioCodec=getParsedTrackCodec(initData.audio,ElementaryStreamTypes.AUDIO);}if(initData.video){videoCodec=getParsedTrackCodec(initData.video,ElementaryStreamTypes.VIDEO);}const tracks={};if(initData.audio&&initData.video){tracks.audiovideo={container:'video/mp4',codec:audioCodec+','+videoCodec,initSegment,id:'main'};}else if(initData.audio){tracks.audio={container:'audio/mp4',codec:audioCodec,initSegment,id:'audio'};}else if(initData.video){tracks.video={container:'video/mp4',codec:videoCodec,initSegment,id:'main'};}else {logger.warn('[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes.');}this.initTracks=tracks;}remux(audioTrack,videoTrack,id3Track,textTrack,timeOffset,accurateTimeOffset){var _initData,_initData2;let{initPTS,lastEndTime}=this;const result={audio:undefined,video:undefined,text:textTrack,id3:id3Track,initSegment:undefined};// If we haven't yet set a lastEndDTS, or it was reset, set it to the provided timeOffset. We want to use the
// lastEndDTS over timeOffset whenever possible; during progressive playback, the media source will not update
// the media duration (which is what timeOffset is provided as) before we need to process the next chunk.
if(!isFiniteNumber(lastEndTime)){lastEndTime=this.lastEndTime=timeOffset||0;}// The binary segment data is added to the videoTrack in the mp4demuxer. We don't check to see if the data is only
// audio or video (or both); adding it to video was an arbitrary choice.
const data=videoTrack.samples;if(!(data!=null&&data.length)){return result;}const initSegment={initPTS:undefined,timescale:1};let initData=this.initData;if(!((_initData=initData)!=null&&_initData.length)){this.generateInitSegment(data);initData=this.initData;}if(!((_initData2=initData)!=null&&_initData2.length)){// We can't remux if the initSegment could not be generated
logger.warn('[passthrough-remuxer.ts]: Failed to generate initSegment.');return result;}if(this.emitInitSegment){initSegment.tracks=this.initTracks;this.emitInitSegment=false;}const duration=getDuration(data,initData);const startDTS=getStartDTS(initData,data);const decodeTime=startDTS===null?timeOffset:startDTS;if(isInvalidInitPts(initPTS,decodeTime,timeOffset,duration)||initSegment.timescale!==initPTS.timescale&&accurateTimeOffset){initSegment.initPTS=decodeTime-timeOffset;if(initPTS&&initPTS.timescale===1){logger.warn(`Adjusting initPTS by ${initSegment.initPTS-initPTS.baseTime}`);}this.initPTS=initPTS={baseTime:initSegment.initPTS,timescale:1};}const startTime=audioTrack?decodeTime-initPTS.baseTime/initPTS.timescale:lastEndTime;const endTime=startTime+duration;offsetStartDTS(initData,data,initPTS.baseTime/initPTS.timescale);if(duration>0){this.lastEndTime=endTime;}else {logger.warn('Duration parsed from mp4 should be greater than zero');this.resetNextTimestamp();}const hasAudio=!!initData.audio;const hasVideo=!!initData.video;let type='';if(hasAudio){type+='audio';}if(hasVideo){type+='video';}const track={data1:data,startPTS:startTime,startDTS:startTime,endPTS:endTime,endDTS:endTime,type,hasAudio,hasVideo,nb:1,dropped:0};result.audio=track.type==='audio'?track:undefined;result.video=track.type!=='audio'?track:undefined;result.initSegment=initSegment;result.id3=flushTextTrackMetadataCueSamples(id3Track,timeOffset,initPTS,initPTS);if(textTrack.samples.length){result.text=flushTextTrackUserdataCueSamples(textTrack,timeOffset,initPTS);}return result;}}function isInvalidInitPts(initPTS,startDTS,timeOffset,duration){if(initPTS===null){return true;}// InitPTS is invalid when distance from program would be more than segment duration or a minimum of one second
const minDuration=Math.max(duration,1);const startTime=startDTS-initPTS.baseTime/initPTS.timescale;return Math.abs(startTime-timeOffset)>minDuration;}function getParsedTrackCodec(track,type){const parsedCodec=track==null?void 0:track.codec;if(parsedCodec&&parsedCodec.length>4){return parsedCodec;}if(type===ElementaryStreamTypes.AUDIO){if(parsedCodec==='ec-3'||parsedCodec==='ac-3'||parsedCodec==='alac'){return parsedCodec;}if(parsedCodec==='fLaC'||parsedCodec==='Opus'){// Opting not to get `preferManagedMediaSource` from player config for isSupported() check for simplicity
const preferManagedMediaSource=false;return getCodecCompatibleName(parsedCodec,preferManagedMediaSource);}const result='mp4a.40.5';logger.info(`Parsed audio codec "${parsedCodec}" or audio object type not handled. Using "${result}"`);return result;}// Provide defaults based on codec type
// This allows for some playback of some fmp4 playlists without CODECS defined in manifest
logger.warn(`Unhandled video codec "${parsedCodec}"`);if(parsedCodec==='hvc1'||parsedCodec==='hev1'){return 'hvc1.1.6.L120.90';}if(parsedCodec==='av01'){return 'av01.0.04M.08';}return 'avc1.42e01e';}let now;// performance.now() not available on WebWorker, at least on Safari Desktop
try{now=self.performance.now.bind(self.performance);}catch(err){logger.debug('Unable to use Performance API on this environment');now=optionalSelf==null?void 0:optionalSelf.Date.now;}const muxConfig=[{demux:MP4Demuxer,remux:PassThroughRemuxer},{demux:TSDemuxer,remux:MP4Remuxer},{demux:AACDemuxer,remux:MP4Remuxer},{demux:MP3Demuxer,remux:MP4Remuxer}];{muxConfig.splice(2,0,{demux:AC3Demuxer,remux:MP4Remuxer});}class Transmuxer{constructor(observer,typeSupported,config,vendor,id){this.async=false;this.observer=void 0;this.typeSupported=void 0;this.config=void 0;this.vendor=void 0;this.id=void 0;this.demuxer=void 0;this.remuxer=void 0;this.decrypter=void 0;this.probe=void 0;this.decryptionPromise=null;this.transmuxConfig=void 0;this.currentTransmuxState=void 0;this.observer=observer;this.typeSupported=typeSupported;this.config=config;this.vendor=vendor;this.id=id;}configure(transmuxConfig){this.transmuxConfig=transmuxConfig;if(this.decrypter){this.decrypter.reset();}}push(data,decryptdata,chunkMeta,state){const stats=chunkMeta.transmuxing;stats.executeStart=now();let uintData=new Uint8Array(data);const{currentTransmuxState,transmuxConfig}=this;if(state){this.currentTransmuxState=state;}const{contiguous,discontinuity,trackSwitch,accurateTimeOffset,timeOffset,initSegmentChange}=state||currentTransmuxState;const{audioCodec,videoCodec,defaultInitPts,duration,initSegmentData}=transmuxConfig;const keyData=getEncryptionType(uintData,decryptdata);if(keyData&&keyData.method==='AES-128'){const decrypter=this.getDecrypter();// Software decryption is synchronous; webCrypto is not
if(decrypter.isSync()){// Software decryption is progressive. Progressive decryption may not return a result on each call. Any cached
// data is handled in the flush() call
let decryptedData=decrypter.softwareDecrypt(uintData,keyData.key.buffer,keyData.iv.buffer);// For Low-Latency HLS Parts, decrypt in place, since part parsing is expected on push progress
const loadingParts=chunkMeta.part>-1;if(loadingParts){decryptedData=decrypter.flush();}if(!decryptedData){stats.executeEnd=now();return emptyResult(chunkMeta);}uintData=new Uint8Array(decryptedData);}else {this.decryptionPromise=decrypter.webCryptoDecrypt(uintData,keyData.key.buffer,keyData.iv.buffer).then(decryptedData=>{// Calling push here is important; if flush() is called while this is still resolving, this ensures that
// the decrypted data has been transmuxed
const result=this.push(decryptedData,null,chunkMeta);this.decryptionPromise=null;return result;});return this.decryptionPromise;}}const resetMuxers=this.needsProbing(discontinuity,trackSwitch);if(resetMuxers){const error=this.configureTransmuxer(uintData);if(error){logger.warn(`[transmuxer] ${error.message}`);this.observer.emit(Events$1.ERROR,Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_PARSING_ERROR,fatal:false,error,reason:error.message});stats.executeEnd=now();return emptyResult(chunkMeta);}}if(discontinuity||trackSwitch||initSegmentChange||resetMuxers){this.resetInitSegment(initSegmentData,audioCodec,videoCodec,duration,decryptdata);}if(discontinuity||initSegmentChange||resetMuxers){this.resetInitialTimestamp(defaultInitPts);}if(!contiguous){this.resetContiguity();}const result=this.transmux(uintData,keyData,timeOffset,accurateTimeOffset,chunkMeta);const currentState=this.currentTransmuxState;currentState.contiguous=true;currentState.discontinuity=false;currentState.trackSwitch=false;stats.executeEnd=now();return result;}// Due to data caching, flush calls can produce more than one TransmuxerResult (hence the Array type)
flush(chunkMeta){const stats=chunkMeta.transmuxing;stats.executeStart=now();const{decrypter,currentTransmuxState,decryptionPromise}=this;if(decryptionPromise){// Upon resolution, the decryption promise calls push() and returns its TransmuxerResult up the stack. Therefore
// only flushing is required for async decryption
return decryptionPromise.then(()=>{return this.flush(chunkMeta);});}const transmuxResults=[];const{timeOffset}=currentTransmuxState;if(decrypter){// The decrypter may have data cached, which needs to be demuxed. In this case we'll have two TransmuxResults
// This happens in the case that we receive only 1 push call for a segment (either for non-progressive downloads,
// or for progressive downloads with small segments)
const decryptedData=decrypter.flush();if(decryptedData){// Push always returns a TransmuxerResult if decryptdata is null
transmuxResults.push(this.push(decryptedData,null,chunkMeta));}}const{demuxer,remuxer}=this;if(!demuxer||!remuxer){// If probing failed, then Hls.js has been given content its not able to handle
stats.executeEnd=now();return [emptyResult(chunkMeta)];}const demuxResultOrPromise=demuxer.flush(timeOffset);if(isPromise$1(demuxResultOrPromise)){// Decrypt final SAMPLE-AES samples
return demuxResultOrPromise.then(demuxResult=>{this.flushRemux(transmuxResults,demuxResult,chunkMeta);return transmuxResults;});}this.flushRemux(transmuxResults,demuxResultOrPromise,chunkMeta);return transmuxResults;}flushRemux(transmuxResults,demuxResult,chunkMeta){const{audioTrack,videoTrack,id3Track,textTrack}=demuxResult;const{accurateTimeOffset,timeOffset}=this.currentTransmuxState;logger.log(`[transmuxer.ts]: Flushed fragment ${chunkMeta.sn}${chunkMeta.part>-1?' p: '+chunkMeta.part:''} of level ${chunkMeta.level}`);const remuxResult=this.remuxer.remux(audioTrack,videoTrack,id3Track,textTrack,timeOffset,accurateTimeOffset,true,this.id);transmuxResults.push({remuxResult,chunkMeta});chunkMeta.transmuxing.executeEnd=now();}resetInitialTimestamp(defaultInitPts){const{demuxer,remuxer}=this;if(!demuxer||!remuxer){return;}demuxer.resetTimeStamp(defaultInitPts);remuxer.resetTimeStamp(defaultInitPts);}resetContiguity(){const{demuxer,remuxer}=this;if(!demuxer||!remuxer){return;}demuxer.resetContiguity();remuxer.resetNextTimestamp();}resetInitSegment(initSegmentData,audioCodec,videoCodec,trackDuration,decryptdata){const{demuxer,remuxer}=this;if(!demuxer||!remuxer){return;}demuxer.resetInitSegment(initSegmentData,audioCodec,videoCodec,trackDuration);remuxer.resetInitSegment(initSegmentData,audioCodec,videoCodec,decryptdata);}destroy(){if(this.demuxer){this.demuxer.destroy();this.demuxer=undefined;}if(this.remuxer){this.remuxer.destroy();this.remuxer=undefined;}}transmux(data,keyData,timeOffset,accurateTimeOffset,chunkMeta){let result;if(keyData&&keyData.method==='SAMPLE-AES'){result=this.transmuxSampleAes(data,keyData,timeOffset,accurateTimeOffset,chunkMeta);}else {result=this.transmuxUnencrypted(data,timeOffset,accurateTimeOffset,chunkMeta);}return result;}transmuxUnencrypted(data,timeOffset,accurateTimeOffset,chunkMeta){const{audioTrack,videoTrack,id3Track,textTrack}=this.demuxer.demux(data,timeOffset,false,!this.config.progressive);const remuxResult=this.remuxer.remux(audioTrack,videoTrack,id3Track,textTrack,timeOffset,accurateTimeOffset,false,this.id);return {remuxResult,chunkMeta};}transmuxSampleAes(data,decryptData,timeOffset,accurateTimeOffset,chunkMeta){return this.demuxer.demuxSampleAes(data,decryptData,timeOffset).then(demuxResult=>{const remuxResult=this.remuxer.remux(demuxResult.audioTrack,demuxResult.videoTrack,demuxResult.id3Track,demuxResult.textTrack,timeOffset,accurateTimeOffset,false,this.id);return {remuxResult,chunkMeta};});}configureTransmuxer(data){const{config,observer,typeSupported,vendor}=this;// probe for content type
let mux;for(let i=0,len=muxConfig.length;i<len;i++){var _muxConfig$i$demux;if((_muxConfig$i$demux=muxConfig[i].demux)!=null&&_muxConfig$i$demux.probe(data)){mux=muxConfig[i];break;}}if(!mux){return new Error('Failed to find demuxer by probing fragment data');}// so let's check that current remuxer and demuxer are still valid
const demuxer=this.demuxer;const remuxer=this.remuxer;const Remuxer=mux.remux;const Demuxer=mux.demux;if(!remuxer||!(remuxer instanceof Remuxer)){this.remuxer=new Remuxer(observer,config,typeSupported,vendor);}if(!demuxer||!(demuxer instanceof Demuxer)){this.demuxer=new Demuxer(observer,config,typeSupported);this.probe=Demuxer.probe;}}needsProbing(discontinuity,trackSwitch){// in case of continuity change, or track switch
// we might switch from content type (AAC container to TS container, or TS to fmp4 for example)
return !this.demuxer||!this.remuxer||discontinuity||trackSwitch;}getDecrypter(){let decrypter=this.decrypter;if(!decrypter){decrypter=this.decrypter=new Decrypter(this.config);}return decrypter;}}function getEncryptionType(data,decryptData){let encryptionType=null;if(data.byteLength>0&&(decryptData==null?void 0:decryptData.key)!=null&&decryptData.iv!==null&&decryptData.method!=null){encryptionType=decryptData;}return encryptionType;}const emptyResult=chunkMeta=>({remuxResult:{},chunkMeta});function isPromise$1(p){return 'then'in p&&p.then instanceof Function;}class TransmuxConfig{constructor(audioCodec,videoCodec,initSegmentData,duration,defaultInitPts){this.audioCodec=void 0;this.videoCodec=void 0;this.initSegmentData=void 0;this.duration=void 0;this.defaultInitPts=void 0;this.audioCodec=audioCodec;this.videoCodec=videoCodec;this.initSegmentData=initSegmentData;this.duration=duration;this.defaultInitPts=defaultInitPts||null;}}class TransmuxState{constructor(discontinuity,contiguous,accurateTimeOffset,trackSwitch,timeOffset,initSegmentChange){this.discontinuity=void 0;this.contiguous=void 0;this.accurateTimeOffset=void 0;this.trackSwitch=void 0;this.timeOffset=void 0;this.initSegmentChange=void 0;this.discontinuity=discontinuity;this.contiguous=contiguous;this.accurateTimeOffset=accurateTimeOffset;this.trackSwitch=trackSwitch;this.timeOffset=timeOffset;this.initSegmentChange=initSegmentChange;}}var eventemitter3={exports:{}};(function(module){var has=Object.prototype.hasOwnProperty,prefix='~';/**
	 * Constructor to create a storage for our `EE` objects.
	 * An `Events` instance is a plain object whose properties are event names.
	 *
	 * @constructor
	 * @private
	 */function Events(){}//
// We try to not inherit from `Object.prototype`. In some engines creating an
// instance in this way is faster than calling `Object.create(null)` directly.
// If `Object.create(null)` is not supported we prefix the event names with a
// character to make sure that the built-in object properties are not
// overridden or used as an attack vector.
//
if(Object.create){Events.prototype=Object.create(null);//
// This hack is needed because the `__proto__` property is still inherited in
// some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
//
if(!new Events().__proto__)prefix=false;}/**
	 * Representation of a single event listener.
	 *
	 * @param {Function} fn The listener function.
	 * @param {*} context The context to invoke the listener with.
	 * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
	 * @constructor
	 * @private
	 */function EE(fn,context,once){this.fn=fn;this.context=context;this.once=once||false;}/**
	 * Add a listener for a given event.
	 *
	 * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
	 * @param {(String|Symbol)} event The event name.
	 * @param {Function} fn The listener function.
	 * @param {*} context The context to invoke the listener with.
	 * @param {Boolean} once Specify if the listener is a one-time listener.
	 * @returns {EventEmitter}
	 * @private
	 */function addListener(emitter,event,fn,context,once){if(typeof fn!=='function'){throw new TypeError('The listener must be a function');}var listener=new EE(fn,context||emitter,once),evt=prefix?prefix+event:event;if(!emitter._events[evt])emitter._events[evt]=listener,emitter._eventsCount++;else if(!emitter._events[evt].fn)emitter._events[evt].push(listener);else emitter._events[evt]=[emitter._events[evt],listener];return emitter;}/**
	 * Clear event by name.
	 *
	 * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
	 * @param {(String|Symbol)} evt The Event name.
	 * @private
	 */function clearEvent(emitter,evt){if(--emitter._eventsCount===0)emitter._events=new Events();else delete emitter._events[evt];}/**
	 * Minimal `EventEmitter` interface that is molded against the Node.js
	 * `EventEmitter` interface.
	 *
	 * @constructor
	 * @public
	 */function EventEmitter(){this._events=new Events();this._eventsCount=0;}/**
	 * Return an array listing the events for which the emitter has registered
	 * listeners.
	 *
	 * @returns {Array}
	 * @public
	 */EventEmitter.prototype.eventNames=function eventNames(){var names=[],events,name;if(this._eventsCount===0)return names;for(name in events=this._events){if(has.call(events,name))names.push(prefix?name.slice(1):name);}if(Object.getOwnPropertySymbols){return names.concat(Object.getOwnPropertySymbols(events));}return names;};/**
	 * Return the listeners registered for a given event.
	 *
	 * @param {(String|Symbol)} event The event name.
	 * @returns {Array} The registered listeners.
	 * @public
	 */EventEmitter.prototype.listeners=function listeners(event){var evt=prefix?prefix+event:event,handlers=this._events[evt];if(!handlers)return [];if(handlers.fn)return [handlers.fn];for(var i=0,l=handlers.length,ee=new Array(l);i<l;i++){ee[i]=handlers[i].fn;}return ee;};/**
	 * Return the number of listeners listening to a given event.
	 *
	 * @param {(String|Symbol)} event The event name.
	 * @returns {Number} The number of listeners.
	 * @public
	 */EventEmitter.prototype.listenerCount=function listenerCount(event){var evt=prefix?prefix+event:event,listeners=this._events[evt];if(!listeners)return 0;if(listeners.fn)return 1;return listeners.length;};/**
	 * Calls each of the listeners registered for a given event.
	 *
	 * @param {(String|Symbol)} event The event name.
	 * @returns {Boolean} `true` if the event had listeners, else `false`.
	 * @public
	 */EventEmitter.prototype.emit=function emit(event,a1,a2,a3,a4,a5){var evt=prefix?prefix+event:event;if(!this._events[evt])return false;var listeners=this._events[evt],len=arguments.length,args,i;if(listeners.fn){if(listeners.once)this.removeListener(event,listeners.fn,undefined,true);switch(len){case 1:return listeners.fn.call(listeners.context),true;case 2:return listeners.fn.call(listeners.context,a1),true;case 3:return listeners.fn.call(listeners.context,a1,a2),true;case 4:return listeners.fn.call(listeners.context,a1,a2,a3),true;case 5:return listeners.fn.call(listeners.context,a1,a2,a3,a4),true;case 6:return listeners.fn.call(listeners.context,a1,a2,a3,a4,a5),true;}for(i=1,args=new Array(len-1);i<len;i++){args[i-1]=arguments[i];}listeners.fn.apply(listeners.context,args);}else {var length=listeners.length,j;for(i=0;i<length;i++){if(listeners[i].once)this.removeListener(event,listeners[i].fn,undefined,true);switch(len){case 1:listeners[i].fn.call(listeners[i].context);break;case 2:listeners[i].fn.call(listeners[i].context,a1);break;case 3:listeners[i].fn.call(listeners[i].context,a1,a2);break;case 4:listeners[i].fn.call(listeners[i].context,a1,a2,a3);break;default:if(!args)for(j=1,args=new Array(len-1);j<len;j++){args[j-1]=arguments[j];}listeners[i].fn.apply(listeners[i].context,args);}}}return true;};/**
	 * Add a listener for a given event.
	 *
	 * @param {(String|Symbol)} event The event name.
	 * @param {Function} fn The listener function.
	 * @param {*} [context=this] The context to invoke the listener with.
	 * @returns {EventEmitter} `this`.
	 * @public
	 */EventEmitter.prototype.on=function on(event,fn,context){return addListener(this,event,fn,context,false);};/**
	 * Add a one-time listener for a given event.
	 *
	 * @param {(String|Symbol)} event The event name.
	 * @param {Function} fn The listener function.
	 * @param {*} [context=this] The context to invoke the listener with.
	 * @returns {EventEmitter} `this`.
	 * @public
	 */EventEmitter.prototype.once=function once(event,fn,context){return addListener(this,event,fn,context,true);};/**
	 * Remove the listeners of a given event.
	 *
	 * @param {(String|Symbol)} event The event name.
	 * @param {Function} fn Only remove the listeners that match this function.
	 * @param {*} context Only remove the listeners that have this context.
	 * @param {Boolean} once Only remove one-time listeners.
	 * @returns {EventEmitter} `this`.
	 * @public
	 */EventEmitter.prototype.removeListener=function removeListener(event,fn,context,once){var evt=prefix?prefix+event:event;if(!this._events[evt])return this;if(!fn){clearEvent(this,evt);return this;}var listeners=this._events[evt];if(listeners.fn){if(listeners.fn===fn&&(!once||listeners.once)&&(!context||listeners.context===context)){clearEvent(this,evt);}}else {for(var i=0,events=[],length=listeners.length;i<length;i++){if(listeners[i].fn!==fn||once&&!listeners[i].once||context&&listeners[i].context!==context){events.push(listeners[i]);}}//
// Reset the array, or remove it completely if we have no more listeners.
//
if(events.length)this._events[evt]=events.length===1?events[0]:events;else clearEvent(this,evt);}return this;};/**
	 * Remove all listeners, or those of the specified event.
	 *
	 * @param {(String|Symbol)} [event] The event name.
	 * @returns {EventEmitter} `this`.
	 * @public
	 */EventEmitter.prototype.removeAllListeners=function removeAllListeners(event){var evt;if(event){evt=prefix?prefix+event:event;if(this._events[evt])clearEvent(this,evt);}else {this._events=new Events();this._eventsCount=0;}return this;};//
// Alias methods names because people roll like that.
//
EventEmitter.prototype.off=EventEmitter.prototype.removeListener;EventEmitter.prototype.addListener=EventEmitter.prototype.on;//
// Expose the prefix.
//
EventEmitter.prefixed=prefix;//
// Allow `EventEmitter` to be imported as module namespace.
//
EventEmitter.EventEmitter=EventEmitter;//
// Expose the module.
//
{module.exports=EventEmitter;}})(eventemitter3);var eventemitter3Exports=eventemitter3.exports;var EventEmitter$1=/*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);class TransmuxerInterface{constructor(hls,id,onTransmuxComplete,onFlush){this.error=null;this.hls=void 0;this.id=void 0;this.observer=void 0;this.frag=null;this.part=null;this.useWorker=void 0;this.workerContext=null;this.onwmsg=void 0;this.transmuxer=null;this.onTransmuxComplete=void 0;this.onFlush=void 0;const config=hls.config;this.hls=hls;this.id=id;this.useWorker=!!config.enableWorker;this.onTransmuxComplete=onTransmuxComplete;this.onFlush=onFlush;const forwardMessage=(ev,data)=>{data=data||{};data.frag=this.frag;data.id=this.id;if(ev===Events$1.ERROR){this.error=data.error;}this.hls.trigger(ev,data);};// forward events to main thread
this.observer=new EventEmitter$1();this.observer.on(Events$1.FRAG_DECRYPTED,forwardMessage);this.observer.on(Events$1.ERROR,forwardMessage);const MediaSource=getMediaSource(config.preferManagedMediaSource)||{isTypeSupported:()=>false};const m2tsTypeSupported={mpeg:MediaSource.isTypeSupported('audio/mpeg'),mp3:MediaSource.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:MediaSource.isTypeSupported('audio/mp4; codecs="ac-3"')};// navigator.vendor is not always available in Web Worker
// refer to https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/navigator
const vendor=navigator.vendor;if(this.useWorker&&typeof Worker!=='undefined'){const canCreateWorker=config.workerPath||hasUMDWorker();if(canCreateWorker){try{if(config.workerPath){logger.log(`loading Web Worker ${config.workerPath} for "${id}"`);this.workerContext=loadWorker(config.workerPath);}else {logger.log(`injecting Web Worker for "${id}"`);this.workerContext=injectWorker();}this.onwmsg=ev=>this.onWorkerMessage(ev);const{worker}=this.workerContext;worker.addEventListener('message',this.onwmsg);worker.onerror=event=>{const error=new Error(`${event.message}  (${event.filename}:${event.lineno})`);config.enableWorker=false;logger.warn(`Error in "${id}" Web Worker, fallback to inline`);this.hls.trigger(Events$1.ERROR,{type:ErrorTypes.OTHER_ERROR,details:ErrorDetails.INTERNAL_EXCEPTION,fatal:false,event:'demuxerWorker',error});};worker.postMessage({cmd:'init',typeSupported:m2tsTypeSupported,vendor:vendor,id:id,config:JSON.stringify(config)});}catch(err){logger.warn(`Error setting up "${id}" Web Worker, fallback to inline`,err);this.resetWorker();this.error=null;this.transmuxer=new Transmuxer(this.observer,m2tsTypeSupported,config,vendor,id);}return;}}this.transmuxer=new Transmuxer(this.observer,m2tsTypeSupported,config,vendor,id);}resetWorker(){if(this.workerContext){const{worker,objectURL}=this.workerContext;if(objectURL){// revoke the Object URL that was used to create transmuxer worker, so as not to leak it
self.URL.revokeObjectURL(objectURL);}worker.removeEventListener('message',this.onwmsg);worker.onerror=null;worker.terminate();this.workerContext=null;}}destroy(){if(this.workerContext){this.resetWorker();this.onwmsg=undefined;}else {const transmuxer=this.transmuxer;if(transmuxer){transmuxer.destroy();this.transmuxer=null;}}const observer=this.observer;if(observer){observer.removeAllListeners();}this.frag=null;// @ts-ignore
this.observer=null;// @ts-ignore
this.hls=null;}push(data,initSegmentData,audioCodec,videoCodec,frag,part,duration,accurateTimeOffset,chunkMeta,defaultInitPTS){var _frag$initSegment,_lastFrag$initSegment;chunkMeta.transmuxing.start=self.performance.now();const{transmuxer}=this;const timeOffset=part?part.start:frag.start;// TODO: push "clear-lead" decrypt data for unencrypted fragments in streams with encrypted ones
const decryptdata=frag.decryptdata;const lastFrag=this.frag;const discontinuity=!(lastFrag&&frag.cc===lastFrag.cc);const trackSwitch=!(lastFrag&&chunkMeta.level===lastFrag.level);const snDiff=lastFrag?chunkMeta.sn-lastFrag.sn:-1;const partDiff=this.part?chunkMeta.part-this.part.index:-1;const progressive=snDiff===0&&chunkMeta.id>1&&chunkMeta.id===(lastFrag==null?void 0:lastFrag.stats.chunkCount);const contiguous=!trackSwitch&&(snDiff===1||snDiff===0&&(partDiff===1||progressive&&partDiff<=0));const now=self.performance.now();if(trackSwitch||snDiff||frag.stats.parsing.start===0){frag.stats.parsing.start=now;}if(part&&(partDiff||!contiguous)){part.stats.parsing.start=now;}const initSegmentChange=!(lastFrag&&((_frag$initSegment=frag.initSegment)==null?void 0:_frag$initSegment.url)===((_lastFrag$initSegment=lastFrag.initSegment)==null?void 0:_lastFrag$initSegment.url));const state=new TransmuxState(discontinuity,contiguous,accurateTimeOffset,trackSwitch,timeOffset,initSegmentChange);if(!contiguous||discontinuity||initSegmentChange){logger.log(`[transmuxer-interface, ${frag.type}]: Starting new transmux session for sn: ${chunkMeta.sn} p: ${chunkMeta.part} level: ${chunkMeta.level} id: ${chunkMeta.id}
        discontinuity: ${discontinuity}
        trackSwitch: ${trackSwitch}
        contiguous: ${contiguous}
        accurateTimeOffset: ${accurateTimeOffset}
        timeOffset: ${timeOffset}
        initSegmentChange: ${initSegmentChange}`);const config=new TransmuxConfig(audioCodec,videoCodec,initSegmentData,duration,defaultInitPTS);this.configureTransmuxer(config);}this.frag=frag;this.part=part;// Frags with sn of 'initSegment' are not transmuxed
if(this.workerContext){// post fragment payload as transferable objects for ArrayBuffer (no copy)
this.workerContext.worker.postMessage({cmd:'demux',data,decryptdata,chunkMeta,state},data instanceof ArrayBuffer?[data]:[]);}else if(transmuxer){const transmuxResult=transmuxer.push(data,decryptdata,chunkMeta,state);if(isPromise$1(transmuxResult)){transmuxer.async=true;transmuxResult.then(data=>{this.handleTransmuxComplete(data);}).catch(error=>{this.transmuxerError(error,chunkMeta,'transmuxer-interface push error');});}else {transmuxer.async=false;this.handleTransmuxComplete(transmuxResult);}}}flush(chunkMeta){chunkMeta.transmuxing.start=self.performance.now();const{transmuxer}=this;if(this.workerContext){this.workerContext.worker.postMessage({cmd:'flush',chunkMeta});}else if(transmuxer){let transmuxResult=transmuxer.flush(chunkMeta);const asyncFlush=isPromise$1(transmuxResult);if(asyncFlush||transmuxer.async){if(!isPromise$1(transmuxResult)){transmuxResult=Promise.resolve(transmuxResult);}transmuxResult.then(data=>{this.handleFlushResult(data,chunkMeta);}).catch(error=>{this.transmuxerError(error,chunkMeta,'transmuxer-interface flush error');});}else {this.handleFlushResult(transmuxResult,chunkMeta);}}}transmuxerError(error,chunkMeta,reason){if(!this.hls){return;}this.error=error;this.hls.trigger(Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_PARSING_ERROR,chunkMeta,frag:this.frag||undefined,fatal:false,error,err:error,reason});}handleFlushResult(results,chunkMeta){results.forEach(result=>{this.handleTransmuxComplete(result);});this.onFlush(chunkMeta);}onWorkerMessage(ev){const data=ev.data;const hls=this.hls;switch(data.event){case'init':{var _this$workerContext;const objectURL=(_this$workerContext=this.workerContext)==null?void 0:_this$workerContext.objectURL;if(objectURL){// revoke the Object URL that was used to create transmuxer worker, so as not to leak it
self.URL.revokeObjectURL(objectURL);}break;}case'transmuxComplete':{this.handleTransmuxComplete(data.data);break;}case'flush':{this.onFlush(data.data);break;}// pass logs from the worker thread to the main logger
case'workerLog':if(logger[data.data.logType]){logger[data.data.logType](data.data.message);}break;default:{data.data=data.data||{};data.data.frag=this.frag;data.data.id=this.id;hls.trigger(data.event,data.data);break;}}}configureTransmuxer(config){const{transmuxer}=this;if(this.workerContext){this.workerContext.worker.postMessage({cmd:'configure',config});}else if(transmuxer){transmuxer.configure(config);}}handleTransmuxComplete(result){result.chunkMeta.transmuxing.end=self.performance.now();this.onTransmuxComplete(result);}}function subtitleOptionsIdentical(trackList1,trackList2){if(trackList1.length!==trackList2.length){return false;}for(let i=0;i<trackList1.length;i++){if(!mediaAttributesIdentical(trackList1[i].attrs,trackList2[i].attrs)){return false;}}return true;}function mediaAttributesIdentical(attrs1,attrs2,customAttributes){// Media options with the same rendition ID must be bit identical
const stableRenditionId=attrs1['STABLE-RENDITION-ID'];if(stableRenditionId&&!customAttributes){return stableRenditionId===attrs2['STABLE-RENDITION-ID'];}// When rendition ID is not present, compare attributes
return !(customAttributes||['LANGUAGE','NAME','CHARACTERISTICS','AUTOSELECT','DEFAULT','FORCED','ASSOC-LANGUAGE']).some(subtitleAttribute=>attrs1[subtitleAttribute]!==attrs2[subtitleAttribute]);}function subtitleTrackMatchesTextTrack(subtitleTrack,textTrack){return textTrack.label.toLowerCase()===subtitleTrack.name.toLowerCase()&&(!textTrack.language||textTrack.language.toLowerCase()===(subtitleTrack.lang||'').toLowerCase());}const TICK_INTERVAL$2=100;// how often to tick in ms
class AudioStreamController extends BaseStreamController{constructor(hls,fragmentTracker,keyLoader){super(hls,fragmentTracker,keyLoader,'[audio-stream-controller]',PlaylistLevelType.AUDIO);this.videoBuffer=null;this.videoTrackCC=-1;this.waitingVideoCC=-1;this.bufferedTrack=null;this.switchingTrack=null;this.trackId=-1;this.waitingData=null;this.mainDetails=null;this.flushing=false;this.bufferFlushed=false;this.cachedTrackLoadedData=null;this._registerListeners();}onHandlerDestroying(){this._unregisterListeners();super.onHandlerDestroying();this.mainDetails=null;this.bufferedTrack=null;this.switchingTrack=null;}_registerListeners(){const{hls}=this;hls.on(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);hls.on(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);hls.on(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.on(Events$1.LEVEL_LOADED,this.onLevelLoaded,this);hls.on(Events$1.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this);hls.on(Events$1.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this);hls.on(Events$1.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this);hls.on(Events$1.ERROR,this.onError,this);hls.on(Events$1.BUFFER_RESET,this.onBufferReset,this);hls.on(Events$1.BUFFER_CREATED,this.onBufferCreated,this);hls.on(Events$1.BUFFER_FLUSHING,this.onBufferFlushing,this);hls.on(Events$1.BUFFER_FLUSHED,this.onBufferFlushed,this);hls.on(Events$1.INIT_PTS_FOUND,this.onInitPtsFound,this);hls.on(Events$1.FRAG_BUFFERED,this.onFragBuffered,this);}_unregisterListeners(){const{hls}=this;hls.off(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);hls.off(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);hls.off(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.off(Events$1.LEVEL_LOADED,this.onLevelLoaded,this);hls.off(Events$1.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this);hls.off(Events$1.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this);hls.off(Events$1.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this);hls.off(Events$1.ERROR,this.onError,this);hls.off(Events$1.BUFFER_RESET,this.onBufferReset,this);hls.off(Events$1.BUFFER_CREATED,this.onBufferCreated,this);hls.off(Events$1.BUFFER_FLUSHING,this.onBufferFlushing,this);hls.off(Events$1.BUFFER_FLUSHED,this.onBufferFlushed,this);hls.off(Events$1.INIT_PTS_FOUND,this.onInitPtsFound,this);hls.off(Events$1.FRAG_BUFFERED,this.onFragBuffered,this);}// INIT_PTS_FOUND is triggered when the video track parsed in the stream-controller has a new PTS value
onInitPtsFound(event,{frag,id,initPTS,timescale}){// Always update the new INIT PTS
// Can change due level switch
if(id==='main'){const cc=frag.cc;this.initPTS[frag.cc]={baseTime:initPTS,timescale};this.log(`InitPTS for cc: ${cc} found from main: ${initPTS}`);this.videoTrackCC=cc;// If we are waiting, tick immediately to unblock audio fragment transmuxing
if(this.state===State.WAITING_INIT_PTS){this.tick();}}}startLoad(startPosition){if(!this.levels){this.startPosition=startPosition;this.state=State.STOPPED;return;}const lastCurrentTime=this.lastCurrentTime;this.stopLoad();this.setInterval(TICK_INTERVAL$2);if(lastCurrentTime>0&&startPosition===-1){this.log(`Override startPosition with lastCurrentTime @${lastCurrentTime.toFixed(3)}`);startPosition=lastCurrentTime;this.state=State.IDLE;}else {this.loadedmetadata=false;this.state=State.WAITING_TRACK;}this.nextLoadPosition=this.startPosition=this.lastCurrentTime=startPosition;this.tick();}doTick(){switch(this.state){case State.IDLE:this.doTickIdle();break;case State.WAITING_TRACK:{var _levels$trackId;const{levels,trackId}=this;const details=levels==null?void 0:(_levels$trackId=levels[trackId])==null?void 0:_levels$trackId.details;if(details){if(this.waitForCdnTuneIn(details)){break;}this.state=State.WAITING_INIT_PTS;}break;}case State.FRAG_LOADING_WAITING_RETRY:{var _this$media;const now=performance.now();const retryDate=this.retryDate;// if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading
if(!retryDate||now>=retryDate||(_this$media=this.media)!=null&&_this$media.seeking){const{levels,trackId}=this;this.log('RetryDate reached, switch back to IDLE state');this.resetStartWhenNotLoaded((levels==null?void 0:levels[trackId])||null);this.state=State.IDLE;}break;}case State.WAITING_INIT_PTS:{// Ensure we don't get stuck in the WAITING_INIT_PTS state if the waiting frag CC doesn't match any initPTS
const waitingData=this.waitingData;if(waitingData){const{frag,part,cache,complete}=waitingData;if(this.initPTS[frag.cc]!==undefined){this.waitingData=null;this.waitingVideoCC=-1;this.state=State.FRAG_LOADING;const payload=cache.flush();const data={frag,part,payload,networkDetails:null};this._handleFragmentLoadProgress(data);if(complete){super._handleFragmentLoadComplete(data);}}else if(this.videoTrackCC!==this.waitingVideoCC){// Drop waiting fragment if videoTrackCC has changed since waitingFragment was set and initPTS was not found
this.log(`Waiting fragment cc (${frag.cc}) cancelled because video is at cc ${this.videoTrackCC}`);this.clearWaitingFragment();}else {// Drop waiting fragment if an earlier fragment is needed
const pos=this.getLoadPosition();const bufferInfo=BufferHelper.bufferInfo(this.mediaBuffer,pos,this.config.maxBufferHole);const waitingFragmentAtPosition=fragmentWithinToleranceTest(bufferInfo.end,this.config.maxFragLookUpTolerance,frag);if(waitingFragmentAtPosition<0){this.log(`Waiting fragment cc (${frag.cc}) @ ${frag.start} cancelled because another fragment at ${bufferInfo.end} is needed`);this.clearWaitingFragment();}}}else {this.state=State.IDLE;}}}this.onTickEnd();}clearWaitingFragment(){const waitingData=this.waitingData;if(waitingData){this.fragmentTracker.removeFragment(waitingData.frag);this.waitingData=null;this.waitingVideoCC=-1;this.state=State.IDLE;}}resetLoadingState(){this.clearWaitingFragment();super.resetLoadingState();}onTickEnd(){const{media}=this;if(!(media!=null&&media.readyState)){// Exit early if we don't have media or if the media hasn't buffered anything yet (readyState 0)
return;}this.lastCurrentTime=media.currentTime;}doTickIdle(){const{hls,levels,media,trackId}=this;const config=hls.config;// 1. if video not attached AND
//    start fragment already requested OR start frag prefetch not enabled
// 2. if tracks or track not loaded and selected
// then exit loop
// => if media not attached but start frag prefetch is enabled and start frag not requested yet, we will not exit loop
if(!media&&(this.startFragRequested||!config.startFragPrefetch)||!(levels!=null&&levels[trackId])){return;}const levelInfo=levels[trackId];const trackDetails=levelInfo.details;if(!trackDetails||trackDetails.live&&this.levelLastLoaded!==levelInfo||this.waitForCdnTuneIn(trackDetails)){this.state=State.WAITING_TRACK;return;}const bufferable=this.mediaBuffer?this.mediaBuffer:this.media;if(this.bufferFlushed&&bufferable){this.bufferFlushed=false;this.afterBufferFlushed(bufferable,ElementaryStreamTypes.AUDIO,PlaylistLevelType.AUDIO);}const bufferInfo=this.getFwdBufferInfo(bufferable,PlaylistLevelType.AUDIO);if(bufferInfo===null){return;}const{bufferedTrack,switchingTrack}=this;if(!switchingTrack&&this._streamEnded(bufferInfo,trackDetails)){hls.trigger(Events$1.BUFFER_EOS,{type:'audio'});this.state=State.ENDED;return;}const mainBufferInfo=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,PlaylistLevelType.MAIN);const bufferLen=bufferInfo.len;const maxBufLen=this.getMaxBufferLength(mainBufferInfo==null?void 0:mainBufferInfo.len);const fragments=trackDetails.fragments;const start=fragments[0].start;let targetBufferTime=this.flushing?this.getLoadPosition():bufferInfo.end;if(switchingTrack&&media){const pos=this.getLoadPosition();// STABLE
if(bufferedTrack&&!mediaAttributesIdentical(switchingTrack.attrs,bufferedTrack.attrs)){targetBufferTime=pos;}// if currentTime (pos) is less than alt audio playlist start time, it means that alt audio is ahead of currentTime
if(trackDetails.PTSKnown&&pos<start){// if everything is buffered from pos to start or if audio buffer upfront, let's seek to start
if(bufferInfo.end>start||bufferInfo.nextStart){this.log('Alt audio track ahead of main track, seek to start of alt audio track');media.currentTime=start+0.05;}}}// if buffer length is less than maxBufLen, or near the end, find a fragment to load
if(bufferLen>=maxBufLen&&!switchingTrack&&targetBufferTime<fragments[fragments.length-1].start){return;}let frag=this.getNextFragment(targetBufferTime,trackDetails);let atGap=false;// Avoid loop loading by using nextLoadPosition set for backtracking and skipping consecutive GAP tags
if(frag&&this.isLoopLoading(frag,targetBufferTime)){atGap=!!frag.gap;frag=this.getNextFragmentLoopLoading(frag,trackDetails,bufferInfo,PlaylistLevelType.MAIN,maxBufLen);}if(!frag){this.bufferFlushed=true;return;}// Buffer audio up to one target duration ahead of main buffer
const atBufferSyncLimit=mainBufferInfo&&frag.start>mainBufferInfo.end+trackDetails.targetduration;if(atBufferSyncLimit||// Or wait for main buffer after buffing some audio
!(mainBufferInfo!=null&&mainBufferInfo.len)&&bufferInfo.len){// Check fragment-tracker for main fragments since GAP segments do not show up in bufferInfo
const mainFrag=this.getAppendedFrag(frag.start,PlaylistLevelType.MAIN);if(mainFrag===null){return;}// Bridge gaps in main buffer
atGap||(atGap=!!mainFrag.gap||!!atBufferSyncLimit&&mainBufferInfo.len===0);if(atBufferSyncLimit&&!atGap||atGap&&bufferInfo.nextStart&&bufferInfo.nextStart<mainFrag.end){return;}}this.loadFragment(frag,levelInfo,targetBufferTime);}getMaxBufferLength(mainBufferLength){const maxConfigBuffer=super.getMaxBufferLength();if(!mainBufferLength){return maxConfigBuffer;}return Math.min(Math.max(maxConfigBuffer,mainBufferLength),this.config.maxMaxBufferLength);}onMediaDetaching(){this.videoBuffer=null;this.bufferFlushed=this.flushing=false;super.onMediaDetaching();}onAudioTracksUpdated(event,{audioTracks}){// Reset tranxmuxer is essential for large context switches (Content Steering)
this.resetTransmuxer();this.levels=audioTracks.map(mediaPlaylist=>new Level(mediaPlaylist));}onAudioTrackSwitching(event,data){// if any URL found on new audio track, it is an alternate audio track
const altAudio=!!data.url;this.trackId=data.id;const{fragCurrent}=this;if(fragCurrent){fragCurrent.abortRequests();this.removeUnbufferedFrags(fragCurrent.start);}this.resetLoadingState();// destroy useless transmuxer when switching audio to main
if(!altAudio){this.resetTransmuxer();}else {// switching to audio track, start timer if not already started
this.setInterval(TICK_INTERVAL$2);}// should we switch tracks ?
if(altAudio){this.switchingTrack=data;// main audio track are handled by stream-controller, just do something if switching to alt audio track
this.state=State.IDLE;this.flushAudioIfNeeded(data);}else {this.switchingTrack=null;this.bufferedTrack=data;this.state=State.STOPPED;}this.tick();}onManifestLoading(){this.fragmentTracker.removeAllFragments();this.startPosition=this.lastCurrentTime=0;this.bufferFlushed=this.flushing=false;this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null;this.startFragRequested=false;this.trackId=this.videoTrackCC=this.waitingVideoCC=-1;}onLevelLoaded(event,data){this.mainDetails=data.details;if(this.cachedTrackLoadedData!==null){this.hls.trigger(Events$1.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData);this.cachedTrackLoadedData=null;}}onAudioTrackLoaded(event,data){var _track$details;if(this.mainDetails==null){this.cachedTrackLoadedData=data;return;}const{levels}=this;const{details:newDetails,id:trackId}=data;if(!levels){this.warn(`Audio tracks were reset while loading level ${trackId}`);return;}this.log(`Audio track ${trackId} loaded [${newDetails.startSN},${newDetails.endSN}]${newDetails.lastPartSn?`[part-${newDetails.lastPartSn}-${newDetails.lastPartIndex}]`:''},duration:${newDetails.totalduration}`);const track=levels[trackId];let sliding=0;if(newDetails.live||(_track$details=track.details)!=null&&_track$details.live){this.checkLiveUpdate(newDetails);const mainDetails=this.mainDetails;if(newDetails.deltaUpdateFailed||!mainDetails){return;}if(!track.details&&newDetails.hasProgramDateTime&&mainDetails.hasProgramDateTime){// Make sure our audio rendition is aligned with the "main" rendition, using
// pdt as our reference times.
alignMediaPlaylistByPDT(newDetails,mainDetails);sliding=newDetails.fragments[0].start;}else {var _this$levelLastLoaded;sliding=this.alignPlaylists(newDetails,track.details,(_this$levelLastLoaded=this.levelLastLoaded)==null?void 0:_this$levelLastLoaded.details);}}track.details=newDetails;this.levelLastLoaded=track;// compute start position if we are aligned with the main playlist
if(!this.startFragRequested&&(this.mainDetails||!newDetails.live)){this.setStartPosition(this.mainDetails||newDetails,sliding);}// only switch back to IDLE state if we were waiting for track to start downloading a new fragment
if(this.state===State.WAITING_TRACK&&!this.waitForCdnTuneIn(newDetails)){this.state=State.IDLE;}// trigger handler right now
this.tick();}_handleFragmentLoadProgress(data){var _frag$initSegment;const{frag,part,payload}=data;const{config,trackId,levels}=this;if(!levels){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${frag.sn} of level ${frag.level} will not be buffered`);return;}const track=levels[trackId];if(!track){this.warn('Audio track is undefined on fragment load progress');return;}const details=track.details;if(!details){this.warn('Audio track details undefined on fragment load progress');this.removeUnbufferedFrags(frag.start);return;}const audioCodec=config.defaultAudioCodec||track.audioCodec||'mp4a.40.2';let transmuxer=this.transmuxer;if(!transmuxer){transmuxer=this.transmuxer=new TransmuxerInterface(this.hls,PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this));}// Check if we have video initPTS
// If not we need to wait for it
const initPTS=this.initPTS[frag.cc];const initSegmentData=(_frag$initSegment=frag.initSegment)==null?void 0:_frag$initSegment.data;if(initPTS!==undefined){// this.log(`Transmuxing ${sn} of [${details.startSN} ,${details.endSN}],track ${trackId}`);
// time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)
const accurateTimeOffset=false;// details.PTSKnown || !details.live;
const partIndex=part?part.index:-1;const partial=partIndex!==-1;const chunkMeta=new ChunkMetadata(frag.level,frag.sn,frag.stats.chunkCount,payload.byteLength,partIndex,partial);transmuxer.push(payload,initSegmentData,audioCodec,'',frag,part,details.totalduration,accurateTimeOffset,chunkMeta,initPTS);}else {this.log(`Unknown video PTS for cc ${frag.cc}, waiting for video PTS before demuxing audio frag ${frag.sn} of [${details.startSN} ,${details.endSN}],track ${trackId}`);const{cache}=this.waitingData=this.waitingData||{frag,part,cache:new ChunkCache(),complete:false};cache.push(new Uint8Array(payload));this.waitingVideoCC=this.videoTrackCC;this.state=State.WAITING_INIT_PTS;}}_handleFragmentLoadComplete(fragLoadedData){if(this.waitingData){this.waitingData.complete=true;return;}super._handleFragmentLoadComplete(fragLoadedData);}onBufferReset(/* event: Events.BUFFER_RESET */){// reset reference to sourcebuffers
this.mediaBuffer=this.videoBuffer=null;this.loadedmetadata=false;}onBufferCreated(event,data){const audioTrack=data.tracks.audio;if(audioTrack){this.mediaBuffer=audioTrack.buffer||null;}if(data.tracks.video){this.videoBuffer=data.tracks.video.buffer||null;}}onFragBuffered(event,data){const{frag,part}=data;if(frag.type!==PlaylistLevelType.AUDIO){if(!this.loadedmetadata&&frag.type===PlaylistLevelType.MAIN){const bufferable=this.videoBuffer||this.media;if(bufferable){const bufferedTimeRanges=BufferHelper.getBuffered(bufferable);if(bufferedTimeRanges.length){this.loadedmetadata=true;}}}return;}if(this.fragContextChanged(frag)){// If a level switch was requested while a fragment was buffering, it will emit the FRAG_BUFFERED event upon completion
// Avoid setting state back to IDLE or concluding the audio switch; otherwise, the switched-to track will not buffer
this.warn(`Fragment ${frag.sn}${part?' p: '+part.index:''} of level ${frag.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:'false'}`);return;}if(frag.sn!=='initSegment'){this.fragPrevious=frag;const track=this.switchingTrack;if(track){this.bufferedTrack=track;this.switchingTrack=null;this.hls.trigger(Events$1.AUDIO_TRACK_SWITCHED,_objectSpread2({},track));}}this.fragBufferedComplete(frag,part);}onError(event,data){var _data$context;if(data.fatal){this.state=State.ERROR;return;}switch(data.details){case ErrorDetails.FRAG_GAP:case ErrorDetails.FRAG_PARSING_ERROR:case ErrorDetails.FRAG_DECRYPT_ERROR:case ErrorDetails.FRAG_LOAD_ERROR:case ErrorDetails.FRAG_LOAD_TIMEOUT:case ErrorDetails.KEY_LOAD_ERROR:case ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(PlaylistLevelType.AUDIO,data);break;case ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case ErrorDetails.LEVEL_PARSING_ERROR:// in case of non fatal error while loading track, if not retrying to load track, switch back to IDLE
if(!data.levelRetry&&this.state===State.WAITING_TRACK&&((_data$context=data.context)==null?void 0:_data$context.type)===PlaylistContextType.AUDIO_TRACK){this.state=State.IDLE;}break;case ErrorDetails.BUFFER_APPEND_ERROR:case ErrorDetails.BUFFER_FULL_ERROR:if(!data.parent||data.parent!=='audio'){return;}if(data.details===ErrorDetails.BUFFER_APPEND_ERROR){this.resetLoadingState();return;}if(this.reduceLengthAndFlushBuffer(data)){this.bufferedTrack=null;super.flushMainBuffer(0,Number.POSITIVE_INFINITY,'audio');}break;case ErrorDetails.INTERNAL_EXCEPTION:this.recoverWorkerError(data);break;}}onBufferFlushing(event,{type}){if(type!==ElementaryStreamTypes.VIDEO){this.flushing=true;}}onBufferFlushed(event,{type}){if(type!==ElementaryStreamTypes.VIDEO){this.flushing=false;this.bufferFlushed=true;if(this.state===State.ENDED){this.state=State.IDLE;}const mediaBuffer=this.mediaBuffer||this.media;if(mediaBuffer){this.afterBufferFlushed(mediaBuffer,type,PlaylistLevelType.AUDIO);this.tick();}}}_handleTransmuxComplete(transmuxResult){var _id3$samples;const id='audio';const{hls}=this;const{remuxResult,chunkMeta}=transmuxResult;const context=this.getCurrentContext(chunkMeta);if(!context){this.resetWhenMissingContext(chunkMeta);return;}const{frag,part,level}=context;const{details}=level;const{audio,text,id3,initSegment}=remuxResult;// Check if the current fragment has been aborted. We check this by first seeing if we're still playing the current level.
// If we are, subsequently check if the currently loading fragment (fragCurrent) has changed.
if(this.fragContextChanged(frag)||!details){this.fragmentTracker.removeFragment(frag);return;}this.state=State.PARSING;if(this.switchingTrack&&audio){this.completeAudioSwitch(this.switchingTrack);}if(initSegment!=null&&initSegment.tracks){const mapFragment=frag.initSegment||frag;this._bufferInitSegment(level,initSegment.tracks,mapFragment,chunkMeta);hls.trigger(Events$1.FRAG_PARSING_INIT_SEGMENT,{frag:mapFragment,id,tracks:initSegment.tracks});// Only flush audio from old audio tracks when PTS is known on new audio track
}if(audio){const{startPTS,endPTS,startDTS,endDTS}=audio;if(part){part.elementaryStreams[ElementaryStreamTypes.AUDIO]={startPTS,endPTS,startDTS,endDTS};}frag.setElementaryStreamInfo(ElementaryStreamTypes.AUDIO,startPTS,endPTS,startDTS,endDTS);this.bufferFragmentData(audio,frag,part,chunkMeta);}if(id3!=null&&(_id3$samples=id3.samples)!=null&&_id3$samples.length){const emittedID3=_extends({id,frag,details},id3);hls.trigger(Events$1.FRAG_PARSING_METADATA,emittedID3);}if(text){const emittedText=_extends({id,frag,details},text);hls.trigger(Events$1.FRAG_PARSING_USERDATA,emittedText);}}_bufferInitSegment(currentLevel,tracks,frag,chunkMeta){if(this.state!==State.PARSING){return;}// delete any video track found on audio transmuxer
if(tracks.video){delete tracks.video;}// include levelCodec in audio and video tracks
const track=tracks.audio;if(!track){return;}track.id='audio';const variantAudioCodecs=currentLevel.audioCodec;this.log(`Init audio buffer, container:${track.container}, codecs[level/parsed]=[${variantAudioCodecs}/${track.codec}]`);// SourceBuffer will use track.levelCodec if defined
if(variantAudioCodecs&&variantAudioCodecs.split(',').length===1){track.levelCodec=variantAudioCodecs;}this.hls.trigger(Events$1.BUFFER_CODECS,tracks);const initSegment=track.initSegment;if(initSegment!=null&&initSegment.byteLength){const segment={type:'audio',frag,part:null,chunkMeta,parent:frag.type,data:initSegment};this.hls.trigger(Events$1.BUFFER_APPENDING,segment);}// trigger handler right now
this.tickImmediate();}loadFragment(frag,track,targetBufferTime){// only load if fragment is not loaded or if in audio switch
const fragState=this.fragmentTracker.getState(frag);this.fragCurrent=frag;// we force a frag loading in audio switch as fragment tracker might not have evicted previous frags in case of quick audio switch
if(this.switchingTrack||fragState===FragmentState.NOT_LOADED||fragState===FragmentState.PARTIAL){var _track$details2;if(frag.sn==='initSegment'){this._loadInitSegment(frag,track);}else if((_track$details2=track.details)!=null&&_track$details2.live&&!this.initPTS[frag.cc]){this.log(`Waiting for video PTS in continuity counter ${frag.cc} of live stream before loading audio fragment ${frag.sn} of level ${this.trackId}`);this.state=State.WAITING_INIT_PTS;const mainDetails=this.mainDetails;if(mainDetails&&mainDetails.fragments[0].start!==track.details.fragments[0].start){alignMediaPlaylistByPDT(track.details,mainDetails);}}else {this.startFragRequested=true;super.loadFragment(frag,track,targetBufferTime);}}else {this.clearTrackerIfNeeded(frag);}}flushAudioIfNeeded(switchingTrack){const{media,bufferedTrack}=this;const bufferedAttributes=bufferedTrack==null?void 0:bufferedTrack.attrs;const switchAttributes=switchingTrack.attrs;if(media&&bufferedAttributes&&(bufferedAttributes.CHANNELS!==switchAttributes.CHANNELS||bufferedTrack.name!==switchingTrack.name||bufferedTrack.lang!==switchingTrack.lang)){this.log('Switching audio track : flushing all audio');super.flushMainBuffer(0,Number.POSITIVE_INFINITY,'audio');this.bufferedTrack=null;}}completeAudioSwitch(switchingTrack){const{hls}=this;this.flushAudioIfNeeded(switchingTrack);this.bufferedTrack=switchingTrack;this.switchingTrack=null;hls.trigger(Events$1.AUDIO_TRACK_SWITCHED,_objectSpread2({},switchingTrack));}}class AudioTrackController extends BasePlaylistController{constructor(hls){super(hls,'[audio-track-controller]');this.tracks=[];this.groupIds=null;this.tracksInGroup=[];this.trackId=-1;this.currentTrack=null;this.selectDefaultTrack=true;this.registerListeners();}registerListeners(){const{hls}=this;hls.on(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.on(Events$1.MANIFEST_PARSED,this.onManifestParsed,this);hls.on(Events$1.LEVEL_LOADING,this.onLevelLoading,this);hls.on(Events$1.LEVEL_SWITCHING,this.onLevelSwitching,this);hls.on(Events$1.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this);hls.on(Events$1.ERROR,this.onError,this);}unregisterListeners(){const{hls}=this;hls.off(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.off(Events$1.MANIFEST_PARSED,this.onManifestParsed,this);hls.off(Events$1.LEVEL_LOADING,this.onLevelLoading,this);hls.off(Events$1.LEVEL_SWITCHING,this.onLevelSwitching,this);hls.off(Events$1.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this);hls.off(Events$1.ERROR,this.onError,this);}destroy(){this.unregisterListeners();this.tracks.length=0;this.tracksInGroup.length=0;this.currentTrack=null;super.destroy();}onManifestLoading(){this.tracks=[];this.tracksInGroup=[];this.groupIds=null;this.currentTrack=null;this.trackId=-1;this.selectDefaultTrack=true;}onManifestParsed(event,data){this.tracks=data.audioTracks||[];}onAudioTrackLoaded(event,data){const{id,groupId,details}=data;const trackInActiveGroup=this.tracksInGroup[id];if(!trackInActiveGroup||trackInActiveGroup.groupId!==groupId){this.warn(`Audio track with id:${id} and group:${groupId} not found in active group ${trackInActiveGroup==null?void 0:trackInActiveGroup.groupId}`);return;}const curDetails=trackInActiveGroup.details;trackInActiveGroup.details=data.details;this.log(`Audio track ${id} "${trackInActiveGroup.name}" lang:${trackInActiveGroup.lang} group:${groupId} loaded [${details.startSN}-${details.endSN}]`);if(id===this.trackId){this.playlistLoaded(id,data,curDetails);}}onLevelLoading(event,data){this.switchLevel(data.level);}onLevelSwitching(event,data){this.switchLevel(data.level);}switchLevel(levelIndex){const levelInfo=this.hls.levels[levelIndex];if(!levelInfo){return;}const audioGroups=levelInfo.audioGroups||null;const currentGroups=this.groupIds;let currentTrack=this.currentTrack;if(!audioGroups||(currentGroups==null?void 0:currentGroups.length)!==(audioGroups==null?void 0:audioGroups.length)||audioGroups!=null&&audioGroups.some(groupId=>(currentGroups==null?void 0:currentGroups.indexOf(groupId))===-1)){this.groupIds=audioGroups;this.trackId=-1;this.currentTrack=null;const audioTracks=this.tracks.filter(track=>!audioGroups||audioGroups.indexOf(track.groupId)!==-1);if(audioTracks.length){// Disable selectDefaultTrack if there are no default tracks
if(this.selectDefaultTrack&&!audioTracks.some(track=>track.default)){this.selectDefaultTrack=false;}// track.id should match hls.audioTracks index
audioTracks.forEach((track,i)=>{track.id=i;});}else if(!currentTrack&&!this.tracksInGroup.length){// Do not dispatch AUDIO_TRACKS_UPDATED when there were and are no tracks
return;}this.tracksInGroup=audioTracks;// Find preferred track
const audioPreference=this.hls.config.audioPreference;if(!currentTrack&&audioPreference){const groupIndex=findMatchingOption(audioPreference,audioTracks,audioMatchPredicate);if(groupIndex>-1){currentTrack=audioTracks[groupIndex];}else {const allIndex=findMatchingOption(audioPreference,this.tracks);currentTrack=this.tracks[allIndex];}}// Select initial track
let trackId=this.findTrackId(currentTrack);if(trackId===-1&&currentTrack){trackId=this.findTrackId(null);}// Dispatch events and load track if needed
const audioTracksUpdated={audioTracks};this.log(`Updating audio tracks, ${audioTracks.length} track(s) found in group(s): ${audioGroups==null?void 0:audioGroups.join(',')}`);this.hls.trigger(Events$1.AUDIO_TRACKS_UPDATED,audioTracksUpdated);const selectedTrackId=this.trackId;if(trackId!==-1&&selectedTrackId===-1){this.setAudioTrack(trackId);}else if(audioTracks.length&&selectedTrackId===-1){var _this$groupIds;const error=new Error(`No audio track selected for current audio group-ID(s): ${(_this$groupIds=this.groupIds)==null?void 0:_this$groupIds.join(',')} track count: ${audioTracks.length}`);this.warn(error.message);this.hls.trigger(Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:true,error});}}else if(this.shouldReloadPlaylist(currentTrack)){// Retry playlist loading if no playlist is or has been loaded yet
this.setAudioTrack(this.trackId);}}onError(event,data){if(data.fatal||!data.context){return;}if(data.context.type===PlaylistContextType.AUDIO_TRACK&&data.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(data.context.groupId)!==-1)){this.requestScheduled=-1;this.checkRetry(data);}}get allAudioTracks(){return this.tracks;}get audioTracks(){return this.tracksInGroup;}get audioTrack(){return this.trackId;}set audioTrack(newId){// If audio track is selected from API then don't choose from the manifest default track
this.selectDefaultTrack=false;this.setAudioTrack(newId);}setAudioOption(audioOption){const hls=this.hls;hls.config.audioPreference=audioOption;if(audioOption){const allAudioTracks=this.allAudioTracks;this.selectDefaultTrack=false;if(allAudioTracks.length){// First see if current option matches (no switch op)
const currentTrack=this.currentTrack;if(currentTrack&&matchesOption(audioOption,currentTrack,audioMatchPredicate)){return currentTrack;}// Find option in available tracks (tracksInGroup)
const groupIndex=findMatchingOption(audioOption,this.tracksInGroup,audioMatchPredicate);if(groupIndex>-1){const track=this.tracksInGroup[groupIndex];this.setAudioTrack(groupIndex);return track;}else if(currentTrack){// Find option in nearest level audio group
let searchIndex=hls.loadLevel;if(searchIndex===-1){searchIndex=hls.firstAutoLevel;}const switchIndex=findClosestLevelWithAudioGroup(audioOption,hls.levels,allAudioTracks,searchIndex,audioMatchPredicate);if(switchIndex===-1){// could not find matching variant
return null;}// and switch level to acheive the audio group switch
hls.nextLoadLevel=switchIndex;}if(audioOption.channels||audioOption.audioCodec){// Could not find a match with codec / channels predicate
// Find a match without channels or codec
const withoutCodecAndChannelsMatch=findMatchingOption(audioOption,allAudioTracks);if(withoutCodecAndChannelsMatch>-1){return allAudioTracks[withoutCodecAndChannelsMatch];}}}}return null;}setAudioTrack(newId){const tracks=this.tracksInGroup;// check if level idx is valid
if(newId<0||newId>=tracks.length){this.warn(`Invalid audio track id: ${newId}`);return;}// stopping live reloading timer if any
this.clearTimer();this.selectDefaultTrack=false;const lastTrack=this.currentTrack;const track=tracks[newId];const trackLoaded=track.details&&!track.details.live;if(newId===this.trackId&&track===lastTrack&&trackLoaded){return;}this.log(`Switching to audio-track ${newId} "${track.name}" lang:${track.lang} group:${track.groupId} channels:${track.channels}`);this.trackId=newId;this.currentTrack=track;this.hls.trigger(Events$1.AUDIO_TRACK_SWITCHING,_objectSpread2({},track));// Do not reload track unless live
if(trackLoaded){return;}const hlsUrlParameters=this.switchParams(track.url,lastTrack==null?void 0:lastTrack.details,track.details);this.loadPlaylist(hlsUrlParameters);}findTrackId(currentTrack){const audioTracks=this.tracksInGroup;for(let i=0;i<audioTracks.length;i++){const track=audioTracks[i];if(this.selectDefaultTrack&&!track.default){continue;}if(!currentTrack||matchesOption(currentTrack,track,audioMatchPredicate)){return i;}}if(currentTrack){const{name,lang,assocLang,characteristics,audioCodec,channels}=currentTrack;for(let i=0;i<audioTracks.length;i++){const track=audioTracks[i];if(matchesOption({name,lang,assocLang,characteristics,audioCodec,channels},track,audioMatchPredicate)){return i;}}for(let i=0;i<audioTracks.length;i++){const track=audioTracks[i];if(mediaAttributesIdentical(currentTrack.attrs,track.attrs,['LANGUAGE','ASSOC-LANGUAGE','CHARACTERISTICS'])){return i;}}for(let i=0;i<audioTracks.length;i++){const track=audioTracks[i];if(mediaAttributesIdentical(currentTrack.attrs,track.attrs,['LANGUAGE'])){return i;}}}return -1;}loadPlaylist(hlsUrlParameters){const audioTrack=this.currentTrack;if(this.shouldLoadPlaylist(audioTrack)&&audioTrack){super.loadPlaylist();const id=audioTrack.id;const groupId=audioTrack.groupId;let url=audioTrack.url;if(hlsUrlParameters){try{url=hlsUrlParameters.addDirectives(url);}catch(error){this.warn(`Could not construct new URL with HLS Delivery Directives: ${error}`);}}// track not retrieved yet, or live playlist we need to (re)load it
this.log(`loading audio-track playlist ${id} "${audioTrack.name}" lang:${audioTrack.lang} group:${groupId}`);this.clearTimer();this.hls.trigger(Events$1.AUDIO_TRACK_LOADING,{url,id,groupId,deliveryDirectives:hlsUrlParameters||null});}}}const TICK_INTERVAL$1=500;// how often to tick in ms
class SubtitleStreamController extends BaseStreamController{constructor(hls,fragmentTracker,keyLoader){super(hls,fragmentTracker,keyLoader,'[subtitle-stream-controller]',PlaylistLevelType.SUBTITLE);this.currentTrackId=-1;this.tracksBuffered=[];this.mainDetails=null;this._registerListeners();}onHandlerDestroying(){this._unregisterListeners();super.onHandlerDestroying();this.mainDetails=null;}_registerListeners(){const{hls}=this;hls.on(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);hls.on(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);hls.on(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.on(Events$1.LEVEL_LOADED,this.onLevelLoaded,this);hls.on(Events$1.ERROR,this.onError,this);hls.on(Events$1.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this);hls.on(Events$1.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this);hls.on(Events$1.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this);hls.on(Events$1.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this);hls.on(Events$1.BUFFER_FLUSHING,this.onBufferFlushing,this);hls.on(Events$1.FRAG_BUFFERED,this.onFragBuffered,this);}_unregisterListeners(){const{hls}=this;hls.off(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);hls.off(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);hls.off(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.off(Events$1.LEVEL_LOADED,this.onLevelLoaded,this);hls.off(Events$1.ERROR,this.onError,this);hls.off(Events$1.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this);hls.off(Events$1.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this);hls.off(Events$1.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this);hls.off(Events$1.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this);hls.off(Events$1.BUFFER_FLUSHING,this.onBufferFlushing,this);hls.off(Events$1.FRAG_BUFFERED,this.onFragBuffered,this);}startLoad(startPosition){this.stopLoad();this.state=State.IDLE;this.setInterval(TICK_INTERVAL$1);this.nextLoadPosition=this.startPosition=this.lastCurrentTime=startPosition;this.tick();}onManifestLoading(){this.mainDetails=null;this.fragmentTracker.removeAllFragments();}onMediaDetaching(){this.tracksBuffered=[];super.onMediaDetaching();}onLevelLoaded(event,data){this.mainDetails=data.details;}onSubtitleFragProcessed(event,data){const{frag,success}=data;this.fragPrevious=frag;this.state=State.IDLE;if(!success){return;}const buffered=this.tracksBuffered[this.currentTrackId];if(!buffered){return;}// Create/update a buffered array matching the interface used by BufferHelper.bufferedInfo
// so we can re-use the logic used to detect how much has been buffered
let timeRange;const fragStart=frag.start;for(let i=0;i<buffered.length;i++){if(fragStart>=buffered[i].start&&fragStart<=buffered[i].end){timeRange=buffered[i];break;}}const fragEnd=frag.start+frag.duration;if(timeRange){timeRange.end=fragEnd;}else {timeRange={start:fragStart,end:fragEnd};buffered.push(timeRange);}this.fragmentTracker.fragBuffered(frag);this.fragBufferedComplete(frag,null);}onBufferFlushing(event,data){const{startOffset,endOffset}=data;if(startOffset===0&&endOffset!==Number.POSITIVE_INFINITY){const endOffsetSubtitles=endOffset-1;if(endOffsetSubtitles<=0){return;}data.endOffsetSubtitles=Math.max(0,endOffsetSubtitles);this.tracksBuffered.forEach(buffered=>{for(let i=0;i<buffered.length;){if(buffered[i].end<=endOffsetSubtitles){buffered.shift();continue;}else if(buffered[i].start<endOffsetSubtitles){buffered[i].start=endOffsetSubtitles;}else {break;}i++;}});this.fragmentTracker.removeFragmentsInRange(startOffset,endOffsetSubtitles,PlaylistLevelType.SUBTITLE);}}onFragBuffered(event,data){if(!this.loadedmetadata&&data.frag.type===PlaylistLevelType.MAIN){var _this$media;if((_this$media=this.media)!=null&&_this$media.buffered.length){this.loadedmetadata=true;}}}// If something goes wrong, proceed to next frag, if we were processing one.
onError(event,data){const frag=data.frag;if((frag==null?void 0:frag.type)===PlaylistLevelType.SUBTITLE){if(this.fragCurrent){this.fragCurrent.abortRequests();}if(this.state!==State.STOPPED){this.state=State.IDLE;}}}// Got all new subtitle levels.
onSubtitleTracksUpdated(event,{subtitleTracks}){if(this.levels&&subtitleOptionsIdentical(this.levels,subtitleTracks)){this.levels=subtitleTracks.map(mediaPlaylist=>new Level(mediaPlaylist));return;}this.tracksBuffered=[];this.levels=subtitleTracks.map(mediaPlaylist=>{const level=new Level(mediaPlaylist);this.tracksBuffered[level.id]=[];return level;});this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,PlaylistLevelType.SUBTITLE);this.fragPrevious=null;this.mediaBuffer=null;}onSubtitleTrackSwitch(event,data){var _this$levels;this.currentTrackId=data.id;if(!((_this$levels=this.levels)!=null&&_this$levels.length)||this.currentTrackId===-1){this.clearInterval();return;}// Check if track has the necessary details to load fragments
const currentTrack=this.levels[this.currentTrackId];if(currentTrack!=null&&currentTrack.details){this.mediaBuffer=this.mediaBufferTimeRanges;}else {this.mediaBuffer=null;}if(currentTrack){this.setInterval(TICK_INTERVAL$1);}}// Got a new set of subtitle fragments.
onSubtitleTrackLoaded(event,data){var _track$details;const{currentTrackId,levels}=this;const{details:newDetails,id:trackId}=data;if(!levels){this.warn(`Subtitle tracks were reset while loading level ${trackId}`);return;}const track=levels[trackId];if(trackId>=levels.length||!track){return;}this.log(`Subtitle track ${trackId} loaded [${newDetails.startSN},${newDetails.endSN}]${newDetails.lastPartSn?`[part-${newDetails.lastPartSn}-${newDetails.lastPartIndex}]`:''},duration:${newDetails.totalduration}`);this.mediaBuffer=this.mediaBufferTimeRanges;let sliding=0;if(newDetails.live||(_track$details=track.details)!=null&&_track$details.live){const mainDetails=this.mainDetails;if(newDetails.deltaUpdateFailed||!mainDetails){return;}const mainSlidingStartFragment=mainDetails.fragments[0];if(!track.details){if(newDetails.hasProgramDateTime&&mainDetails.hasProgramDateTime){alignMediaPlaylistByPDT(newDetails,mainDetails);sliding=newDetails.fragments[0].start;}else if(mainSlidingStartFragment){// line up live playlist with main so that fragments in range are loaded
sliding=mainSlidingStartFragment.start;addSliding(newDetails,sliding);}}else {var _this$levelLastLoaded;sliding=this.alignPlaylists(newDetails,track.details,(_this$levelLastLoaded=this.levelLastLoaded)==null?void 0:_this$levelLastLoaded.details);if(sliding===0&&mainSlidingStartFragment){// realign with main when there is no overlap with last refresh
sliding=mainSlidingStartFragment.start;addSliding(newDetails,sliding);}}}track.details=newDetails;this.levelLastLoaded=track;if(trackId!==currentTrackId){return;}if(!this.startFragRequested&&(this.mainDetails||!newDetails.live)){this.setStartPosition(this.mainDetails||newDetails,sliding);}// trigger handler right now
this.tick();// If playlist is misaligned because of bad PDT or drift, delete details to resync with main on reload
if(newDetails.live&&!this.fragCurrent&&this.media&&this.state===State.IDLE){const foundFrag=findFragmentByPTS(null,newDetails.fragments,this.media.currentTime,0);if(!foundFrag){this.warn('Subtitle playlist not aligned with playback');track.details=undefined;}}}_handleFragmentLoadComplete(fragLoadedData){const{frag,payload}=fragLoadedData;const decryptData=frag.decryptdata;const hls=this.hls;if(this.fragContextChanged(frag)){return;}// check to see if the payload needs to be decrypted
if(payload&&payload.byteLength>0&&decryptData!=null&&decryptData.key&&decryptData.iv&&decryptData.method==='AES-128'){const startTime=performance.now();// decrypt the subtitles
this.decrypter.decrypt(new Uint8Array(payload),decryptData.key.buffer,decryptData.iv.buffer).catch(err=>{hls.trigger(Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.FRAG_DECRYPT_ERROR,fatal:false,error:err,reason:err.message,frag});throw err;}).then(decryptedData=>{const endTime=performance.now();hls.trigger(Events$1.FRAG_DECRYPTED,{frag,payload:decryptedData,stats:{tstart:startTime,tdecrypt:endTime}});}).catch(err=>{this.warn(`${err.name}: ${err.message}`);this.state=State.IDLE;});}}doTick(){if(!this.media){this.state=State.IDLE;return;}if(this.state===State.IDLE){const{currentTrackId,levels}=this;const track=levels==null?void 0:levels[currentTrackId];if(!track||!levels.length||!track.details){return;}const{config}=this;const currentTime=this.getLoadPosition();const bufferedInfo=BufferHelper.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],currentTime,config.maxBufferHole);const{end:targetBufferTime,len:bufferLen}=bufferedInfo;const mainBufferInfo=this.getFwdBufferInfo(this.media,PlaylistLevelType.MAIN);const trackDetails=track.details;const maxBufLen=this.getMaxBufferLength(mainBufferInfo==null?void 0:mainBufferInfo.len)+trackDetails.levelTargetDuration;if(bufferLen>maxBufLen){return;}const fragments=trackDetails.fragments;const fragLen=fragments.length;const end=trackDetails.edge;let foundFrag=null;const fragPrevious=this.fragPrevious;if(targetBufferTime<end){const tolerance=config.maxFragLookUpTolerance;const lookupTolerance=targetBufferTime>end-tolerance?0:tolerance;foundFrag=findFragmentByPTS(fragPrevious,fragments,Math.max(fragments[0].start,targetBufferTime),lookupTolerance);if(!foundFrag&&fragPrevious&&fragPrevious.start<fragments[0].start){foundFrag=fragments[0];}}else {foundFrag=fragments[fragLen-1];}if(!foundFrag){return;}foundFrag=this.mapToInitFragWhenRequired(foundFrag);if(foundFrag.sn!=='initSegment'){// Load earlier fragment in same discontinuity to make up for misaligned playlists and cues that extend beyond end of segment
const curSNIdx=foundFrag.sn-trackDetails.startSN;const prevFrag=fragments[curSNIdx-1];if(prevFrag&&prevFrag.cc===foundFrag.cc&&this.fragmentTracker.getState(prevFrag)===FragmentState.NOT_LOADED){foundFrag=prevFrag;}}if(this.fragmentTracker.getState(foundFrag)===FragmentState.NOT_LOADED){// only load if fragment is not loaded
this.loadFragment(foundFrag,track,targetBufferTime);}}}getMaxBufferLength(mainBufferLength){const maxConfigBuffer=super.getMaxBufferLength();if(!mainBufferLength){return maxConfigBuffer;}return Math.max(maxConfigBuffer,mainBufferLength);}loadFragment(frag,level,targetBufferTime){this.fragCurrent=frag;if(frag.sn==='initSegment'){this._loadInitSegment(frag,level);}else {this.startFragRequested=true;super.loadFragment(frag,level,targetBufferTime);}}get mediaBufferTimeRanges(){return new BufferableInstance(this.tracksBuffered[this.currentTrackId]||[]);}}class BufferableInstance{constructor(timeranges){this.buffered=void 0;const getRange=(name,index,length)=>{index=index>>>0;if(index>length-1){throw new DOMException(`Failed to execute '${name}' on 'TimeRanges': The index provided (${index}) is greater than the maximum bound (${length})`);}return timeranges[index][name];};this.buffered={get length(){return timeranges.length;},end(index){return getRange('end',index,timeranges.length);},start(index){return getRange('start',index,timeranges.length);}};}}class SubtitleTrackController extends BasePlaylistController{constructor(hls){super(hls,'[subtitle-track-controller]');this.media=null;this.tracks=[];this.groupIds=null;this.tracksInGroup=[];this.trackId=-1;this.currentTrack=null;this.selectDefaultTrack=true;this.queuedDefaultTrack=-1;this.asyncPollTrackChange=()=>this.pollTrackChange(0);this.useTextTrackPolling=false;this.subtitlePollingInterval=-1;this._subtitleDisplay=true;this.onTextTracksChanged=()=>{if(!this.useTextTrackPolling){self.clearInterval(this.subtitlePollingInterval);}// Media is undefined when switching streams via loadSource()
if(!this.media||!this.hls.config.renderTextTracksNatively){return;}let textTrack=null;const tracks=filterSubtitleTracks(this.media.textTracks);for(let i=0;i<tracks.length;i++){if(tracks[i].mode==='hidden'){// Do not break in case there is a following track with showing.
textTrack=tracks[i];}else if(tracks[i].mode==='showing'){textTrack=tracks[i];break;}}// Find internal track index for TextTrack
const trackId=this.findTrackForTextTrack(textTrack);if(this.subtitleTrack!==trackId){this.setSubtitleTrack(trackId);}};this.registerListeners();}destroy(){this.unregisterListeners();this.tracks.length=0;this.tracksInGroup.length=0;this.currentTrack=null;this.onTextTracksChanged=this.asyncPollTrackChange=null;super.destroy();}get subtitleDisplay(){return this._subtitleDisplay;}set subtitleDisplay(value){this._subtitleDisplay=value;if(this.trackId>-1){this.toggleTrackModes();}}registerListeners(){const{hls}=this;hls.on(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);hls.on(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);hls.on(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.on(Events$1.MANIFEST_PARSED,this.onManifestParsed,this);hls.on(Events$1.LEVEL_LOADING,this.onLevelLoading,this);hls.on(Events$1.LEVEL_SWITCHING,this.onLevelSwitching,this);hls.on(Events$1.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this);hls.on(Events$1.ERROR,this.onError,this);}unregisterListeners(){const{hls}=this;hls.off(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);hls.off(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);hls.off(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.off(Events$1.MANIFEST_PARSED,this.onManifestParsed,this);hls.off(Events$1.LEVEL_LOADING,this.onLevelLoading,this);hls.off(Events$1.LEVEL_SWITCHING,this.onLevelSwitching,this);hls.off(Events$1.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this);hls.off(Events$1.ERROR,this.onError,this);}// Listen for subtitle track change, then extract the current track ID.
onMediaAttached(event,data){this.media=data.media;if(!this.media){return;}if(this.queuedDefaultTrack>-1){this.subtitleTrack=this.queuedDefaultTrack;this.queuedDefaultTrack=-1;}this.useTextTrackPolling=!(this.media.textTracks&&'onchange'in this.media.textTracks);if(this.useTextTrackPolling){this.pollTrackChange(500);}else {this.media.textTracks.addEventListener('change',this.asyncPollTrackChange);}}pollTrackChange(timeout){self.clearInterval(this.subtitlePollingInterval);this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,timeout);}onMediaDetaching(){if(!this.media){return;}self.clearInterval(this.subtitlePollingInterval);if(!this.useTextTrackPolling){this.media.textTracks.removeEventListener('change',this.asyncPollTrackChange);}if(this.trackId>-1){this.queuedDefaultTrack=this.trackId;}const textTracks=filterSubtitleTracks(this.media.textTracks);// Clear loaded cues on media detachment from tracks
textTracks.forEach(track=>{clearCurrentCues(track);});// Disable all subtitle tracks before detachment so when reattached only tracks in that content are enabled.
this.subtitleTrack=-1;this.media=null;}onManifestLoading(){this.tracks=[];this.groupIds=null;this.tracksInGroup=[];this.trackId=-1;this.currentTrack=null;this.selectDefaultTrack=true;}// Fired whenever a new manifest is loaded.
onManifestParsed(event,data){this.tracks=data.subtitleTracks;}onSubtitleTrackLoaded(event,data){const{id,groupId,details}=data;const trackInActiveGroup=this.tracksInGroup[id];if(!trackInActiveGroup||trackInActiveGroup.groupId!==groupId){this.warn(`Subtitle track with id:${id} and group:${groupId} not found in active group ${trackInActiveGroup==null?void 0:trackInActiveGroup.groupId}`);return;}const curDetails=trackInActiveGroup.details;trackInActiveGroup.details=data.details;this.log(`Subtitle track ${id} "${trackInActiveGroup.name}" lang:${trackInActiveGroup.lang} group:${groupId} loaded [${details.startSN}-${details.endSN}]`);if(id===this.trackId){this.playlistLoaded(id,data,curDetails);}}onLevelLoading(event,data){this.switchLevel(data.level);}onLevelSwitching(event,data){this.switchLevel(data.level);}switchLevel(levelIndex){const levelInfo=this.hls.levels[levelIndex];if(!levelInfo){return;}const subtitleGroups=levelInfo.subtitleGroups||null;const currentGroups=this.groupIds;let currentTrack=this.currentTrack;if(!subtitleGroups||(currentGroups==null?void 0:currentGroups.length)!==(subtitleGroups==null?void 0:subtitleGroups.length)||subtitleGroups!=null&&subtitleGroups.some(groupId=>(currentGroups==null?void 0:currentGroups.indexOf(groupId))===-1)){this.groupIds=subtitleGroups;this.trackId=-1;this.currentTrack=null;const subtitleTracks=this.tracks.filter(track=>!subtitleGroups||subtitleGroups.indexOf(track.groupId)!==-1);if(subtitleTracks.length){// Disable selectDefaultTrack if there are no default tracks
if(this.selectDefaultTrack&&!subtitleTracks.some(track=>track.default)){this.selectDefaultTrack=false;}// track.id should match hls.audioTracks index
subtitleTracks.forEach((track,i)=>{track.id=i;});}else if(!currentTrack&&!this.tracksInGroup.length){// Do not dispatch SUBTITLE_TRACKS_UPDATED when there were and are no tracks
return;}this.tracksInGroup=subtitleTracks;// Find preferred track
const subtitlePreference=this.hls.config.subtitlePreference;if(!currentTrack&&subtitlePreference){this.selectDefaultTrack=false;const groupIndex=findMatchingOption(subtitlePreference,subtitleTracks);if(groupIndex>-1){currentTrack=subtitleTracks[groupIndex];}else {const allIndex=findMatchingOption(subtitlePreference,this.tracks);currentTrack=this.tracks[allIndex];}}// Select initial track
let trackId=this.findTrackId(currentTrack);if(trackId===-1&&currentTrack){trackId=this.findTrackId(null);}// Dispatch events and load track if needed
const subtitleTracksUpdated={subtitleTracks};this.log(`Updating subtitle tracks, ${subtitleTracks.length} track(s) found in "${subtitleGroups==null?void 0:subtitleGroups.join(',')}" group-id`);this.hls.trigger(Events$1.SUBTITLE_TRACKS_UPDATED,subtitleTracksUpdated);if(trackId!==-1&&this.trackId===-1){this.setSubtitleTrack(trackId);}}else if(this.shouldReloadPlaylist(currentTrack)){// Retry playlist loading if no playlist is or has been loaded yet
this.setSubtitleTrack(this.trackId);}}findTrackId(currentTrack){const tracks=this.tracksInGroup;const selectDefault=this.selectDefaultTrack;for(let i=0;i<tracks.length;i++){const track=tracks[i];if(selectDefault&&!track.default||!selectDefault&&!currentTrack){continue;}if(!currentTrack||matchesOption(track,currentTrack)){return i;}}if(currentTrack){for(let i=0;i<tracks.length;i++){const track=tracks[i];if(mediaAttributesIdentical(currentTrack.attrs,track.attrs,['LANGUAGE','ASSOC-LANGUAGE','CHARACTERISTICS'])){return i;}}for(let i=0;i<tracks.length;i++){const track=tracks[i];if(mediaAttributesIdentical(currentTrack.attrs,track.attrs,['LANGUAGE'])){return i;}}}return -1;}findTrackForTextTrack(textTrack){if(textTrack){const tracks=this.tracksInGroup;for(let i=0;i<tracks.length;i++){const track=tracks[i];if(subtitleTrackMatchesTextTrack(track,textTrack)){return i;}}}return -1;}onError(event,data){if(data.fatal||!data.context){return;}if(data.context.type===PlaylistContextType.SUBTITLE_TRACK&&data.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(data.context.groupId)!==-1)){this.checkRetry(data);}}get allSubtitleTracks(){return this.tracks;}/** get alternate subtitle tracks list from playlist **/get subtitleTracks(){return this.tracksInGroup;}/** get/set index of the selected subtitle track (based on index in subtitle track lists) **/get subtitleTrack(){return this.trackId;}set subtitleTrack(newId){this.selectDefaultTrack=false;this.setSubtitleTrack(newId);}setSubtitleOption(subtitleOption){this.hls.config.subtitlePreference=subtitleOption;if(subtitleOption){const allSubtitleTracks=this.allSubtitleTracks;this.selectDefaultTrack=false;if(allSubtitleTracks.length){// First see if current option matches (no switch op)
const currentTrack=this.currentTrack;if(currentTrack&&matchesOption(subtitleOption,currentTrack)){return currentTrack;}// Find option in current group
const groupIndex=findMatchingOption(subtitleOption,this.tracksInGroup);if(groupIndex>-1){const track=this.tracksInGroup[groupIndex];this.setSubtitleTrack(groupIndex);return track;}else if(currentTrack){// If this is not the initial selection return null
// option should have matched one in active group
return null;}else {// Find the option in all tracks for initial selection
const allIndex=findMatchingOption(subtitleOption,allSubtitleTracks);if(allIndex>-1){return allSubtitleTracks[allIndex];}}}}return null;}loadPlaylist(hlsUrlParameters){super.loadPlaylist();const currentTrack=this.currentTrack;if(this.shouldLoadPlaylist(currentTrack)&&currentTrack){const id=currentTrack.id;const groupId=currentTrack.groupId;let url=currentTrack.url;if(hlsUrlParameters){try{url=hlsUrlParameters.addDirectives(url);}catch(error){this.warn(`Could not construct new URL with HLS Delivery Directives: ${error}`);}}this.log(`Loading subtitle playlist for id ${id}`);this.hls.trigger(Events$1.SUBTITLE_TRACK_LOADING,{url,id,groupId,deliveryDirectives:hlsUrlParameters||null});}}/**
   * Disables the old subtitleTrack and sets current mode on the next subtitleTrack.
   * This operates on the DOM textTracks.
   * A value of -1 will disable all subtitle tracks.
   */toggleTrackModes(){const{media}=this;if(!media){return;}const textTracks=filterSubtitleTracks(media.textTracks);const currentTrack=this.currentTrack;let nextTrack;if(currentTrack){nextTrack=textTracks.filter(textTrack=>subtitleTrackMatchesTextTrack(currentTrack,textTrack))[0];if(!nextTrack){this.warn(`Unable to find subtitle TextTrack with name "${currentTrack.name}" and language "${currentTrack.lang}"`);}}[].slice.call(textTracks).forEach(track=>{if(track.mode!=='disabled'&&track!==nextTrack){track.mode='disabled';}});if(nextTrack){const mode=this.subtitleDisplay?'showing':'hidden';if(nextTrack.mode!==mode){nextTrack.mode=mode;}}}/**
   * This method is responsible for validating the subtitle index and periodically reloading if live.
   * Dispatches the SUBTITLE_TRACK_SWITCH event, which instructs the subtitle-stream-controller to load the selected track.
   */setSubtitleTrack(newId){const tracks=this.tracksInGroup;// setting this.subtitleTrack will trigger internal logic
// if media has not been attached yet, it will fail
// we keep a reference to the default track id
// and we'll set subtitleTrack when onMediaAttached is triggered
if(!this.media){this.queuedDefaultTrack=newId;return;}// exit if track id as already set or invalid
if(newId<-1||newId>=tracks.length||!isFiniteNumber(newId)){this.warn(`Invalid subtitle track id: ${newId}`);return;}// stopping live reloading timer if any
this.clearTimer();this.selectDefaultTrack=false;const lastTrack=this.currentTrack;const track=tracks[newId]||null;this.trackId=newId;this.currentTrack=track;this.toggleTrackModes();if(!track){// switch to -1
this.hls.trigger(Events$1.SUBTITLE_TRACK_SWITCH,{id:newId});return;}const trackLoaded=!!track.details&&!track.details.live;if(newId===this.trackId&&track===lastTrack&&trackLoaded){return;}this.log(`Switching to subtitle-track ${newId}`+(track?` "${track.name}" lang:${track.lang} group:${track.groupId}`:''));const{id,groupId='',name,type,url}=track;this.hls.trigger(Events$1.SUBTITLE_TRACK_SWITCH,{id,groupId,name,type,url});const hlsUrlParameters=this.switchParams(track.url,lastTrack==null?void 0:lastTrack.details,track.details);this.loadPlaylist(hlsUrlParameters);}}class BufferOperationQueue{constructor(sourceBufferReference){this.buffers=void 0;this.queues={video:[],audio:[],audiovideo:[]};this.buffers=sourceBufferReference;}append(operation,type,pending){const queue=this.queues[type];queue.push(operation);if(queue.length===1&&!pending){this.executeNext(type);}}insertAbort(operation,type){const queue=this.queues[type];queue.unshift(operation);this.executeNext(type);}appendBlocker(type){let execute;const promise=new Promise(resolve=>{execute=resolve;});const operation={execute,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(operation,type);return promise;}executeNext(type){const queue=this.queues[type];if(queue.length){const operation=queue[0];try{// Operations are expected to result in an 'updateend' event being fired. If not, the queue will lock. Operations
// which do not end with this event must call _onSBUpdateEnd manually
operation.execute();}catch(error){logger.warn(`[buffer-operation-queue]: Exception executing "${type}" SourceBuffer operation: ${error}`);operation.onError(error);// Only shift the current operation off, otherwise the updateend handler will do this for us
const sb=this.buffers[type];if(!(sb!=null&&sb.updating)){this.shiftAndExecuteNext(type);}}}}shiftAndExecuteNext(type){this.queues[type].shift();this.executeNext(type);}current(type){return this.queues[type][0];}}const VIDEO_CODEC_PROFILE_REPLACE=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;class BufferController{constructor(hls){// The level details used to determine duration, target-duration and live
this.details=null;// cache the self generated object url to detect hijack of video tag
this._objectUrl=null;// A queue of buffer operations which require the SourceBuffer to not be updating upon execution
this.operationQueue=void 0;// References to event listeners for each SourceBuffer, so that they can be referenced for event removal
this.listeners=void 0;this.hls=void 0;// The number of BUFFER_CODEC events received before any sourceBuffers are created
this.bufferCodecEventsExpected=0;// The total number of BUFFER_CODEC events received
this._bufferCodecEventsTotal=0;// A reference to the attached media element
this.media=null;// A reference to the active media source
this.mediaSource=null;// Last MP3 audio chunk appended
this.lastMpegAudioChunk=null;this.appendSource=void 0;// counters
this.appendErrors={audio:0,video:0,audiovideo:0};this.tracks={};this.pendingTracks={};this.sourceBuffer=void 0;this.log=void 0;this.warn=void 0;this.error=void 0;this._onEndStreaming=event=>{if(!this.hls){return;}this.hls.pauseBuffering();};this._onStartStreaming=event=>{if(!this.hls){return;}this.hls.resumeBuffering();};// Keep as arrow functions so that we can directly reference these functions directly as event listeners
this._onMediaSourceOpen=()=>{const{media,mediaSource}=this;this.log('Media source opened');if(media){media.removeEventListener('emptied',this._onMediaEmptied);this.updateMediaElementDuration();this.hls.trigger(Events$1.MEDIA_ATTACHED,{media,mediaSource:mediaSource});}if(mediaSource){// once received, don't listen anymore to sourceopen event
mediaSource.removeEventListener('sourceopen',this._onMediaSourceOpen);}this.checkPendingTracks();};this._onMediaSourceClose=()=>{this.log('Media source closed');};this._onMediaSourceEnded=()=>{this.log('Media source ended');};this._onMediaEmptied=()=>{const{mediaSrc,_objectUrl}=this;if(mediaSrc!==_objectUrl){logger.error(`Media element src was set while attaching MediaSource (${_objectUrl} > ${mediaSrc})`);}};this.hls=hls;const logPrefix='[buffer-controller]';this.appendSource=isManagedMediaSource(getMediaSource(hls.config.preferManagedMediaSource));this.log=logger.log.bind(logger,logPrefix);this.warn=logger.warn.bind(logger,logPrefix);this.error=logger.error.bind(logger,logPrefix);this._initSourceBuffer();this.registerListeners();}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0;}destroy(){this.unregisterListeners();this.details=null;this.lastMpegAudioChunk=null;// @ts-ignore
this.hls=null;}registerListeners(){const{hls}=this;hls.on(Events$1.MEDIA_ATTACHING,this.onMediaAttaching,this);hls.on(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);hls.on(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.on(Events$1.MANIFEST_PARSED,this.onManifestParsed,this);hls.on(Events$1.BUFFER_RESET,this.onBufferReset,this);hls.on(Events$1.BUFFER_APPENDING,this.onBufferAppending,this);hls.on(Events$1.BUFFER_CODECS,this.onBufferCodecs,this);hls.on(Events$1.BUFFER_EOS,this.onBufferEos,this);hls.on(Events$1.BUFFER_FLUSHING,this.onBufferFlushing,this);hls.on(Events$1.LEVEL_UPDATED,this.onLevelUpdated,this);hls.on(Events$1.FRAG_PARSED,this.onFragParsed,this);hls.on(Events$1.FRAG_CHANGED,this.onFragChanged,this);}unregisterListeners(){const{hls}=this;hls.off(Events$1.MEDIA_ATTACHING,this.onMediaAttaching,this);hls.off(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);hls.off(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.off(Events$1.MANIFEST_PARSED,this.onManifestParsed,this);hls.off(Events$1.BUFFER_RESET,this.onBufferReset,this);hls.off(Events$1.BUFFER_APPENDING,this.onBufferAppending,this);hls.off(Events$1.BUFFER_CODECS,this.onBufferCodecs,this);hls.off(Events$1.BUFFER_EOS,this.onBufferEos,this);hls.off(Events$1.BUFFER_FLUSHING,this.onBufferFlushing,this);hls.off(Events$1.LEVEL_UPDATED,this.onLevelUpdated,this);hls.off(Events$1.FRAG_PARSED,this.onFragParsed,this);hls.off(Events$1.FRAG_CHANGED,this.onFragChanged,this);}_initSourceBuffer(){this.sourceBuffer={};this.operationQueue=new BufferOperationQueue(this.sourceBuffer);this.listeners={audio:[],video:[],audiovideo:[]};this.appendErrors={audio:0,video:0,audiovideo:0};this.lastMpegAudioChunk=null;}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0;this.details=null;}onManifestParsed(event,data){// in case of alt audio 2 BUFFER_CODECS events will be triggered, one per stream controller
// sourcebuffers will be created all at once when the expected nb of tracks will be reached
// in case alt audio is not used, only one BUFFER_CODEC event will be fired from main stream controller
// it will contain the expected nb of source buffers, no need to compute it
let codecEvents=2;if(data.audio&&!data.video||!data.altAudio||!true){codecEvents=1;}this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=codecEvents;this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`);}onMediaAttaching(event,data){const media=this.media=data.media;const MediaSource=getMediaSource(this.appendSource);if(media&&MediaSource){var _ms$constructor;const ms=this.mediaSource=new MediaSource();this.log(`created media source: ${(_ms$constructor=ms.constructor)==null?void 0:_ms$constructor.name}`);// MediaSource listeners are arrow functions with a lexical scope, and do not need to be bound
ms.addEventListener('sourceopen',this._onMediaSourceOpen);ms.addEventListener('sourceended',this._onMediaSourceEnded);ms.addEventListener('sourceclose',this._onMediaSourceClose);if(this.appendSource){ms.addEventListener('startstreaming',this._onStartStreaming);ms.addEventListener('endstreaming',this._onEndStreaming);}// cache the locally generated object url
const objectUrl=this._objectUrl=self.URL.createObjectURL(ms);// link video and media Source
if(this.appendSource){try{media.removeAttribute('src');// ManagedMediaSource will not open without disableRemotePlayback set to false or source alternatives
const MMS=self.ManagedMediaSource;media.disableRemotePlayback=media.disableRemotePlayback||MMS&&ms instanceof MMS;removeSourceChildren(media);addSource(media,objectUrl);media.load();}catch(error){media.src=objectUrl;}}else {media.src=objectUrl;}media.addEventListener('emptied',this._onMediaEmptied);}}onMediaDetaching(){const{media,mediaSource,_objectUrl}=this;if(mediaSource){this.log('media source detaching');if(mediaSource.readyState==='open'){try{// endOfStream could trigger exception if any sourcebuffer is in updating state
// we don't really care about checking sourcebuffer state here,
// as we are anyway detaching the MediaSource
// let's just avoid this exception to propagate
mediaSource.endOfStream();}catch(err){this.warn(`onMediaDetaching: ${err.message} while calling endOfStream`);}}// Clean up the SourceBuffers by invoking onBufferReset
this.onBufferReset();mediaSource.removeEventListener('sourceopen',this._onMediaSourceOpen);mediaSource.removeEventListener('sourceended',this._onMediaSourceEnded);mediaSource.removeEventListener('sourceclose',this._onMediaSourceClose);if(this.appendSource){mediaSource.removeEventListener('startstreaming',this._onStartStreaming);mediaSource.removeEventListener('endstreaming',this._onEndStreaming);}// Detach properly the MediaSource from the HTMLMediaElement as
// suggested in https://github.com/w3c/media-source/issues/53.
if(media){media.removeEventListener('emptied',this._onMediaEmptied);if(_objectUrl){self.URL.revokeObjectURL(_objectUrl);}// clean up video tag src only if it's our own url. some external libraries might
// hijack the video tag and change its 'src' without destroying the Hls instance first
if(this.mediaSrc===_objectUrl){media.removeAttribute('src');if(this.appendSource){removeSourceChildren(media);}media.load();}else {this.warn('media|source.src was changed by a third party - skip cleanup');}}this.mediaSource=null;this.media=null;this._objectUrl=null;this.bufferCodecEventsExpected=this._bufferCodecEventsTotal;this.pendingTracks={};this.tracks={};}this.hls.trigger(Events$1.MEDIA_DETACHED,undefined);}onBufferReset(){this.getSourceBufferTypes().forEach(type=>{this.resetBuffer(type);});this._initSourceBuffer();}resetBuffer(type){const sb=this.sourceBuffer[type];try{if(sb){var _this$mediaSource;this.removeBufferListeners(type);// Synchronously remove the SB from the map before the next call in order to prevent an async function from
// accessing it
this.sourceBuffer[type]=undefined;if((_this$mediaSource=this.mediaSource)!=null&&_this$mediaSource.sourceBuffers.length){this.mediaSource.removeSourceBuffer(sb);}}}catch(err){this.warn(`onBufferReset ${type}`,err);}}onBufferCodecs(event,data){const sourceBufferCount=this.getSourceBufferTypes().length;const trackNames=Object.keys(data);trackNames.forEach(trackName=>{if(sourceBufferCount){// check if SourceBuffer codec needs to change
const track=this.tracks[trackName];if(track&&typeof track.buffer.changeType==='function'){var _trackCodec;const{id,codec,levelCodec,container,metadata}=data[trackName];const currentCodecFull=pickMostCompleteCodecName(track.codec,track.levelCodec);const currentCodec=currentCodecFull==null?void 0:currentCodecFull.replace(VIDEO_CODEC_PROFILE_REPLACE,'$1');let trackCodec=pickMostCompleteCodecName(codec,levelCodec);const nextCodec=(_trackCodec=trackCodec)==null?void 0:_trackCodec.replace(VIDEO_CODEC_PROFILE_REPLACE,'$1');if(trackCodec&&currentCodec!==nextCodec){if(trackName.slice(0,5)==='audio'){trackCodec=getCodecCompatibleName(trackCodec,this.appendSource);}const mimeType=`${container};codecs=${trackCodec}`;this.appendChangeType(trackName,mimeType);this.log(`switching codec ${currentCodecFull} to ${trackCodec}`);this.tracks[trackName]={buffer:track.buffer,codec,container,levelCodec,metadata,id};}}}else {// if source buffer(s) not created yet, appended buffer tracks in this.pendingTracks
this.pendingTracks[trackName]=data[trackName];}});// if sourcebuffers already created, do nothing ...
if(sourceBufferCount){return;}const bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0);if(this.bufferCodecEventsExpected!==bufferCodecEventsExpected){this.log(`${bufferCodecEventsExpected} bufferCodec event(s) expected ${trackNames.join(',')}`);this.bufferCodecEventsExpected=bufferCodecEventsExpected;}if(this.mediaSource&&this.mediaSource.readyState==='open'){this.checkPendingTracks();}}appendChangeType(type,mimeType){const{operationQueue}=this;const operation={execute:()=>{const sb=this.sourceBuffer[type];if(sb){this.log(`changing ${type} sourceBuffer type to ${mimeType}`);sb.changeType(mimeType);}operationQueue.shiftAndExecuteNext(type);},onStart:()=>{},onComplete:()=>{},onError:error=>{this.warn(`Failed to change ${type} SourceBuffer type`,error);}};operationQueue.append(operation,type,!!this.pendingTracks[type]);}onBufferAppending(event,eventData){const{hls,operationQueue,tracks}=this;const{data,type,frag,part,chunkMeta}=eventData;const chunkStats=chunkMeta.buffering[type];const bufferAppendingStart=self.performance.now();chunkStats.start=bufferAppendingStart;const fragBuffering=frag.stats.buffering;const partBuffering=part?part.stats.buffering:null;if(fragBuffering.start===0){fragBuffering.start=bufferAppendingStart;}if(partBuffering&&partBuffering.start===0){partBuffering.start=bufferAppendingStart;}// TODO: Only update timestampOffset when audio/mpeg fragment or part is not contiguous with previously appended
// Adjusting `SourceBuffer.timestampOffset` (desired point in the timeline where the next frames should be appended)
// in Chrome browser when we detect MPEG audio container and time delta between level PTS and `SourceBuffer.timestampOffset`
// is greater than 100ms (this is enough to handle seek for VOD or level change for LIVE videos).
// More info here: https://github.com/video-dev/hls.js/issues/332#issuecomment-257986486
const audioTrack=tracks.audio;let checkTimestampOffset=false;if(type==='audio'&&(audioTrack==null?void 0:audioTrack.container)==='audio/mpeg'){checkTimestampOffset=!this.lastMpegAudioChunk||chunkMeta.id===1||this.lastMpegAudioChunk.sn!==chunkMeta.sn;this.lastMpegAudioChunk=chunkMeta;}const fragStart=frag.start;const operation={execute:()=>{chunkStats.executeStart=self.performance.now();if(checkTimestampOffset){const sb=this.sourceBuffer[type];if(sb){const delta=fragStart-sb.timestampOffset;if(Math.abs(delta)>=0.1){this.log(`Updating audio SourceBuffer timestampOffset to ${fragStart} (delta: ${delta}) sn: ${frag.sn})`);sb.timestampOffset=fragStart;}}}this.appendExecutor(data,type);},onStart:()=>{// logger.debug(`[buffer-controller]: ${type} SourceBuffer updatestart`);
},onComplete:()=>{// logger.debug(`[buffer-controller]: ${type} SourceBuffer updateend`);
const end=self.performance.now();chunkStats.executeEnd=chunkStats.end=end;if(fragBuffering.first===0){fragBuffering.first=end;}if(partBuffering&&partBuffering.first===0){partBuffering.first=end;}const{sourceBuffer}=this;const timeRanges={};for(const type in sourceBuffer){timeRanges[type]=BufferHelper.getBuffered(sourceBuffer[type]);}this.appendErrors[type]=0;if(type==='audio'||type==='video'){this.appendErrors.audiovideo=0;}else {this.appendErrors.audio=0;this.appendErrors.video=0;}this.hls.trigger(Events$1.BUFFER_APPENDED,{type,frag,part,chunkMeta,parent:frag.type,timeRanges});},onError:error=>{// in case any error occured while appending, put back segment in segments table
const event={type:ErrorTypes.MEDIA_ERROR,parent:frag.type,details:ErrorDetails.BUFFER_APPEND_ERROR,sourceBufferName:type,frag,part,chunkMeta,error,err:error,fatal:false};if(error.code===DOMException.QUOTA_EXCEEDED_ERR){// QuotaExceededError: http://www.w3.org/TR/html5/infrastructure.html#quotaexceedederror
// let's stop appending any segments, and report BUFFER_FULL_ERROR error
event.details=ErrorDetails.BUFFER_FULL_ERROR;}else {const appendErrorCount=++this.appendErrors[type];event.details=ErrorDetails.BUFFER_APPEND_ERROR;/* with UHD content, we could get loop of quota exceeded error until
            browser is able to evict some data from sourcebuffer. Retrying can help recover.
          */this.warn(`Failed ${appendErrorCount}/${hls.config.appendErrorMaxRetry} times to append segment in "${type}" sourceBuffer`);if(appendErrorCount>=hls.config.appendErrorMaxRetry){event.fatal=true;}}hls.trigger(Events$1.ERROR,event);}};operationQueue.append(operation,type,!!this.pendingTracks[type]);}onBufferFlushing(event,data){const{operationQueue}=this;const flushOperation=type=>({execute:this.removeExecutor.bind(this,type,data.startOffset,data.endOffset),onStart:()=>{// logger.debug(`[buffer-controller]: Started flushing ${data.startOffset} -> ${data.endOffset} for ${type} Source Buffer`);
},onComplete:()=>{// logger.debug(`[buffer-controller]: Finished flushing ${data.startOffset} -> ${data.endOffset} for ${type} Source Buffer`);
this.hls.trigger(Events$1.BUFFER_FLUSHED,{type});},onError:error=>{this.warn(`Failed to remove from ${type} SourceBuffer`,error);}});if(data.type){operationQueue.append(flushOperation(data.type),data.type);}else {this.getSourceBufferTypes().forEach(type=>{operationQueue.append(flushOperation(type),type);});}}onFragParsed(event,data){const{frag,part}=data;const buffersAppendedTo=[];const elementaryStreams=part?part.elementaryStreams:frag.elementaryStreams;if(elementaryStreams[ElementaryStreamTypes.AUDIOVIDEO]){buffersAppendedTo.push('audiovideo');}else {if(elementaryStreams[ElementaryStreamTypes.AUDIO]){buffersAppendedTo.push('audio');}if(elementaryStreams[ElementaryStreamTypes.VIDEO]){buffersAppendedTo.push('video');}}const onUnblocked=()=>{const now=self.performance.now();frag.stats.buffering.end=now;if(part){part.stats.buffering.end=now;}const stats=part?part.stats:frag.stats;this.hls.trigger(Events$1.FRAG_BUFFERED,{frag,part,stats,id:frag.type});};if(buffersAppendedTo.length===0){this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${frag.type} level: ${frag.level} sn: ${frag.sn}`);}this.blockBuffers(onUnblocked,buffersAppendedTo);}onFragChanged(event,data){this.trimBuffers();}// on BUFFER_EOS mark matching sourcebuffer(s) as ended and trigger checkEos()
// an undefined data.type will mark all buffers as EOS.
onBufferEos(event,data){const ended=this.getSourceBufferTypes().reduce((acc,type)=>{const sb=this.sourceBuffer[type];if(sb&&(!data.type||data.type===type)){sb.ending=true;if(!sb.ended){sb.ended=true;this.log(`${type} sourceBuffer now EOS`);}}return acc&&!!(!sb||sb.ended);},true);if(ended){this.log(`Queueing mediaSource.endOfStream()`);this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(type=>{const sb=this.sourceBuffer[type];if(sb){sb.ending=false;}});const{mediaSource}=this;if(!mediaSource||mediaSource.readyState!=='open'){if(mediaSource){this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${mediaSource.readyState}`);}return;}this.log(`Calling mediaSource.endOfStream()`);// Allow this to throw and be caught by the enqueueing function
mediaSource.endOfStream();});}}onLevelUpdated(event,{details}){if(!details.fragments.length){return;}this.details=details;if(this.getSourceBufferTypes().length){this.blockBuffers(this.updateMediaElementDuration.bind(this));}else {this.updateMediaElementDuration();}}trimBuffers(){const{hls,details,media}=this;if(!media||details===null){return;}const sourceBufferTypes=this.getSourceBufferTypes();if(!sourceBufferTypes.length){return;}const config=hls.config;const currentTime=media.currentTime;const targetDuration=details.levelTargetDuration;// Support for deprecated liveBackBufferLength
const backBufferLength=details.live&&config.liveBackBufferLength!==null?config.liveBackBufferLength:config.backBufferLength;if(isFiniteNumber(backBufferLength)&&backBufferLength>0){const maxBackBufferLength=Math.max(backBufferLength,targetDuration);const targetBackBufferPosition=Math.floor(currentTime/targetDuration)*targetDuration-maxBackBufferLength;this.flushBackBuffer(currentTime,targetDuration,targetBackBufferPosition);}if(isFiniteNumber(config.frontBufferFlushThreshold)&&config.frontBufferFlushThreshold>0){const frontBufferLength=Math.max(config.maxBufferLength,config.frontBufferFlushThreshold);const maxFrontBufferLength=Math.max(frontBufferLength,targetDuration);const targetFrontBufferPosition=Math.floor(currentTime/targetDuration)*targetDuration+maxFrontBufferLength;this.flushFrontBuffer(currentTime,targetDuration,targetFrontBufferPosition);}}flushBackBuffer(currentTime,targetDuration,targetBackBufferPosition){const{details,sourceBuffer}=this;const sourceBufferTypes=this.getSourceBufferTypes();sourceBufferTypes.forEach(type=>{const sb=sourceBuffer[type];if(sb){const buffered=BufferHelper.getBuffered(sb);// when target buffer start exceeds actual buffer start
if(buffered.length>0&&targetBackBufferPosition>buffered.start(0)){this.hls.trigger(Events$1.BACK_BUFFER_REACHED,{bufferEnd:targetBackBufferPosition});// Support for deprecated event:
if(details!=null&&details.live){this.hls.trigger(Events$1.LIVE_BACK_BUFFER_REACHED,{bufferEnd:targetBackBufferPosition});}else if(sb.ended&&buffered.end(buffered.length-1)-currentTime<targetDuration*2){this.log(`Cannot flush ${type} back buffer while SourceBuffer is in ended state`);return;}this.hls.trigger(Events$1.BUFFER_FLUSHING,{startOffset:0,endOffset:targetBackBufferPosition,type});}}});}flushFrontBuffer(currentTime,targetDuration,targetFrontBufferPosition){const{sourceBuffer}=this;const sourceBufferTypes=this.getSourceBufferTypes();sourceBufferTypes.forEach(type=>{const sb=sourceBuffer[type];if(sb){const buffered=BufferHelper.getBuffered(sb);const numBufferedRanges=buffered.length;// The buffer is either empty or contiguous
if(numBufferedRanges<2){return;}const bufferStart=buffered.start(numBufferedRanges-1);const bufferEnd=buffered.end(numBufferedRanges-1);// No flush if we can tolerate the current buffer length or the current buffer range we would flush is contiguous with current position
if(targetFrontBufferPosition>bufferStart||currentTime>=bufferStart&&currentTime<=bufferEnd){return;}else if(sb.ended&&currentTime-bufferEnd<2*targetDuration){this.log(`Cannot flush ${type} front buffer while SourceBuffer is in ended state`);return;}this.hls.trigger(Events$1.BUFFER_FLUSHING,{startOffset:bufferStart,endOffset:Infinity,type});}});}/**
   * Update Media Source duration to current level duration or override to Infinity if configuration parameter
   * 'liveDurationInfinity` is set to `true`
   * More details: https://github.com/video-dev/hls.js/issues/355
   */updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=='open'){return;}const{details,hls,media,mediaSource}=this;const levelDuration=details.fragments[0].start+details.totalduration;const mediaDuration=media.duration;const msDuration=isFiniteNumber(mediaSource.duration)?mediaSource.duration:0;if(details.live&&hls.config.liveDurationInfinity){// Override duration to Infinity
mediaSource.duration=Infinity;this.updateSeekableRange(details);}else if(levelDuration>msDuration&&levelDuration>mediaDuration||!isFiniteNumber(mediaDuration)){// levelDuration was the last value we set.
// not using mediaSource.duration as the browser may tweak this value
// only update Media Source duration if its value increase, this is to avoid
// flushing already buffered portion when switching between quality level
this.log(`Updating Media Source duration to ${levelDuration.toFixed(3)}`);mediaSource.duration=levelDuration;}}updateSeekableRange(levelDetails){const mediaSource=this.mediaSource;const fragments=levelDetails.fragments;const len=fragments.length;if(len&&levelDetails.live&&mediaSource!=null&&mediaSource.setLiveSeekableRange){const start=Math.max(0,fragments[0].start);const end=Math.max(start,start+levelDetails.totalduration);this.log(`Media Source duration is set to ${mediaSource.duration}. Setting seekable range to ${start}-${end}.`);mediaSource.setLiveSeekableRange(start,end);}}checkPendingTracks(){const{bufferCodecEventsExpected,operationQueue,pendingTracks}=this;// Check if we've received all of the expected bufferCodec events. When none remain, create all the sourceBuffers at once.
// This is important because the MSE spec allows implementations to throw QuotaExceededErrors if creating new sourceBuffers after
// data has been appended to existing ones.
// 2 tracks is the max (one for audio, one for video). If we've reach this max go ahead and create the buffers.
const pendingTracksCount=Object.keys(pendingTracks).length;if(pendingTracksCount&&(!bufferCodecEventsExpected||pendingTracksCount===2||'audiovideo'in pendingTracks)){// ok, let's create them now !
this.createSourceBuffers(pendingTracks);this.pendingTracks={};// append any pending segments now !
const buffers=this.getSourceBufferTypes();if(buffers.length){this.hls.trigger(Events$1.BUFFER_CREATED,{tracks:this.tracks});buffers.forEach(type=>{operationQueue.executeNext(type);});}else {const error=new Error('could not create source buffer for media codec(s)');this.hls.trigger(Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:true,error,reason:error.message});}}}createSourceBuffers(tracks){const{sourceBuffer,mediaSource}=this;if(!mediaSource){throw Error('createSourceBuffers called when mediaSource was null');}for(const trackName in tracks){if(!sourceBuffer[trackName]){var _track$levelCodec;const track=tracks[trackName];if(!track){throw Error(`source buffer exists for track ${trackName}, however track does not`);}// use levelCodec as first priority unless it contains multiple comma-separated codec values
let codec=((_track$levelCodec=track.levelCodec)==null?void 0:_track$levelCodec.indexOf(','))===-1?track.levelCodec:track.codec;if(codec){if(trackName.slice(0,5)==='audio'){codec=getCodecCompatibleName(codec,this.appendSource);}}const mimeType=`${track.container};codecs=${codec}`;this.log(`creating sourceBuffer(${mimeType})`);try{const sb=sourceBuffer[trackName]=mediaSource.addSourceBuffer(mimeType);const sbName=trackName;this.addBufferListener(sbName,'updatestart',this._onSBUpdateStart);this.addBufferListener(sbName,'updateend',this._onSBUpdateEnd);this.addBufferListener(sbName,'error',this._onSBUpdateError);// ManagedSourceBuffer bufferedchange event
if(this.appendSource){this.addBufferListener(sbName,'bufferedchange',(type,event)=>{// If media was ejected check for a change. Added ranges are redundant with changes on 'updateend' event.
const removedRanges=event.removedRanges;if(removedRanges!=null&&removedRanges.length){this.hls.trigger(Events$1.BUFFER_FLUSHED,{type:trackName});}});}this.tracks[trackName]={buffer:sb,codec:codec,container:track.container,levelCodec:track.levelCodec,metadata:track.metadata,id:track.id};}catch(err){this.error(`error while trying to add sourceBuffer: ${err.message}`);this.hls.trigger(Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:false,error:err,sourceBufferName:trackName,mimeType:mimeType});}}}}get mediaSrc(){var _this$media;const media=((_this$media=this.media)==null?void 0:_this$media.firstChild)||this.media;return media==null?void 0:media.src;}_onSBUpdateStart(type){const{operationQueue}=this;const operation=operationQueue.current(type);operation.onStart();}_onSBUpdateEnd(type){var _this$mediaSource2;if(((_this$mediaSource2=this.mediaSource)==null?void 0:_this$mediaSource2.readyState)==='closed'){this.resetBuffer(type);return;}const{operationQueue}=this;const operation=operationQueue.current(type);operation.onComplete();operationQueue.shiftAndExecuteNext(type);}_onSBUpdateError(type,event){var _this$mediaSource3;const error=new Error(`${type} SourceBuffer error. MediaSource readyState: ${(_this$mediaSource3=this.mediaSource)==null?void 0:_this$mediaSource3.readyState}`);this.error(`${error}`,event);// according to http://www.w3.org/TR/media-source/#sourcebuffer-append-error
// SourceBuffer errors are not necessarily fatal; if so, the HTMLMediaElement will fire an error event
this.hls.trigger(Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_APPENDING_ERROR,sourceBufferName:type,error,fatal:false});// updateend is always fired after error, so we'll allow that to shift the current operation off of the queue
const operation=this.operationQueue.current(type);if(operation){operation.onError(error);}}// This method must result in an updateend event; if remove is not called, _onSBUpdateEnd must be called manually
removeExecutor(type,startOffset,endOffset){const{media,mediaSource,operationQueue,sourceBuffer}=this;const sb=sourceBuffer[type];if(!media||!mediaSource||!sb){this.warn(`Attempting to remove from the ${type} SourceBuffer, but it does not exist`);operationQueue.shiftAndExecuteNext(type);return;}const mediaDuration=isFiniteNumber(media.duration)?media.duration:Infinity;const msDuration=isFiniteNumber(mediaSource.duration)?mediaSource.duration:Infinity;const removeStart=Math.max(0,startOffset);const removeEnd=Math.min(endOffset,mediaDuration,msDuration);if(removeEnd>removeStart&&(!sb.ending||sb.ended)){sb.ended=false;this.log(`Removing [${removeStart},${removeEnd}] from the ${type} SourceBuffer`);sb.remove(removeStart,removeEnd);}else {// Cycle the queue
operationQueue.shiftAndExecuteNext(type);}}// This method must result in an updateend event; if append is not called, _onSBUpdateEnd must be called manually
appendExecutor(data,type){const sb=this.sourceBuffer[type];if(!sb){if(!this.pendingTracks[type]){throw new Error(`Attempting to append to the ${type} SourceBuffer, but it does not exist`);}return;}sb.ended=false;sb.appendBuffer(data);}// Enqueues an operation to each SourceBuffer queue which, upon execution, resolves a promise. When all promises
// resolve, the onUnblocked function is executed. Functions calling this method do not need to unblock the queue
// upon completion, since we already do it here
blockBuffers(onUnblocked,buffers=this.getSourceBufferTypes()){if(!buffers.length){this.log('Blocking operation requested, but no SourceBuffers exist');Promise.resolve().then(onUnblocked);return;}const{operationQueue}=this;// logger.debug(`[buffer-controller]: Blocking ${buffers} SourceBuffer`);
const blockingOperations=buffers.map(type=>operationQueue.appendBlocker(type));Promise.all(blockingOperations).then(()=>{// logger.debug(`[buffer-controller]: Blocking operation resolved; unblocking ${buffers} SourceBuffer`);
onUnblocked();buffers.forEach(type=>{const sb=this.sourceBuffer[type];// Only cycle the queue if the SB is not updating. There's a bug in Chrome which sets the SB updating flag to
// true when changing the MediaSource duration (https://bugs.chromium.org/p/chromium/issues/detail?id=959359&can=2&q=mediasource%20duration)
// While this is a workaround, it's probably useful to have around
if(!(sb!=null&&sb.updating)){operationQueue.shiftAndExecuteNext(type);}});});}getSourceBufferTypes(){return Object.keys(this.sourceBuffer);}addBufferListener(type,event,fn){const buffer=this.sourceBuffer[type];if(!buffer){return;}const listener=fn.bind(this,type);this.listeners[type].push({event,listener});buffer.addEventListener(event,listener);}removeBufferListeners(type){const buffer=this.sourceBuffer[type];if(!buffer){return;}this.listeners[type].forEach(l=>{buffer.removeEventListener(l.event,l.listener);});}}function removeSourceChildren(node){const sourceChildren=node.querySelectorAll('source');[].slice.call(sourceChildren).forEach(source=>{node.removeChild(source);});}function addSource(media,url){const source=self.document.createElement('source');source.type='video/mp4';source.src=url;media.appendChild(source);}/**
 *
 * This code was ported from the dash.js project at:
 *   https://github.com/Dash-Industry-Forum/dash.js/blob/development/externals/cea608-parser.js
 *   https://github.com/Dash-Industry-Forum/dash.js/commit/8269b26a761e0853bb21d78780ed945144ecdd4d#diff-71bc295a2d6b6b7093a1d3290d53a4b2
 *
 * The original copyright appears below:
 *
 * The copyright in this software is being made available under the BSD License,
 * included below. This software may be subject to other third party and contributor
 * rights, including patent rights, and no such rights are granted under this license.
 *
 * Copyright (c) 2015-2016, DASH Industry Forum.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *  1. Redistributions of source code must retain the above copyright notice, this
 *  list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright notice,
 *  this list of conditions and the following disclaimer in the documentation and/or
 *  other materials provided with the distribution.
 *  2. Neither the name of Dash Industry Forum nor the names of its
 *  contributors may be used to endorse or promote products derived from this software
 *  without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY
 *  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 *  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 *  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 *  POSSIBILITY OF SUCH DAMAGE.
 */ /**
 *  Exceptions from regular ASCII. CodePoints are mapped to UTF-16 codes
 */const specialCea608CharsCodes={0x2a:0xe1,// lowercase a, acute accent
0x5c:0xe9,// lowercase e, acute accent
0x5e:0xed,// lowercase i, acute accent
0x5f:0xf3,// lowercase o, acute accent
0x60:0xfa,// lowercase u, acute accent
0x7b:0xe7,// lowercase c with cedilla
0x7c:0xf7,// division symbol
0x7d:0xd1,// uppercase N tilde
0x7e:0xf1,// lowercase n tilde
0x7f:0x2588,// Full block
// THIS BLOCK INCLUDES THE 16 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
// THAT COME FROM HI BYTE=0x11 AND LOW BETWEEN 0x30 AND 0x3F
// THIS MEANS THAT \x50 MUST BE ADDED TO THE VALUES
0x80:0xae,// Registered symbol (R)
0x81:0xb0,// degree sign
0x82:0xbd,// 1/2 symbol
0x83:0xbf,// Inverted (open) question mark
0x84:0x2122,// Trademark symbol (TM)
0x85:0xa2,// Cents symbol
0x86:0xa3,// Pounds sterling
0x87:0x266a,// Music 8'th note
0x88:0xe0,// lowercase a, grave accent
0x89:0x20,// transparent space (regular)
0x8a:0xe8,// lowercase e, grave accent
0x8b:0xe2,// lowercase a, circumflex accent
0x8c:0xea,// lowercase e, circumflex accent
0x8d:0xee,// lowercase i, circumflex accent
0x8e:0xf4,// lowercase o, circumflex accent
0x8f:0xfb,// lowercase u, circumflex accent
// THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
// THAT COME FROM HI BYTE=0x12 AND LOW BETWEEN 0x20 AND 0x3F
0x90:0xc1,// capital letter A with acute
0x91:0xc9,// capital letter E with acute
0x92:0xd3,// capital letter O with acute
0x93:0xda,// capital letter U with acute
0x94:0xdc,// capital letter U with diaresis
0x95:0xfc,// lowercase letter U with diaeresis
0x96:0x2018,// opening single quote
0x97:0xa1,// inverted exclamation mark
0x98:0x2a,// asterisk
0x99:0x2019,// closing single quote
0x9a:0x2501,// box drawings heavy horizontal
0x9b:0xa9,// copyright sign
0x9c:0x2120,// Service mark
0x9d:0x2022,// (round) bullet
0x9e:0x201c,// Left double quotation mark
0x9f:0x201d,// Right double quotation mark
0xa0:0xc0,// uppercase A, grave accent
0xa1:0xc2,// uppercase A, circumflex
0xa2:0xc7,// uppercase C with cedilla
0xa3:0xc8,// uppercase E, grave accent
0xa4:0xca,// uppercase E, circumflex
0xa5:0xcb,// capital letter E with diaresis
0xa6:0xeb,// lowercase letter e with diaresis
0xa7:0xce,// uppercase I, circumflex
0xa8:0xcf,// uppercase I, with diaresis
0xa9:0xef,// lowercase i, with diaresis
0xaa:0xd4,// uppercase O, circumflex
0xab:0xd9,// uppercase U, grave accent
0xac:0xf9,// lowercase u, grave accent
0xad:0xdb,// uppercase U, circumflex
0xae:0xab,// left-pointing double angle quotation mark
0xaf:0xbb,// right-pointing double angle quotation mark
// THIS BLOCK INCLUDES THE 32 EXTENDED (TWO-BYTE) LINE 21 CHARACTERS
// THAT COME FROM HI BYTE=0x13 AND LOW BETWEEN 0x20 AND 0x3F
0xb0:0xc3,// Uppercase A, tilde
0xb1:0xe3,// Lowercase a, tilde
0xb2:0xcd,// Uppercase I, acute accent
0xb3:0xcc,// Uppercase I, grave accent
0xb4:0xec,// Lowercase i, grave accent
0xb5:0xd2,// Uppercase O, grave accent
0xb6:0xf2,// Lowercase o, grave accent
0xb7:0xd5,// Uppercase O, tilde
0xb8:0xf5,// Lowercase o, tilde
0xb9:0x7b,// Open curly brace
0xba:0x7d,// Closing curly brace
0xbb:0x5c,// Backslash
0xbc:0x5e,// Caret
0xbd:0x5f,// Underscore
0xbe:0x7c,// Pipe (vertical line)
0xbf:0x223c,// Tilde operator
0xc0:0xc4,// Uppercase A, umlaut
0xc1:0xe4,// Lowercase A, umlaut
0xc2:0xd6,// Uppercase O, umlaut
0xc3:0xf6,// Lowercase o, umlaut
0xc4:0xdf,// Esszett (sharp S)
0xc5:0xa5,// Yen symbol
0xc6:0xa4,// Generic currency sign
0xc7:0x2503,// Box drawings heavy vertical
0xc8:0xc5,// Uppercase A, ring
0xc9:0xe5,// Lowercase A, ring
0xca:0xd8,// Uppercase O, stroke
0xcb:0xf8,// Lowercase o, strok
0xcc:0x250f,// Box drawings heavy down and right
0xcd:0x2513,// Box drawings heavy down and left
0xce:0x2517,// Box drawings heavy up and right
0xcf:0x251b// Box drawings heavy up and left
};/**
 * Utils
 */const getCharForByte=byte=>String.fromCharCode(specialCea608CharsCodes[byte]||byte);const NR_ROWS=15;const NR_COLS=100;// Tables to look up row from PAC data
const rowsLowCh1={0x11:1,0x12:3,0x15:5,0x16:7,0x17:9,0x10:11,0x13:12,0x14:14};const rowsHighCh1={0x11:2,0x12:4,0x15:6,0x16:8,0x17:10,0x13:13,0x14:15};const rowsLowCh2={0x19:1,0x1a:3,0x1d:5,0x1e:7,0x1f:9,0x18:11,0x1b:12,0x1c:14};const rowsHighCh2={0x19:2,0x1a:4,0x1d:6,0x1e:8,0x1f:10,0x1b:13,0x1c:15};const backgroundColors=['white','green','blue','cyan','red','yellow','magenta','black','transparent'];class CaptionsLogger{constructor(){this.time=null;this.verboseLevel=0;}log(severity,msg){if(this.verboseLevel>=severity){const m=typeof msg==='function'?msg():msg;logger.log(`${this.time} [${severity}] ${m}`);}}}const numArrayToHexArray=function numArrayToHexArray(numArray){const hexArray=[];for(let j=0;j<numArray.length;j++){hexArray.push(numArray[j].toString(16));}return hexArray;};class PenState{constructor(){this.foreground='white';this.underline=false;this.italics=false;this.background='black';this.flash=false;}reset(){this.foreground='white';this.underline=false;this.italics=false;this.background='black';this.flash=false;}setStyles(styles){const attribs=['foreground','underline','italics','background','flash'];for(let i=0;i<attribs.length;i++){const style=attribs[i];if(styles.hasOwnProperty(style)){this[style]=styles[style];}}}isDefault(){return this.foreground==='white'&&!this.underline&&!this.italics&&this.background==='black'&&!this.flash;}equals(other){return this.foreground===other.foreground&&this.underline===other.underline&&this.italics===other.italics&&this.background===other.background&&this.flash===other.flash;}copy(newPenState){this.foreground=newPenState.foreground;this.underline=newPenState.underline;this.italics=newPenState.italics;this.background=newPenState.background;this.flash=newPenState.flash;}toString(){return 'color='+this.foreground+', underline='+this.underline+', italics='+this.italics+', background='+this.background+', flash='+this.flash;}}/**
 * Unicode character with styling and background.
 * @constructor
 */class StyledUnicodeChar{constructor(){this.uchar=' ';this.penState=new PenState();}reset(){this.uchar=' ';this.penState.reset();}setChar(uchar,newPenState){this.uchar=uchar;this.penState.copy(newPenState);}setPenState(newPenState){this.penState.copy(newPenState);}equals(other){return this.uchar===other.uchar&&this.penState.equals(other.penState);}copy(newChar){this.uchar=newChar.uchar;this.penState.copy(newChar.penState);}isEmpty(){return this.uchar===' '&&this.penState.isDefault();}}/**
 * CEA-608 row consisting of NR_COLS instances of StyledUnicodeChar.
 * @constructor
 */class Row{constructor(logger){this.chars=[];this.pos=0;this.currPenState=new PenState();this.cueStartTime=null;this.logger=void 0;for(let i=0;i<NR_COLS;i++){this.chars.push(new StyledUnicodeChar());}this.logger=logger;}equals(other){for(let i=0;i<NR_COLS;i++){if(!this.chars[i].equals(other.chars[i])){return false;}}return true;}copy(other){for(let i=0;i<NR_COLS;i++){this.chars[i].copy(other.chars[i]);}}isEmpty(){let empty=true;for(let i=0;i<NR_COLS;i++){if(!this.chars[i].isEmpty()){empty=false;break;}}return empty;}/**
   *  Set the cursor to a valid column.
   */setCursor(absPos){if(this.pos!==absPos){this.pos=absPos;}if(this.pos<0){this.logger.log(3,'Negative cursor position '+this.pos);this.pos=0;}else if(this.pos>NR_COLS){this.logger.log(3,'Too large cursor position '+this.pos);this.pos=NR_COLS;}}/**
   * Move the cursor relative to current position.
   */moveCursor(relPos){const newPos=this.pos+relPos;if(relPos>1){for(let i=this.pos+1;i<newPos+1;i++){this.chars[i].setPenState(this.currPenState);}}this.setCursor(newPos);}/**
   * Backspace, move one step back and clear character.
   */backSpace(){this.moveCursor(-1);this.chars[this.pos].setChar(' ',this.currPenState);}insertChar(byte){if(byte>=0x90){// Extended char
this.backSpace();}const char=getCharForByte(byte);if(this.pos>=NR_COLS){this.logger.log(0,()=>'Cannot insert '+byte.toString(16)+' ('+char+') at position '+this.pos+'. Skipping it!');return;}this.chars[this.pos].setChar(char,this.currPenState);this.moveCursor(1);}clearFromPos(startPos){let i;for(i=startPos;i<NR_COLS;i++){this.chars[i].reset();}}clear(){this.clearFromPos(0);this.pos=0;this.currPenState.reset();}clearToEndOfRow(){this.clearFromPos(this.pos);}getTextString(){const chars=[];let empty=true;for(let i=0;i<NR_COLS;i++){const char=this.chars[i].uchar;if(char!==' '){empty=false;}chars.push(char);}if(empty){return '';}else {return chars.join('');}}setPenStyles(styles){this.currPenState.setStyles(styles);const currChar=this.chars[this.pos];currChar.setPenState(this.currPenState);}}/**
 * Keep a CEA-608 screen of 32x15 styled characters
 * @constructor
 */class CaptionScreen{constructor(logger){this.rows=[];this.currRow=NR_ROWS-1;this.nrRollUpRows=null;this.lastOutputScreen=null;this.logger=void 0;for(let i=0;i<NR_ROWS;i++){this.rows.push(new Row(logger));}this.logger=logger;}reset(){for(let i=0;i<NR_ROWS;i++){this.rows[i].clear();}this.currRow=NR_ROWS-1;}equals(other){let equal=true;for(let i=0;i<NR_ROWS;i++){if(!this.rows[i].equals(other.rows[i])){equal=false;break;}}return equal;}copy(other){for(let i=0;i<NR_ROWS;i++){this.rows[i].copy(other.rows[i]);}}isEmpty(){let empty=true;for(let i=0;i<NR_ROWS;i++){if(!this.rows[i].isEmpty()){empty=false;break;}}return empty;}backSpace(){const row=this.rows[this.currRow];row.backSpace();}clearToEndOfRow(){const row=this.rows[this.currRow];row.clearToEndOfRow();}/**
   * Insert a character (without styling) in the current row.
   */insertChar(char){const row=this.rows[this.currRow];row.insertChar(char);}setPen(styles){const row=this.rows[this.currRow];row.setPenStyles(styles);}moveCursor(relPos){const row=this.rows[this.currRow];row.moveCursor(relPos);}setCursor(absPos){this.logger.log(2,'setCursor: '+absPos);const row=this.rows[this.currRow];row.setCursor(absPos);}setPAC(pacData){this.logger.log(2,()=>'pacData = '+JSON.stringify(pacData));let newRow=pacData.row-1;if(this.nrRollUpRows&&newRow<this.nrRollUpRows-1){newRow=this.nrRollUpRows-1;}// Make sure this only affects Roll-up Captions by checking this.nrRollUpRows
if(this.nrRollUpRows&&this.currRow!==newRow){// clear all rows first
for(let i=0;i<NR_ROWS;i++){this.rows[i].clear();}// Copy this.nrRollUpRows rows from lastOutputScreen and place it in the newRow location
// topRowIndex - the start of rows to copy (inclusive index)
const topRowIndex=this.currRow+1-this.nrRollUpRows;// We only copy if the last position was already shown.
// We use the cueStartTime value to check this.
const lastOutputScreen=this.lastOutputScreen;if(lastOutputScreen){const prevLineTime=lastOutputScreen.rows[topRowIndex].cueStartTime;const time=this.logger.time;if(prevLineTime!==null&&time!==null&&prevLineTime<time){for(let i=0;i<this.nrRollUpRows;i++){this.rows[newRow-this.nrRollUpRows+i+1].copy(lastOutputScreen.rows[topRowIndex+i]);}}}}this.currRow=newRow;const row=this.rows[this.currRow];if(pacData.indent!==null){const indent=pacData.indent;const prevPos=Math.max(indent-1,0);row.setCursor(pacData.indent);pacData.color=row.chars[prevPos].penState.foreground;}const styles={foreground:pacData.color,underline:pacData.underline,italics:pacData.italics,background:'black',flash:false};this.setPen(styles);}/**
   * Set background/extra foreground, but first do back_space, and then insert space (backwards compatibility).
   */setBkgData(bkgData){this.logger.log(2,()=>'bkgData = '+JSON.stringify(bkgData));this.backSpace();this.setPen(bkgData);this.insertChar(0x20);// Space
}setRollUpRows(nrRows){this.nrRollUpRows=nrRows;}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,'roll_up but nrRollUpRows not set yet');return;// Not properly setup
}this.logger.log(1,()=>this.getDisplayText());const topRowIndex=this.currRow+1-this.nrRollUpRows;const topRow=this.rows.splice(topRowIndex,1)[0];topRow.clear();this.rows.splice(this.currRow,0,topRow);this.logger.log(2,'Rolling up');// this.logger.log(VerboseLevel.TEXT, this.get_display_text())
}/**
   * Get all non-empty rows with as unicode text.
   */getDisplayText(asOneRow){asOneRow=asOneRow||false;const displayText=[];let text='';let rowNr=-1;for(let i=0;i<NR_ROWS;i++){const rowText=this.rows[i].getTextString();if(rowText){rowNr=i+1;if(asOneRow){displayText.push('Row '+rowNr+": '"+rowText+"'");}else {displayText.push(rowText.trim());}}}if(displayText.length>0){if(asOneRow){text='['+displayText.join(' | ')+']';}else {text=displayText.join('\n');}}return text;}getTextAndFormat(){return this.rows;}}// var modes = ['MODE_ROLL-UP', 'MODE_POP-ON', 'MODE_PAINT-ON', 'MODE_TEXT'];
class Cea608Channel{constructor(channelNumber,outputFilter,logger){this.chNr=void 0;this.outputFilter=void 0;this.mode=void 0;this.verbose=void 0;this.displayedMemory=void 0;this.nonDisplayedMemory=void 0;this.lastOutputScreen=void 0;this.currRollUpRow=void 0;this.writeScreen=void 0;this.cueStartTime=void 0;this.logger=void 0;this.chNr=channelNumber;this.outputFilter=outputFilter;this.mode=null;this.verbose=0;this.displayedMemory=new CaptionScreen(logger);this.nonDisplayedMemory=new CaptionScreen(logger);this.lastOutputScreen=new CaptionScreen(logger);this.currRollUpRow=this.displayedMemory.rows[NR_ROWS-1];this.writeScreen=this.displayedMemory;this.mode=null;this.cueStartTime=null;// Keeps track of where a cue started.
this.logger=logger;}reset(){this.mode=null;this.displayedMemory.reset();this.nonDisplayedMemory.reset();this.lastOutputScreen.reset();this.outputFilter.reset();this.currRollUpRow=this.displayedMemory.rows[NR_ROWS-1];this.writeScreen=this.displayedMemory;this.mode=null;this.cueStartTime=null;}getHandler(){return this.outputFilter;}setHandler(newHandler){this.outputFilter=newHandler;}setPAC(pacData){this.writeScreen.setPAC(pacData);}setBkgData(bkgData){this.writeScreen.setBkgData(bkgData);}setMode(newMode){if(newMode===this.mode){return;}this.mode=newMode;this.logger.log(2,()=>'MODE='+newMode);if(this.mode==='MODE_POP-ON'){this.writeScreen=this.nonDisplayedMemory;}else {this.writeScreen=this.displayedMemory;this.writeScreen.reset();}if(this.mode!=='MODE_ROLL-UP'){this.displayedMemory.nrRollUpRows=null;this.nonDisplayedMemory.nrRollUpRows=null;}this.mode=newMode;}insertChars(chars){for(let i=0;i<chars.length;i++){this.writeScreen.insertChar(chars[i]);}const screen=this.writeScreen===this.displayedMemory?'DISP':'NON_DISP';this.logger.log(2,()=>screen+': '+this.writeScreen.getDisplayText(true));if(this.mode==='MODE_PAINT-ON'||this.mode==='MODE_ROLL-UP'){this.logger.log(1,()=>'DISPLAYED: '+this.displayedMemory.getDisplayText(true));this.outputDataUpdate();}}ccRCL(){// Resume Caption Loading (switch mode to Pop On)
this.logger.log(2,'RCL - Resume Caption Loading');this.setMode('MODE_POP-ON');}ccBS(){// BackSpace
this.logger.log(2,'BS - BackSpace');if(this.mode==='MODE_TEXT'){return;}this.writeScreen.backSpace();if(this.writeScreen===this.displayedMemory){this.outputDataUpdate();}}ccAOF(){// Reserved (formerly Alarm Off)
}ccAON(){// Reserved (formerly Alarm On)
}ccDER(){// Delete to End of Row
this.logger.log(2,'DER- Delete to End of Row');this.writeScreen.clearToEndOfRow();this.outputDataUpdate();}ccRU(nrRows){// Roll-Up Captions-2,3,or 4 Rows
this.logger.log(2,'RU('+nrRows+') - Roll Up');this.writeScreen=this.displayedMemory;this.setMode('MODE_ROLL-UP');this.writeScreen.setRollUpRows(nrRows);}ccFON(){// Flash On
this.logger.log(2,'FON - Flash On');this.writeScreen.setPen({flash:true});}ccRDC(){// Resume Direct Captioning (switch mode to PaintOn)
this.logger.log(2,'RDC - Resume Direct Captioning');this.setMode('MODE_PAINT-ON');}ccTR(){// Text Restart in text mode (not supported, however)
this.logger.log(2,'TR');this.setMode('MODE_TEXT');}ccRTD(){// Resume Text Display in Text mode (not supported, however)
this.logger.log(2,'RTD');this.setMode('MODE_TEXT');}ccEDM(){// Erase Displayed Memory
this.logger.log(2,'EDM - Erase Displayed Memory');this.displayedMemory.reset();this.outputDataUpdate(true);}ccCR(){// Carriage Return
this.logger.log(2,'CR - Carriage Return');this.writeScreen.rollUp();this.outputDataUpdate(true);}ccENM(){// Erase Non-Displayed Memory
this.logger.log(2,'ENM - Erase Non-displayed Memory');this.nonDisplayedMemory.reset();}ccEOC(){// End of Caption (Flip Memories)
this.logger.log(2,'EOC - End Of Caption');if(this.mode==='MODE_POP-ON'){const tmp=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory;this.nonDisplayedMemory=tmp;this.writeScreen=this.nonDisplayedMemory;this.logger.log(1,()=>'DISP: '+this.displayedMemory.getDisplayText());}this.outputDataUpdate(true);}ccTO(nrCols){// Tab Offset 1,2, or 3 columns
this.logger.log(2,'TO('+nrCols+') - Tab Offset');this.writeScreen.moveCursor(nrCols);}ccMIDROW(secondByte){// Parse MIDROW command
const styles={flash:false};styles.underline=secondByte%2===1;styles.italics=secondByte>=0x2e;if(!styles.italics){const colorIndex=Math.floor(secondByte/2)-0x10;const colors=['white','green','blue','cyan','red','yellow','magenta'];styles.foreground=colors[colorIndex];}else {styles.foreground='white';}this.logger.log(2,'MIDROW: '+JSON.stringify(styles));this.writeScreen.setPen(styles);}outputDataUpdate(dispatch=false){const time=this.logger.time;if(time===null){return;}if(this.outputFilter){if(this.cueStartTime===null&&!this.displayedMemory.isEmpty()){// Start of a new cue
this.cueStartTime=time;}else {if(!this.displayedMemory.equals(this.lastOutputScreen)){this.outputFilter.newCue(this.cueStartTime,time,this.lastOutputScreen);if(dispatch&&this.outputFilter.dispatchCue){this.outputFilter.dispatchCue();}this.cueStartTime=this.displayedMemory.isEmpty()?null:time;}}this.lastOutputScreen.copy(this.displayedMemory);}}cueSplitAtTime(t){if(this.outputFilter){if(!this.displayedMemory.isEmpty()){if(this.outputFilter.newCue){this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory);}this.cueStartTime=t;}}}}// Will be 1 or 2 when parsing captions
class Cea608Parser{constructor(field,out1,out2){this.channels=void 0;this.currentChannel=0;this.cmdHistory=createCmdHistory();this.logger=void 0;const logger=this.logger=new CaptionsLogger();this.channels=[null,new Cea608Channel(field,out1,logger),new Cea608Channel(field+1,out2,logger)];}getHandler(channel){return this.channels[channel].getHandler();}setHandler(channel,newHandler){this.channels[channel].setHandler(newHandler);}/**
   * Add data for time t in forms of list of bytes (unsigned ints). The bytes are treated as pairs.
   */addData(time,byteList){this.logger.time=time;for(let i=0;i<byteList.length;i+=2){const a=byteList[i]&0x7f;const b=byteList[i+1]&0x7f;let cmdFound=false;let charsFound=null;if(a===0&&b===0){continue;}else {this.logger.log(3,()=>'['+numArrayToHexArray([byteList[i],byteList[i+1]])+'] -> ('+numArrayToHexArray([a,b])+')');}const cmdHistory=this.cmdHistory;const isControlCode=a>=0x10&&a<=0x1f;if(isControlCode){// Skip redundant control codes
if(hasCmdRepeated(a,b,cmdHistory)){setLastCmd(null,null,cmdHistory);this.logger.log(3,()=>'Repeated command ('+numArrayToHexArray([a,b])+') is dropped');continue;}setLastCmd(a,b,this.cmdHistory);cmdFound=this.parseCmd(a,b);if(!cmdFound){cmdFound=this.parseMidrow(a,b);}if(!cmdFound){cmdFound=this.parsePAC(a,b);}if(!cmdFound){cmdFound=this.parseBackgroundAttributes(a,b);}}else {setLastCmd(null,null,cmdHistory);}if(!cmdFound){charsFound=this.parseChars(a,b);if(charsFound){const currChNr=this.currentChannel;if(currChNr&&currChNr>0){const channel=this.channels[currChNr];channel.insertChars(charsFound);}else {this.logger.log(2,'No channel found yet. TEXT-MODE?');}}}if(!cmdFound&&!charsFound){this.logger.log(2,()=>"Couldn't parse cleaned data "+numArrayToHexArray([a,b])+' orig: '+numArrayToHexArray([byteList[i],byteList[i+1]]));}}}/**
   * Parse Command.
   * @returns True if a command was found
   */parseCmd(a,b){const cond1=(a===0x14||a===0x1c||a===0x15||a===0x1d)&&b>=0x20&&b<=0x2f;const cond2=(a===0x17||a===0x1f)&&b>=0x21&&b<=0x23;if(!(cond1||cond2)){return false;}const chNr=a===0x14||a===0x15||a===0x17?1:2;const channel=this.channels[chNr];if(a===0x14||a===0x15||a===0x1c||a===0x1d){if(b===0x20){channel.ccRCL();}else if(b===0x21){channel.ccBS();}else if(b===0x22){channel.ccAOF();}else if(b===0x23){channel.ccAON();}else if(b===0x24){channel.ccDER();}else if(b===0x25){channel.ccRU(2);}else if(b===0x26){channel.ccRU(3);}else if(b===0x27){channel.ccRU(4);}else if(b===0x28){channel.ccFON();}else if(b===0x29){channel.ccRDC();}else if(b===0x2a){channel.ccTR();}else if(b===0x2b){channel.ccRTD();}else if(b===0x2c){channel.ccEDM();}else if(b===0x2d){channel.ccCR();}else if(b===0x2e){channel.ccENM();}else if(b===0x2f){channel.ccEOC();}}else {// a == 0x17 || a == 0x1F
channel.ccTO(b-0x20);}this.currentChannel=chNr;return true;}/**
   * Parse midrow styling command
   */parseMidrow(a,b){let chNr=0;if((a===0x11||a===0x19)&&b>=0x20&&b<=0x2f){if(a===0x11){chNr=1;}else {chNr=2;}if(chNr!==this.currentChannel){this.logger.log(0,'Mismatch channel in midrow parsing');return false;}const channel=this.channels[chNr];if(!channel){return false;}channel.ccMIDROW(b);this.logger.log(3,()=>'MIDROW ('+numArrayToHexArray([a,b])+')');return true;}return false;}/**
   * Parse Preable Access Codes (Table 53).
   * @returns {Boolean} Tells if PAC found
   */parsePAC(a,b){let row;const case1=(a>=0x11&&a<=0x17||a>=0x19&&a<=0x1f)&&b>=0x40&&b<=0x7f;const case2=(a===0x10||a===0x18)&&b>=0x40&&b<=0x5f;if(!(case1||case2)){return false;}const chNr=a<=0x17?1:2;if(b>=0x40&&b<=0x5f){row=chNr===1?rowsLowCh1[a]:rowsLowCh2[a];}else {// 0x60 <= b <= 0x7F
row=chNr===1?rowsHighCh1[a]:rowsHighCh2[a];}const channel=this.channels[chNr];if(!channel){return false;}channel.setPAC(this.interpretPAC(row,b));this.currentChannel=chNr;return true;}/**
   * Interpret the second byte of the pac, and return the information.
   * @returns pacData with style parameters
   */interpretPAC(row,byte){let pacIndex;const pacData={color:null,italics:false,indent:null,underline:false,row:row};if(byte>0x5f){pacIndex=byte-0x60;}else {pacIndex=byte-0x40;}pacData.underline=(pacIndex&1)===1;if(pacIndex<=0xd){pacData.color=['white','green','blue','cyan','red','yellow','magenta','white'][Math.floor(pacIndex/2)];}else if(pacIndex<=0xf){pacData.italics=true;pacData.color='white';}else {pacData.indent=Math.floor((pacIndex-0x10)/2)*4;}return pacData;// Note that row has zero offset. The spec uses 1.
}/**
   * Parse characters.
   * @returns An array with 1 to 2 codes corresponding to chars, if found. null otherwise.
   */parseChars(a,b){let channelNr;let charCodes=null;let charCode1=null;if(a>=0x19){channelNr=2;charCode1=a-8;}else {channelNr=1;charCode1=a;}if(charCode1>=0x11&&charCode1<=0x13){// Special character
let oneCode;if(charCode1===0x11){oneCode=b+0x50;}else if(charCode1===0x12){oneCode=b+0x70;}else {oneCode=b+0x90;}this.logger.log(2,()=>"Special char '"+getCharForByte(oneCode)+"' in channel "+channelNr);charCodes=[oneCode];}else if(a>=0x20&&a<=0x7f){charCodes=b===0?[a]:[a,b];}if(charCodes){this.logger.log(3,()=>'Char codes =  '+numArrayToHexArray(charCodes).join(','));}return charCodes;}/**
   * Parse extended background attributes as well as new foreground color black.
   * @returns True if background attributes are found
   */parseBackgroundAttributes(a,b){const case1=(a===0x10||a===0x18)&&b>=0x20&&b<=0x2f;const case2=(a===0x17||a===0x1f)&&b>=0x2d&&b<=0x2f;if(!(case1||case2)){return false;}let index;const bkgData={};if(a===0x10||a===0x18){index=Math.floor((b-0x20)/2);bkgData.background=backgroundColors[index];if(b%2===1){bkgData.background=bkgData.background+'_semi';}}else if(b===0x2d){bkgData.background='transparent';}else {bkgData.foreground='black';if(b===0x2f){bkgData.underline=true;}}const chNr=a<=0x17?1:2;const channel=this.channels[chNr];channel.setBkgData(bkgData);return true;}/**
   * Reset state of parser and its channels.
   */reset(){for(let i=0;i<Object.keys(this.channels).length;i++){const channel=this.channels[i];if(channel){channel.reset();}}setLastCmd(null,null,this.cmdHistory);}/**
   * Trigger the generation of a cue, and the start of a new one if displayScreens are not empty.
   */cueSplitAtTime(t){for(let i=0;i<this.channels.length;i++){const channel=this.channels[i];if(channel){channel.cueSplitAtTime(t);}}}}function setLastCmd(a,b,cmdHistory){cmdHistory.a=a;cmdHistory.b=b;}function hasCmdRepeated(a,b,cmdHistory){return cmdHistory.a===a&&cmdHistory.b===b;}function createCmdHistory(){return {a:null,b:null};}class OutputFilter{constructor(timelineController,trackName){this.timelineController=void 0;this.cueRanges=[];this.trackName=void 0;this.startTime=null;this.endTime=null;this.screen=null;this.timelineController=timelineController;this.trackName=trackName;}dispatchCue(){if(this.startTime===null){return;}this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges);this.startTime=null;}newCue(startTime,endTime,screen){if(this.startTime===null||this.startTime>startTime){this.startTime=startTime;}this.endTime=endTime;this.screen=screen;this.timelineController.createCaptionsTrack(this.trackName);}reset(){this.cueRanges=[];this.startTime=null;}}/**
 * Copyright 2013 vtt.js Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the 'License');
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an 'AS IS' BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */var VTTCue$1=function(){if(optionalSelf!=null&&optionalSelf.VTTCue){return self.VTTCue;}const AllowedDirections=['','lr','rl'];const AllowedAlignments=['start','middle','end','left','right'];function isAllowedValue(allowed,value){if(typeof value!=='string'){return false;}// necessary for assuring the generic conforms to the Array interface
if(!Array.isArray(allowed)){return false;}// reset the type so that the next narrowing works well
const lcValue=value.toLowerCase();// use the allow list to narrow the type to a specific subset of strings
if(~allowed.indexOf(lcValue)){return lcValue;}return false;}function findDirectionSetting(value){return isAllowedValue(AllowedDirections,value);}function findAlignSetting(value){return isAllowedValue(AllowedAlignments,value);}function extend(obj,...rest){let i=1;for(;i<arguments.length;i++){const cobj=arguments[i];for(const p in cobj){obj[p]=cobj[p];}}return obj;}function VTTCue(startTime,endTime,text){const cue=this;const baseObj={enumerable:true};/**
     * Shim implementation specific properties. These properties are not in
     * the spec.
     */ // Lets us know when the VTTCue's data has changed in such a way that we need
// to recompute its display state. This lets us compute its display state
// lazily.
cue.hasBeenReset=false;/**
     * VTTCue and TextTrackCue properties
     * http://dev.w3.org/html5/webvtt/#vttcue-interface
     */let _id='';let _pauseOnExit=false;let _startTime=startTime;let _endTime=endTime;let _text=text;let _region=null;let _vertical='';let _snapToLines=true;let _line='auto';let _lineAlign='start';let _position=50;let _positionAlign='middle';let _size=50;let _align='middle';Object.defineProperty(cue,'id',extend({},baseObj,{get:function(){return _id;},set:function(value){_id=''+value;}}));Object.defineProperty(cue,'pauseOnExit',extend({},baseObj,{get:function(){return _pauseOnExit;},set:function(value){_pauseOnExit=!!value;}}));Object.defineProperty(cue,'startTime',extend({},baseObj,{get:function(){return _startTime;},set:function(value){if(typeof value!=='number'){throw new TypeError('Start time must be set to a number.');}_startTime=value;this.hasBeenReset=true;}}));Object.defineProperty(cue,'endTime',extend({},baseObj,{get:function(){return _endTime;},set:function(value){if(typeof value!=='number'){throw new TypeError('End time must be set to a number.');}_endTime=value;this.hasBeenReset=true;}}));Object.defineProperty(cue,'text',extend({},baseObj,{get:function(){return _text;},set:function(value){_text=''+value;this.hasBeenReset=true;}}));// todo: implement VTTRegion polyfill?
Object.defineProperty(cue,'region',extend({},baseObj,{get:function(){return _region;},set:function(value){_region=value;this.hasBeenReset=true;}}));Object.defineProperty(cue,'vertical',extend({},baseObj,{get:function(){return _vertical;},set:function(value){const setting=findDirectionSetting(value);// Have to check for false because the setting an be an empty string.
if(setting===false){throw new SyntaxError('An invalid or illegal string was specified.');}_vertical=setting;this.hasBeenReset=true;}}));Object.defineProperty(cue,'snapToLines',extend({},baseObj,{get:function(){return _snapToLines;},set:function(value){_snapToLines=!!value;this.hasBeenReset=true;}}));Object.defineProperty(cue,'line',extend({},baseObj,{get:function(){return _line;},set:function(value){if(typeof value!=='number'&&value!=='auto'){throw new SyntaxError('An invalid number or illegal string was specified.');}_line=value;this.hasBeenReset=true;}}));Object.defineProperty(cue,'lineAlign',extend({},baseObj,{get:function(){return _lineAlign;},set:function(value){const setting=findAlignSetting(value);if(!setting){throw new SyntaxError('An invalid or illegal string was specified.');}_lineAlign=setting;this.hasBeenReset=true;}}));Object.defineProperty(cue,'position',extend({},baseObj,{get:function(){return _position;},set:function(value){if(value<0||value>100){throw new Error('Position must be between 0 and 100.');}_position=value;this.hasBeenReset=true;}}));Object.defineProperty(cue,'positionAlign',extend({},baseObj,{get:function(){return _positionAlign;},set:function(value){const setting=findAlignSetting(value);if(!setting){throw new SyntaxError('An invalid or illegal string was specified.');}_positionAlign=setting;this.hasBeenReset=true;}}));Object.defineProperty(cue,'size',extend({},baseObj,{get:function(){return _size;},set:function(value){if(value<0||value>100){throw new Error('Size must be between 0 and 100.');}_size=value;this.hasBeenReset=true;}}));Object.defineProperty(cue,'align',extend({},baseObj,{get:function(){return _align;},set:function(value){const setting=findAlignSetting(value);if(!setting){throw new SyntaxError('An invalid or illegal string was specified.');}_align=setting;this.hasBeenReset=true;}}));/**
     * Other <track> spec defined properties
     */ // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state
cue.displayState=undefined;}/**
   * VTTCue methods
   */VTTCue.prototype.getCueAsHTML=function(){// Assume WebVTT.convertCueToDOMTree is on the global.
const WebVTT=self.WebVTT;return WebVTT.convertCueToDOMTree(self,this.text);};// this is a polyfill hack
return VTTCue;}();/*
 * Source: https://github.com/mozilla/vtt.js/blob/master/dist/vtt.js
 */class StringDecoder{// eslint-disable-next-line @typescript-eslint/no-unused-vars
decode(data,options){if(!data){return '';}if(typeof data!=='string'){throw new Error('Error - expected string data.');}return decodeURIComponent(encodeURIComponent(data));}}// Try to parse input as a time stamp.
function parseTimeStamp$1(input){function computeSeconds(h,m,s,f){return (h|0)*3600+(m|0)*60+(s|0)+parseFloat(f||0);}const m=input.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);if(!m){return null;}if(parseFloat(m[2])>59){// Timestamp takes the form of [hours]:[minutes].[milliseconds]
// First position is hours as it's over 59.
return computeSeconds(m[2],m[3],0,m[4]);}// Timestamp takes the form of [hours (optional)]:[minutes]:[seconds].[milliseconds]
return computeSeconds(m[1],m[2],m[3],m[4]);}// A settings object holds key/value pairs and will ignore anything but the first
// assignment to a specific key.
class Settings$1{constructor(){this.values=Object.create(null);}// Only accept the first assignment to any key.
set(k,v){if(!this.get(k)&&v!==''){this.values[k]=v;}}// Return the value for a key, or a default value.
// If 'defaultKey' is passed then 'dflt' is assumed to be an object with
// a number of possible default values as properties where 'defaultKey' is
// the key of the property that will be chosen; otherwise it's assumed to be
// a single value.
get(k,dflt,defaultKey){if(defaultKey){return this.has(k)?this.values[k]:dflt[defaultKey];}return this.has(k)?this.values[k]:dflt;}// Check whether we have a value for a key.
has(k){return k in this.values;}// Accept a setting if its one of the given alternatives.
alt(k,v,a){for(let n=0;n<a.length;++n){if(v===a[n]){this.set(k,v);break;}}}// Accept a setting if its a valid (signed) integer.
integer(k,v){if(/^-?\d+$/.test(v)){// integer
this.set(k,parseInt(v,10));}}// Accept a setting if its a valid percentage.
percent(k,v){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(v)){const percent=parseFloat(v);if(percent>=0&&percent<=100){this.set(k,percent);return true;}}return false;}}// Helper function to parse input into groups separated by 'groupDelim', and
// interpret each group as a key/value pair separated by 'keyValueDelim'.
function parseOptions$1(input,callback,keyValueDelim,groupDelim){const groups=groupDelim?input.split(groupDelim):[input];for(const i in groups){if(typeof groups[i]!=='string'){continue;}const kv=groups[i].split(keyValueDelim);if(kv.length!==2){continue;}const k=kv[0];const v=kv[1];callback(k,v);}}const defaults=new VTTCue$1(0,0,'');// 'middle' was changed to 'center' in the spec: https://github.com/w3c/webvtt/pull/244
//  Safari doesn't yet support this change, but FF and Chrome do.
const center=defaults.align==='middle'?'middle':'center';function parseCue$1(input,cue,regionList){// Remember the original input if we need to throw an error.
const oInput=input;// 4.1 WebVTT timestamp
function consumeTimeStamp(){const ts=parseTimeStamp$1(input);if(ts===null){throw new Error('Malformed timestamp: '+oInput);}// Remove time stamp from input.
input=input.replace(/^[^\sa-zA-Z-]+/,'');return ts;}// 4.4.2 WebVTT cue settings
function consumeCueSettings(input,cue){const settings=new Settings$1();parseOptions$1(input,function(k,v){let vals;switch(k){case'region':// Find the last region we parsed with the same region id.
for(let i=regionList.length-1;i>=0;i--){if(regionList[i].id===v){settings.set(k,regionList[i].region);break;}}break;case'vertical':settings.alt(k,v,['rl','lr']);break;case'line':vals=v.split(',');settings.integer(k,vals[0]);if(settings.percent(k,vals[0])){settings.set('snapToLines',false);}settings.alt(k,vals[0],['auto']);if(vals.length===2){settings.alt('lineAlign',vals[1],['start',center,'end']);}break;case'position':vals=v.split(',');settings.percent(k,vals[0]);if(vals.length===2){settings.alt('positionAlign',vals[1],['start',center,'end','line-left','line-right','auto']);}break;case'size':settings.percent(k,v);break;case'align':settings.alt(k,v,['start',center,'end','left','right']);break;}},/:/,/\s/);// Apply default values for any missing fields.
cue.region=settings.get('region',null);cue.vertical=settings.get('vertical','');let line=settings.get('line','auto');if(line==='auto'&&defaults.line===-1){// set numeric line number for Safari
line=-1;}cue.line=line;cue.lineAlign=settings.get('lineAlign','start');cue.snapToLines=settings.get('snapToLines',true);cue.size=settings.get('size',100);cue.align=settings.get('align',center);let position=settings.get('position','auto');if(position==='auto'&&defaults.position===50){// set numeric position for Safari
position=cue.align==='start'||cue.align==='left'?0:cue.align==='end'||cue.align==='right'?100:50;}cue.position=position;}function skipWhitespace(){input=input.replace(/^\s+/,'');}// 4.1 WebVTT cue timings.
skipWhitespace();cue.startTime=consumeTimeStamp();// (1) collect cue start time
skipWhitespace();if(input.slice(0,3)!=='-->'){// (3) next characters must match '-->'
throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+oInput);}input=input.slice(3);skipWhitespace();cue.endTime=consumeTimeStamp();// (5) collect cue end time
// 4.1 WebVTT cue settings list.
skipWhitespace();consumeCueSettings(input,cue);}function fixLineBreaks(input){return input.replace(/<br(?: \/)?>/gi,'\n');}class VTTParser{constructor(){this.state='INITIAL';this.buffer='';this.decoder=new StringDecoder();this.regionList=[];this.cue=null;this.oncue=void 0;this.onparsingerror=void 0;this.onflush=void 0;}parse(data){const _this=this;// If there is no data then we won't decode it, but will just try to parse
// whatever is in buffer already. This may occur in circumstances, for
// example when flush() is called.
if(data){// Try to decode the data that we received.
_this.buffer+=_this.decoder.decode(data,{stream:true});}function collectNextLine(){let buffer=_this.buffer;let pos=0;buffer=fixLineBreaks(buffer);while(pos<buffer.length&&buffer[pos]!=='\r'&&buffer[pos]!=='\n'){++pos;}const line=buffer.slice(0,pos);// Advance the buffer early in case we fail below.
if(buffer[pos]==='\r'){++pos;}if(buffer[pos]==='\n'){++pos;}_this.buffer=buffer.slice(pos);return line;}// 3.2 WebVTT metadata header syntax
function parseHeader(input){parseOptions$1(input,function(k,v){// switch (k) {
// case 'region':
// 3.3 WebVTT region metadata header syntax
// console.log('parse region', v);
// parseRegion(v);
// break;
// }
},/:/);}// 5.1 WebVTT file parsing.
try{let line='';if(_this.state==='INITIAL'){// We can't start parsing until we have the first line.
if(!/\r\n|\n/.test(_this.buffer)){return this;}line=collectNextLine();// strip of UTF-8 BOM if any
// https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8
const m=line.match(/^(ï»¿)?WEBVTT([ \t].*)?$/);if(!(m!=null&&m[0])){throw new Error('Malformed WebVTT signature.');}_this.state='HEADER';}let alreadyCollectedLine=false;while(_this.buffer){// We can't parse a line until we have the full line.
if(!/\r\n|\n/.test(_this.buffer)){return this;}if(!alreadyCollectedLine){line=collectNextLine();}else {alreadyCollectedLine=false;}switch(_this.state){case'HEADER':// 13-18 - Allow a header (metadata) under the WEBVTT line.
if(/:/.test(line)){parseHeader(line);}else if(!line){// An empty line terminates the header and starts the body (cues).
_this.state='ID';}continue;case'NOTE':// Ignore NOTE blocks.
if(!line){_this.state='ID';}continue;case'ID':// Check for the start of NOTE blocks.
if(/^NOTE($|[ \t])/.test(line)){_this.state='NOTE';break;}// 19-29 - Allow any number of line terminators, then initialize new cue values.
if(!line){continue;}_this.cue=new VTTCue$1(0,0,'');_this.state='CUE';// 30-39 - Check if self line contains an optional identifier or timing data.
if(line.indexOf('-->')===-1){_this.cue.id=line;continue;}// Process line as start of a cue.
/* falls through */case'CUE':// 40 - Collect cue timings and settings.
if(!_this.cue){_this.state='BADCUE';continue;}try{parseCue$1(line,_this.cue,_this.regionList);}catch(e){// In case of an error ignore rest of the cue.
_this.cue=null;_this.state='BADCUE';continue;}_this.state='CUETEXT';continue;case'CUETEXT':{const hasSubstring=line.indexOf('-->')!==-1;// 34 - If we have an empty line then report the cue.
// 35 - If we have the special substring '-->' then report the cue,
// but do not collect the line as we need to process the current
// one as a new cue.
if(!line||hasSubstring&&(alreadyCollectedLine=true)){// We are done parsing self cue.
if(_this.oncue&&_this.cue){_this.oncue(_this.cue);}_this.cue=null;_this.state='ID';continue;}if(_this.cue===null){continue;}if(_this.cue.text){_this.cue.text+='\n';}_this.cue.text+=line;}continue;case'BADCUE':// 54-62 - Collect and discard the remaining cue.
if(!line){_this.state='ID';}}}}catch(e){// If we are currently parsing a cue, report what we have.
if(_this.state==='CUETEXT'&&_this.cue&&_this.oncue){_this.oncue(_this.cue);}_this.cue=null;// Enter BADWEBVTT state if header was not parsed correctly otherwise
// another exception occurred so enter BADCUE state.
_this.state=_this.state==='INITIAL'?'BADWEBVTT':'BADCUE';}return this;}flush(){const _this=this;try{// Finish decoding the stream.
// _this.buffer += _this.decoder.decode();
// Synthesize the end of the current cue or region.
if(_this.cue||_this.state==='HEADER'){_this.buffer+='\n\n';_this.parse();}// If we've flushed, parsed, and we're still on the INITIAL state then
// that means we don't have enough of the stream to parse the first
// line.
if(_this.state==='INITIAL'||_this.state==='BADWEBVTT'){throw new Error('Malformed WebVTT signature.');}}catch(e){if(_this.onparsingerror){_this.onparsingerror(e);}}if(_this.onflush){_this.onflush();}return this;}}const LINEBREAKS=/\r\n|\n\r|\n|\r/g;// String.prototype.startsWith is not supported in IE11
const startsWith=function startsWith(inputString,searchString,position=0){return inputString.slice(position,position+searchString.length)===searchString;};const cueString2millis=function cueString2millis(timeString){let ts=parseInt(timeString.slice(-3));const secs=parseInt(timeString.slice(-6,-4));const mins=parseInt(timeString.slice(-9,-7));const hours=timeString.length>9?parseInt(timeString.substring(0,timeString.indexOf(':'))):0;if(!isFiniteNumber(ts)||!isFiniteNumber(secs)||!isFiniteNumber(mins)||!isFiniteNumber(hours)){throw Error(`Malformed X-TIMESTAMP-MAP: Local:${timeString}`);}ts+=1000*secs;ts+=60*1000*mins;ts+=60*60*1000*hours;return ts;};// From https://github.com/darkskyapp/string-hash
const hash=function hash(text){let _hash=5381;let i=text.length;while(i){_hash=_hash*33^text.charCodeAt(--i);}return (_hash>>>0).toString();};// Create a unique hash id for a cue based on start/end times and text.
// This helps timeline-controller to avoid showing repeated captions.
function generateCueId(startTime,endTime,text){return hash(startTime.toString())+hash(endTime.toString())+hash(text);}const calculateOffset=function calculateOffset(vttCCs,cc,presentationTime){let currCC=vttCCs[cc];let prevCC=vttCCs[currCC.prevCC];// This is the first discontinuity or cues have been processed since the last discontinuity
// Offset = current discontinuity time
if(!prevCC||!prevCC.new&&currCC.new){vttCCs.ccOffset=vttCCs.presentationOffset=currCC.start;currCC.new=false;return;}// There have been discontinuities since cues were last parsed.
// Offset = time elapsed
while((_prevCC=prevCC)!=null&&_prevCC.new){var _prevCC;vttCCs.ccOffset+=currCC.start-prevCC.start;currCC.new=false;currCC=prevCC;prevCC=vttCCs[currCC.prevCC];}vttCCs.presentationOffset=presentationTime;};function parseWebVTT(vttByteArray,initPTS,vttCCs,cc,timeOffset,callBack,errorCallBack){const parser=new VTTParser();// Convert byteArray into string, replacing any somewhat exotic linefeeds with "\n", then split on that character.
// Uint8Array.prototype.reduce is not implemented in IE11
const vttLines=utf8ArrayToStr(new Uint8Array(vttByteArray)).trim().replace(LINEBREAKS,'\n').split('\n');const cues=[];const init90kHz=initPTS?toMpegTsClockFromTimescale(initPTS.baseTime,initPTS.timescale):0;let cueTime='00:00.000';let timestampMapMPEGTS=0;let timestampMapLOCAL=0;let parsingError;let inHeader=true;parser.oncue=function(cue){// Adjust cue timing; clamp cues to start no earlier than - and drop cues that don't end after - 0 on timeline.
const currCC=vttCCs[cc];let cueOffset=vttCCs.ccOffset;// Calculate subtitle PTS offset
const webVttMpegTsMapOffset=(timestampMapMPEGTS-init90kHz)/90000;// Update offsets for new discontinuities
if(currCC!=null&&currCC.new){if(timestampMapLOCAL!==undefined){// When local time is provided, offset = discontinuity start time - local time
cueOffset=vttCCs.ccOffset=currCC.start;}else {calculateOffset(vttCCs,cc,webVttMpegTsMapOffset);}}if(webVttMpegTsMapOffset){if(!initPTS){parsingError=new Error('Missing initPTS for VTT MPEGTS');return;}// If we have MPEGTS, offset = presentation time + discontinuity offset
cueOffset=webVttMpegTsMapOffset-vttCCs.presentationOffset;}const duration=cue.endTime-cue.startTime;const startTime=normalizePts((cue.startTime+cueOffset-timestampMapLOCAL)*90000,timeOffset*90000)/90000;cue.startTime=Math.max(startTime,0);cue.endTime=Math.max(startTime+duration,0);//trim trailing webvtt block whitespaces
const text=cue.text.trim();// Fix encoding of special characters
cue.text=decodeURIComponent(encodeURIComponent(text));// If the cue was not assigned an id from the VTT file (line above the content), create one.
if(!cue.id){cue.id=generateCueId(cue.startTime,cue.endTime,text);}if(cue.endTime>0){cues.push(cue);}};parser.onparsingerror=function(error){parsingError=error;};parser.onflush=function(){if(parsingError){errorCallBack(parsingError);return;}callBack(cues);};// Go through contents line by line.
vttLines.forEach(line=>{if(inHeader){// Look for X-TIMESTAMP-MAP in header.
if(startsWith(line,'X-TIMESTAMP-MAP=')){// Once found, no more are allowed anyway, so stop searching.
inHeader=false;// Extract LOCAL and MPEGTS.
line.slice(16).split(',').forEach(timestamp=>{if(startsWith(timestamp,'LOCAL:')){cueTime=timestamp.slice(6);}else if(startsWith(timestamp,'MPEGTS:')){timestampMapMPEGTS=parseInt(timestamp.slice(7));}});try{// Convert cue time to seconds
timestampMapLOCAL=cueString2millis(cueTime)/1000;}catch(error){parsingError=error;}// Return without parsing X-TIMESTAMP-MAP line.
return;}else if(line===''){inHeader=false;}}// Parse line by default.
parser.parse(line+'\n');});parser.flush();}const IMSC1_CODEC='stpp.ttml.im1t';// Time format: h:m:s:frames(.subframes)
const HMSF_REGEX=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/;// Time format: hours, minutes, seconds, milliseconds, frames, ticks
const TIME_UNIT_REGEX=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/;const textAlignToLineAlign={left:'start',center:'center',right:'end',start:'start',end:'end'};function parseIMSC1(payload,initPTS,callBack,errorCallBack){const results=findBox(new Uint8Array(payload),['mdat']);if(results.length===0){errorCallBack(new Error('Could not parse IMSC1 mdat'));return;}const ttmlList=results.map(mdat=>utf8ArrayToStr(mdat));const syncTime=toTimescaleFromScale(initPTS.baseTime,1,initPTS.timescale);try{ttmlList.forEach(ttml=>callBack(parseTTML(ttml,syncTime)));}catch(error){errorCallBack(error);}}function parseTTML(ttml,syncTime){const parser=new DOMParser();const xmlDoc=parser.parseFromString(ttml,'text/xml');const tt=xmlDoc.getElementsByTagName('tt')[0];if(!tt){throw new Error('Invalid ttml');}const defaultRateInfo={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0};const rateInfo=Object.keys(defaultRateInfo).reduce((result,key)=>{result[key]=tt.getAttribute(`ttp:${key}`)||defaultRateInfo[key];return result;},{});const trim=tt.getAttribute('xml:space')!=='preserve';const styleElements=collectionToDictionary(getElementCollection(tt,'styling','style'));const regionElements=collectionToDictionary(getElementCollection(tt,'layout','region'));const cueElements=getElementCollection(tt,'body','[begin]');return [].map.call(cueElements,cueElement=>{const cueText=getTextContent(cueElement,trim);if(!cueText||!cueElement.hasAttribute('begin')){return null;}const startTime=parseTtmlTime(cueElement.getAttribute('begin'),rateInfo);const duration=parseTtmlTime(cueElement.getAttribute('dur'),rateInfo);let endTime=parseTtmlTime(cueElement.getAttribute('end'),rateInfo);if(startTime===null){throw timestampParsingError(cueElement);}if(endTime===null){if(duration===null){throw timestampParsingError(cueElement);}endTime=startTime+duration;}const cue=new VTTCue$1(startTime-syncTime,endTime-syncTime,cueText);cue.id=generateCueId(cue.startTime,cue.endTime,cue.text);const region=regionElements[cueElement.getAttribute('region')];const style=styleElements[cueElement.getAttribute('style')];// Apply styles to cue
const styles=getTtmlStyles(region,style,styleElements);const{textAlign}=styles;if(textAlign){// cue.positionAlign not settable in FF~2016
const lineAlign=textAlignToLineAlign[textAlign];if(lineAlign){cue.lineAlign=lineAlign;}cue.align=textAlign;}_extends(cue,styles);return cue;}).filter(cue=>cue!==null);}function getElementCollection(fromElement,parentName,childName){const parent=fromElement.getElementsByTagName(parentName)[0];if(parent){return [].slice.call(parent.querySelectorAll(childName));}return [];}function collectionToDictionary(elementsWithId){return elementsWithId.reduce((dict,element)=>{const id=element.getAttribute('xml:id');if(id){dict[id]=element;}return dict;},{});}function getTextContent(element,trim){return [].slice.call(element.childNodes).reduce((str,node,i)=>{var _node$childNodes;if(node.nodeName==='br'&&i){return str+'\n';}if((_node$childNodes=node.childNodes)!=null&&_node$childNodes.length){return getTextContent(node,trim);}else if(trim){return str+node.textContent.trim().replace(/\s+/g,' ');}return str+node.textContent;},'');}function getTtmlStyles(region,style,styleElements){const ttsNs='http://www.w3.org/ns/ttml#styling';let regionStyle=null;const styleAttributes=['displayAlign','textAlign','color','backgroundColor','fontSize','fontFamily'// 'fontWeight',
// 'lineHeight',
// 'wrapOption',
// 'fontStyle',
// 'direction',
// 'writingMode'
];const regionStyleName=region!=null&&region.hasAttribute('style')?region.getAttribute('style'):null;if(regionStyleName&&styleElements.hasOwnProperty(regionStyleName)){regionStyle=styleElements[regionStyleName];}return styleAttributes.reduce((styles,name)=>{const value=getAttributeNS(style,ttsNs,name)||getAttributeNS(region,ttsNs,name)||getAttributeNS(regionStyle,ttsNs,name);if(value){styles[name]=value;}return styles;},{});}function getAttributeNS(element,ns,name){if(!element){return null;}return element.hasAttributeNS(ns,name)?element.getAttributeNS(ns,name):null;}function timestampParsingError(node){return new Error(`Could not parse ttml timestamp ${node}`);}function parseTtmlTime(timeAttributeValue,rateInfo){if(!timeAttributeValue){return null;}let seconds=parseTimeStamp$1(timeAttributeValue);if(seconds===null){if(HMSF_REGEX.test(timeAttributeValue)){seconds=parseHoursMinutesSecondsFrames(timeAttributeValue,rateInfo);}else if(TIME_UNIT_REGEX.test(timeAttributeValue)){seconds=parseTimeUnits(timeAttributeValue,rateInfo);}}return seconds;}function parseHoursMinutesSecondsFrames(timeAttributeValue,rateInfo){const m=HMSF_REGEX.exec(timeAttributeValue);const frames=(m[4]|0)+(m[5]|0)/rateInfo.subFrameRate;return (m[1]|0)*3600+(m[2]|0)*60+(m[3]|0)+frames/rateInfo.frameRate;}function parseTimeUnits(timeAttributeValue,rateInfo){const m=TIME_UNIT_REGEX.exec(timeAttributeValue);const value=Number(m[1]);const unit=m[2];switch(unit){case'h':return value*3600;case'm':return value*60;case'ms':return value*1000;case'f':return value/rateInfo.frameRate;case't':return value/rateInfo.tickRate;}return value;}class TimelineController{constructor(hls){this.hls=void 0;this.media=null;this.config=void 0;this.enabled=true;this.Cues=void 0;this.textTracks=[];this.tracks=[];this.initPTS=[];this.unparsedVttFrags=[];this.captionsTracks={};this.nonNativeCaptionsTracks={};this.cea608Parser1=void 0;this.cea608Parser2=void 0;this.lastCc=-1;// Last video (CEA-608) fragment CC
this.lastSn=-1;// Last video (CEA-608) fragment MSN
this.lastPartIndex=-1;// Last video (CEA-608) fragment Part Index
this.prevCC=-1;// Last subtitle fragment CC
this.vttCCs=newVTTCCs();this.captionsProperties=void 0;this.hls=hls;this.config=hls.config;this.Cues=hls.config.cueHandler;this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}};hls.on(Events$1.MEDIA_ATTACHING,this.onMediaAttaching,this);hls.on(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);hls.on(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.on(Events$1.MANIFEST_LOADED,this.onManifestLoaded,this);hls.on(Events$1.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this);hls.on(Events$1.FRAG_LOADING,this.onFragLoading,this);hls.on(Events$1.FRAG_LOADED,this.onFragLoaded,this);hls.on(Events$1.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this);hls.on(Events$1.FRAG_DECRYPTED,this.onFragDecrypted,this);hls.on(Events$1.INIT_PTS_FOUND,this.onInitPtsFound,this);hls.on(Events$1.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this);hls.on(Events$1.BUFFER_FLUSHING,this.onBufferFlushing,this);}destroy(){const{hls}=this;hls.off(Events$1.MEDIA_ATTACHING,this.onMediaAttaching,this);hls.off(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);hls.off(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.off(Events$1.MANIFEST_LOADED,this.onManifestLoaded,this);hls.off(Events$1.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this);hls.off(Events$1.FRAG_LOADING,this.onFragLoading,this);hls.off(Events$1.FRAG_LOADED,this.onFragLoaded,this);hls.off(Events$1.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this);hls.off(Events$1.FRAG_DECRYPTED,this.onFragDecrypted,this);hls.off(Events$1.INIT_PTS_FOUND,this.onInitPtsFound,this);hls.off(Events$1.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this);hls.off(Events$1.BUFFER_FLUSHING,this.onBufferFlushing,this);// @ts-ignore
this.hls=this.config=null;this.cea608Parser1=this.cea608Parser2=undefined;}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const channel1=new OutputFilter(this,'textTrack1');const channel2=new OutputFilter(this,'textTrack2');const channel3=new OutputFilter(this,'textTrack3');const channel4=new OutputFilter(this,'textTrack4');this.cea608Parser1=new Cea608Parser(1,channel1,channel2);this.cea608Parser2=new Cea608Parser(3,channel3,channel4);}}addCues(trackName,startTime,endTime,screen,cueRanges){// skip cues which overlap more than 50% with previously parsed time ranges
let merged=false;for(let i=cueRanges.length;i--;){const cueRange=cueRanges[i];const overlap=intersection(cueRange[0],cueRange[1],startTime,endTime);if(overlap>=0){cueRange[0]=Math.min(cueRange[0],startTime);cueRange[1]=Math.max(cueRange[1],endTime);merged=true;if(overlap/(endTime-startTime)>0.5){return;}}}if(!merged){cueRanges.push([startTime,endTime]);}if(this.config.renderTextTracksNatively){const track=this.captionsTracks[trackName];this.Cues.newCue(track,startTime,endTime,screen);}else {const cues=this.Cues.newCue(null,startTime,endTime,screen);this.hls.trigger(Events$1.CUES_PARSED,{type:'captions',cues,track:trackName});}}// Triggered when an initial PTS is found; used for synchronisation of WebVTT.
onInitPtsFound(event,{frag,id,initPTS,timescale}){const{unparsedVttFrags}=this;if(id==='main'){this.initPTS[frag.cc]={baseTime:initPTS,timescale};}// Due to asynchronous processing, initial PTS may arrive later than the first VTT fragments are loaded.
// Parse any unparsed fragments upon receiving the initial PTS.
if(unparsedVttFrags.length){this.unparsedVttFrags=[];unparsedVttFrags.forEach(frag=>{this.onFragLoaded(Events$1.FRAG_LOADED,frag);});}}getExistingTrack(label,language){const{media}=this;if(media){for(let i=0;i<media.textTracks.length;i++){const textTrack=media.textTracks[i];if(canReuseVttTextTrack(textTrack,{name:label,lang:language,attrs:{}})){return textTrack;}}}return null;}createCaptionsTrack(trackName){if(this.config.renderTextTracksNatively){this.createNativeTrack(trackName);}else {this.createNonNativeTrack(trackName);}}createNativeTrack(trackName){if(this.captionsTracks[trackName]){return;}const{captionsProperties,captionsTracks,media}=this;const{label,languageCode}=captionsProperties[trackName];// Enable reuse of existing text track.
const existingTrack=this.getExistingTrack(label,languageCode);if(!existingTrack){const textTrack=this.createTextTrack('captions',label,languageCode);if(textTrack){// Set a special property on the track so we know it's managed by Hls.js
textTrack[trackName]=true;captionsTracks[trackName]=textTrack;}}else {captionsTracks[trackName]=existingTrack;clearCurrentCues(captionsTracks[trackName]);sendAddTrackEvent(captionsTracks[trackName],media);}}createNonNativeTrack(trackName){if(this.nonNativeCaptionsTracks[trackName]){return;}// Create a list of a single track for the provider to consume
const trackProperties=this.captionsProperties[trackName];if(!trackProperties){return;}const label=trackProperties.label;const track={_id:trackName,label,kind:'captions',default:trackProperties.media?!!trackProperties.media.default:false,closedCaptions:trackProperties.media};this.nonNativeCaptionsTracks[trackName]=track;this.hls.trigger(Events$1.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[track]});}createTextTrack(kind,label,lang){const media=this.media;if(!media){return;}return media.addTextTrack(kind,label,lang);}onMediaAttaching(event,data){this.media=data.media;this._cleanTracks();}onMediaDetaching(){const{captionsTracks}=this;Object.keys(captionsTracks).forEach(trackName=>{clearCurrentCues(captionsTracks[trackName]);delete captionsTracks[trackName];});this.nonNativeCaptionsTracks={};}onManifestLoading(){// Detect discontinuity in video fragment (CEA-608) parsing
this.lastCc=-1;this.lastSn=-1;this.lastPartIndex=-1;// Detect discontinuity in subtitle manifests
this.prevCC=-1;this.vttCCs=newVTTCCs();// Reset tracks
this._cleanTracks();this.tracks=[];this.captionsTracks={};this.nonNativeCaptionsTracks={};this.textTracks=[];this.unparsedVttFrags=[];this.initPTS=[];if(this.cea608Parser1&&this.cea608Parser2){this.cea608Parser1.reset();this.cea608Parser2.reset();}}_cleanTracks(){// clear outdated subtitles
const{media}=this;if(!media){return;}const textTracks=media.textTracks;if(textTracks){for(let i=0;i<textTracks.length;i++){clearCurrentCues(textTracks[i]);}}}onSubtitleTracksUpdated(event,data){const tracks=data.subtitleTracks||[];const hasIMSC1=tracks.some(track=>track.textCodec===IMSC1_CODEC);if(this.config.enableWebVTT||hasIMSC1&&this.config.enableIMSC1){const listIsIdentical=subtitleOptionsIdentical(this.tracks,tracks);if(listIsIdentical){this.tracks=tracks;return;}this.textTracks=[];this.tracks=tracks;if(this.config.renderTextTracksNatively){const media=this.media;const inUseTracks=media?filterSubtitleTracks(media.textTracks):null;this.tracks.forEach((track,index)=>{// Reuse tracks with the same label and lang, but do not reuse 608/708 tracks
let textTrack;if(inUseTracks){let inUseTrack=null;for(let i=0;i<inUseTracks.length;i++){if(inUseTracks[i]&&canReuseVttTextTrack(inUseTracks[i],track)){inUseTrack=inUseTracks[i];inUseTracks[i]=null;break;}}if(inUseTrack){textTrack=inUseTrack;}}if(textTrack){clearCurrentCues(textTrack);}else {const textTrackKind=captionsOrSubtitlesFromCharacteristics(track);textTrack=this.createTextTrack(textTrackKind,track.name,track.lang);if(textTrack){textTrack.mode='disabled';}}if(textTrack){this.textTracks.push(textTrack);}});// Warn when video element has captions or subtitle TextTracks carried over from another source
if(inUseTracks!=null&&inUseTracks.length){const unusedTextTracks=inUseTracks.filter(t=>t!==null).map(t=>t.label);if(unusedTextTracks.length){logger.warn(`Media element contains unused subtitle tracks: ${unusedTextTracks.join(', ')}. Replace media element for each source to clear TextTracks and captions menu.`);}}}else if(this.tracks.length){// Create a list of tracks for the provider to consume
const tracksList=this.tracks.map(track=>{return {label:track.name,kind:track.type.toLowerCase(),default:track.default,subtitleTrack:track};});this.hls.trigger(Events$1.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:tracksList});}}}onManifestLoaded(event,data){if(this.config.enableCEA708Captions&&data.captions){data.captions.forEach(captionsTrack=>{const instreamIdMatch=/(?:CC|SERVICE)([1-4])/.exec(captionsTrack.instreamId);if(!instreamIdMatch){return;}const trackName=`textTrack${instreamIdMatch[1]}`;const trackProperties=this.captionsProperties[trackName];if(!trackProperties){return;}trackProperties.label=captionsTrack.name;if(captionsTrack.lang){// optional attribute
trackProperties.languageCode=captionsTrack.lang;}trackProperties.media=captionsTrack;});}}closedCaptionsForLevel(frag){const level=this.hls.levels[frag.level];return level==null?void 0:level.attrs['CLOSED-CAPTIONS'];}onFragLoading(event,data){// if this frag isn't contiguous, clear the parser so cues with bad start/end times aren't added to the textTrack
if(this.enabled&&data.frag.type===PlaylistLevelType.MAIN){var _data$part$index,_data$part;const{cea608Parser1,cea608Parser2,lastSn}=this;const{cc,sn}=data.frag;const partIndex=(_data$part$index=(_data$part=data.part)==null?void 0:_data$part.index)!=null?_data$part$index:-1;if(cea608Parser1&&cea608Parser2){if(sn!==lastSn+1||sn===lastSn&&partIndex!==this.lastPartIndex+1||cc!==this.lastCc){cea608Parser1.reset();cea608Parser2.reset();}}this.lastCc=cc;this.lastSn=sn;this.lastPartIndex=partIndex;}}onFragLoaded(event,data){const{frag,payload}=data;if(frag.type===PlaylistLevelType.SUBTITLE){// If fragment is subtitle type, parse as WebVTT.
if(payload.byteLength){const decryptData=frag.decryptdata;// fragment after decryption has a stats object
const decrypted=('stats'in data);// If the subtitles are not encrypted, parse VTTs now. Otherwise, we need to wait.
if(decryptData==null||!decryptData.encrypted||decrypted){const trackPlaylistMedia=this.tracks[frag.level];const vttCCs=this.vttCCs;if(!vttCCs[frag.cc]){vttCCs[frag.cc]={start:frag.start,prevCC:this.prevCC,new:true};this.prevCC=frag.cc;}if(trackPlaylistMedia&&trackPlaylistMedia.textCodec===IMSC1_CODEC){this._parseIMSC1(frag,payload);}else {this._parseVTTs(data);}}}else {// In case there is no payload, finish unsuccessfully.
this.hls.trigger(Events$1.SUBTITLE_FRAG_PROCESSED,{success:false,frag,error:new Error('Empty subtitle payload')});}}}_parseIMSC1(frag,payload){const hls=this.hls;parseIMSC1(payload,this.initPTS[frag.cc],cues=>{this._appendCues(cues,frag.level);hls.trigger(Events$1.SUBTITLE_FRAG_PROCESSED,{success:true,frag:frag});},error=>{logger.log(`Failed to parse IMSC1: ${error}`);hls.trigger(Events$1.SUBTITLE_FRAG_PROCESSED,{success:false,frag:frag,error});});}_parseVTTs(data){var _frag$initSegment;const{frag,payload}=data;// We need an initial synchronisation PTS. Store fragments as long as none has arrived
const{initPTS,unparsedVttFrags}=this;const maxAvCC=initPTS.length-1;if(!initPTS[frag.cc]&&maxAvCC===-1){unparsedVttFrags.push(data);return;}const hls=this.hls;// Parse the WebVTT file contents.
const payloadWebVTT=(_frag$initSegment=frag.initSegment)!=null&&_frag$initSegment.data?appendUint8Array(frag.initSegment.data,new Uint8Array(payload)):payload;parseWebVTT(payloadWebVTT,this.initPTS[frag.cc],this.vttCCs,frag.cc,frag.start,cues=>{this._appendCues(cues,frag.level);hls.trigger(Events$1.SUBTITLE_FRAG_PROCESSED,{success:true,frag:frag});},error=>{const missingInitPTS=error.message==='Missing initPTS for VTT MPEGTS';if(missingInitPTS){unparsedVttFrags.push(data);}else {this._fallbackToIMSC1(frag,payload);}// Something went wrong while parsing. Trigger event with success false.
logger.log(`Failed to parse VTT cue: ${error}`);if(missingInitPTS&&maxAvCC>frag.cc){return;}hls.trigger(Events$1.SUBTITLE_FRAG_PROCESSED,{success:false,frag:frag,error});});}_fallbackToIMSC1(frag,payload){// If textCodec is unknown, try parsing as IMSC1. Set textCodec based on the result
const trackPlaylistMedia=this.tracks[frag.level];if(!trackPlaylistMedia.textCodec){parseIMSC1(payload,this.initPTS[frag.cc],()=>{trackPlaylistMedia.textCodec=IMSC1_CODEC;this._parseIMSC1(frag,payload);},()=>{trackPlaylistMedia.textCodec='wvtt';});}}_appendCues(cues,fragLevel){const hls=this.hls;if(this.config.renderTextTracksNatively){const textTrack=this.textTracks[fragLevel];// WebVTTParser.parse is an async method and if the currently selected text track mode is set to "disabled"
// before parsing is done then don't try to access currentTrack.cues.getCueById as cues will be null
// and trying to access getCueById method of cues will throw an exception
// Because we check if the mode is disabled, we can force check `cues` below. They can't be null.
if(!textTrack||textTrack.mode==='disabled'){return;}cues.forEach(cue=>addCueToTrack(textTrack,cue));}else {const currentTrack=this.tracks[fragLevel];if(!currentTrack){return;}const track=currentTrack.default?'default':'subtitles'+fragLevel;hls.trigger(Events$1.CUES_PARSED,{type:'subtitles',cues,track});}}onFragDecrypted(event,data){const{frag}=data;if(frag.type===PlaylistLevelType.SUBTITLE){this.onFragLoaded(Events$1.FRAG_LOADED,data);}}onSubtitleTracksCleared(){this.tracks=[];this.captionsTracks={};}onFragParsingUserdata(event,data){this.initCea608Parsers();const{cea608Parser1,cea608Parser2}=this;if(!this.enabled||!cea608Parser1||!cea608Parser2){return;}const{frag,samples}=data;if(frag.type===PlaylistLevelType.MAIN&&this.closedCaptionsForLevel(frag)==='NONE'){return;}// If the event contains captions (found in the bytes property), push all bytes into the parser immediately
// It will create the proper timestamps based on the PTS value
for(let i=0;i<samples.length;i++){const ccBytes=samples[i].bytes;if(ccBytes){const ccdatas=this.extractCea608Data(ccBytes);cea608Parser1.addData(samples[i].pts,ccdatas[0]);cea608Parser2.addData(samples[i].pts,ccdatas[1]);}}}onBufferFlushing(event,{startOffset,endOffset,endOffsetSubtitles,type}){const{media}=this;if(!media||media.currentTime<endOffset){return;}// Clear 608 caption cues from the captions TextTracks when the video back buffer is flushed
// Forward cues are never removed because we can loose streamed 608 content from recent fragments
if(!type||type==='video'){const{captionsTracks}=this;Object.keys(captionsTracks).forEach(trackName=>removeCuesInRange(captionsTracks[trackName],startOffset,endOffset));}if(this.config.renderTextTracksNatively){// Clear VTT/IMSC1 subtitle cues from the subtitle TextTracks when the back buffer is flushed
if(startOffset===0&&endOffsetSubtitles!==undefined){const{textTracks}=this;Object.keys(textTracks).forEach(trackName=>removeCuesInRange(textTracks[trackName],startOffset,endOffsetSubtitles));}}}extractCea608Data(byteArray){const actualCCBytes=[[],[]];const count=byteArray[0]&0x1f;let position=2;for(let j=0;j<count;j++){const tmpByte=byteArray[position++];const ccbyte1=0x7f&byteArray[position++];const ccbyte2=0x7f&byteArray[position++];if(ccbyte1===0&&ccbyte2===0){continue;}const ccValid=(0x04&tmpByte)!==0;// Support all four channels
if(ccValid){const ccType=0x03&tmpByte;if(0x00/* CEA608 field1*/===ccType||0x01/* CEA608 field2*/===ccType){// Exclude CEA708 CC data.
actualCCBytes[ccType].push(ccbyte1);actualCCBytes[ccType].push(ccbyte2);}}}return actualCCBytes;}}function captionsOrSubtitlesFromCharacteristics(track){if(track.characteristics){if(/transcribes-spoken-dialog/gi.test(track.characteristics)&&/describes-music-and-sound/gi.test(track.characteristics)){return 'captions';}}return 'subtitles';}function canReuseVttTextTrack(inUseTrack,manifestTrack){return !!inUseTrack&&inUseTrack.kind===captionsOrSubtitlesFromCharacteristics(manifestTrack)&&subtitleTrackMatchesTextTrack(manifestTrack,inUseTrack);}function intersection(x1,x2,y1,y2){return Math.min(x2,y2)-Math.max(x1,y1);}function newVTTCCs(){return {ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:true}};}class CapLevelController{constructor(hls){this.hls=void 0;this.autoLevelCapping=void 0;this.firstLevel=void 0;this.media=void 0;this.restrictedLevels=void 0;this.timer=void 0;this.clientRect=void 0;this.streamController=void 0;this.hls=hls;this.autoLevelCapping=Number.POSITIVE_INFINITY;this.firstLevel=-1;this.media=null;this.restrictedLevels=[];this.timer=undefined;this.clientRect=null;this.registerListeners();}setStreamController(streamController){this.streamController=streamController;}destroy(){if(this.hls){this.unregisterListener();}if(this.timer){this.stopCapping();}this.media=null;this.clientRect=null;// @ts-ignore
this.hls=this.streamController=null;}registerListeners(){const{hls}=this;hls.on(Events$1.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this);hls.on(Events$1.MEDIA_ATTACHING,this.onMediaAttaching,this);hls.on(Events$1.MANIFEST_PARSED,this.onManifestParsed,this);hls.on(Events$1.LEVELS_UPDATED,this.onLevelsUpdated,this);hls.on(Events$1.BUFFER_CODECS,this.onBufferCodecs,this);hls.on(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);}unregisterListener(){const{hls}=this;hls.off(Events$1.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this);hls.off(Events$1.MEDIA_ATTACHING,this.onMediaAttaching,this);hls.off(Events$1.MANIFEST_PARSED,this.onManifestParsed,this);hls.off(Events$1.LEVELS_UPDATED,this.onLevelsUpdated,this);hls.off(Events$1.BUFFER_CODECS,this.onBufferCodecs,this);hls.off(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);}onFpsDropLevelCapping(event,data){// Don't add a restricted level more than once
const level=this.hls.levels[data.droppedLevel];if(this.isLevelAllowed(level)){this.restrictedLevels.push({bitrate:level.bitrate,height:level.height,width:level.width});}}onMediaAttaching(event,data){this.media=data.media instanceof HTMLVideoElement?data.media:null;this.clientRect=null;if(this.timer&&this.hls.levels.length){this.detectPlayerSize();}}onManifestParsed(event,data){const hls=this.hls;this.restrictedLevels=[];this.firstLevel=data.firstLevel;if(hls.config.capLevelToPlayerSize&&data.video){// Start capping immediately if the manifest has signaled video codecs
this.startCapping();}}onLevelsUpdated(event,data){if(this.timer&&isFiniteNumber(this.autoLevelCapping)){this.detectPlayerSize();}}// Only activate capping when playing a video stream; otherwise, multi-bitrate audio-only streams will be restricted
// to the first level
onBufferCodecs(event,data){const hls=this.hls;if(hls.config.capLevelToPlayerSize&&data.video){// If the manifest did not signal a video codec capping has been deferred until we're certain video is present
this.startCapping();}}onMediaDetaching(){this.stopCapping();}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return;}const levels=this.hls.levels;if(levels.length){const hls=this.hls;const maxLevel=this.getMaxLevel(levels.length-1);if(maxLevel!==this.autoLevelCapping){logger.log(`Setting autoLevelCapping to ${maxLevel}: ${levels[maxLevel].height}p@${levels[maxLevel].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`);}hls.autoLevelCapping=maxLevel;if(hls.autoLevelCapping>this.autoLevelCapping&&this.streamController){// if auto level capping has a higher value for the previous one, flush the buffer using nextLevelSwitch
// usually happen when the user go to the fullscreen mode.
this.streamController.nextLevelSwitch();}this.autoLevelCapping=hls.autoLevelCapping;}}}/*
   * returns level should be the one with the dimensions equal or greater than the media (player) dimensions (so the video will be downscaled)
   */getMaxLevel(capLevelIndex){const levels=this.hls.levels;if(!levels.length){return -1;}const validLevels=levels.filter((level,index)=>this.isLevelAllowed(level)&&index<=capLevelIndex);this.clientRect=null;return CapLevelController.getMaxLevelByMediaSize(validLevels,this.mediaWidth,this.mediaHeight);}startCapping(){if(this.timer){// Don't reset capping if started twice; this can happen if the manifest signals a video codec
return;}this.autoLevelCapping=Number.POSITIVE_INFINITY;self.clearInterval(this.timer);this.timer=self.setInterval(this.detectPlayerSize.bind(this),1000);this.detectPlayerSize();}stopCapping(){this.restrictedLevels=[];this.firstLevel=-1;this.autoLevelCapping=Number.POSITIVE_INFINITY;if(this.timer){self.clearInterval(this.timer);this.timer=undefined;}}getDimensions(){if(this.clientRect){return this.clientRect;}const media=this.media;const boundsRect={width:0,height:0};if(media){const clientRect=media.getBoundingClientRect();boundsRect.width=clientRect.width;boundsRect.height=clientRect.height;if(!boundsRect.width&&!boundsRect.height){// When the media element has no width or height (equivalent to not being in the DOM),
// then use its width and height attributes (media.width, media.height)
boundsRect.width=clientRect.right-clientRect.left||media.width||0;boundsRect.height=clientRect.bottom-clientRect.top||media.height||0;}}this.clientRect=boundsRect;return boundsRect;}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor;}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor;}get contentScaleFactor(){let pixelRatio=1;if(!this.hls.config.ignoreDevicePixelRatio){try{pixelRatio=self.devicePixelRatio;}catch(e){/* no-op */}}return pixelRatio;}isLevelAllowed(level){const restrictedLevels=this.restrictedLevels;return !restrictedLevels.some(restrictedLevel=>{return level.bitrate===restrictedLevel.bitrate&&level.width===restrictedLevel.width&&level.height===restrictedLevel.height;});}static getMaxLevelByMediaSize(levels,width,height){if(!(levels!=null&&levels.length)){return -1;}// Levels can have the same dimensions but differing bandwidths - since levels are ordered, we can look to the next
// to determine whether we've chosen the greatest bandwidth for the media's dimensions
const atGreatestBandwidth=(curLevel,nextLevel)=>{if(!nextLevel){return true;}return curLevel.width!==nextLevel.width||curLevel.height!==nextLevel.height;};// If we run through the loop without breaking, the media's dimensions are greater than every level, so default to
// the max level
let maxLevelIndex=levels.length-1;// Prevent changes in aspect-ratio from causing capping to toggle back and forth
const squareSize=Math.max(width,height);for(let i=0;i<levels.length;i+=1){const level=levels[i];if((level.width>=squareSize||level.height>=squareSize)&&atGreatestBandwidth(level,levels[i+1])){maxLevelIndex=i;break;}}return maxLevelIndex;}}class FPSController{constructor(hls){this.hls=void 0;this.isVideoPlaybackQualityAvailable=false;this.timer=void 0;this.media=null;this.lastTime=void 0;this.lastDroppedFrames=0;this.lastDecodedFrames=0;// stream controller must be provided as a dependency!
this.streamController=void 0;this.hls=hls;this.registerListeners();}setStreamController(streamController){this.streamController=streamController;}registerListeners(){this.hls.on(Events$1.MEDIA_ATTACHING,this.onMediaAttaching,this);}unregisterListeners(){this.hls.off(Events$1.MEDIA_ATTACHING,this.onMediaAttaching,this);}destroy(){if(this.timer){clearInterval(this.timer);}this.unregisterListeners();this.isVideoPlaybackQualityAvailable=false;this.media=null;}onMediaAttaching(event,data){const config=this.hls.config;if(config.capLevelOnFPSDrop){const media=data.media instanceof self.HTMLVideoElement?data.media:null;this.media=media;if(media&&typeof media.getVideoPlaybackQuality==='function'){this.isVideoPlaybackQualityAvailable=true;}self.clearInterval(this.timer);this.timer=self.setInterval(this.checkFPSInterval.bind(this),config.fpsDroppedMonitoringPeriod);}}checkFPS(video,decodedFrames,droppedFrames){const currentTime=performance.now();if(decodedFrames){if(this.lastTime){const currentPeriod=currentTime-this.lastTime;const currentDropped=droppedFrames-this.lastDroppedFrames;const currentDecoded=decodedFrames-this.lastDecodedFrames;const droppedFPS=1000*currentDropped/currentPeriod;const hls=this.hls;hls.trigger(Events$1.FPS_DROP,{currentDropped:currentDropped,currentDecoded:currentDecoded,totalDroppedFrames:droppedFrames});if(droppedFPS>0){// logger.log('checkFPS : droppedFPS/decodedFPS:' + droppedFPS/(1000 * currentDecoded / currentPeriod));
if(currentDropped>hls.config.fpsDroppedMonitoringThreshold*currentDecoded){let currentLevel=hls.currentLevel;logger.warn('drop FPS ratio greater than max allowed value for currentLevel: '+currentLevel);if(currentLevel>0&&(hls.autoLevelCapping===-1||hls.autoLevelCapping>=currentLevel)){currentLevel=currentLevel-1;hls.trigger(Events$1.FPS_DROP_LEVEL_CAPPING,{level:currentLevel,droppedLevel:hls.currentLevel});hls.autoLevelCapping=currentLevel;this.streamController.nextLevelSwitch();}}}}this.lastTime=currentTime;this.lastDroppedFrames=droppedFrames;this.lastDecodedFrames=decodedFrames;}}checkFPSInterval(){const video=this.media;if(video){if(this.isVideoPlaybackQualityAvailable){const videoPlaybackQuality=video.getVideoPlaybackQuality();this.checkFPS(video,videoPlaybackQuality.totalVideoFrames,videoPlaybackQuality.droppedVideoFrames);}else {// HTMLVideoElement doesn't include the webkit types
this.checkFPS(video,video.webkitDecodedFrameCount,video.webkitDroppedFrameCount);}}}}const LOGGER_PREFIX='[eme]';/**
 * Controller to deal with encrypted media extensions (EME)
 * @see https://developer.mozilla.org/en-US/docs/Web/API/Encrypted_Media_Extensions_API
 *
 * @class
 * @constructor
 */class EMEController{constructor(hls){this.hls=void 0;this.config=void 0;this.media=null;this.keyFormatPromise=null;this.keySystemAccessPromises={};this._requestLicenseFailureCount=0;this.mediaKeySessions=[];this.keyIdToKeySessionPromise={};this.setMediaKeysQueue=EMEController.CDMCleanupPromise?[EMEController.CDMCleanupPromise]:[];this.onMediaEncrypted=this._onMediaEncrypted.bind(this);this.onWaitingForKey=this._onWaitingForKey.bind(this);this.debug=logger.debug.bind(logger,LOGGER_PREFIX);this.log=logger.log.bind(logger,LOGGER_PREFIX);this.warn=logger.warn.bind(logger,LOGGER_PREFIX);this.error=logger.error.bind(logger,LOGGER_PREFIX);this.hls=hls;this.config=hls.config;this.registerListeners();}destroy(){this.unregisterListeners();this.onMediaDetached();// Remove any references that could be held in config options or callbacks
const config=this.config;config.requestMediaKeySystemAccessFunc=null;config.licenseXhrSetup=config.licenseResponseCallback=undefined;config.drmSystems=config.drmSystemOptions={};// @ts-ignore
this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null;// @ts-ignore
this.config=null;}registerListeners(){this.hls.on(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);this.hls.on(Events$1.MEDIA_DETACHED,this.onMediaDetached,this);this.hls.on(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);this.hls.on(Events$1.MANIFEST_LOADED,this.onManifestLoaded,this);}unregisterListeners(){this.hls.off(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);this.hls.off(Events$1.MEDIA_DETACHED,this.onMediaDetached,this);this.hls.off(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);this.hls.off(Events$1.MANIFEST_LOADED,this.onManifestLoaded,this);}getLicenseServerUrl(keySystem){const{drmSystems,widevineLicenseUrl}=this.config;const keySystemConfiguration=drmSystems[keySystem];if(keySystemConfiguration){return keySystemConfiguration.licenseUrl;}// For backward compatibility
if(keySystem===KeySystems.WIDEVINE&&widevineLicenseUrl){return widevineLicenseUrl;}throw new Error(`no license server URL configured for key-system "${keySystem}"`);}getServerCertificateUrl(keySystem){const{drmSystems}=this.config;const keySystemConfiguration=drmSystems[keySystem];if(keySystemConfiguration){return keySystemConfiguration.serverCertificateUrl;}else {this.log(`No Server Certificate in config.drmSystems["${keySystem}"]`);}}attemptKeySystemAccess(keySystemsToAttempt){const levels=this.hls.levels;const uniqueCodec=(value,i,a)=>!!value&&a.indexOf(value)===i;const audioCodecs=levels.map(level=>level.audioCodec).filter(uniqueCodec);const videoCodecs=levels.map(level=>level.videoCodec).filter(uniqueCodec);if(audioCodecs.length+videoCodecs.length===0){videoCodecs.push('avc1.42e01e');}return new Promise((resolve,reject)=>{const attempt=keySystems=>{const keySystem=keySystems.shift();this.getMediaKeysPromise(keySystem,audioCodecs,videoCodecs).then(mediaKeys=>resolve({keySystem,mediaKeys})).catch(error=>{if(keySystems.length){attempt(keySystems);}else if(error instanceof EMEKeyError){reject(error);}else {reject(new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_NO_ACCESS,error,fatal:true},error.message));}});};attempt(keySystemsToAttempt);});}requestMediaKeySystemAccess(keySystem,supportedConfigurations){const{requestMediaKeySystemAccessFunc}=this.config;if(!(typeof requestMediaKeySystemAccessFunc==='function')){let errMessage=`Configured requestMediaKeySystemAccess is not a function ${requestMediaKeySystemAccessFunc}`;if(requestMediaKeySystemAccess===null&&self.location.protocol==='http:'){errMessage=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`;}return Promise.reject(new Error(errMessage));}return requestMediaKeySystemAccessFunc(keySystem,supportedConfigurations);}getMediaKeysPromise(keySystem,audioCodecs,videoCodecs){// This can throw, but is caught in event handler callpath
const mediaKeySystemConfigs=getSupportedMediaKeySystemConfigurations(keySystem,audioCodecs,videoCodecs,this.config.drmSystemOptions);const keySystemAccessPromises=this.keySystemAccessPromises[keySystem];let keySystemAccess=keySystemAccessPromises==null?void 0:keySystemAccessPromises.keySystemAccess;if(!keySystemAccess){this.log(`Requesting encrypted media "${keySystem}" key-system access with config: ${JSON.stringify(mediaKeySystemConfigs)}`);keySystemAccess=this.requestMediaKeySystemAccess(keySystem,mediaKeySystemConfigs);const _keySystemAccessPromises=this.keySystemAccessPromises[keySystem]={keySystemAccess};keySystemAccess.catch(error=>{this.log(`Failed to obtain access to key-system "${keySystem}": ${error}`);});return keySystemAccess.then(mediaKeySystemAccess=>{this.log(`Access for key-system "${mediaKeySystemAccess.keySystem}" obtained`);const certificateRequest=this.fetchServerCertificate(keySystem);this.log(`Create media-keys for "${keySystem}"`);_keySystemAccessPromises.mediaKeys=mediaKeySystemAccess.createMediaKeys().then(mediaKeys=>{this.log(`Media-keys created for "${keySystem}"`);return certificateRequest.then(certificate=>{if(certificate){return this.setMediaKeysServerCertificate(mediaKeys,keySystem,certificate);}return mediaKeys;});});_keySystemAccessPromises.mediaKeys.catch(error=>{this.error(`Failed to create media-keys for "${keySystem}"}: ${error}`);});return _keySystemAccessPromises.mediaKeys;});}return keySystemAccess.then(()=>keySystemAccessPromises.mediaKeys);}createMediaKeySessionContext({decryptdata,keySystem,mediaKeys}){this.log(`Creating key-system session "${keySystem}" keyId: ${Hex.hexDump(decryptdata.keyId||[])}`);const mediaKeysSession=mediaKeys.createSession();const mediaKeySessionContext={decryptdata,keySystem,mediaKeys,mediaKeysSession,keyStatus:'status-pending'};this.mediaKeySessions.push(mediaKeySessionContext);return mediaKeySessionContext;}renewKeySession(mediaKeySessionContext){const decryptdata=mediaKeySessionContext.decryptdata;if(decryptdata.pssh){const keySessionContext=this.createMediaKeySessionContext(mediaKeySessionContext);const keyId=this.getKeyIdString(decryptdata);const scheme='cenc';this.keyIdToKeySessionPromise[keyId]=this.generateRequestWithPreferredKeySession(keySessionContext,scheme,decryptdata.pssh,'expired');}else {this.warn(`Could not renew expired session. Missing pssh initData.`);}this.removeSession(mediaKeySessionContext);}getKeyIdString(decryptdata){if(!decryptdata){throw new Error('Could not read keyId of undefined decryptdata');}if(decryptdata.keyId===null){throw new Error('keyId is null');}return Hex.hexDump(decryptdata.keyId);}updateKeySession(mediaKeySessionContext,data){var _mediaKeySessionConte;const keySession=mediaKeySessionContext.mediaKeysSession;this.log(`Updating key-session "${keySession.sessionId}" for keyID ${Hex.hexDump(((_mediaKeySessionConte=mediaKeySessionContext.decryptdata)==null?void 0:_mediaKeySessionConte.keyId)||[])}
      } (data length: ${data?data.byteLength:data})`);return keySession.update(data);}selectKeySystemFormat(frag){const keyFormats=Object.keys(frag.levelkeys||{});if(!this.keyFormatPromise){this.log(`Selecting key-system from fragment (sn: ${frag.sn} ${frag.type}: ${frag.level}) key formats ${keyFormats.join(', ')}`);this.keyFormatPromise=this.getKeyFormatPromise(keyFormats);}return this.keyFormatPromise;}getKeyFormatPromise(keyFormats){return new Promise((resolve,reject)=>{const keySystemsInConfig=getKeySystemsForConfig(this.config);const keySystemsToAttempt=keyFormats.map(keySystemFormatToKeySystemDomain).filter(value=>!!value&&keySystemsInConfig.indexOf(value)!==-1);return this.getKeySystemSelectionPromise(keySystemsToAttempt).then(({keySystem})=>{const keySystemFormat=keySystemDomainToKeySystemFormat(keySystem);if(keySystemFormat){resolve(keySystemFormat);}else {reject(new Error(`Unable to find format for key-system "${keySystem}"`));}}).catch(reject);});}loadKey(data){const decryptdata=data.keyInfo.decryptdata;const keyId=this.getKeyIdString(decryptdata);const keyDetails=`(keyId: ${keyId} format: "${decryptdata.keyFormat}" method: ${decryptdata.method} uri: ${decryptdata.uri})`;this.log(`Starting session for key ${keyDetails}`);let keySessionContextPromise=this.keyIdToKeySessionPromise[keyId];if(!keySessionContextPromise){keySessionContextPromise=this.keyIdToKeySessionPromise[keyId]=this.getKeySystemForKeyPromise(decryptdata).then(({keySystem,mediaKeys})=>{this.throwIfDestroyed();this.log(`Handle encrypted media sn: ${data.frag.sn} ${data.frag.type}: ${data.frag.level} using key ${keyDetails}`);return this.attemptSetMediaKeys(keySystem,mediaKeys).then(()=>{this.throwIfDestroyed();const keySessionContext=this.createMediaKeySessionContext({keySystem,mediaKeys,decryptdata});const scheme='cenc';return this.generateRequestWithPreferredKeySession(keySessionContext,scheme,decryptdata.pssh,'playlist-key');});});keySessionContextPromise.catch(error=>this.handleError(error));}return keySessionContextPromise;}throwIfDestroyed(message='Invalid state'){if(!this.hls){throw new Error('invalid state');}}handleError(error){if(!this.hls){return;}this.error(error.message);if(error instanceof EMEKeyError){this.hls.trigger(Events$1.ERROR,error.data);}else {this.hls.trigger(Events$1.ERROR,{type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_NO_KEYS,error,fatal:true});}}getKeySystemForKeyPromise(decryptdata){const keyId=this.getKeyIdString(decryptdata);const mediaKeySessionContext=this.keyIdToKeySessionPromise[keyId];if(!mediaKeySessionContext){const keySystem=keySystemFormatToKeySystemDomain(decryptdata.keyFormat);const keySystemsToAttempt=keySystem?[keySystem]:getKeySystemsForConfig(this.config);return this.attemptKeySystemAccess(keySystemsToAttempt);}return mediaKeySessionContext;}getKeySystemSelectionPromise(keySystemsToAttempt){if(!keySystemsToAttempt.length){keySystemsToAttempt=getKeySystemsForConfig(this.config);}if(keySystemsToAttempt.length===0){throw new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:true},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);}return this.attemptKeySystemAccess(keySystemsToAttempt);}_onMediaEncrypted(event){const{initDataType,initData}=event;this.debug(`"${event.type}" event: init data type: "${initDataType}"`);// Ignore event when initData is null
if(initData===null){return;}let keyId;let keySystemDomain;if(initDataType==='sinf'&&this.config.drmSystems[KeySystems.FAIRPLAY]){// Match sinf keyId to playlist skd://keyId=
const json=bin2str(new Uint8Array(initData));try{const sinf=base64Decode(JSON.parse(json).sinf);const tenc=parseSinf(new Uint8Array(sinf));if(!tenc){return;}keyId=tenc.subarray(8,24);keySystemDomain=KeySystems.FAIRPLAY;}catch(error){this.warn('Failed to parse sinf "encrypted" event message initData');return;}}else {// Support clear-lead key-session creation (otherwise depend on playlist keys)
const psshInfo=parsePssh(initData);if(psshInfo===null){return;}if(psshInfo.version===0&&psshInfo.systemId===KeySystemIds.WIDEVINE&&psshInfo.data){keyId=psshInfo.data.subarray(8,24);}keySystemDomain=keySystemIdToKeySystemDomain(psshInfo.systemId);}if(!keySystemDomain||!keyId){return;}const keyIdHex=Hex.hexDump(keyId);const{keyIdToKeySessionPromise,mediaKeySessions}=this;let keySessionContextPromise=keyIdToKeySessionPromise[keyIdHex];for(let i=0;i<mediaKeySessions.length;i++){// Match playlist key
const keyContext=mediaKeySessions[i];const decryptdata=keyContext.decryptdata;if(decryptdata.pssh||!decryptdata.keyId){continue;}const oldKeyIdHex=Hex.hexDump(decryptdata.keyId);if(keyIdHex===oldKeyIdHex||decryptdata.uri.replace(/-/g,'').indexOf(keyIdHex)!==-1){keySessionContextPromise=keyIdToKeySessionPromise[oldKeyIdHex];delete keyIdToKeySessionPromise[oldKeyIdHex];decryptdata.pssh=new Uint8Array(initData);decryptdata.keyId=keyId;keySessionContextPromise=keyIdToKeySessionPromise[keyIdHex]=keySessionContextPromise.then(()=>{return this.generateRequestWithPreferredKeySession(keyContext,initDataType,initData,'encrypted-event-key-match');});break;}}if(!keySessionContextPromise){// Clear-lead key (not encountered in playlist)
keySessionContextPromise=keyIdToKeySessionPromise[keyIdHex]=this.getKeySystemSelectionPromise([keySystemDomain]).then(({keySystem,mediaKeys})=>{var _keySystemToKeySystem;this.throwIfDestroyed();const decryptdata=new LevelKey('ISO-23001-7',keyIdHex,(_keySystemToKeySystem=keySystemDomainToKeySystemFormat(keySystem))!=null?_keySystemToKeySystem:'');decryptdata.pssh=new Uint8Array(initData);decryptdata.keyId=keyId;return this.attemptSetMediaKeys(keySystem,mediaKeys).then(()=>{this.throwIfDestroyed();const keySessionContext=this.createMediaKeySessionContext({decryptdata,keySystem,mediaKeys});return this.generateRequestWithPreferredKeySession(keySessionContext,initDataType,initData,'encrypted-event-no-match');});});}keySessionContextPromise.catch(error=>this.handleError(error));}_onWaitingForKey(event){this.log(`"${event.type}" event`);}attemptSetMediaKeys(keySystem,mediaKeys){const queue=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${keySystem}"`);// Only one setMediaKeys() can run at one time, and multiple setMediaKeys() operations
// can be queued for execution for multiple key sessions.
const setMediaKeysPromise=Promise.all(queue).then(()=>{if(!this.media){throw new Error('Attempted to set mediaKeys without media element attached');}return this.media.setMediaKeys(mediaKeys);});this.setMediaKeysQueue.push(setMediaKeysPromise);return setMediaKeysPromise.then(()=>{this.log(`Media-keys set for "${keySystem}"`);queue.push(setMediaKeysPromise);this.setMediaKeysQueue=this.setMediaKeysQueue.filter(p=>queue.indexOf(p)===-1);});}generateRequestWithPreferredKeySession(context,initDataType,initData,reason){var _this$config$drmSyste,_this$config$drmSyste2;const generateRequestFilter=(_this$config$drmSyste=this.config.drmSystems)==null?void 0:(_this$config$drmSyste2=_this$config$drmSyste[context.keySystem])==null?void 0:_this$config$drmSyste2.generateRequest;if(generateRequestFilter){try{const mappedInitData=generateRequestFilter.call(this.hls,initDataType,initData,context);if(!mappedInitData){throw new Error('Invalid response from configured generateRequest filter');}initDataType=mappedInitData.initDataType;initData=context.decryptdata.pssh=mappedInitData.initData?new Uint8Array(mappedInitData.initData):null;}catch(error){var _this$hls;this.warn(error.message);if((_this$hls=this.hls)!=null&&_this$hls.config.debug){throw error;}}}if(initData===null){this.log(`Skipping key-session request for "${reason}" (no initData)`);return Promise.resolve(context);}const keyId=this.getKeyIdString(context.decryptdata);this.log(`Generating key-session request for "${reason}": ${keyId} (init data type: ${initDataType} length: ${initData?initData.byteLength:null})`);const licenseStatus=new EventEmitter$1();const onmessage=context._onmessage=event=>{const keySession=context.mediaKeysSession;if(!keySession){licenseStatus.emit('error',new Error('invalid state'));return;}const{messageType,message}=event;this.log(`"${messageType}" message event for session "${keySession.sessionId}" message size: ${message.byteLength}`);if(messageType==='license-request'||messageType==='license-renewal'){this.renewLicense(context,message).catch(error=>{this.handleError(error);licenseStatus.emit('error',error);});}else if(messageType==='license-release'){if(context.keySystem===KeySystems.FAIRPLAY){this.updateKeySession(context,strToUtf8array('acknowledged'));this.removeSession(context);}}else {this.warn(`unhandled media key message type "${messageType}"`);}};const onkeystatuseschange=context._onkeystatuseschange=event=>{const keySession=context.mediaKeysSession;if(!keySession){licenseStatus.emit('error',new Error('invalid state'));return;}this.onKeyStatusChange(context);const keyStatus=context.keyStatus;licenseStatus.emit('keyStatus',keyStatus);if(keyStatus==='expired'){this.warn(`${context.keySystem} expired for key ${keyId}`);this.renewKeySession(context);}};context.mediaKeysSession.addEventListener('message',onmessage);context.mediaKeysSession.addEventListener('keystatuseschange',onkeystatuseschange);const keyUsablePromise=new Promise((resolve,reject)=>{licenseStatus.on('error',reject);licenseStatus.on('keyStatus',keyStatus=>{if(keyStatus.startsWith('usable')){resolve();}else if(keyStatus==='output-restricted'){reject(new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:false},'HDCP level output restricted'));}else if(keyStatus==='internal-error'){reject(new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:true},`key status changed to "${keyStatus}"`));}else if(keyStatus==='expired'){reject(new Error('key expired while generating request'));}else {this.warn(`unhandled key status change "${keyStatus}"`);}});});return context.mediaKeysSession.generateRequest(initDataType,initData).then(()=>{var _context$mediaKeysSes;this.log(`Request generated for key-session "${(_context$mediaKeysSes=context.mediaKeysSession)==null?void 0:_context$mediaKeysSes.sessionId}" keyId: ${keyId}`);}).catch(error=>{throw new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_NO_SESSION,error,fatal:false},`Error generating key-session request: ${error}`);}).then(()=>keyUsablePromise).catch(error=>{licenseStatus.removeAllListeners();this.removeSession(context);throw error;}).then(()=>{licenseStatus.removeAllListeners();return context;});}onKeyStatusChange(mediaKeySessionContext){mediaKeySessionContext.mediaKeysSession.keyStatuses.forEach((status,keyId)=>{this.log(`key status change "${status}" for keyStatuses keyId: ${Hex.hexDump('buffer'in keyId?new Uint8Array(keyId.buffer,keyId.byteOffset,keyId.byteLength):new Uint8Array(keyId))} session keyId: ${Hex.hexDump(new Uint8Array(mediaKeySessionContext.decryptdata.keyId||[]))} uri: ${mediaKeySessionContext.decryptdata.uri}`);mediaKeySessionContext.keyStatus=status;});}fetchServerCertificate(keySystem){const config=this.config;const Loader=config.loader;const certLoader=new Loader(config);const url=this.getServerCertificateUrl(keySystem);if(!url){return Promise.resolve();}this.log(`Fetching server certificate for "${keySystem}"`);return new Promise((resolve,reject)=>{const loaderContext={responseType:'arraybuffer',url};const loadPolicy=config.certLoadPolicy.default;const loaderConfig={loadPolicy,timeout:loadPolicy.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0};const loaderCallbacks={onSuccess:(response,stats,context,networkDetails)=>{resolve(response.data);},onError:(response,contex,networkDetails,stats)=>{reject(new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:true,networkDetails,response:_objectSpread2({url:loaderContext.url,data:undefined},response)},`"${keySystem}" certificate request failed (${url}). Status: ${response.code} (${response.text})`));},onTimeout:(stats,context,networkDetails)=>{reject(new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:true,networkDetails,response:{url:loaderContext.url,data:undefined}},`"${keySystem}" certificate request timed out (${url})`));},onAbort:(stats,context,networkDetails)=>{reject(new Error('aborted'));}};certLoader.load(loaderContext,loaderConfig,loaderCallbacks);});}setMediaKeysServerCertificate(mediaKeys,keySystem,cert){return new Promise((resolve,reject)=>{mediaKeys.setServerCertificate(cert).then(success=>{this.log(`setServerCertificate ${success?'success':'not supported by CDM'} (${cert==null?void 0:cert.byteLength}) on "${keySystem}"`);resolve(mediaKeys);}).catch(error=>{reject(new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error,fatal:true},error.message));});});}renewLicense(context,keyMessage){return this.requestLicense(context,new Uint8Array(keyMessage)).then(data=>{return this.updateKeySession(context,new Uint8Array(data)).catch(error=>{throw new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_SESSION_UPDATE_FAILED,error,fatal:true},error.message);});});}unpackPlayReadyKeyMessage(xhr,licenseChallenge){// On Edge, the raw license message is UTF-16-encoded XML.  We need
// to unpack the Challenge element (base64-encoded string containing the
// actual license request) and any HttpHeader elements (sent as request
// headers).
// For PlayReady CDMs, we need to dig the Challenge out of the XML.
const xmlString=String.fromCharCode.apply(null,new Uint16Array(licenseChallenge.buffer));if(!xmlString.includes('PlayReadyKeyMessage')){// This does not appear to be a wrapped message as on Edge.  Some
// clients do not need this unwrapping, so we will assume this is one of
// them.  Note that "xml" at this point probably looks like random
// garbage, since we interpreted UTF-8 as UTF-16.
xhr.setRequestHeader('Content-Type','text/xml; charset=utf-8');return licenseChallenge;}const keyMessageXml=new DOMParser().parseFromString(xmlString,'application/xml');// Set request headers.
const headers=keyMessageXml.querySelectorAll('HttpHeader');if(headers.length>0){let header;for(let i=0,len=headers.length;i<len;i++){var _header$querySelector,_header$querySelector2;header=headers[i];const name=(_header$querySelector=header.querySelector('name'))==null?void 0:_header$querySelector.textContent;const value=(_header$querySelector2=header.querySelector('value'))==null?void 0:_header$querySelector2.textContent;if(name&&value){xhr.setRequestHeader(name,value);}}}const challengeElement=keyMessageXml.querySelector('Challenge');const challengeText=challengeElement==null?void 0:challengeElement.textContent;if(!challengeText){throw new Error(`Cannot find <Challenge> in key message`);}return strToUtf8array(atob(challengeText));}setupLicenseXHR(xhr,url,keysListItem,licenseChallenge){const licenseXhrSetup=this.config.licenseXhrSetup;if(!licenseXhrSetup){xhr.open('POST',url,true);return Promise.resolve({xhr,licenseChallenge});}return Promise.resolve().then(()=>{if(!keysListItem.decryptdata){throw new Error('Key removed');}return licenseXhrSetup.call(this.hls,xhr,url,keysListItem,licenseChallenge);}).catch(error=>{if(!keysListItem.decryptdata){// Key session removed. Cancel license request.
throw error;}// let's try to open before running setup
xhr.open('POST',url,true);return licenseXhrSetup.call(this.hls,xhr,url,keysListItem,licenseChallenge);}).then(licenseXhrSetupResult=>{// if licenseXhrSetup did not yet call open, let's do it now
if(!xhr.readyState){xhr.open('POST',url,true);}const finalLicenseChallenge=licenseXhrSetupResult?licenseXhrSetupResult:licenseChallenge;return {xhr,licenseChallenge:finalLicenseChallenge};});}requestLicense(keySessionContext,licenseChallenge){const keyLoadPolicy=this.config.keyLoadPolicy.default;return new Promise((resolve,reject)=>{const url=this.getLicenseServerUrl(keySessionContext.keySystem);this.log(`Sending license request to URL: ${url}`);const xhr=new XMLHttpRequest();xhr.responseType='arraybuffer';xhr.onreadystatechange=()=>{if(!this.hls||!keySessionContext.mediaKeysSession){return reject(new Error('invalid state'));}if(xhr.readyState===4){if(xhr.status===200){this._requestLicenseFailureCount=0;let data=xhr.response;this.log(`License received ${data instanceof ArrayBuffer?data.byteLength:data}`);const licenseResponseCallback=this.config.licenseResponseCallback;if(licenseResponseCallback){try{data=licenseResponseCallback.call(this.hls,xhr,url,keySessionContext);}catch(error){this.error(error);}}resolve(data);}else {const retryConfig=keyLoadPolicy.errorRetry;const maxNumRetry=retryConfig?retryConfig.maxNumRetry:0;this._requestLicenseFailureCount++;if(this._requestLicenseFailureCount>maxNumRetry||xhr.status>=400&&xhr.status<500){reject(new EMEKeyError({type:ErrorTypes.KEY_SYSTEM_ERROR,details:ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:true,networkDetails:xhr,response:{url,data:undefined,code:xhr.status,text:xhr.statusText}},`License Request XHR failed (${url}). Status: ${xhr.status} (${xhr.statusText})`));}else {const attemptsLeft=maxNumRetry-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${attemptsLeft} attempts left`);this.requestLicense(keySessionContext,licenseChallenge).then(resolve,reject);}}}};if(keySessionContext.licenseXhr&&keySessionContext.licenseXhr.readyState!==XMLHttpRequest.DONE){keySessionContext.licenseXhr.abort();}keySessionContext.licenseXhr=xhr;this.setupLicenseXHR(xhr,url,keySessionContext,licenseChallenge).then(({xhr,licenseChallenge})=>{if(keySessionContext.keySystem==KeySystems.PLAYREADY){licenseChallenge=this.unpackPlayReadyKeyMessage(xhr,licenseChallenge);}xhr.send(licenseChallenge);});});}onMediaAttached(event,data){if(!this.config.emeEnabled){return;}const media=data.media;// keep reference of media
this.media=media;media.addEventListener('encrypted',this.onMediaEncrypted);media.addEventListener('waitingforkey',this.onWaitingForKey);}onMediaDetached(){const media=this.media;const mediaKeysList=this.mediaKeySessions;if(media){media.removeEventListener('encrypted',this.onMediaEncrypted);media.removeEventListener('waitingforkey',this.onWaitingForKey);this.media=null;}this._requestLicenseFailureCount=0;this.setMediaKeysQueue=[];this.mediaKeySessions=[];this.keyIdToKeySessionPromise={};LevelKey.clearKeyUriToKeyIdMap();// Close all sessions and remove media keys from the video element.
const keySessionCount=mediaKeysList.length;EMEController.CDMCleanupPromise=Promise.all(mediaKeysList.map(mediaKeySessionContext=>this.removeSession(mediaKeySessionContext)).concat(media==null?void 0:media.setMediaKeys(null).catch(error=>{this.log(`Could not clear media keys: ${error}`);}))).then(()=>{if(keySessionCount){this.log('finished closing key sessions and clearing media keys');mediaKeysList.length=0;}}).catch(error=>{this.log(`Could not close sessions and clear media keys: ${error}`);});}onManifestLoading(){this.keyFormatPromise=null;}onManifestLoaded(event,{sessionKeys}){if(!sessionKeys||!this.config.emeEnabled){return;}if(!this.keyFormatPromise){const keyFormats=sessionKeys.reduce((formats,sessionKey)=>{if(formats.indexOf(sessionKey.keyFormat)===-1){formats.push(sessionKey.keyFormat);}return formats;},[]);this.log(`Selecting key-system from session-keys ${keyFormats.join(', ')}`);this.keyFormatPromise=this.getKeyFormatPromise(keyFormats);}}removeSession(mediaKeySessionContext){const{mediaKeysSession,licenseXhr}=mediaKeySessionContext;if(mediaKeysSession){this.log(`Remove licenses and keys and close session ${mediaKeysSession.sessionId}`);if(mediaKeySessionContext._onmessage){mediaKeysSession.removeEventListener('message',mediaKeySessionContext._onmessage);mediaKeySessionContext._onmessage=undefined;}if(mediaKeySessionContext._onkeystatuseschange){mediaKeysSession.removeEventListener('keystatuseschange',mediaKeySessionContext._onkeystatuseschange);mediaKeySessionContext._onkeystatuseschange=undefined;}if(licenseXhr&&licenseXhr.readyState!==XMLHttpRequest.DONE){licenseXhr.abort();}mediaKeySessionContext.mediaKeysSession=mediaKeySessionContext.decryptdata=mediaKeySessionContext.licenseXhr=undefined;const index=this.mediaKeySessions.indexOf(mediaKeySessionContext);if(index>-1){this.mediaKeySessions.splice(index,1);}return mediaKeysSession.remove().catch(error=>{this.log(`Could not remove session: ${error}`);}).then(()=>{return mediaKeysSession.close();}).catch(error=>{this.log(`Could not close session: ${error}`);});}}}EMEController.CDMCleanupPromise=void 0;class EMEKeyError extends Error{constructor(data,message){super(message);this.data=void 0;data.error||(data.error=new Error(message));this.data=data;data.err=data.error;}}/**
 * Common Media Object Type
 *
 * @group CMCD
 * @group CMSD
 *
 * @beta
 */var CmObjectType;(function(CmObjectType){/**
   * text file, such as a manifest or playlist
   */CmObjectType["MANIFEST"]="m";/**
   * audio only
   */CmObjectType["AUDIO"]="a";/**
   * video only
   */CmObjectType["VIDEO"]="v";/**
   * muxed audio and video
   */CmObjectType["MUXED"]="av";/**
   * init segment
   */CmObjectType["INIT"]="i";/**
   * caption or subtitle
   */CmObjectType["CAPTION"]="c";/**
   * ISOBMFF timed text track
   */CmObjectType["TIMED_TEXT"]="tt";/**
   * cryptographic key, license or certificate.
   */CmObjectType["KEY"]="k";/**
   * other
   */CmObjectType["OTHER"]="o";})(CmObjectType||(CmObjectType={}));/**
 * Common Media Streaming Format
 *
 * @group CMCD
 * @group CMSD
 *
 * @beta
 */var CmStreamingFormat;(function(CmStreamingFormat){/**
   * MPEG DASH
   */CmStreamingFormat["DASH"]="d";/**
   * HTTP Live Streaming (HLS)
   */CmStreamingFormat["HLS"]="h";/**
   * Smooth Streaming
   */CmStreamingFormat["SMOOTH"]="s";/**
   * Other
   */CmStreamingFormat["OTHER"]="o";})(CmStreamingFormat||(CmStreamingFormat={}));/**
 * CMCD header fields.
 *
 * @group CMCD
 *
 * @beta
 */var CmcdHeaderField;(function(CmcdHeaderField){/**
   * keys whose values vary with the object being requested.
   */CmcdHeaderField["OBJECT"]="CMCD-Object";/**
   * keys whose values vary with each request.
   */CmcdHeaderField["REQUEST"]="CMCD-Request";/**
   * keys whose values are expected to be invariant over the life of the session.
   */CmcdHeaderField["SESSION"]="CMCD-Session";/**
   * keys whose values do not vary with every request or object.
   */CmcdHeaderField["STATUS"]="CMCD-Status";})(CmcdHeaderField||(CmcdHeaderField={}));/**
 * The map of CMCD header fields to official CMCD keys.
 *
 * @internal
 *
 * @group CMCD
 */const CmcdHeaderMap={[CmcdHeaderField.OBJECT]:['br','d','ot','tb'],[CmcdHeaderField.REQUEST]:['bl','dl','mtp','nor','nrr','su'],[CmcdHeaderField.SESSION]:['cid','pr','sf','sid','st','v'],[CmcdHeaderField.STATUS]:['bs','rtp']};/**
 * Structured Field Item
 *
 * @group Structured Field
 *
 * @beta
 */class SfItem{constructor(value,params){this.value=void 0;this.params=void 0;if(Array.isArray(value)){value=value.map(v=>v instanceof SfItem?v:new SfItem(v));}this.value=value;this.params=params;}}/**
 * A class to represent structured field tokens when `Symbol` is not available.
 *
 * @group Structured Field
 *
 * @beta
 */class SfToken{constructor(description){this.description=void 0;this.description=description;}}const DICT='Dict';function format(value){if(Array.isArray(value)){return JSON.stringify(value);}if(value instanceof Map){return 'Map{}';}if(value instanceof Set){return 'Set{}';}if(typeof value==='object'){return JSON.stringify(value);}return String(value);}function throwError(action,src,type,cause){return new Error(`failed to ${action} "${format(src)}" as ${type}`,{cause});}const BARE_ITEM='Bare Item';const BOOLEAN='Boolean';const BYTES='Byte Sequence';const DECIMAL='Decimal';const INTEGER='Integer';function isInvalidInt(value){return value<-999999999999999||999999999999999<value;}const STRING_REGEX=/[\x00-\x1f\x7f]+/;// eslint-disable-line no-control-regex
const TOKEN='Token';const KEY='Key';function serializeError(src,type,cause){return throwError('serialize',src,type,cause);}// 4.1.9.  Serializing a Boolean
//
// Given a Boolean as input_boolean, return an ASCII string suitable for
// use in a HTTP field value.
//
// 1.  If input_boolean is not a boolean, fail serialization.
//
// 2.  Let output be an empty string.
//
// 3.  Append "?" to output.
//
// 4.  If input_boolean is true, append "1" to output.
//
// 5.  If input_boolean is false, append "0" to output.
//
// 6.  Return output.
function serializeBoolean(value){if(typeof value!=='boolean'){throw serializeError(value,BOOLEAN);}return value?'?1':'?0';}/**
 * Encodes binary data to base64
 *
 * @param binary - The binary data to encode
 * @returns The base64 encoded string
 *
 * @group Utils
 *
 * @beta
 */function base64encode(binary){return btoa(String.fromCharCode(...binary));}// 4.1.8.  Serializing a Byte Sequence
//
// Given a Byte Sequence as input_bytes, return an ASCII string suitable
// for use in a HTTP field value.
//
// 1.  If input_bytes is not a sequence of bytes, fail serialization.
//
// 2.  Let output be an empty string.
//
// 3.  Append ":" to output.
//
// 4.  Append the result of base64-encoding input_bytes as per
//     [RFC4648], Section 4, taking account of the requirements below.
//
// 5.  Append ":" to output.
//
// 6.  Return output.
//
// The encoded data is required to be padded with "=", as per [RFC4648],
// Section 3.2.
//
// Likewise, encoded data SHOULD have pad bits set to zero, as per
// [RFC4648], Section 3.5, unless it is not possible to do so due to
// implementation constraints.
function serializeByteSequence(value){if(ArrayBuffer.isView(value)===false){throw serializeError(value,BYTES);}return `:${base64encode(value)}:`;}// 4.1.4.  Serializing an Integer
//
// Given an Integer as input_integer, return an ASCII string suitable
// for use in a HTTP field value.
//
// 1.  If input_integer is not an integer in the range of
//     -999,999,999,999,999 to 999,999,999,999,999 inclusive, fail
//     serialization.
//
// 2.  Let output be an empty string.
//
// 3.  If input_integer is less than (but not equal to) 0, append "-" to
//     output.
//
// 4.  Append input_integer's numeric value represented in base 10 using
//     only decimal digits to output.
//
// 5.  Return output.
function serializeInteger(value){if(isInvalidInt(value)){throw serializeError(value,INTEGER);}return value.toString();}// 4.1.10.  Serializing a Date
//
// Given a Date as input_integer, return an ASCII string suitable for
// use in an HTTP field value.
// 1.  Let output be "@".
// 2.  Append to output the result of running Serializing an Integer
//     with input_date (Section 4.1.4).
// 3.  Return output.
function serializeDate(value){return `@${serializeInteger(value.getTime()/1000)}`;}/**
 * This implements the rounding procedure described in step 2 of the "Serializing a Decimal" specification.
 * This rounding style is known as "even rounding", "banker's rounding", or "commercial rounding".
 *
 * @param value - The value to round
 * @param precision - The number of decimal places to round to
 * @returns The rounded value
 *
 * @group Utils
 *
 * @beta
 */function roundToEven(value,precision){if(value<0){return -roundToEven(-value,precision);}const decimalShift=Math.pow(10,precision);const isEquidistant=Math.abs(value*decimalShift%1-0.5)<Number.EPSILON;if(isEquidistant){// If the tail of the decimal place is 'equidistant' we round to the nearest even value
const flooredValue=Math.floor(value*decimalShift);return (flooredValue%2===0?flooredValue:flooredValue+1)/decimalShift;}else {// Otherwise, proceed as normal
return Math.round(value*decimalShift)/decimalShift;}}// 4.1.5.  Serializing a Decimal
//
// Given a decimal number as input_decimal, return an ASCII string
// suitable for use in a HTTP field value.
//
// 1.   If input_decimal is not a decimal number, fail serialization.
//
// 2.   If input_decimal has more than three significant digits to the
//      right of the decimal point, round it to three decimal places,
//      rounding the final digit to the nearest value, or to the even
//      value if it is equidistant.
//
// 3.   If input_decimal has more than 12 significant digits to the left
//      of the decimal point after rounding, fail serialization.
//
// 4.   Let output be an empty string.
//
// 5.   If input_decimal is less than (but not equal to) 0, append "-"
//      to output.
//
// 6.   Append input_decimal's integer component represented in base 10
//      (using only decimal digits) to output; if it is zero, append
//      "0".
//
// 7.   Append "." to output.
//
// 8.   If input_decimal's fractional component is zero, append "0" to
//      output.
//
// 9.   Otherwise, append the significant digits of input_decimal's
//      fractional component represented in base 10 (using only decimal
//      digits) to output.
//
// 10.  Return output.
function serializeDecimal(value){const roundedValue=roundToEven(value,3);// round to 3 decimal places
if(Math.floor(Math.abs(roundedValue)).toString().length>12){throw serializeError(value,DECIMAL);}const stringValue=roundedValue.toString();return stringValue.includes('.')?stringValue:`${stringValue}.0`;}const STRING='String';// 4.1.6.  Serializing a String
//
// Given a String as input_string, return an ASCII string suitable for
// use in a HTTP field value.
//
// 1.  Convert input_string into a sequence of ASCII characters; if
//     conversion fails, fail serialization.
//
// 2.  If input_string contains characters in the range %x00-1f or %x7f
//     (i.e., not in VCHAR or SP), fail serialization.
//
// 3.  Let output be the string DQUOTE.
//
// 4.  For each character char in input_string:
//
//     1.  If char is "\" or DQUOTE:
//
//         1.  Append "\" to output.
//
//     2.  Append char to output.
//
// 5.  Append DQUOTE to output.
//
// 6.  Return output.
function serializeString(value){if(STRING_REGEX.test(value)){throw serializeError(value,STRING);}return `"${value.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`;}function symbolToStr(symbol){return symbol.description||symbol.toString().slice(7,-1);}function serializeToken(token){const value=symbolToStr(token);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(value)===false){throw serializeError(value,TOKEN);}return value;}// 4.1.3.1.  Serializing a Bare Item
//
// Given an Item as input_item, return an ASCII string suitable for use
// in a HTTP field value.
//
// 1.  If input_item is an Integer, return the result of running
//     Serializing an Integer (Section 4.1.4) with input_item.
//
// 2.  If input_item is a Decimal, return the result of running
//     Serializing a Decimal (Section 4.1.5) with input_item.
//
// 3.  If input_item is a String, return the result of running
//     Serializing a String (Section 4.1.6) with input_item.
//
// 4.  If input_item is a Token, return the result of running
//     Serializing a Token (Section 4.1.7) with input_item.
//
// 5.  If input_item is a Boolean, return the result of running
//     Serializing a Boolean (Section 4.1.9) with input_item.
//
// 6.  If input_item is a Byte Sequence, return the result of running
//     Serializing a Byte Sequence (Section 4.1.8) with input_item.
//
// 7.  If input_item is a Date, return the result of running Serializing
//     a Date (Section 4.1.10) with input_item.
//
// 8.  Otherwise, fail serialization.
function serializeBareItem(value){switch(typeof value){case'number':if(!isFiniteNumber(value)){throw serializeError(value,BARE_ITEM);}if(Number.isInteger(value)){return serializeInteger(value);}return serializeDecimal(value);case'string':return serializeString(value);case'symbol':return serializeToken(value);case'boolean':return serializeBoolean(value);case'object':if(value instanceof Date){return serializeDate(value);}if(value instanceof Uint8Array){return serializeByteSequence(value);}if(value instanceof SfToken){return serializeToken(value);}default:// fail
throw serializeError(value,BARE_ITEM);}}// 4.1.1.3.  Serializing a Key
//
// Given a key as input_key, return an ASCII string suitable for use in
// a HTTP field value.
//
// 1.  Convert input_key into a sequence of ASCII characters; if
//     conversion fails, fail serialization.
//
// 2.  If input_key contains characters not in lcalpha, DIGIT, "_", "-",
//     ".", or "*" fail serialization.
//
// 3.  If the first character of input_key is not lcalpha or "*", fail
//     serialization.
//
// 4.  Let output be an empty string.
//
// 5.  Append input_key to output.
//
// 6.  Return output.
function serializeKey(value){if(/^[a-z*][a-z0-9\-_.*]*$/.test(value)===false){throw serializeError(value,KEY);}return value;}// 4.1.1.2.  Serializing Parameters
//
// Given an ordered Dictionary as input_parameters (each member having a
// param_name and a param_value), return an ASCII string suitable for
// use in a HTTP field value.
//
// 1.  Let output be an empty string.
//
// 2.  For each param_name with a value of param_value in
//     input_parameters:
//
//     1.  Append ";" to output.
//
//     2.  Append the result of running Serializing a Key
//         (Section 4.1.1.3) with param_name to output.
//
//     3.  If param_value is not Boolean true:
//
//         1.  Append "=" to output.
//
//         2.  Append the result of running Serializing a bare Item
//             (Section 4.1.3.1) with param_value to output.
//
// 3.  Return output.
function serializeParams(params){if(params==null){return '';}return Object.entries(params).map(([key,value])=>{if(value===true){return `;${serializeKey(key)}`;// omit true
}return `;${serializeKey(key)}=${serializeBareItem(value)}`;}).join('');}// 4.1.3.  Serializing an Item
//
// Given an Item as bare_item and Parameters as item_parameters, return
// an ASCII string suitable for use in a HTTP field value.
//
// 1.  Let output be an empty string.
//
// 2.  Append the result of running Serializing a Bare Item
//     Section 4.1.3.1 with bare_item to output.
//
// 3.  Append the result of running Serializing Parameters
//     Section 4.1.1.2 with item_parameters to output.
//
// 4.  Return output.
function serializeItem(value){if(value instanceof SfItem){return `${serializeBareItem(value.value)}${serializeParams(value.params)}`;}else {return serializeBareItem(value);}}// 4.1.1.1.  Serializing an Inner List
//
// Given an array of (member_value, parameters) tuples as inner_list,
// and parameters as list_parameters, return an ASCII string suitable
// for use in a HTTP field value.
//
// 1.  Let output be the string "(".
//
// 2.  For each (member_value, parameters) of inner_list:
//
//     1.  Append the result of running Serializing an Item
//         (Section 4.1.3) with (member_value, parameters) to output.
//
//     2.  If more values remain in inner_list, append a single SP to
//         output.
//
// 3.  Append ")" to output.
//
// 4.  Append the result of running Serializing Parameters
//     (Section 4.1.1.2) with list_parameters to output.
//
// 5.  Return output.
function serializeInnerList(value){return `(${value.value.map(serializeItem).join(' ')})${serializeParams(value.params)}`;}// 4.1.2.  Serializing a Dictionary
//
// Given an ordered Dictionary as input_dictionary (each member having a
// member_name and a tuple value of (member_value, parameters)), return
// an ASCII string suitable for use in a HTTP field value.
//
// 1.  Let output be an empty string.
//
// 2.  For each member_name with a value of (member_value, parameters)
//     in input_dictionary:
//
//     1.  Append the result of running Serializing a Key
//         (Section 4.1.1.3) with member's member_name to output.
//
//     2.  If member_value is Boolean true:
//
//         1.  Append the result of running Serializing Parameters
//             (Section 4.1.1.2) with parameters to output.
//
//     3.  Otherwise:
//
//         1.  Append "=" to output.
//
//         2.  If member_value is an array, append the result of running
//             Serializing an Inner List (Section 4.1.1.1) with
//             (member_value, parameters) to output.
//
//         3.  Otherwise, append the result of running Serializing an
//             Item (Section 4.1.3) with (member_value, parameters) to
//             output.
//
//     4.  If more members remain in input_dictionary:
//
//         1.  Append "," to output.
//
//         2.  Append a single SP to output.
//
// 3.  Return output.
function serializeDict(dict,options={whitespace:true}){if(typeof dict!=='object'){throw serializeError(dict,DICT);}const entries=dict instanceof Map?dict.entries():Object.entries(dict);const optionalWhiteSpace=options!=null&&options.whitespace?' ':'';return Array.from(entries).map(([key,item])=>{if(item instanceof SfItem===false){item=new SfItem(item);}let output=serializeKey(key);if(item.value===true){output+=serializeParams(item.params);}else {output+='=';if(Array.isArray(item.value)){output+=serializeInnerList(item);}else {output+=serializeItem(item);}}return output;}).join(`,${optionalWhiteSpace}`);}/**
 * Encode an object into a structured field dictionary
 *
 * @param input - The structured field dictionary to encode
 * @returns The structured field string
 *
 * @group Structured Field
 *
 * @beta
 */function encodeSfDict(value,options){return serializeDict(value,options);}/**
 * Checks if the given key is a token field.
 *
 * @param key - The key to check.
 *
 * @returns `true` if the key is a token field.
 *
 * @internal
 *
 * @group CMCD
 */const isTokenField=key=>key==='ot'||key==='sf'||key==='st';const isValid=value=>{if(typeof value==='number'){return isFiniteNumber(value);}return value!=null&&value!==''&&value!==false;};/**
 * Constructs a relative path from a URL.
 *
 * @param url - The destination URL
 * @param base - The base URL
 * @returns The relative path
 *
 * @group Utils
 *
 * @beta
 */function urlToRelativePath(url,base){const to=new URL(url);const from=new URL(base);if(to.origin!==from.origin){return url;}const toPath=to.pathname.split('/').slice(1);const fromPath=from.pathname.split('/').slice(1,-1);// remove common parents
while(toPath[0]===fromPath[0]){toPath.shift();fromPath.shift();}// add back paths
while(fromPath.length){fromPath.shift();toPath.unshift('..');}return toPath.join('/');}/**
 * Generate a random v4 UUID
 *
 * @returns A random v4 UUID
 *
 * @group Utils
 *
 * @beta
 */function uuid$1(){try{return crypto.randomUUID();}catch(error){try{const url=URL.createObjectURL(new Blob());const uuid=url.toString();URL.revokeObjectURL(url);return uuid.slice(uuid.lastIndexOf('/')+1);}catch(error){let dt=new Date().getTime();const uuid='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,c=>{const r=(dt+Math.random()*16)%16|0;dt=Math.floor(dt/16);return (c=='x'?r:r&0x3|0x8).toString(16);});return uuid;}}}const toRounded=value=>Math.round(value);const toUrlSafe=(value,options)=>{if(options!=null&&options.baseUrl){value=urlToRelativePath(value,options.baseUrl);}return encodeURIComponent(value);};const toHundred=value=>toRounded(value/100)*100;/**
 * The default formatters for CMCD values.
 *
 * @group CMCD
 *
 * @beta
 */const CmcdFormatters={/**
   * Bitrate (kbps) rounded integer
   */br:toRounded,/**
   * Duration (milliseconds) rounded integer
   */d:toRounded,/**
   * Buffer Length (milliseconds) rounded nearest 100ms
   */bl:toHundred,/**
   * Deadline (milliseconds) rounded nearest 100ms
   */dl:toHundred,/**
   * Measured Throughput (kbps) rounded nearest 100kbps
   */mtp:toHundred,/**
   * Next Object Request URL encoded
   */nor:toUrlSafe,/**
   * Requested maximum throughput (kbps) rounded nearest 100kbps
   */rtp:toHundred,/**
   * Top Bitrate (kbps) rounded integer
   */tb:toRounded};/**
 * Internal CMCD processing function.
 *
 * @param obj - The CMCD object to process.
 * @param map - The mapping function to use.
 * @param options - Options for encoding.
 *
 * @internal
 *
 * @group CMCD
 */function processCmcd(obj,options){const results={};if(obj==null||typeof obj!=='object'){return results;}const keys=Object.keys(obj).sort();const formatters=_extends({},CmcdFormatters,options==null?void 0:options.formatters);const filter=options==null?void 0:options.filter;keys.forEach(key=>{if(filter!=null&&filter(key)){return;}let value=obj[key];const formatter=formatters[key];if(formatter){value=formatter(value,options);}// Version should only be reported if not equal to 1.
if(key==='v'&&value===1){return;}// Playback rate should only be sent if not equal to 1.
if(key=='pr'&&value===1){return;}// ignore invalid values
if(!isValid(value)){return;}if(isTokenField(key)&&typeof value==='string'){value=new SfToken(value);}results[key]=value;});return results;}/**
 * Encode a CMCD object to a string.
 *
 * @param cmcd - The CMCD object to encode.
 * @param options - Options for encoding.
 *
 * @returns The encoded CMCD string.
 *
 * @group CMCD
 *
 * @beta
 */function encodeCmcd(cmcd,options={}){if(!cmcd){return '';}return encodeSfDict(processCmcd(cmcd,options),_extends({whitespace:false},options));}/**
 * Convert a CMCD data object to request headers
 *
 * @param cmcd - The CMCD data object to convert.
 * @param options - Options for encoding the CMCD object.
 *
 * @returns The CMCD header shards.
 *
 * @group CMCD
 *
 * @beta
 */function toCmcdHeaders(cmcd,options={}){if(!cmcd){return {};}const entries=Object.entries(cmcd);const headerMap=Object.entries(CmcdHeaderMap).concat(Object.entries((options==null?void 0:options.customHeaderMap)||{}));const shards=entries.reduce((acc,entry)=>{var _headerMap$find,_acc$field;const[key,value]=entry;const field=((_headerMap$find=headerMap.find(entry=>entry[1].includes(key)))==null?void 0:_headerMap$find[0])||CmcdHeaderField.REQUEST;(_acc$field=acc[field])!=null?_acc$field:acc[field]={};acc[field][key]=value;return acc;},{});return Object.entries(shards).reduce((acc,[field,value])=>{acc[field]=encodeCmcd(value,options);return acc;},{});}/**
 * Append CMCD query args to a header object.
 *
 * @param headers - The headers to append to.
 * @param cmcd - The CMCD object to append.
 * @param customHeaderMap - A map of custom CMCD keys to header fields.
 *
 * @returns The headers with the CMCD header shards appended.
 *
 * @group CMCD
 *
 * @beta
 */function appendCmcdHeaders(headers,cmcd,options){return _extends(headers,toCmcdHeaders(cmcd,options));}/**
 * CMCD parameter name.
 *
 * @group CMCD
 *
 * @beta
 */const CMCD_PARAM='CMCD';/**
 * Convert a CMCD data object to a query arg.
 *
 * @param cmcd - The CMCD object to convert.
 * @param options - Options for encoding the CMCD object.
 *
 * @returns The CMCD query arg.
 *
 * @group CMCD
 *
 * @beta
 */function toCmcdQuery(cmcd,options={}){if(!cmcd){return '';}const params=encodeCmcd(cmcd,options);return `${CMCD_PARAM}=${encodeURIComponent(params)}`;}const REGEX=/CMCD=[^&#]+/;/**
 * Append CMCD query args to a URL.
 *
 * @param url - The URL to append to.
 * @param cmcd - The CMCD object to append.
 * @param options - Options for encoding the CMCD object.
 *
 * @returns The URL with the CMCD query args appended.
 *
 * @group CMCD
 *
 * @beta
 */function appendCmcdQuery(url,cmcd,options){// TODO: Replace with URLSearchParams once we drop Safari < 10.1 & Chrome < 49 support.
// https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
const query=toCmcdQuery(cmcd,options);if(!query){return url;}if(REGEX.test(url)){return url.replace(REGEX,query);}const separator=url.includes('?')?'&':'?';return `${url}${separator}${query}`;}/**
 * Controller to deal with Common Media Client Data (CMCD)
 * @see https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf
 */class CMCDController{// eslint-disable-line no-restricted-globals
constructor(hls){this.hls=void 0;this.config=void 0;this.media=void 0;this.sid=void 0;this.cid=void 0;this.useHeaders=false;this.includeKeys=void 0;this.initialized=false;this.starved=false;this.buffering=true;this.audioBuffer=void 0;// eslint-disable-line no-restricted-globals
this.videoBuffer=void 0;this.onWaiting=()=>{if(this.initialized){this.starved=true;}this.buffering=true;};this.onPlaying=()=>{if(!this.initialized){this.initialized=true;}this.buffering=false;};/**
     * Apply CMCD data to a manifest request.
     */this.applyPlaylistData=context=>{try{this.apply(context,{ot:CmObjectType.MANIFEST,su:!this.initialized});}catch(error){logger.warn('Could not generate manifest CMCD data.',error);}};/**
     * Apply CMCD data to a segment request
     */this.applyFragmentData=context=>{try{const fragment=context.frag;const level=this.hls.levels[fragment.level];const ot=this.getObjectType(fragment);const data={d:fragment.duration*1000,ot};if(ot===CmObjectType.VIDEO||ot===CmObjectType.AUDIO||ot==CmObjectType.MUXED){data.br=level.bitrate/1000;data.tb=this.getTopBandwidth(ot)/1000;data.bl=this.getBufferLength(ot);}this.apply(context,data);}catch(error){logger.warn('Could not generate segment CMCD data.',error);}};this.hls=hls;const config=this.config=hls.config;const{cmcd}=config;if(cmcd!=null){config.pLoader=this.createPlaylistLoader();config.fLoader=this.createFragmentLoader();this.sid=cmcd.sessionId||uuid$1();this.cid=cmcd.contentId;this.useHeaders=cmcd.useHeaders===true;this.includeKeys=cmcd.includeKeys;this.registerListeners();}}registerListeners(){const hls=this.hls;hls.on(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);hls.on(Events$1.MEDIA_DETACHED,this.onMediaDetached,this);hls.on(Events$1.BUFFER_CREATED,this.onBufferCreated,this);}unregisterListeners(){const hls=this.hls;hls.off(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);hls.off(Events$1.MEDIA_DETACHED,this.onMediaDetached,this);hls.off(Events$1.BUFFER_CREATED,this.onBufferCreated,this);}destroy(){this.unregisterListeners();this.onMediaDetached();// @ts-ignore
this.hls=this.config=this.audioBuffer=this.videoBuffer=null;// @ts-ignore
this.onWaiting=this.onPlaying=null;}onMediaAttached(event,data){this.media=data.media;this.media.addEventListener('waiting',this.onWaiting);this.media.addEventListener('playing',this.onPlaying);}onMediaDetached(){if(!this.media){return;}this.media.removeEventListener('waiting',this.onWaiting);this.media.removeEventListener('playing',this.onPlaying);// @ts-ignore
this.media=null;}onBufferCreated(event,data){var _data$tracks$audio,_data$tracks$video;this.audioBuffer=(_data$tracks$audio=data.tracks.audio)==null?void 0:_data$tracks$audio.buffer;this.videoBuffer=(_data$tracks$video=data.tracks.video)==null?void 0:_data$tracks$video.buffer;}/**
   * Create baseline CMCD data
   */createData(){var _this$media;return {v:1,sf:CmStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(_this$media=this.media)==null?void 0:_this$media.playbackRate,mtp:this.hls.bandwidthEstimate/1000};}/**
   * Apply CMCD data to a request.
   */apply(context,data={}){// apply baseline data
_extends(data,this.createData());const isVideo=data.ot===CmObjectType.INIT||data.ot===CmObjectType.VIDEO||data.ot===CmObjectType.MUXED;if(this.starved&&isVideo){data.bs=true;data.su=true;this.starved=false;}if(data.su==null){data.su=this.buffering;}// TODO: Implement rtp, nrr, nor, dl
const{includeKeys}=this;if(includeKeys){data=Object.keys(data).reduce((acc,key)=>{includeKeys.includes(key)&&(acc[key]=data[key]);return acc;},{});}if(this.useHeaders){if(!context.headers){context.headers={};}appendCmcdHeaders(context.headers,data);}else {context.url=appendCmcdQuery(context.url,data);}}/**
   * The CMCD object type.
   */getObjectType(fragment){const{type}=fragment;if(type==='subtitle'){return CmObjectType.TIMED_TEXT;}if(fragment.sn==='initSegment'){return CmObjectType.INIT;}if(type==='audio'){return CmObjectType.AUDIO;}if(type==='main'){if(!this.hls.audioTracks.length){return CmObjectType.MUXED;}return CmObjectType.VIDEO;}return undefined;}/**
   * Get the highest bitrate.
   */getTopBandwidth(type){let bitrate=0;let levels;const hls=this.hls;if(type===CmObjectType.AUDIO){levels=hls.audioTracks;}else {const max=hls.maxAutoLevel;const len=max>-1?max+1:hls.levels.length;levels=hls.levels.slice(0,len);}for(const level of levels){if(level.bitrate>bitrate){bitrate=level.bitrate;}}return bitrate>0?bitrate:NaN;}/**
   * Get the buffer length for a media type in milliseconds
   */getBufferLength(type){const media=this.hls.media;const buffer=type===CmObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!buffer||!media){return NaN;}const info=BufferHelper.bufferInfo(buffer,media.currentTime,this.config.maxBufferHole);return info.len*1000;}/**
   * Create a playlist loader
   */createPlaylistLoader(){const{pLoader}=this.config;const apply=this.applyPlaylistData;const Ctor=pLoader||this.config.loader;return class CmcdPlaylistLoader{constructor(config){this.loader=void 0;this.loader=new Ctor(config);}get stats(){return this.loader.stats;}get context(){return this.loader.context;}destroy(){this.loader.destroy();}abort(){this.loader.abort();}load(context,config,callbacks){apply(context);this.loader.load(context,config,callbacks);}};}/**
   * Create a playlist loader
   */createFragmentLoader(){const{fLoader}=this.config;const apply=this.applyFragmentData;const Ctor=fLoader||this.config.loader;return class CmcdFragmentLoader{constructor(config){this.loader=void 0;this.loader=new Ctor(config);}get stats(){return this.loader.stats;}get context(){return this.loader.context;}destroy(){this.loader.destroy();}abort(){this.loader.abort();}load(context,config,callbacks){apply(context);this.loader.load(context,config,callbacks);}};}}const PATHWAY_PENALTY_DURATION_MS=300000;class ContentSteeringController{constructor(hls){this.hls=void 0;this.log=void 0;this.loader=null;this.uri=null;this.pathwayId='.';this.pathwayPriority=null;this.timeToLoad=300;this.reloadTimer=-1;this.updated=0;this.started=false;this.enabled=true;this.levels=null;this.audioTracks=null;this.subtitleTracks=null;this.penalizedPathways={};this.hls=hls;this.log=logger.log.bind(logger,`[content-steering]:`);this.registerListeners();}registerListeners(){const hls=this.hls;hls.on(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.on(Events$1.MANIFEST_LOADED,this.onManifestLoaded,this);hls.on(Events$1.MANIFEST_PARSED,this.onManifestParsed,this);hls.on(Events$1.ERROR,this.onError,this);}unregisterListeners(){const hls=this.hls;if(!hls){return;}hls.off(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.off(Events$1.MANIFEST_LOADED,this.onManifestLoaded,this);hls.off(Events$1.MANIFEST_PARSED,this.onManifestParsed,this);hls.off(Events$1.ERROR,this.onError,this);}startLoad(){this.started=true;this.clearTimeout();if(this.enabled&&this.uri){if(this.updated){const ttl=this.timeToLoad*1000-(performance.now()-this.updated);if(ttl>0){this.scheduleRefresh(this.uri,ttl);return;}}this.loadSteeringManifest(this.uri);}}stopLoad(){this.started=false;if(this.loader){this.loader.destroy();this.loader=null;}this.clearTimeout();}clearTimeout(){if(this.reloadTimer!==-1){self.clearTimeout(this.reloadTimer);this.reloadTimer=-1;}}destroy(){this.unregisterListeners();this.stopLoad();// @ts-ignore
this.hls=null;this.levels=this.audioTracks=this.subtitleTracks=null;}removeLevel(levelToRemove){const levels=this.levels;if(levels){this.levels=levels.filter(level=>level!==levelToRemove);}}onManifestLoading(){this.stopLoad();this.enabled=true;this.timeToLoad=300;this.updated=0;this.uri=null;this.pathwayId='.';this.levels=this.audioTracks=this.subtitleTracks=null;}onManifestLoaded(event,data){const{contentSteering}=data;if(contentSteering===null){return;}this.pathwayId=contentSteering.pathwayId;this.uri=contentSteering.uri;if(this.started){this.startLoad();}}onManifestParsed(event,data){this.audioTracks=data.audioTracks;this.subtitleTracks=data.subtitleTracks;}onError(event,data){const{errorAction}=data;if((errorAction==null?void 0:errorAction.action)===NetworkErrorAction.SendAlternateToPenaltyBox&&errorAction.flags===ErrorActionFlags.MoveAllAlternatesMatchingHost){const levels=this.levels;let pathwayPriority=this.pathwayPriority;let errorPathway=this.pathwayId;if(data.context){const{groupId,pathwayId,type}=data.context;if(groupId&&levels){errorPathway=this.getPathwayForGroupId(groupId,type,errorPathway);}else if(pathwayId){errorPathway=pathwayId;}}if(!(errorPathway in this.penalizedPathways)){this.penalizedPathways[errorPathway]=performance.now();}if(!pathwayPriority&&levels){// If PATHWAY-PRIORITY was not provided, list pathways for error handling
pathwayPriority=levels.reduce((pathways,level)=>{if(pathways.indexOf(level.pathwayId)===-1){pathways.push(level.pathwayId);}return pathways;},[]);}if(pathwayPriority&&pathwayPriority.length>1){this.updatePathwayPriority(pathwayPriority);errorAction.resolved=this.pathwayId!==errorPathway;}if(!errorAction.resolved){logger.warn(`Could not resolve ${data.details} ("${data.error.message}") with content-steering for Pathway: ${errorPathway} levels: ${levels?levels.length:levels} priorities: ${JSON.stringify(pathwayPriority)} penalized: ${JSON.stringify(this.penalizedPathways)}`);}}}filterParsedLevels(levels){// Filter levels to only include those that are in the initial pathway
this.levels=levels;let pathwayLevels=this.getLevelsForPathway(this.pathwayId);if(pathwayLevels.length===0){const pathwayId=levels[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${pathwayId}"`);pathwayLevels=this.getLevelsForPathway(pathwayId);this.pathwayId=pathwayId;}if(pathwayLevels.length!==levels.length){this.log(`Found ${pathwayLevels.length}/${levels.length} levels in Pathway "${this.pathwayId}"`);return pathwayLevels;}return levels;}getLevelsForPathway(pathwayId){if(this.levels===null){return [];}return this.levels.filter(level=>pathwayId===level.pathwayId);}updatePathwayPriority(pathwayPriority){this.pathwayPriority=pathwayPriority;let levels;// Evaluate if we should remove the pathway from the penalized list
const penalizedPathways=this.penalizedPathways;const now=performance.now();Object.keys(penalizedPathways).forEach(pathwayId=>{if(now-penalizedPathways[pathwayId]>PATHWAY_PENALTY_DURATION_MS){delete penalizedPathways[pathwayId];}});for(let i=0;i<pathwayPriority.length;i++){const pathwayId=pathwayPriority[i];if(pathwayId in penalizedPathways){continue;}if(pathwayId===this.pathwayId){return;}const selectedIndex=this.hls.nextLoadLevel;const selectedLevel=this.hls.levels[selectedIndex];levels=this.getLevelsForPathway(pathwayId);if(levels.length>0){this.log(`Setting Pathway to "${pathwayId}"`);this.pathwayId=pathwayId;reassignFragmentLevelIndexes(levels);this.hls.trigger(Events$1.LEVELS_UPDATED,{levels});// Set LevelController's level to trigger LEVEL_SWITCHING which loads playlist if needed
const levelAfterChange=this.hls.levels[selectedIndex];if(selectedLevel&&levelAfterChange&&this.levels){if(levelAfterChange.attrs['STABLE-VARIANT-ID']!==selectedLevel.attrs['STABLE-VARIANT-ID']&&levelAfterChange.bitrate!==selectedLevel.bitrate){this.log(`Unstable Pathways change from bitrate ${selectedLevel.bitrate} to ${levelAfterChange.bitrate}`);}this.hls.nextLoadLevel=selectedIndex;}break;}}}getPathwayForGroupId(groupId,type,defaultPathway){const levels=this.getLevelsForPathway(defaultPathway).concat(this.levels||[]);for(let i=0;i<levels.length;i++){if(type===PlaylistContextType.AUDIO_TRACK&&levels[i].hasAudioGroup(groupId)||type===PlaylistContextType.SUBTITLE_TRACK&&levels[i].hasSubtitleGroup(groupId)){return levels[i].pathwayId;}}return defaultPathway;}clonePathways(pathwayClones){const levels=this.levels;if(!levels){return;}const audioGroupCloneMap={};const subtitleGroupCloneMap={};pathwayClones.forEach(pathwayClone=>{const{ID:cloneId,'BASE-ID':baseId,'URI-REPLACEMENT':uriReplacement}=pathwayClone;if(levels.some(level=>level.pathwayId===cloneId)){return;}const clonedVariants=this.getLevelsForPathway(baseId).map(baseLevel=>{const attributes=new AttrList(baseLevel.attrs);attributes['PATHWAY-ID']=cloneId;const clonedAudioGroupId=attributes.AUDIO&&`${attributes.AUDIO}_clone_${cloneId}`;const clonedSubtitleGroupId=attributes.SUBTITLES&&`${attributes.SUBTITLES}_clone_${cloneId}`;if(clonedAudioGroupId){audioGroupCloneMap[attributes.AUDIO]=clonedAudioGroupId;attributes.AUDIO=clonedAudioGroupId;}if(clonedSubtitleGroupId){subtitleGroupCloneMap[attributes.SUBTITLES]=clonedSubtitleGroupId;attributes.SUBTITLES=clonedSubtitleGroupId;}const url=performUriReplacement(baseLevel.uri,attributes['STABLE-VARIANT-ID'],'PER-VARIANT-URIS',uriReplacement);const clonedLevel=new Level({attrs:attributes,audioCodec:baseLevel.audioCodec,bitrate:baseLevel.bitrate,height:baseLevel.height,name:baseLevel.name,url,videoCodec:baseLevel.videoCodec,width:baseLevel.width});if(baseLevel.audioGroups){for(let i=1;i<baseLevel.audioGroups.length;i++){clonedLevel.addGroupId('audio',`${baseLevel.audioGroups[i]}_clone_${cloneId}`);}}if(baseLevel.subtitleGroups){for(let i=1;i<baseLevel.subtitleGroups.length;i++){clonedLevel.addGroupId('text',`${baseLevel.subtitleGroups[i]}_clone_${cloneId}`);}}return clonedLevel;});levels.push(...clonedVariants);cloneRenditionGroups(this.audioTracks,audioGroupCloneMap,uriReplacement,cloneId);cloneRenditionGroups(this.subtitleTracks,subtitleGroupCloneMap,uriReplacement,cloneId);});}loadSteeringManifest(uri){const config=this.hls.config;const Loader=config.loader;if(this.loader){this.loader.destroy();}this.loader=new Loader(config);let url;try{url=new self.URL(uri);}catch(error){this.enabled=false;this.log(`Failed to parse Steering Manifest URI: ${uri}`);return;}if(url.protocol!=='data:'){const throughput=(this.hls.bandwidthEstimate||config.abrEwmaDefaultEstimate)|0;url.searchParams.set('_HLS_pathway',this.pathwayId);url.searchParams.set('_HLS_throughput',''+throughput);}const context={responseType:'json',url:url.href};const loadPolicy=config.steeringManifestLoadPolicy.default;const legacyRetryCompatibility=loadPolicy.errorRetry||loadPolicy.timeoutRetry||{};const loaderConfig={loadPolicy,timeout:loadPolicy.maxLoadTimeMs,maxRetry:legacyRetryCompatibility.maxNumRetry||0,retryDelay:legacyRetryCompatibility.retryDelayMs||0,maxRetryDelay:legacyRetryCompatibility.maxRetryDelayMs||0};const callbacks={onSuccess:(response,stats,context,networkDetails)=>{this.log(`Loaded steering manifest: "${url}"`);const steeringData=response.data;if(steeringData.VERSION!==1){this.log(`Steering VERSION ${steeringData.VERSION} not supported!`);return;}this.updated=performance.now();this.timeToLoad=steeringData.TTL;const{'RELOAD-URI':reloadUri,'PATHWAY-CLONES':pathwayClones,'PATHWAY-PRIORITY':pathwayPriority}=steeringData;if(reloadUri){try{this.uri=new self.URL(reloadUri,url).href;}catch(error){this.enabled=false;this.log(`Failed to parse Steering Manifest RELOAD-URI: ${reloadUri}`);return;}}this.scheduleRefresh(this.uri||context.url);if(pathwayClones){this.clonePathways(pathwayClones);}const loadedSteeringData={steeringManifest:steeringData,url:url.toString()};this.hls.trigger(Events$1.STEERING_MANIFEST_LOADED,loadedSteeringData);if(pathwayPriority){this.updatePathwayPriority(pathwayPriority);}},onError:(error,context,networkDetails,stats)=>{this.log(`Error loading steering manifest: ${error.code} ${error.text} (${context.url})`);this.stopLoad();if(error.code===410){this.enabled=false;this.log(`Steering manifest ${context.url} no longer available`);return;}let ttl=this.timeToLoad*1000;if(error.code===429){const loader=this.loader;if(typeof(loader==null?void 0:loader.getResponseHeader)==='function'){const retryAfter=loader.getResponseHeader('Retry-After');if(retryAfter){ttl=parseFloat(retryAfter)*1000;}}this.log(`Steering manifest ${context.url} rate limited`);return;}this.scheduleRefresh(this.uri||context.url,ttl);},onTimeout:(stats,context,networkDetails)=>{this.log(`Timeout loading steering manifest (${context.url})`);this.scheduleRefresh(this.uri||context.url);}};this.log(`Requesting steering manifest: ${url}`);this.loader.load(context,loaderConfig,callbacks);}scheduleRefresh(uri,ttlMs=this.timeToLoad*1000){this.clearTimeout();this.reloadTimer=self.setTimeout(()=>{var _this$hls;const media=(_this$hls=this.hls)==null?void 0:_this$hls.media;if(media&&!media.ended){this.loadSteeringManifest(uri);return;}this.scheduleRefresh(uri,this.timeToLoad*1000);},ttlMs);}}function cloneRenditionGroups(tracks,groupCloneMap,uriReplacement,cloneId){if(!tracks){return;}Object.keys(groupCloneMap).forEach(audioGroupId=>{const clonedTracks=tracks.filter(track=>track.groupId===audioGroupId).map(track=>{const clonedTrack=_extends({},track);clonedTrack.details=undefined;clonedTrack.attrs=new AttrList(clonedTrack.attrs);clonedTrack.url=clonedTrack.attrs.URI=performUriReplacement(track.url,track.attrs['STABLE-RENDITION-ID'],'PER-RENDITION-URIS',uriReplacement);clonedTrack.groupId=clonedTrack.attrs['GROUP-ID']=groupCloneMap[audioGroupId];clonedTrack.attrs['PATHWAY-ID']=cloneId;return clonedTrack;});tracks.push(...clonedTracks);});}function performUriReplacement(uri,stableId,perOptionKey,uriReplacement){const{HOST:host,PARAMS:params,[perOptionKey]:perOptionUris}=uriReplacement;let perVariantUri;if(stableId){perVariantUri=perOptionUris==null?void 0:perOptionUris[stableId];if(perVariantUri){uri=perVariantUri;}}const url=new self.URL(uri);if(host&&!perVariantUri){url.host=host;}if(params){Object.keys(params).sort().forEach(key=>{if(key){url.searchParams.set(key,params[key]);}});}return url.href;}const AGE_HEADER_LINE_REGEX=/^age:\s*[\d.]+\s*$/im;class XhrLoader{constructor(config){this.xhrSetup=void 0;this.requestTimeout=void 0;this.retryTimeout=void 0;this.retryDelay=void 0;this.config=null;this.callbacks=null;this.context=null;this.loader=null;this.stats=void 0;this.xhrSetup=config?config.xhrSetup||null:null;this.stats=new LoadStats();this.retryDelay=0;}destroy(){this.callbacks=null;this.abortInternal();this.loader=null;this.config=null;this.context=null;this.xhrSetup=null;// @ts-ignore
this.stats=null;}abortInternal(){const loader=this.loader;self.clearTimeout(this.requestTimeout);self.clearTimeout(this.retryTimeout);if(loader){loader.onreadystatechange=null;loader.onprogress=null;if(loader.readyState!==4){this.stats.aborted=true;loader.abort();}}}abort(){var _this$callbacks;this.abortInternal();if((_this$callbacks=this.callbacks)!=null&&_this$callbacks.onAbort){this.callbacks.onAbort(this.stats,this.context,this.loader);}}load(context,config,callbacks){if(this.stats.loading.start){throw new Error('Loader can only be used once.');}this.stats.loading.start=self.performance.now();this.context=context;this.config=config;this.callbacks=callbacks;this.loadInternal();}loadInternal(){const{config,context}=this;if(!config||!context){return;}const xhr=this.loader=new self.XMLHttpRequest();const stats=this.stats;stats.loading.first=0;stats.loaded=0;stats.aborted=false;const xhrSetup=this.xhrSetup;if(xhrSetup){Promise.resolve().then(()=>{if(this.stats.aborted)return;return xhrSetup(xhr,context.url);}).catch(error=>{xhr.open('GET',context.url,true);return xhrSetup(xhr,context.url);}).then(()=>{if(this.stats.aborted)return;this.openAndSendXhr(xhr,context,config);}).catch(error=>{// IE11 throws an exception on xhr.open if attempting to access an HTTP resource over HTTPS
this.callbacks.onError({code:xhr.status,text:error.message},context,xhr,stats);return;});}else {this.openAndSendXhr(xhr,context,config);}}openAndSendXhr(xhr,context,config){if(!xhr.readyState){xhr.open('GET',context.url,true);}const headers=context.headers;const{maxTimeToFirstByteMs,maxLoadTimeMs}=config.loadPolicy;if(headers){for(const header in headers){xhr.setRequestHeader(header,headers[header]);}}if(context.rangeEnd){xhr.setRequestHeader('Range','bytes='+context.rangeStart+'-'+(context.rangeEnd-1));}xhr.onreadystatechange=this.readystatechange.bind(this);xhr.onprogress=this.loadprogress.bind(this);xhr.responseType=context.responseType;// setup timeout before we perform request
self.clearTimeout(this.requestTimeout);config.timeout=maxTimeToFirstByteMs&&isFiniteNumber(maxTimeToFirstByteMs)?maxTimeToFirstByteMs:maxLoadTimeMs;this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),config.timeout);xhr.send();}readystatechange(){const{context,loader:xhr,stats}=this;if(!context||!xhr){return;}const readyState=xhr.readyState;const config=this.config;// don't proceed if xhr has been aborted
if(stats.aborted){return;}// >= HEADERS_RECEIVED
if(readyState>=2){if(stats.loading.first===0){stats.loading.first=Math.max(self.performance.now(),stats.loading.start);// readyState >= 2 AND readyState !==4 (readyState = HEADERS_RECEIVED || LOADING) rearm timeout as xhr not finished yet
if(config.timeout!==config.loadPolicy.maxLoadTimeMs){self.clearTimeout(this.requestTimeout);config.timeout=config.loadPolicy.maxLoadTimeMs;this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),config.loadPolicy.maxLoadTimeMs-(stats.loading.first-stats.loading.start));}}if(readyState===4){self.clearTimeout(this.requestTimeout);xhr.onreadystatechange=null;xhr.onprogress=null;const status=xhr.status;// http status between 200 to 299 are all successful
const useResponse=xhr.responseType!=='text';if(status>=200&&status<300&&(useResponse&&xhr.response||xhr.responseText!==null)){stats.loading.end=Math.max(self.performance.now(),stats.loading.first);const data=useResponse?xhr.response:xhr.responseText;const len=xhr.responseType==='arraybuffer'?data.byteLength:data.length;stats.loaded=stats.total=len;stats.bwEstimate=stats.total*8000/(stats.loading.end-stats.loading.first);if(!this.callbacks){return;}const onProgress=this.callbacks.onProgress;if(onProgress){onProgress(stats,context,data,xhr);}if(!this.callbacks){return;}const response={url:xhr.responseURL,data:data,code:status};this.callbacks.onSuccess(response,stats,context,xhr);}else {const retryConfig=config.loadPolicy.errorRetry;const retryCount=stats.retry;// if max nb of retries reached or if http status between 400 and 499 (such error cannot be recovered, retrying is useless), return error
const response={url:context.url,data:undefined,code:status};if(shouldRetry(retryConfig,retryCount,false,response)){this.retry(retryConfig);}else {logger.error(`${status} while loading ${context.url}`);this.callbacks.onError({code:status,text:xhr.statusText},context,xhr,stats);}}}}}loadtimeout(){var _this$config;const retryConfig=(_this$config=this.config)==null?void 0:_this$config.loadPolicy.timeoutRetry;const retryCount=this.stats.retry;if(shouldRetry(retryConfig,retryCount,true)){this.retry(retryConfig);}else {var _this$context;logger.warn(`timeout while loading ${(_this$context=this.context)==null?void 0:_this$context.url}`);const callbacks=this.callbacks;if(callbacks){this.abortInternal();callbacks.onTimeout(this.stats,this.context,this.loader);}}}retry(retryConfig){const{context,stats}=this;this.retryDelay=getRetryDelay(retryConfig,stats.retry);stats.retry++;logger.warn(`${status?'HTTP Status '+status:'Timeout'} while loading ${context==null?void 0:context.url}, retrying ${stats.retry}/${retryConfig.maxNumRetry} in ${this.retryDelay}ms`);// abort and reset internal state
this.abortInternal();this.loader=null;// schedule retry
self.clearTimeout(this.retryTimeout);this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay);}loadprogress(event){const stats=this.stats;stats.loaded=event.loaded;if(event.lengthComputable){stats.total=event.total;}}getCacheAge(){let result=null;if(this.loader&&AGE_HEADER_LINE_REGEX.test(this.loader.getAllResponseHeaders())){const ageHeader=this.loader.getResponseHeader('age');result=ageHeader?parseFloat(ageHeader):null;}return result;}getResponseHeader(name){if(this.loader&&new RegExp(`^${name}:\\s*[\\d.]+\\s*$`,'im').test(this.loader.getAllResponseHeaders())){return this.loader.getResponseHeader(name);}return null;}}function fetchSupported(){if(// @ts-ignore
self.fetch&&self.AbortController&&self.ReadableStream&&self.Request){try{new self.ReadableStream({});// eslint-disable-line no-new
return true;}catch(e){/* noop */}}return false;}const BYTERANGE=/(\d+)-(\d+)\/(\d+)/;class FetchLoader{constructor(config/* HlsConfig */){this.fetchSetup=void 0;this.requestTimeout=void 0;this.request=null;this.response=null;this.controller=void 0;this.context=null;this.config=null;this.callbacks=null;this.stats=void 0;this.loader=null;this.fetchSetup=config.fetchSetup||getRequest;this.controller=new self.AbortController();this.stats=new LoadStats();}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null;this.abortInternal();this.response=null;// @ts-ignore
this.fetchSetup=this.controller=this.stats=null;}abortInternal(){if(this.controller&&!this.stats.loading.end){this.stats.aborted=true;this.controller.abort();}}abort(){var _this$callbacks;this.abortInternal();if((_this$callbacks=this.callbacks)!=null&&_this$callbacks.onAbort){this.callbacks.onAbort(this.stats,this.context,this.response);}}load(context,config,callbacks){const stats=this.stats;if(stats.loading.start){throw new Error('Loader can only be used once.');}stats.loading.start=self.performance.now();const initParams=getRequestParameters(context,this.controller.signal);const onProgress=callbacks.onProgress;const isArrayBuffer=context.responseType==='arraybuffer';const LENGTH=isArrayBuffer?'byteLength':'length';const{maxTimeToFirstByteMs,maxLoadTimeMs}=config.loadPolicy;this.context=context;this.config=config;this.callbacks=callbacks;this.request=this.fetchSetup(context,initParams);self.clearTimeout(this.requestTimeout);config.timeout=maxTimeToFirstByteMs&&isFiniteNumber(maxTimeToFirstByteMs)?maxTimeToFirstByteMs:maxLoadTimeMs;this.requestTimeout=self.setTimeout(()=>{this.abortInternal();callbacks.onTimeout(stats,context,this.response);},config.timeout);self.fetch(this.request).then(response=>{this.response=this.loader=response;const first=Math.max(self.performance.now(),stats.loading.start);self.clearTimeout(this.requestTimeout);config.timeout=maxLoadTimeMs;this.requestTimeout=self.setTimeout(()=>{this.abortInternal();callbacks.onTimeout(stats,context,this.response);},maxLoadTimeMs-(first-stats.loading.start));if(!response.ok){const{status,statusText}=response;throw new FetchError(statusText||'fetch, bad network response',status,response);}stats.loading.first=first;stats.total=getContentLength(response.headers)||stats.total;if(onProgress&&isFiniteNumber(config.highWaterMark)){return this.loadProgressively(response,stats,context,config.highWaterMark,onProgress);}if(isArrayBuffer){return response.arrayBuffer();}if(context.responseType==='json'){return response.json();}return response.text();}).then(responseData=>{const response=this.response;if(!response){throw new Error('loader destroyed');}self.clearTimeout(this.requestTimeout);stats.loading.end=Math.max(self.performance.now(),stats.loading.first);const total=responseData[LENGTH];if(total){stats.loaded=stats.total=total;}const loaderResponse={url:response.url,data:responseData,code:response.status};if(onProgress&&!isFiniteNumber(config.highWaterMark)){onProgress(stats,context,responseData,response);}callbacks.onSuccess(loaderResponse,stats,context,response);}).catch(error=>{self.clearTimeout(this.requestTimeout);if(stats.aborted){return;}// CORS errors result in an undefined code. Set it to 0 here to align with XHR's behavior
// when destroying, 'error' itself can be undefined
const code=!error?0:error.code||0;const text=!error?null:error.message;callbacks.onError({code,text},context,error?error.details:null,stats);});}getCacheAge(){let result=null;if(this.response){const ageHeader=this.response.headers.get('age');result=ageHeader?parseFloat(ageHeader):null;}return result;}getResponseHeader(name){return this.response?this.response.headers.get(name):null;}loadProgressively(response,stats,context,highWaterMark=0,onProgress){const chunkCache=new ChunkCache();const reader=response.body.getReader();const pump=()=>{return reader.read().then(data=>{if(data.done){if(chunkCache.dataLength){onProgress(stats,context,chunkCache.flush(),response);}return Promise.resolve(new ArrayBuffer(0));}const chunk=data.value;const len=chunk.length;stats.loaded+=len;if(len<highWaterMark||chunkCache.dataLength){// The current chunk is too small to to be emitted or the cache already has data
// Push it to the cache
chunkCache.push(chunk);if(chunkCache.dataLength>=highWaterMark){// flush in order to join the typed arrays
onProgress(stats,context,chunkCache.flush(),response);}}else {// If there's nothing cached already, and the chache is large enough
// just emit the progress event
onProgress(stats,context,chunk,response);}return pump();}).catch(()=>{/* aborted */return Promise.reject();});};return pump();}}function getRequestParameters(context,signal){const initParams={method:'GET',mode:'cors',credentials:'same-origin',signal,headers:new self.Headers(_extends({},context.headers))};if(context.rangeEnd){initParams.headers.set('Range','bytes='+context.rangeStart+'-'+String(context.rangeEnd-1));}return initParams;}function getByteRangeLength(byteRangeHeader){const result=BYTERANGE.exec(byteRangeHeader);if(result){return parseInt(result[2])-parseInt(result[1])+1;}}function getContentLength(headers){const contentRange=headers.get('Content-Range');if(contentRange){const byteRangeLength=getByteRangeLength(contentRange);if(isFiniteNumber(byteRangeLength)){return byteRangeLength;}}const contentLength=headers.get('Content-Length');if(contentLength){return parseInt(contentLength);}}function getRequest(context,initParams){return new self.Request(context.url,initParams);}class FetchError extends Error{constructor(message,code,details){super(message);this.code=void 0;this.details=void 0;this.code=code;this.details=details;}}const WHITESPACE_CHAR=/\s/;const Cues={newCue(track,startTime,endTime,captionScreen){const result=[];let row;// the type data states this is VTTCue, but it can potentially be a TextTrackCue on old browsers
let cue;let indenting;let indent;let text;const Cue=self.VTTCue||self.TextTrackCue;for(let r=0;r<captionScreen.rows.length;r++){row=captionScreen.rows[r];indenting=true;indent=0;text='';if(!row.isEmpty()){var _track$cues;for(let c=0;c<row.chars.length;c++){if(WHITESPACE_CHAR.test(row.chars[c].uchar)&&indenting){indent++;}else {text+=row.chars[c].uchar;indenting=false;}}// To be used for cleaning-up orphaned roll-up captions
row.cueStartTime=startTime;// Give a slight bump to the endTime if it's equal to startTime to avoid a SyntaxError in IE
if(startTime===endTime){endTime+=0.0001;}if(indent>=16){indent--;}else {indent++;}const cueText=fixLineBreaks(text.trim());const id=generateCueId(startTime,endTime,cueText);// If this cue already exists in the track do not push it
if(!(track!=null&&(_track$cues=track.cues)!=null&&_track$cues.getCueById(id))){cue=new Cue(startTime,endTime,cueText);cue.id=id;cue.line=r+1;cue.align='left';// Clamp the position between 10 and 80 percent (CEA-608 PAC indent code)
// https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/608toVTT.html#positioning-in-cea-608
// Firefox throws an exception and captions break with out of bounds 0-100 values
cue.position=10+Math.min(80,Math.floor(indent*8/32)*10);result.push(cue);}}}if(track&&result.length){// Sort bottom cues in reverse order so that they render in line order when overlapping in Chrome
result.sort((cueA,cueB)=>{if(cueA.line==='auto'||cueB.line==='auto'){return 0;}if(cueA.line>8&&cueB.line>8){return cueB.line-cueA.line;}return cueA.line-cueB.line;});result.forEach(cue=>addCueToTrack(track,cue));}return result;}};/**
 * @deprecated use fragLoadPolicy.default
 */ /**
 * @deprecated use manifestLoadPolicy.default and playlistLoadPolicy.default
 */const defaultLoadPolicy={maxTimeToFirstByteMs:8000,maxLoadTimeMs:20000,timeoutRetry:null,errorRetry:null};/**
 * @ignore
 * If possible, keep hlsDefaultConfig shallow
 * It is cloned whenever a new Hls instance is created, by keeping the config
 * shallow the properties are cloned, and we don't end up manipulating the default
 */const hlsDefaultConfig=_objectSpread2(_objectSpread2({autoStartLoad:true,// used by stream-controller
startPosition:-1,// used by stream-controller
defaultAudioCodec:undefined,// used by stream-controller
debug:false,// used by logger
capLevelOnFPSDrop:false,// used by fps-controller
capLevelToPlayerSize:false,// used by cap-level-controller
ignoreDevicePixelRatio:false,// used by cap-level-controller
preferManagedMediaSource:true,initialLiveManifestSize:1,// used by stream-controller
maxBufferLength:30,// used by stream-controller
backBufferLength:Infinity,// used by buffer-controller
frontBufferFlushThreshold:Infinity,maxBufferSize:60*1000*1000,// used by stream-controller
maxBufferHole:0.1,// used by stream-controller
highBufferWatchdogPeriod:2,// used by stream-controller
nudgeOffset:0.1,// used by stream-controller
nudgeMaxRetry:3,// used by stream-controller
maxFragLookUpTolerance:0.25,// used by stream-controller
liveSyncDurationCount:3,// used by latency-controller
liveMaxLatencyDurationCount:Infinity,// used by latency-controller
liveSyncDuration:undefined,// used by latency-controller
liveMaxLatencyDuration:undefined,// used by latency-controller
maxLiveSyncPlaybackRate:1,// used by latency-controller
liveDurationInfinity:false,// used by buffer-controller
/**
   * @deprecated use backBufferLength
   */liveBackBufferLength:null,// used by buffer-controller
maxMaxBufferLength:600,// used by stream-controller
enableWorker:true,// used by transmuxer
workerPath:null,// used by transmuxer
enableSoftwareAES:true,// used by decrypter
startLevel:undefined,// used by level-controller
startFragPrefetch:false,// used by stream-controller
fpsDroppedMonitoringPeriod:5000,// used by fps-controller
fpsDroppedMonitoringThreshold:0.2,// used by fps-controller
appendErrorMaxRetry:3,// used by buffer-controller
loader:XhrLoader,// loader: FetchLoader,
fLoader:undefined,// used by fragment-loader
pLoader:undefined,// used by playlist-loader
xhrSetup:undefined,// used by xhr-loader
licenseXhrSetup:undefined,// used by eme-controller
licenseResponseCallback:undefined,// used by eme-controller
abrController:AbrController,bufferController:BufferController,capLevelController:CapLevelController,errorController:ErrorController,fpsController:FPSController,stretchShortVideoTrack:false,// used by mp4-remuxer
maxAudioFramesDrift:1,// used by mp4-remuxer
forceKeyFrameOnDiscontinuity:true,// used by ts-demuxer
abrEwmaFastLive:3,// used by abr-controller
abrEwmaSlowLive:9,// used by abr-controller
abrEwmaFastVoD:3,// used by abr-controller
abrEwmaSlowVoD:9,// used by abr-controller
abrEwmaDefaultEstimate:5e5,// 500 kbps  // used by abr-controller
abrEwmaDefaultEstimateMax:5e6,// 5 mbps
abrBandWidthFactor:0.95,// used by abr-controller
abrBandWidthUpFactor:0.7,// used by abr-controller
abrMaxWithRealBitrate:false,// used by abr-controller
maxStarvationDelay:4,// used by abr-controller
maxLoadingDelay:4,// used by abr-controller
minAutoBitrate:0,// used by hls
emeEnabled:false,// used by eme-controller
widevineLicenseUrl:undefined,// used by eme-controller
drmSystems:{},// used by eme-controller
drmSystemOptions:{},// used by eme-controller
requestMediaKeySystemAccessFunc:requestMediaKeySystemAccess,// used by eme-controller
testBandwidth:true,progressive:false,lowLatencyMode:true,cmcd:undefined,enableDateRangeMetadataCues:true,enableEmsgMetadataCues:true,enableID3MetadataCues:true,useMediaCapabilities:true,certLoadPolicy:{default:defaultLoadPolicy},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8000,maxLoadTimeMs:20000,timeoutRetry:{maxNumRetry:1,retryDelayMs:1000,maxRetryDelayMs:20000,backoff:'linear'},errorRetry:{maxNumRetry:8,retryDelayMs:1000,maxRetryDelayMs:20000,backoff:'linear'}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:Infinity,maxLoadTimeMs:20000,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1000,maxRetryDelayMs:8000}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:10000,maxLoadTimeMs:20000,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1000,maxRetryDelayMs:8000}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:10000,maxLoadTimeMs:120000,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1000,maxRetryDelayMs:8000}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:10000,maxLoadTimeMs:20000,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1000,maxRetryDelayMs:8000}}},// These default settings are deprecated in favor of the above policies
// and are maintained for backwards compatibility
manifestLoadingTimeOut:10000,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1000,manifestLoadingMaxRetryTimeout:64000,levelLoadingTimeOut:10000,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1000,levelLoadingMaxRetryTimeout:64000,fragLoadingTimeOut:20000,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1000,fragLoadingMaxRetryTimeout:64000},timelineConfig()),{},{subtitleStreamController:SubtitleStreamController,subtitleTrackController:SubtitleTrackController,timelineController:TimelineController,audioStreamController:AudioStreamController,audioTrackController:AudioTrackController,emeController:EMEController,cmcdController:CMCDController,contentSteeringController:ContentSteeringController});function timelineConfig(){return {cueHandler:Cues,// used by timeline-controller
enableWebVTT:true,// used by timeline-controller
enableIMSC1:true,// used by timeline-controller
enableCEA708Captions:true,// used by timeline-controller
captionsTextTrack1Label:'English',// used by timeline-controller
captionsTextTrack1LanguageCode:'en',// used by timeline-controller
captionsTextTrack2Label:'Spanish',// used by timeline-controller
captionsTextTrack2LanguageCode:'es',// used by timeline-controller
captionsTextTrack3Label:'Unknown CC',// used by timeline-controller
captionsTextTrack3LanguageCode:'',// used by timeline-controller
captionsTextTrack4Label:'Unknown CC',// used by timeline-controller
captionsTextTrack4LanguageCode:'',// used by timeline-controller
renderTextTracksNatively:true};}/**
 * @ignore
 */function mergeConfig(defaultConfig,userConfig){if((userConfig.liveSyncDurationCount||userConfig.liveMaxLatencyDurationCount)&&(userConfig.liveSyncDuration||userConfig.liveMaxLatencyDuration)){throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");}if(userConfig.liveMaxLatencyDurationCount!==undefined&&(userConfig.liveSyncDurationCount===undefined||userConfig.liveMaxLatencyDurationCount<=userConfig.liveSyncDurationCount)){throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');}if(userConfig.liveMaxLatencyDuration!==undefined&&(userConfig.liveSyncDuration===undefined||userConfig.liveMaxLatencyDuration<=userConfig.liveSyncDuration)){throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');}const defaultsCopy=deepCpy(defaultConfig);// Backwards compatibility with deprecated config values
const deprecatedSettingTypes=['manifest','level','frag'];const deprecatedSettings=['TimeOut','MaxRetry','RetryDelay','MaxRetryTimeout'];deprecatedSettingTypes.forEach(type=>{const policyName=`${type==='level'?'playlist':type}LoadPolicy`;const policyNotSet=userConfig[policyName]===undefined;const report=[];deprecatedSettings.forEach(setting=>{const deprecatedSetting=`${type}Loading${setting}`;const value=userConfig[deprecatedSetting];if(value!==undefined&&policyNotSet){report.push(deprecatedSetting);const settings=defaultsCopy[policyName].default;userConfig[policyName]={default:settings};switch(setting){case'TimeOut':settings.maxLoadTimeMs=value;settings.maxTimeToFirstByteMs=value;break;case'MaxRetry':settings.errorRetry.maxNumRetry=value;settings.timeoutRetry.maxNumRetry=value;break;case'RetryDelay':settings.errorRetry.retryDelayMs=value;settings.timeoutRetry.retryDelayMs=value;break;case'MaxRetryTimeout':settings.errorRetry.maxRetryDelayMs=value;settings.timeoutRetry.maxRetryDelayMs=value;break;}}});if(report.length){logger.warn(`hls.js config: "${report.join('", "')}" setting(s) are deprecated, use "${policyName}": ${JSON.stringify(userConfig[policyName])}`);}});return _objectSpread2(_objectSpread2({},defaultsCopy),userConfig);}function deepCpy(obj){if(obj&&typeof obj==='object'){if(Array.isArray(obj)){return obj.map(deepCpy);}return Object.keys(obj).reduce((result,key)=>{result[key]=deepCpy(obj[key]);return result;},{});}return obj;}/**
 * @ignore
 */function enableStreamingMode(config){const currentLoader=config.loader;if(currentLoader!==FetchLoader&&currentLoader!==XhrLoader){// If a developer has configured their own loader, respect that choice
logger.log('[config]: Custom loader detected, cannot enable progressive streaming');config.progressive=false;}else {const canStreamProgressively=fetchSupported();if(canStreamProgressively){config.loader=FetchLoader;config.progressive=true;config.enableSoftwareAES=true;logger.log('[config]: Progressive streaming enabled, using FetchLoader');}}}let chromeOrFirefox;class LevelController extends BasePlaylistController{constructor(hls,contentSteeringController){super(hls,'[level-controller]');this._levels=[];this._firstLevel=-1;this._maxAutoLevel=-1;this._startLevel=void 0;this.currentLevel=null;this.currentLevelIndex=-1;this.manualLevelIndex=-1;this.steering=void 0;this.onParsedComplete=void 0;this.steering=contentSteeringController;this._registerListeners();}_registerListeners(){const{hls}=this;hls.on(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.on(Events$1.MANIFEST_LOADED,this.onManifestLoaded,this);hls.on(Events$1.LEVEL_LOADED,this.onLevelLoaded,this);hls.on(Events$1.LEVELS_UPDATED,this.onLevelsUpdated,this);hls.on(Events$1.FRAG_BUFFERED,this.onFragBuffered,this);hls.on(Events$1.ERROR,this.onError,this);}_unregisterListeners(){const{hls}=this;hls.off(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.off(Events$1.MANIFEST_LOADED,this.onManifestLoaded,this);hls.off(Events$1.LEVEL_LOADED,this.onLevelLoaded,this);hls.off(Events$1.LEVELS_UPDATED,this.onLevelsUpdated,this);hls.off(Events$1.FRAG_BUFFERED,this.onFragBuffered,this);hls.off(Events$1.ERROR,this.onError,this);}destroy(){this._unregisterListeners();this.steering=null;this.resetLevels();super.destroy();}stopLoad(){const levels=this._levels;// clean up live level details to force reload them, and reset load errors
levels.forEach(level=>{level.loadError=0;level.fragmentError=0;});super.stopLoad();}resetLevels(){this._startLevel=undefined;this.manualLevelIndex=-1;this.currentLevelIndex=-1;this.currentLevel=null;this._levels=[];this._maxAutoLevel=-1;}onManifestLoading(event,data){this.resetLevels();}onManifestLoaded(event,data){const preferManagedMediaSource=this.hls.config.preferManagedMediaSource;const levels=[];const redundantSet={};const generatePathwaySet={};let resolutionFound=false;let videoCodecFound=false;let audioCodecFound=false;data.levels.forEach(levelParsed=>{var _audioCodec,_videoCodec;const attributes=levelParsed.attrs;// erase audio codec info if browser does not support mp4a.40.34.
// demuxer will autodetect codec and fallback to mpeg/audio
let{audioCodec,videoCodec}=levelParsed;if(((_audioCodec=audioCodec)==null?void 0:_audioCodec.indexOf('mp4a.40.34'))!==-1){chromeOrFirefox||(chromeOrFirefox=/chrome|firefox/i.test(navigator.userAgent));if(chromeOrFirefox){levelParsed.audioCodec=audioCodec=undefined;}}if(audioCodec){levelParsed.audioCodec=audioCodec=getCodecCompatibleName(audioCodec,preferManagedMediaSource);}if(((_videoCodec=videoCodec)==null?void 0:_videoCodec.indexOf('avc1'))===0){videoCodec=levelParsed.videoCodec=convertAVC1ToAVCOTI(videoCodec);}// only keep levels with supported audio/video codecs
const{width,height,unknownCodecs}=levelParsed;resolutionFound||(resolutionFound=!!(width&&height));videoCodecFound||(videoCodecFound=!!videoCodec);audioCodecFound||(audioCodecFound=!!audioCodec);if(unknownCodecs!=null&&unknownCodecs.length||audioCodec&&!areCodecsMediaSourceSupported(audioCodec,'audio',preferManagedMediaSource)||videoCodec&&!areCodecsMediaSourceSupported(videoCodec,'video',preferManagedMediaSource)){return;}const{CODECS,'FRAME-RATE':FRAMERATE,'HDCP-LEVEL':HDCP,'PATHWAY-ID':PATHWAY,RESOLUTION,'VIDEO-RANGE':VIDEO_RANGE}=attributes;const contentSteeringPrefix=`${PATHWAY||'.'}-`;const levelKey=`${contentSteeringPrefix}${levelParsed.bitrate}-${RESOLUTION}-${FRAMERATE}-${CODECS}-${VIDEO_RANGE}-${HDCP}`;if(!redundantSet[levelKey]){const level=new Level(levelParsed);redundantSet[levelKey]=level;generatePathwaySet[levelKey]=1;levels.push(level);}else if(redundantSet[levelKey].uri!==levelParsed.url&&!levelParsed.attrs['PATHWAY-ID']){// Assign Pathway IDs to Redundant Streams (default Pathways is ".". Redundant Streams "..", "...", and so on.)
// Content Steering controller to handles Pathway fallback on error
const pathwayCount=generatePathwaySet[levelKey]+=1;levelParsed.attrs['PATHWAY-ID']=new Array(pathwayCount+1).join('.');const level=new Level(levelParsed);redundantSet[levelKey]=level;levels.push(level);}else {redundantSet[levelKey].addGroupId('audio',attributes.AUDIO);redundantSet[levelKey].addGroupId('text',attributes.SUBTITLES);}});this.filterAndSortMediaOptions(levels,data,resolutionFound,videoCodecFound,audioCodecFound);}filterAndSortMediaOptions(filteredLevels,data,resolutionFound,videoCodecFound,audioCodecFound){let audioTracks=[];let subtitleTracks=[];let levels=filteredLevels;// remove audio-only and invalid video-range levels if we also have levels with video codecs or RESOLUTION signalled
if((resolutionFound||videoCodecFound)&&audioCodecFound){levels=levels.filter(({videoCodec,videoRange,width,height})=>(!!videoCodec||!!(width&&height))&&isVideoRange(videoRange));}if(levels.length===0){// Dispatch error after MANIFEST_LOADED is done propagating
Promise.resolve().then(()=>{if(this.hls){if(data.levels.length){this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(data.levels[0].attrs)}`);}const error=new Error('no level with compatible codecs found in manifest');this.hls.trigger(Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:true,url:data.url,error,reason:error.message});}});return;}if(data.audioTracks){const{preferManagedMediaSource}=this.hls.config;audioTracks=data.audioTracks.filter(track=>!track.audioCodec||areCodecsMediaSourceSupported(track.audioCodec,'audio',preferManagedMediaSource));// Assign ids after filtering as array indices by group-id
assignTrackIdsByGroup(audioTracks);}if(data.subtitles){subtitleTracks=data.subtitles;assignTrackIdsByGroup(subtitleTracks);}// start bitrate is the first bitrate of the manifest
const unsortedLevels=levels.slice(0);// sort levels from lowest to highest
levels.sort((a,b)=>{if(a.attrs['HDCP-LEVEL']!==b.attrs['HDCP-LEVEL']){return (a.attrs['HDCP-LEVEL']||'')>(b.attrs['HDCP-LEVEL']||'')?1:-1;}// sort on height before bitrate for cap-level-controller
if(resolutionFound&&a.height!==b.height){return a.height-b.height;}if(a.frameRate!==b.frameRate){return a.frameRate-b.frameRate;}if(a.videoRange!==b.videoRange){return VideoRangeValues.indexOf(a.videoRange)-VideoRangeValues.indexOf(b.videoRange);}if(a.videoCodec!==b.videoCodec){const valueA=videoCodecPreferenceValue(a.videoCodec);const valueB=videoCodecPreferenceValue(b.videoCodec);if(valueA!==valueB){return valueB-valueA;}}if(a.uri===b.uri&&a.codecSet!==b.codecSet){const valueA=codecsSetSelectionPreferenceValue(a.codecSet);const valueB=codecsSetSelectionPreferenceValue(b.codecSet);if(valueA!==valueB){return valueB-valueA;}}if(a.averageBitrate!==b.averageBitrate){return a.averageBitrate-b.averageBitrate;}return 0;});let firstLevelInPlaylist=unsortedLevels[0];if(this.steering){levels=this.steering.filterParsedLevels(levels);if(levels.length!==unsortedLevels.length){for(let i=0;i<unsortedLevels.length;i++){if(unsortedLevels[i].pathwayId===levels[0].pathwayId){firstLevelInPlaylist=unsortedLevels[i];break;}}}}this._levels=levels;// find index of first level in sorted levels
for(let i=0;i<levels.length;i++){if(levels[i]===firstLevelInPlaylist){var _this$hls$userConfig;this._firstLevel=i;const firstLevelBitrate=firstLevelInPlaylist.bitrate;const bandwidthEstimate=this.hls.bandwidthEstimate;this.log(`manifest loaded, ${levels.length} level(s) found, first bitrate: ${firstLevelBitrate}`);// Update default bwe to first variant bitrate as long it has not been configured or set
if(((_this$hls$userConfig=this.hls.userConfig)==null?void 0:_this$hls$userConfig.abrEwmaDefaultEstimate)===undefined){const startingBwEstimate=Math.min(firstLevelBitrate,this.hls.config.abrEwmaDefaultEstimateMax);if(startingBwEstimate>bandwidthEstimate&&bandwidthEstimate===hlsDefaultConfig.abrEwmaDefaultEstimate){this.hls.bandwidthEstimate=startingBwEstimate;}}break;}}// Audio is only alternate if manifest include a URI along with the audio group tag,
// and this is not an audio-only stream where levels contain audio-only
const audioOnly=audioCodecFound&&!videoCodecFound;const edata={levels,audioTracks,subtitleTracks,sessionData:data.sessionData,sessionKeys:data.sessionKeys,firstLevel:this._firstLevel,stats:data.stats,audio:audioCodecFound,video:videoCodecFound,altAudio:!audioOnly&&audioTracks.some(t=>!!t.url)};this.hls.trigger(Events$1.MANIFEST_PARSED,edata);// Initiate loading after all controllers have received MANIFEST_PARSED
if(this.hls.config.autoStartLoad||this.hls.forceStartLoad){this.hls.startLoad(this.hls.config.startPosition);}}get levels(){if(this._levels.length===0){return null;}return this._levels;}get level(){return this.currentLevelIndex;}set level(newLevel){const levels=this._levels;if(levels.length===0){return;}// check if level idx is valid
if(newLevel<0||newLevel>=levels.length){// invalid level id given, trigger error
const error=new Error('invalid level idx');const fatal=newLevel<0;this.hls.trigger(Events$1.ERROR,{type:ErrorTypes.OTHER_ERROR,details:ErrorDetails.LEVEL_SWITCH_ERROR,level:newLevel,fatal,error,reason:error.message});if(fatal){return;}newLevel=Math.min(newLevel,levels.length-1);}const lastLevelIndex=this.currentLevelIndex;const lastLevel=this.currentLevel;const lastPathwayId=lastLevel?lastLevel.attrs['PATHWAY-ID']:undefined;const level=levels[newLevel];const pathwayId=level.attrs['PATHWAY-ID'];this.currentLevelIndex=newLevel;this.currentLevel=level;if(lastLevelIndex===newLevel&&level.details&&lastLevel&&lastPathwayId===pathwayId){return;}this.log(`Switching to level ${newLevel} (${level.height?level.height+'p ':''}${level.videoRange?level.videoRange+' ':''}${level.codecSet?level.codecSet+' ':''}@${level.bitrate})${pathwayId?' with Pathway '+pathwayId:''} from level ${lastLevelIndex}${lastPathwayId?' with Pathway '+lastPathwayId:''}`);const levelSwitchingData={level:newLevel,attrs:level.attrs,details:level.details,bitrate:level.bitrate,averageBitrate:level.averageBitrate,maxBitrate:level.maxBitrate,realBitrate:level.realBitrate,width:level.width,height:level.height,codecSet:level.codecSet,audioCodec:level.audioCodec,videoCodec:level.videoCodec,audioGroups:level.audioGroups,subtitleGroups:level.subtitleGroups,loaded:level.loaded,loadError:level.loadError,fragmentError:level.fragmentError,name:level.name,id:level.id,uri:level.uri,url:level.url,urlId:0,audioGroupIds:level.audioGroupIds,textGroupIds:level.textGroupIds};this.hls.trigger(Events$1.LEVEL_SWITCHING,levelSwitchingData);// check if we need to load playlist for this level
const levelDetails=level.details;if(!levelDetails||levelDetails.live){// level not retrieved yet, or live playlist we need to (re)load it
const hlsUrlParameters=this.switchParams(level.uri,lastLevel==null?void 0:lastLevel.details,levelDetails);this.loadPlaylist(hlsUrlParameters);}}get manualLevel(){return this.manualLevelIndex;}set manualLevel(newLevel){this.manualLevelIndex=newLevel;if(this._startLevel===undefined){this._startLevel=newLevel;}if(newLevel!==-1){this.level=newLevel;}}get firstLevel(){return this._firstLevel;}set firstLevel(newLevel){this._firstLevel=newLevel;}get startLevel(){// Setting hls.startLevel (this._startLevel) overrides config.startLevel
if(this._startLevel===undefined){const configStartLevel=this.hls.config.startLevel;if(configStartLevel!==undefined){return configStartLevel;}return this.hls.firstAutoLevel;}return this._startLevel;}set startLevel(newLevel){this._startLevel=newLevel;}onError(event,data){if(data.fatal||!data.context){return;}if(data.context.type===PlaylistContextType.LEVEL&&data.context.level===this.level){this.checkRetry(data);}}// reset errors on the successful load of a fragment
onFragBuffered(event,{frag}){if(frag!==undefined&&frag.type===PlaylistLevelType.MAIN){const el=frag.elementaryStreams;if(!Object.keys(el).some(type=>!!el[type])){return;}const level=this._levels[frag.level];if(level!=null&&level.loadError){this.log(`Resetting level error count of ${level.loadError} on frag buffered`);level.loadError=0;}}}onLevelLoaded(event,data){var _data$deliveryDirecti2;const{level,details}=data;const curLevel=this._levels[level];if(!curLevel){var _data$deliveryDirecti;this.warn(`Invalid level index ${level}`);if((_data$deliveryDirecti=data.deliveryDirectives)!=null&&_data$deliveryDirecti.skip){details.deltaUpdateFailed=true;}return;}// only process level loaded events matching with expected level
if(level===this.currentLevelIndex){// reset level load error counter on successful level loaded only if there is no issues with fragments
if(curLevel.fragmentError===0){curLevel.loadError=0;}this.playlistLoaded(level,data,curLevel.details);}else if((_data$deliveryDirecti2=data.deliveryDirectives)!=null&&_data$deliveryDirecti2.skip){// received a delta playlist update that cannot be merged
details.deltaUpdateFailed=true;}}loadPlaylist(hlsUrlParameters){super.loadPlaylist();const currentLevelIndex=this.currentLevelIndex;const currentLevel=this.currentLevel;if(currentLevel&&this.shouldLoadPlaylist(currentLevel)){let url=currentLevel.uri;if(hlsUrlParameters){try{url=hlsUrlParameters.addDirectives(url);}catch(error){this.warn(`Could not construct new URL with HLS Delivery Directives: ${error}`);}}const pathwayId=currentLevel.attrs['PATHWAY-ID'];this.log(`Loading level index ${currentLevelIndex}${(hlsUrlParameters==null?void 0:hlsUrlParameters.msn)!==undefined?' at sn '+hlsUrlParameters.msn+' part '+hlsUrlParameters.part:''} with${pathwayId?' Pathway '+pathwayId:''} ${url}`);// console.log('Current audio track group ID:', this.hls.audioTracks[this.hls.audioTrack].groupId);
// console.log('New video quality level audio group id:', levelObject.attrs.AUDIO, level);
this.clearTimer();this.hls.trigger(Events$1.LEVEL_LOADING,{url,level:currentLevelIndex,pathwayId:currentLevel.attrs['PATHWAY-ID'],id:0,// Deprecated Level urlId
deliveryDirectives:hlsUrlParameters||null});}}get nextLoadLevel(){if(this.manualLevelIndex!==-1){return this.manualLevelIndex;}else {return this.hls.nextAutoLevel;}}set nextLoadLevel(nextLevel){this.level=nextLevel;if(this.manualLevelIndex===-1){this.hls.nextAutoLevel=nextLevel;}}removeLevel(levelIndex){var _this$currentLevel;const levels=this._levels.filter((level,index)=>{if(index!==levelIndex){return true;}if(this.steering){this.steering.removeLevel(level);}if(level===this.currentLevel){this.currentLevel=null;this.currentLevelIndex=-1;if(level.details){level.details.fragments.forEach(f=>f.level=-1);}}return false;});reassignFragmentLevelIndexes(levels);this._levels=levels;if(this.currentLevelIndex>-1&&(_this$currentLevel=this.currentLevel)!=null&&_this$currentLevel.details){this.currentLevelIndex=this.currentLevel.details.fragments[0].level;}this.hls.trigger(Events$1.LEVELS_UPDATED,{levels});}onLevelsUpdated(event,{levels}){this._levels=levels;}checkMaxAutoUpdated(){const{autoLevelCapping,maxAutoLevel,maxHdcpLevel}=this.hls;if(this._maxAutoLevel!==maxAutoLevel){this._maxAutoLevel=maxAutoLevel;this.hls.trigger(Events$1.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping,levels:this.levels,maxAutoLevel,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel});}}}function assignTrackIdsByGroup(tracks){const groups={};tracks.forEach(track=>{const groupId=track.groupId||'';track.id=groups[groupId]=groups[groupId]||0;groups[groupId]++;});}class KeyLoader{constructor(config){this.config=void 0;this.keyUriToKeyInfo={};this.emeController=null;this.config=config;}abort(type){for(const uri in this.keyUriToKeyInfo){const loader=this.keyUriToKeyInfo[uri].loader;if(loader){var _loader$context;if(type&&type!==((_loader$context=loader.context)==null?void 0:_loader$context.frag.type)){return;}loader.abort();}}}detach(){for(const uri in this.keyUriToKeyInfo){const keyInfo=this.keyUriToKeyInfo[uri];// Remove cached EME keys on detach
if(keyInfo.mediaKeySessionContext||keyInfo.decryptdata.isCommonEncryption){delete this.keyUriToKeyInfo[uri];}}}destroy(){this.detach();for(const uri in this.keyUriToKeyInfo){const loader=this.keyUriToKeyInfo[uri].loader;if(loader){loader.destroy();}}this.keyUriToKeyInfo={};}createKeyLoadError(frag,details=ErrorDetails.KEY_LOAD_ERROR,error,networkDetails,response){return new LoadError({type:ErrorTypes.NETWORK_ERROR,details,fatal:false,frag,response,error,networkDetails});}loadClear(loadingFrag,encryptedFragments){if(this.emeController&&this.config.emeEnabled){// access key-system with nearest key on start (loaidng frag is unencrypted)
const{sn,cc}=loadingFrag;for(let i=0;i<encryptedFragments.length;i++){const frag=encryptedFragments[i];if(cc<=frag.cc&&(sn==='initSegment'||frag.sn==='initSegment'||sn<frag.sn)){this.emeController.selectKeySystemFormat(frag).then(keySystemFormat=>{frag.setKeyFormat(keySystemFormat);});break;}}}}load(frag){if(!frag.decryptdata&&frag.encrypted&&this.emeController){// Multiple keys, but none selected, resolve in eme-controller
return this.emeController.selectKeySystemFormat(frag).then(keySystemFormat=>{return this.loadInternal(frag,keySystemFormat);});}return this.loadInternal(frag);}loadInternal(frag,keySystemFormat){var _keyInfo,_keyInfo2;if(keySystemFormat){frag.setKeyFormat(keySystemFormat);}const decryptdata=frag.decryptdata;if(!decryptdata){const error=new Error(keySystemFormat?`Expected frag.decryptdata to be defined after setting format ${keySystemFormat}`:'Missing decryption data on fragment in onKeyLoading');return Promise.reject(this.createKeyLoadError(frag,ErrorDetails.KEY_LOAD_ERROR,error));}const uri=decryptdata.uri;if(!uri){return Promise.reject(this.createKeyLoadError(frag,ErrorDetails.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${uri}"`)));}let keyInfo=this.keyUriToKeyInfo[uri];if((_keyInfo=keyInfo)!=null&&_keyInfo.decryptdata.key){decryptdata.key=keyInfo.decryptdata.key;return Promise.resolve({frag,keyInfo});}// Return key load promise as long as it does not have a mediakey session with an unusable key status
if((_keyInfo2=keyInfo)!=null&&_keyInfo2.keyLoadPromise){var _keyInfo$mediaKeySess;switch((_keyInfo$mediaKeySess=keyInfo.mediaKeySessionContext)==null?void 0:_keyInfo$mediaKeySess.keyStatus){case undefined:case'status-pending':case'usable':case'usable-in-future':return keyInfo.keyLoadPromise.then(keyLoadedData=>{// Return the correct fragment with updated decryptdata key and loaded keyInfo
decryptdata.key=keyLoadedData.keyInfo.decryptdata.key;return {frag,keyInfo};});}// If we have a key session and status and it is not pending or usable, continue
// This will go back to the eme-controller for expired keys to get a new keyLoadPromise
}// Load the key or return the loading promise
keyInfo=this.keyUriToKeyInfo[uri]={decryptdata,keyLoadPromise:null,loader:null,mediaKeySessionContext:null};switch(decryptdata.method){case'ISO-23001-7':case'SAMPLE-AES':case'SAMPLE-AES-CENC':case'SAMPLE-AES-CTR':if(decryptdata.keyFormat==='identity'){// loadKeyHTTP handles http(s) and data URLs
return this.loadKeyHTTP(keyInfo,frag);}return this.loadKeyEME(keyInfo,frag);case'AES-128':return this.loadKeyHTTP(keyInfo,frag);default:return Promise.reject(this.createKeyLoadError(frag,ErrorDetails.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${decryptdata.method}"`)));}}loadKeyEME(keyInfo,frag){const keyLoadedData={frag,keyInfo};if(this.emeController&&this.config.emeEnabled){const keySessionContextPromise=this.emeController.loadKey(keyLoadedData);if(keySessionContextPromise){return (keyInfo.keyLoadPromise=keySessionContextPromise.then(keySessionContext=>{keyInfo.mediaKeySessionContext=keySessionContext;return keyLoadedData;})).catch(error=>{// Remove promise for license renewal or retry
keyInfo.keyLoadPromise=null;throw error;});}}return Promise.resolve(keyLoadedData);}loadKeyHTTP(keyInfo,frag){const config=this.config;const Loader=config.loader;const keyLoader=new Loader(config);frag.keyLoader=keyInfo.loader=keyLoader;return keyInfo.keyLoadPromise=new Promise((resolve,reject)=>{const loaderContext={keyInfo,frag,responseType:'arraybuffer',url:keyInfo.decryptdata.uri};// maxRetry is 0 so that instead of retrying the same key on the same variant multiple times,
// key-loader will trigger an error and rely on stream-controller to handle retry logic.
// this will also align retry logic with fragment-loader
const loadPolicy=config.keyLoadPolicy.default;const loaderConfig={loadPolicy,timeout:loadPolicy.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0};const loaderCallbacks={onSuccess:(response,stats,context,networkDetails)=>{const{frag,keyInfo,url:uri}=context;if(!frag.decryptdata||keyInfo!==this.keyUriToKeyInfo[uri]){return reject(this.createKeyLoadError(frag,ErrorDetails.KEY_LOAD_ERROR,new Error('after key load, decryptdata unset or changed'),networkDetails));}keyInfo.decryptdata.key=frag.decryptdata.key=new Uint8Array(response.data);// detach fragment key loader on load success
frag.keyLoader=null;keyInfo.loader=null;resolve({frag,keyInfo});},onError:(response,context,networkDetails,stats)=>{this.resetLoader(context);reject(this.createKeyLoadError(frag,ErrorDetails.KEY_LOAD_ERROR,new Error(`HTTP Error ${response.code} loading key ${response.text}`),networkDetails,_objectSpread2({url:loaderContext.url,data:undefined},response)));},onTimeout:(stats,context,networkDetails)=>{this.resetLoader(context);reject(this.createKeyLoadError(frag,ErrorDetails.KEY_LOAD_TIMEOUT,new Error('key loading timed out'),networkDetails));},onAbort:(stats,context,networkDetails)=>{this.resetLoader(context);reject(this.createKeyLoadError(frag,ErrorDetails.INTERNAL_ABORTED,new Error('key loading aborted'),networkDetails));}};keyLoader.load(loaderContext,loaderConfig,loaderCallbacks);});}resetLoader(context){const{frag,keyInfo,url:uri}=context;const loader=keyInfo.loader;if(frag.keyLoader===loader){frag.keyLoader=null;keyInfo.loader=null;}delete this.keyUriToKeyInfo[uri];if(loader){loader.destroy();}}}function getSourceBuffer(){return self.SourceBuffer||self.WebKitSourceBuffer;}function isMSESupported(){const mediaSource=getMediaSource();if(!mediaSource){return false;}// if SourceBuffer is exposed ensure its API is valid
// Older browsers do not expose SourceBuffer globally so checking SourceBuffer.prototype is impossible
const sourceBuffer=getSourceBuffer();return !sourceBuffer||sourceBuffer.prototype&&typeof sourceBuffer.prototype.appendBuffer==='function'&&typeof sourceBuffer.prototype.remove==='function';}function isSupported(){if(!isMSESupported()){return false;}const mediaSource=getMediaSource();return typeof(mediaSource==null?void 0:mediaSource.isTypeSupported)==='function'&&(['avc1.42E01E,mp4a.40.2','av01.0.01M.08','vp09.00.50.08'].some(codecsForVideoContainer=>mediaSource.isTypeSupported(mimeTypeForCodec(codecsForVideoContainer,'video')))||['mp4a.40.2','fLaC'].some(codecForAudioContainer=>mediaSource.isTypeSupported(mimeTypeForCodec(codecForAudioContainer,'audio'))));}function changeTypeSupported(){var _sourceBuffer$prototy;const sourceBuffer=getSourceBuffer();return typeof(sourceBuffer==null?void 0:(_sourceBuffer$prototy=sourceBuffer.prototype)==null?void 0:_sourceBuffer$prototy.changeType)==='function';}const STALL_MINIMUM_DURATION_MS=250;const MAX_START_GAP_JUMP=2.0;const SKIP_BUFFER_HOLE_STEP_SECONDS=0.1;const SKIP_BUFFER_RANGE_START=0.05;class GapController{constructor(config,media,fragmentTracker,hls){this.config=void 0;this.media=null;this.fragmentTracker=void 0;this.hls=void 0;this.nudgeRetry=0;this.stallReported=false;this.stalled=null;this.moved=false;this.seeking=false;this.config=config;this.media=media;this.fragmentTracker=fragmentTracker;this.hls=hls;}destroy(){this.media=null;// @ts-ignore
this.hls=this.fragmentTracker=null;}/**
   * Checks if the playhead is stuck within a gap, and if so, attempts to free it.
   * A gap is an unbuffered range between two buffered ranges (or the start and the first buffered range).
   *
   * @param lastCurrentTime - Previously read playhead position
   */poll(lastCurrentTime,activeFrag){const{config,media,stalled}=this;if(media===null){return;}const{currentTime,seeking}=media;const seeked=this.seeking&&!seeking;const beginSeek=!this.seeking&&seeking;this.seeking=seeking;// The playhead is moving, no-op
if(currentTime!==lastCurrentTime){this.moved=true;if(!seeking){this.nudgeRetry=0;}if(stalled!==null){// The playhead is now moving, but was previously stalled
if(this.stallReported){const _stalledDuration=self.performance.now()-stalled;logger.warn(`playback not stuck anymore @${currentTime}, after ${Math.round(_stalledDuration)}ms`);this.stallReported=false;}this.stalled=null;}return;}// Clear stalled state when beginning or finishing seeking so that we don't report stalls coming out of a seek
if(beginSeek||seeked){this.stalled=null;return;}// The playhead should not be moving
if(media.paused&&!seeking||media.ended||media.playbackRate===0||!BufferHelper.getBuffered(media).length){this.nudgeRetry=0;return;}const bufferInfo=BufferHelper.bufferInfo(media,currentTime,0);const nextStart=bufferInfo.nextStart||0;if(seeking){// Waiting for seeking in a buffered range to complete
const hasEnoughBuffer=bufferInfo.len>MAX_START_GAP_JUMP;// Next buffered range is too far ahead to jump to while still seeking
const noBufferGap=!nextStart||activeFrag&&activeFrag.start<=currentTime||nextStart-currentTime>MAX_START_GAP_JUMP&&!this.fragmentTracker.getPartialFragment(currentTime);if(hasEnoughBuffer||noBufferGap){return;}// Reset moved state when seeking to a point in or before a gap
this.moved=false;}// Skip start gaps if we haven't played, but the last poll detected the start of a stall
// The addition poll gives the browser a chance to jump the gap for us
if(!this.moved&&this.stalled!==null){var _level$details;// There is no playable buffer (seeked, waiting for buffer)
const isBuffered=bufferInfo.len>0;if(!isBuffered&&!nextStart){return;}// Jump start gaps within jump threshold
const startJump=Math.max(nextStart,bufferInfo.start||0)-currentTime;// When joining a live stream with audio tracks, account for live playlist window sliding by allowing
// a larger jump over start gaps caused by the audio-stream-controller buffering a start fragment
// that begins over 1 target duration after the video start position.
const level=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null;const isLive=level==null?void 0:(_level$details=level.details)==null?void 0:_level$details.live;const maxStartGapJump=isLive?level.details.targetduration*2:MAX_START_GAP_JUMP;const partialOrGap=this.fragmentTracker.getPartialFragment(currentTime);if(startJump>0&&(startJump<=maxStartGapJump||partialOrGap)){if(!media.paused){this._trySkipBufferHole(partialOrGap);}return;}}// Start tracking stall time
const tnow=self.performance.now();if(stalled===null){this.stalled=tnow;return;}const stalledDuration=tnow-stalled;if(!seeking&&stalledDuration>=STALL_MINIMUM_DURATION_MS){// Report stalling after trying to fix
this._reportStall(bufferInfo);if(!this.media){return;}}const bufferedWithHoles=BufferHelper.bufferInfo(media,currentTime,config.maxBufferHole);this._tryFixBufferStall(bufferedWithHoles,stalledDuration);}/**
   * Detects and attempts to fix known buffer stalling issues.
   * @param bufferInfo - The properties of the current buffer.
   * @param stalledDurationMs - The amount of time Hls.js has been stalling for.
   * @private
   */_tryFixBufferStall(bufferInfo,stalledDurationMs){const{config,fragmentTracker,media}=this;if(media===null){return;}const currentTime=media.currentTime;const partial=fragmentTracker.getPartialFragment(currentTime);if(partial){// Try to skip over the buffer hole caused by a partial fragment
// This method isn't limited by the size of the gap between buffered ranges
const targetTime=this._trySkipBufferHole(partial);// we return here in this case, meaning
// the branch below only executes when we haven't seeked to a new position
if(targetTime||!this.media){return;}}// if we haven't had to skip over a buffer hole of a partial fragment
// we may just have to "nudge" the playlist as the browser decoding/rendering engine
// needs to cross some sort of threshold covering all source-buffers content
// to start playing properly.
if((bufferInfo.len>config.maxBufferHole||bufferInfo.nextStart&&bufferInfo.nextStart-currentTime<config.maxBufferHole)&&stalledDurationMs>config.highBufferWatchdogPeriod*1000){logger.warn('Trying to nudge playhead over buffer-hole');// Try to nudge currentTime over a buffer hole if we've been stalling for the configured amount of seconds
// We only try to jump the hole if it's under the configured size
// Reset stalled so to rearm watchdog timer
this.stalled=null;this._tryNudgeBuffer();}}/**
   * Triggers a BUFFER_STALLED_ERROR event, but only once per stall period.
   * @param bufferLen - The playhead distance from the end of the current buffer segment.
   * @private
   */_reportStall(bufferInfo){const{hls,media,stallReported}=this;if(!stallReported&&media){// Report stalled error once
this.stallReported=true;const error=new Error(`Playback stalling at @${media.currentTime} due to low buffer (${JSON.stringify(bufferInfo)})`);logger.warn(error.message);hls.trigger(Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_STALLED_ERROR,fatal:false,error,buffer:bufferInfo.len});}}/**
   * Attempts to fix buffer stalls by jumping over known gaps caused by partial fragments
   * @param partial - The partial fragment found at the current time (where playback is stalling).
   * @private
   */_trySkipBufferHole(partial){const{config,hls,media}=this;if(media===null){return 0;}// Check if currentTime is between unbuffered regions of partial fragments
const currentTime=media.currentTime;const bufferInfo=BufferHelper.bufferInfo(media,currentTime,0);const startTime=currentTime<bufferInfo.start?bufferInfo.start:bufferInfo.nextStart;if(startTime){const bufferStarved=bufferInfo.len<=config.maxBufferHole;const waiting=bufferInfo.len>0&&bufferInfo.len<1&&media.readyState<3;const gapLength=startTime-currentTime;if(gapLength>0&&(bufferStarved||waiting)){// Only allow large gaps to be skipped if it is a start gap, or all fragments in skip range are partial
if(gapLength>config.maxBufferHole){const{fragmentTracker}=this;let startGap=false;if(currentTime===0){const startFrag=fragmentTracker.getAppendedFrag(0,PlaylistLevelType.MAIN);if(startFrag&&startTime<startFrag.end){startGap=true;}}if(!startGap){const startProvisioned=partial||fragmentTracker.getAppendedFrag(currentTime,PlaylistLevelType.MAIN);if(startProvisioned){let moreToLoad=false;let pos=startProvisioned.end;while(pos<startTime){const provisioned=fragmentTracker.getPartialFragment(pos);if(provisioned){pos+=provisioned.duration;}else {moreToLoad=true;break;}}if(moreToLoad){return 0;}}}}const targetTime=Math.max(startTime+SKIP_BUFFER_RANGE_START,currentTime+SKIP_BUFFER_HOLE_STEP_SECONDS);logger.warn(`skipping hole, adjusting currentTime from ${currentTime} to ${targetTime}`);this.moved=true;this.stalled=null;media.currentTime=targetTime;if(partial&&!partial.gap){const error=new Error(`fragment loaded with buffer holes, seeking from ${currentTime} to ${targetTime}`);hls.trigger(Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:false,error,reason:error.message,frag:partial});}return targetTime;}}return 0;}/**
   * Attempts to fix buffer stalls by advancing the mediaElement's current time by a small amount.
   * @private
   */_tryNudgeBuffer(){const{config,hls,media,nudgeRetry}=this;if(media===null){return;}const currentTime=media.currentTime;this.nudgeRetry++;if(nudgeRetry<config.nudgeMaxRetry){const targetTime=currentTime+(nudgeRetry+1)*config.nudgeOffset;// playback stalled in buffered area ... let's nudge currentTime to try to overcome this
const error=new Error(`Nudging 'currentTime' from ${currentTime} to ${targetTime}`);logger.warn(error.message);media.currentTime=targetTime;hls.trigger(Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_NUDGE_ON_STALL,error,fatal:false});}else {const error=new Error(`Playhead still not moving while enough data buffered @${currentTime} after ${config.nudgeMaxRetry} nudges`);logger.error(error.message);hls.trigger(Events$1.ERROR,{type:ErrorTypes.MEDIA_ERROR,details:ErrorDetails.BUFFER_STALLED_ERROR,error,fatal:true});}}}const TICK_INTERVAL=100;// how often to tick in ms
class StreamController extends BaseStreamController{constructor(hls,fragmentTracker,keyLoader){super(hls,fragmentTracker,keyLoader,'[stream-controller]',PlaylistLevelType.MAIN);this.audioCodecSwap=false;this.gapController=null;this.level=-1;this._forceStartLoad=false;this.altAudio=false;this.audioOnly=false;this.fragPlaying=null;this.onvplaying=null;this.onvseeked=null;this.fragLastKbps=0;this.couldBacktrack=false;this.backtrackFragment=null;this.audioCodecSwitch=false;this.videoBuffer=null;this._registerListeners();}_registerListeners(){const{hls}=this;hls.on(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);hls.on(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);hls.on(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.on(Events$1.MANIFEST_PARSED,this.onManifestParsed,this);hls.on(Events$1.LEVEL_LOADING,this.onLevelLoading,this);hls.on(Events$1.LEVEL_LOADED,this.onLevelLoaded,this);hls.on(Events$1.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this);hls.on(Events$1.ERROR,this.onError,this);hls.on(Events$1.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this);hls.on(Events$1.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this);hls.on(Events$1.BUFFER_CREATED,this.onBufferCreated,this);hls.on(Events$1.BUFFER_FLUSHED,this.onBufferFlushed,this);hls.on(Events$1.LEVELS_UPDATED,this.onLevelsUpdated,this);hls.on(Events$1.FRAG_BUFFERED,this.onFragBuffered,this);}_unregisterListeners(){const{hls}=this;hls.off(Events$1.MEDIA_ATTACHED,this.onMediaAttached,this);hls.off(Events$1.MEDIA_DETACHING,this.onMediaDetaching,this);hls.off(Events$1.MANIFEST_LOADING,this.onManifestLoading,this);hls.off(Events$1.MANIFEST_PARSED,this.onManifestParsed,this);hls.off(Events$1.LEVEL_LOADED,this.onLevelLoaded,this);hls.off(Events$1.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this);hls.off(Events$1.ERROR,this.onError,this);hls.off(Events$1.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this);hls.off(Events$1.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this);hls.off(Events$1.BUFFER_CREATED,this.onBufferCreated,this);hls.off(Events$1.BUFFER_FLUSHED,this.onBufferFlushed,this);hls.off(Events$1.LEVELS_UPDATED,this.onLevelsUpdated,this);hls.off(Events$1.FRAG_BUFFERED,this.onFragBuffered,this);}onHandlerDestroying(){this._unregisterListeners();super.onHandlerDestroying();}startLoad(startPosition){if(this.levels){const{lastCurrentTime,hls}=this;this.stopLoad();this.setInterval(TICK_INTERVAL);this.level=-1;if(!this.startFragRequested){// determine load level
let startLevel=hls.startLevel;if(startLevel===-1){if(hls.config.testBandwidth&&this.levels.length>1){// -1 : guess start Level by doing a bitrate test by loading first fragment of lowest quality level
startLevel=0;this.bitrateTest=true;}else {startLevel=hls.firstAutoLevel;}}// set new level to playlist loader : this will trigger start level load
// hls.nextLoadLevel remains until it is set to a new value or until a new frag is successfully loaded
hls.nextLoadLevel=startLevel;this.level=hls.loadLevel;this.loadedmetadata=false;}// if startPosition undefined but lastCurrentTime set, set startPosition to last currentTime
if(lastCurrentTime>0&&startPosition===-1){this.log(`Override startPosition with lastCurrentTime @${lastCurrentTime.toFixed(3)}`);startPosition=lastCurrentTime;}this.state=State.IDLE;this.nextLoadPosition=this.startPosition=this.lastCurrentTime=startPosition;this.tick();}else {this._forceStartLoad=true;this.state=State.STOPPED;}}stopLoad(){this._forceStartLoad=false;super.stopLoad();}doTick(){switch(this.state){case State.WAITING_LEVEL:{const{levels,level}=this;const currentLevel=levels==null?void 0:levels[level];const details=currentLevel==null?void 0:currentLevel.details;if(details&&(!details.live||this.levelLastLoaded===currentLevel)){if(this.waitForCdnTuneIn(details)){break;}this.state=State.IDLE;break;}else if(this.hls.nextLoadLevel!==this.level){this.state=State.IDLE;break;}break;}case State.FRAG_LOADING_WAITING_RETRY:{var _this$media;const now=self.performance.now();const retryDate=this.retryDate;// if current time is gt than retryDate, or if media seeking let's switch to IDLE state to retry loading
if(!retryDate||now>=retryDate||(_this$media=this.media)!=null&&_this$media.seeking){const{levels,level}=this;const currentLevel=levels==null?void 0:levels[level];this.resetStartWhenNotLoaded(currentLevel||null);this.state=State.IDLE;}}break;}if(this.state===State.IDLE){this.doTickIdle();}this.onTickEnd();}onTickEnd(){super.onTickEnd();this.checkBuffer();this.checkFragmentChanged();}doTickIdle(){const{hls,levelLastLoaded,levels,media}=this;// if start level not parsed yet OR
// if video not attached AND start fragment already requested OR start frag prefetch not enabled
// exit loop, as we either need more info (level not parsed) or we need media to be attached to load new fragment
if(levelLastLoaded===null||!media&&(this.startFragRequested||!hls.config.startFragPrefetch)){return;}// If the "main" level is audio-only but we are loading an alternate track in the same group, do not load anything
if(this.altAudio&&this.audioOnly){return;}const level=hls.nextLoadLevel;if(!(levels!=null&&levels[level])){return;}const levelInfo=levels[level];// if buffer length is less than maxBufLen try to load a new fragment
const bufferInfo=this.getMainFwdBufferInfo();if(bufferInfo===null){return;}const lastDetails=this.getLevelDetails();if(lastDetails&&this._streamEnded(bufferInfo,lastDetails)){const data={};if(this.altAudio){data.type='video';}this.hls.trigger(Events$1.BUFFER_EOS,data);this.state=State.ENDED;return;}// set next load level : this will trigger a playlist load if needed
if(hls.loadLevel!==level&&hls.manualLevel===-1){this.log(`Adapting to level ${level} from level ${this.level}`);}this.level=hls.nextLoadLevel=level;const levelDetails=levelInfo.details;// if level info not retrieved yet, switch state and wait for level retrieval
// if live playlist, ensure that new playlist has been refreshed to avoid loading/try to load
// a useless and outdated fragment (that might even introduce load error if it is already out of the live playlist)
if(!levelDetails||this.state===State.WAITING_LEVEL||levelDetails.live&&this.levelLastLoaded!==levelInfo){this.level=level;this.state=State.WAITING_LEVEL;return;}const bufferLen=bufferInfo.len;// compute max Buffer Length that we could get from this load level, based on level bitrate. don't buffer more than 60 MB and more than 30s
const maxBufLen=this.getMaxBufferLength(levelInfo.maxBitrate);// Stay idle if we are still with buffer margins
if(bufferLen>=maxBufLen){return;}if(this.backtrackFragment&&this.backtrackFragment.start>bufferInfo.end){this.backtrackFragment=null;}const targetBufferTime=this.backtrackFragment?this.backtrackFragment.start:bufferInfo.end;let frag=this.getNextFragment(targetBufferTime,levelDetails);// Avoid backtracking by loading an earlier segment in streams with segments that do not start with a key frame (flagged by `couldBacktrack`)
if(this.couldBacktrack&&!this.fragPrevious&&frag&&frag.sn!=='initSegment'&&this.fragmentTracker.getState(frag)!==FragmentState.OK){var _this$backtrackFragme;const backtrackSn=((_this$backtrackFragme=this.backtrackFragment)!=null?_this$backtrackFragme:frag).sn;const fragIdx=backtrackSn-levelDetails.startSN;const backtrackFrag=levelDetails.fragments[fragIdx-1];if(backtrackFrag&&frag.cc===backtrackFrag.cc){frag=backtrackFrag;this.fragmentTracker.removeFragment(backtrackFrag);}}else if(this.backtrackFragment&&bufferInfo.len){this.backtrackFragment=null;}// Avoid loop loading by using nextLoadPosition set for backtracking and skipping consecutive GAP tags
if(frag&&this.isLoopLoading(frag,targetBufferTime)){const gapStart=frag.gap;if(!gapStart){// Cleanup the fragment tracker before trying to find the next unbuffered fragment
const type=this.audioOnly&&!this.altAudio?ElementaryStreamTypes.AUDIO:ElementaryStreamTypes.VIDEO;const mediaBuffer=(type===ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;if(mediaBuffer){this.afterBufferFlushed(mediaBuffer,type,PlaylistLevelType.MAIN);}}frag=this.getNextFragmentLoopLoading(frag,levelDetails,bufferInfo,PlaylistLevelType.MAIN,maxBufLen);}if(!frag){return;}if(frag.initSegment&&!frag.initSegment.data&&!this.bitrateTest){frag=frag.initSegment;}this.loadFragment(frag,levelInfo,targetBufferTime);}loadFragment(frag,level,targetBufferTime){// Check if fragment is not loaded
const fragState=this.fragmentTracker.getState(frag);this.fragCurrent=frag;if(fragState===FragmentState.NOT_LOADED||fragState===FragmentState.PARTIAL){if(frag.sn==='initSegment'){this._loadInitSegment(frag,level);}else if(this.bitrateTest){this.log(`Fragment ${frag.sn} of level ${frag.level} is being downloaded to test bitrate and will not be buffered`);this._loadBitrateTestFrag(frag,level);}else {this.startFragRequested=true;super.loadFragment(frag,level,targetBufferTime);}}else {this.clearTrackerIfNeeded(frag);}}getBufferedFrag(position){return this.fragmentTracker.getBufferedFrag(position,PlaylistLevelType.MAIN);}followingBufferedFrag(frag){if(frag){// try to get range of next fragment (500ms after this range)
return this.getBufferedFrag(frag.end+0.5);}return null;}/*
    on immediate level switch :
     - pause playback if playing
     - cancel any pending load request
     - and trigger a buffer flush
  */immediateLevelSwitch(){this.abortCurrentFrag();this.flushMainBuffer(0,Number.POSITIVE_INFINITY);}/**
   * try to switch ASAP without breaking video playback:
   * in order to ensure smooth but quick level switching,
   * we need to find the next flushable buffer range
   * we should take into account new segment fetch time
   */nextLevelSwitch(){const{levels,media}=this;// ensure that media is defined and that metadata are available (to retrieve currentTime)
if(media!=null&&media.readyState){let fetchdelay;const fragPlayingCurrent=this.getAppendedFrag(media.currentTime);if(fragPlayingCurrent&&fragPlayingCurrent.start>1){// flush buffer preceding current fragment (flush until current fragment start offset)
// minus 1s to avoid video freezing, that could happen if we flush keyframe of current video ...
this.flushMainBuffer(0,fragPlayingCurrent.start-1);}const levelDetails=this.getLevelDetails();if(levelDetails!=null&&levelDetails.live){const bufferInfo=this.getMainFwdBufferInfo();// Do not flush in live stream with low buffer
if(!bufferInfo||bufferInfo.len<levelDetails.targetduration*2){return;}}if(!media.paused&&levels){// add a safety delay of 1s
const nextLevelId=this.hls.nextLoadLevel;const nextLevel=levels[nextLevelId];const fragLastKbps=this.fragLastKbps;if(fragLastKbps&&this.fragCurrent){fetchdelay=this.fragCurrent.duration*nextLevel.maxBitrate/(1000*fragLastKbps)+1;}else {fetchdelay=0;}}else {fetchdelay=0;}// this.log('fetchdelay:'+fetchdelay);
// find buffer range that will be reached once new fragment will be fetched
const bufferedFrag=this.getBufferedFrag(media.currentTime+fetchdelay);if(bufferedFrag){// we can flush buffer range following this one without stalling playback
const nextBufferedFrag=this.followingBufferedFrag(bufferedFrag);if(nextBufferedFrag){// if we are here, we can also cancel any loading/demuxing in progress, as they are useless
this.abortCurrentFrag();// start flush position is in next buffered frag. Leave some padding for non-independent segments and smoother playback.
const maxStart=nextBufferedFrag.maxStartPTS?nextBufferedFrag.maxStartPTS:nextBufferedFrag.start;const fragDuration=nextBufferedFrag.duration;const startPts=Math.max(bufferedFrag.end,maxStart+Math.min(Math.max(fragDuration-this.config.maxFragLookUpTolerance,fragDuration*(this.couldBacktrack?0.5:0.125)),fragDuration*(this.couldBacktrack?0.75:0.25)));this.flushMainBuffer(startPts,Number.POSITIVE_INFINITY);}}}}abortCurrentFrag(){const fragCurrent=this.fragCurrent;this.fragCurrent=null;this.backtrackFragment=null;if(fragCurrent){fragCurrent.abortRequests();this.fragmentTracker.removeFragment(fragCurrent);}switch(this.state){case State.KEY_LOADING:case State.FRAG_LOADING:case State.FRAG_LOADING_WAITING_RETRY:case State.PARSING:case State.PARSED:this.state=State.IDLE;break;}this.nextLoadPosition=this.getLoadPosition();}flushMainBuffer(startOffset,endOffset){super.flushMainBuffer(startOffset,endOffset,this.altAudio?'video':null);}onMediaAttached(event,data){super.onMediaAttached(event,data);const media=data.media;this.onvplaying=this.onMediaPlaying.bind(this);this.onvseeked=this.onMediaSeeked.bind(this);media.addEventListener('playing',this.onvplaying);media.addEventListener('seeked',this.onvseeked);this.gapController=new GapController(this.config,media,this.fragmentTracker,this.hls);}onMediaDetaching(){const{media}=this;if(media&&this.onvplaying&&this.onvseeked){media.removeEventListener('playing',this.onvplaying);media.removeEventListener('seeked',this.onvseeked);this.onvplaying=this.onvseeked=null;this.videoBuffer=null;}this.fragPlaying=null;if(this.gapController){this.gapController.destroy();this.gapController=null;}super.onMediaDetaching();}onMediaPlaying(){// tick to speed up FRAG_CHANGED triggering
this.tick();}onMediaSeeked(){const media=this.media;const currentTime=media?media.currentTime:null;if(isFiniteNumber(currentTime)){this.log(`Media seeked to ${currentTime.toFixed(3)}`);}// If seeked was issued before buffer was appended do not tick immediately
const bufferInfo=this.getMainFwdBufferInfo();if(bufferInfo===null||bufferInfo.len===0){this.warn(`Main forward buffer length on "seeked" event ${bufferInfo?bufferInfo.len:'empty'})`);return;}// tick to speed up FRAG_CHANGED triggering
this.tick();}onManifestLoading(){// reset buffer on manifest loading
this.log('Trigger BUFFER_RESET');this.hls.trigger(Events$1.BUFFER_RESET,undefined);this.fragmentTracker.removeAllFragments();this.couldBacktrack=false;this.startPosition=this.lastCurrentTime=this.fragLastKbps=0;this.levels=this.fragPlaying=this.backtrackFragment=this.levelLastLoaded=null;this.altAudio=this.audioOnly=this.startFragRequested=false;}onManifestParsed(event,data){// detect if we have different kind of audio codecs used amongst playlists
let aac=false;let heaac=false;data.levels.forEach(level=>{const codec=level.audioCodec;if(codec){aac=aac||codec.indexOf('mp4a.40.2')!==-1;heaac=heaac||codec.indexOf('mp4a.40.5')!==-1;}});this.audioCodecSwitch=aac&&heaac&&!changeTypeSupported();if(this.audioCodecSwitch){this.log('Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC');}this.levels=data.levels;this.startFragRequested=false;}onLevelLoading(event,data){const{levels}=this;if(!levels||this.state!==State.IDLE){return;}const level=levels[data.level];if(!level.details||level.details.live&&this.levelLastLoaded!==level||this.waitForCdnTuneIn(level.details)){this.state=State.WAITING_LEVEL;}}onLevelLoaded(event,data){var _curLevel$details;const{levels}=this;const newLevelId=data.level;const newDetails=data.details;const duration=newDetails.totalduration;if(!levels){this.warn(`Levels were reset while loading level ${newLevelId}`);return;}this.log(`Level ${newLevelId} loaded [${newDetails.startSN},${newDetails.endSN}]${newDetails.lastPartSn?`[part-${newDetails.lastPartSn}-${newDetails.lastPartIndex}]`:''}, cc [${newDetails.startCC}, ${newDetails.endCC}] duration:${duration}`);const curLevel=levels[newLevelId];const fragCurrent=this.fragCurrent;if(fragCurrent&&(this.state===State.FRAG_LOADING||this.state===State.FRAG_LOADING_WAITING_RETRY)){if(fragCurrent.level!==data.level&&fragCurrent.loader){this.abortCurrentFrag();}}let sliding=0;if(newDetails.live||(_curLevel$details=curLevel.details)!=null&&_curLevel$details.live){var _this$levelLastLoaded;this.checkLiveUpdate(newDetails);if(newDetails.deltaUpdateFailed){return;}sliding=this.alignPlaylists(newDetails,curLevel.details,(_this$levelLastLoaded=this.levelLastLoaded)==null?void 0:_this$levelLastLoaded.details);}// override level info
curLevel.details=newDetails;this.levelLastLoaded=curLevel;this.hls.trigger(Events$1.LEVEL_UPDATED,{details:newDetails,level:newLevelId});// only switch back to IDLE state if we were waiting for level to start downloading a new fragment
if(this.state===State.WAITING_LEVEL){if(this.waitForCdnTuneIn(newDetails)){// Wait for Low-Latency CDN Tune-in
return;}this.state=State.IDLE;}if(!this.startFragRequested){this.setStartPosition(newDetails,sliding);}else if(newDetails.live){this.synchronizeToLiveEdge(newDetails);}// trigger handler right now
this.tick();}_handleFragmentLoadProgress(data){var _frag$initSegment;const{frag,part,payload}=data;const{levels}=this;if(!levels){this.warn(`Levels were reset while fragment load was in progress. Fragment ${frag.sn} of level ${frag.level} will not be buffered`);return;}const currentLevel=levels[frag.level];const details=currentLevel.details;if(!details){this.warn(`Dropping fragment ${frag.sn} of level ${frag.level} after level details were reset`);this.fragmentTracker.removeFragment(frag);return;}const videoCodec=currentLevel.videoCodec;// time Offset is accurate if level PTS is known, or if playlist is not sliding (not live)
const accurateTimeOffset=details.PTSKnown||!details.live;const initSegmentData=(_frag$initSegment=frag.initSegment)==null?void 0:_frag$initSegment.data;const audioCodec=this._getAudioCodec(currentLevel);// transmux the MPEG-TS data to ISO-BMFF segments
// this.log(`Transmuxing ${frag.sn} of [${details.startSN} ,${details.endSN}],level ${frag.level}, cc ${frag.cc}`);
const transmuxer=this.transmuxer=this.transmuxer||new TransmuxerInterface(this.hls,PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this));const partIndex=part?part.index:-1;const partial=partIndex!==-1;const chunkMeta=new ChunkMetadata(frag.level,frag.sn,frag.stats.chunkCount,payload.byteLength,partIndex,partial);const initPTS=this.initPTS[frag.cc];transmuxer.push(payload,initSegmentData,audioCodec,videoCodec,frag,part,details.totalduration,accurateTimeOffset,chunkMeta,initPTS);}onAudioTrackSwitching(event,data){// if any URL found on new audio track, it is an alternate audio track
const fromAltAudio=this.altAudio;const altAudio=!!data.url;// if we switch on main audio, ensure that main fragment scheduling is synced with media.buffered
// don't do anything if we switch to alt audio: audio stream controller is handling it.
// we will just have to change buffer scheduling on audioTrackSwitched
if(!altAudio){if(this.mediaBuffer!==this.media){this.log('Switching on main audio, use media.buffered to schedule main fragment loading');this.mediaBuffer=this.media;const fragCurrent=this.fragCurrent;// we need to refill audio buffer from main: cancel any frag loading to speed up audio switch
if(fragCurrent){this.log('Switching to main audio track, cancel main fragment load');fragCurrent.abortRequests();this.fragmentTracker.removeFragment(fragCurrent);}// destroy transmuxer to force init segment generation (following audio switch)
this.resetTransmuxer();// switch to IDLE state to load new fragment
this.resetLoadingState();}else if(this.audioOnly){// Reset audio transmuxer so when switching back to main audio we're not still appending where we left off
this.resetTransmuxer();}const hls=this.hls;// If switching from alt to main audio, flush all audio and trigger track switched
if(fromAltAudio){hls.trigger(Events$1.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});this.fragmentTracker.removeAllFragments();}hls.trigger(Events$1.AUDIO_TRACK_SWITCHED,data);}}onAudioTrackSwitched(event,data){const trackId=data.id;const altAudio=!!this.hls.audioTracks[trackId].url;if(altAudio){const videoBuffer=this.videoBuffer;// if we switched on alternate audio, ensure that main fragment scheduling is synced with video sourcebuffer buffered
if(videoBuffer&&this.mediaBuffer!==videoBuffer){this.log('Switching on alternate audio, use video.buffered to schedule main fragment loading');this.mediaBuffer=videoBuffer;}}this.altAudio=altAudio;this.tick();}onBufferCreated(event,data){const tracks=data.tracks;let mediaTrack;let name;let alternate=false;for(const type in tracks){const track=tracks[type];if(track.id==='main'){name=type;mediaTrack=track;// keep video source buffer reference
if(type==='video'){const videoTrack=tracks[type];if(videoTrack){this.videoBuffer=videoTrack.buffer;}}}else {alternate=true;}}if(alternate&&mediaTrack){this.log(`Alternate track found, use ${name}.buffered to schedule main fragment loading`);this.mediaBuffer=mediaTrack.buffer;}else {this.mediaBuffer=this.media;}}onFragBuffered(event,data){const{frag,part}=data;if(frag&&frag.type!==PlaylistLevelType.MAIN){return;}if(this.fragContextChanged(frag)){// If a level switch was requested while a fragment was buffering, it will emit the FRAG_BUFFERED event upon completion
// Avoid setting state back to IDLE, since that will interfere with a level switch
this.warn(`Fragment ${frag.sn}${part?' p: '+part.index:''} of level ${frag.level} finished buffering, but was aborted. state: ${this.state}`);if(this.state===State.PARSED){this.state=State.IDLE;}return;}const stats=part?part.stats:frag.stats;this.fragLastKbps=Math.round(8*stats.total/(stats.buffering.end-stats.loading.first));if(frag.sn!=='initSegment'){this.fragPrevious=frag;}this.fragBufferedComplete(frag,part);}onError(event,data){var _data$context;if(data.fatal){this.state=State.ERROR;return;}switch(data.details){case ErrorDetails.FRAG_GAP:case ErrorDetails.FRAG_PARSING_ERROR:case ErrorDetails.FRAG_DECRYPT_ERROR:case ErrorDetails.FRAG_LOAD_ERROR:case ErrorDetails.FRAG_LOAD_TIMEOUT:case ErrorDetails.KEY_LOAD_ERROR:case ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(PlaylistLevelType.MAIN,data);break;case ErrorDetails.LEVEL_LOAD_ERROR:case ErrorDetails.LEVEL_LOAD_TIMEOUT:case ErrorDetails.LEVEL_PARSING_ERROR:// in case of non fatal error while loading level, if level controller is not retrying to load level, switch back to IDLE
if(!data.levelRetry&&this.state===State.WAITING_LEVEL&&((_data$context=data.context)==null?void 0:_data$context.type)===PlaylistContextType.LEVEL){this.state=State.IDLE;}break;case ErrorDetails.BUFFER_APPEND_ERROR:case ErrorDetails.BUFFER_FULL_ERROR:if(!data.parent||data.parent!=='main'){return;}if(data.details===ErrorDetails.BUFFER_APPEND_ERROR){this.resetLoadingState();return;}if(this.reduceLengthAndFlushBuffer(data)){this.flushMainBuffer(0,Number.POSITIVE_INFINITY);}break;case ErrorDetails.INTERNAL_EXCEPTION:this.recoverWorkerError(data);break;}}// Checks the health of the buffer and attempts to resolve playback stalls.
checkBuffer(){const{media,gapController}=this;if(!media||!gapController||!media.readyState){// Exit early if we don't have media or if the media hasn't buffered anything yet (readyState 0)
return;}if(this.loadedmetadata||!BufferHelper.getBuffered(media).length){// Resolve gaps using the main buffer, whose ranges are the intersections of the A/V sourcebuffers
const activeFrag=this.state!==State.IDLE?this.fragCurrent:null;gapController.poll(this.lastCurrentTime,activeFrag);}this.lastCurrentTime=media.currentTime;}onFragLoadEmergencyAborted(){this.state=State.IDLE;// if loadedmetadata is not set, it means that we are emergency switch down on first frag
// in that case, reset startFragRequested flag
if(!this.loadedmetadata){this.startFragRequested=false;this.nextLoadPosition=this.startPosition;}this.tickImmediate();}onBufferFlushed(event,{type}){if(type!==ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){const mediaBuffer=(type===ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(mediaBuffer,type,PlaylistLevelType.MAIN);this.tick();}}onLevelsUpdated(event,data){if(this.level>-1&&this.fragCurrent){this.level=this.fragCurrent.level;}this.levels=data.levels;}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap;}/**
   * Seeks to the set startPosition if not equal to the mediaElement's current time.
   */seekToStartPos(){const{media}=this;if(!media){return;}const currentTime=media.currentTime;let startPosition=this.startPosition;// only adjust currentTime if different from startPosition or if startPosition not buffered
// at that stage, there should be only one buffered range, as we reach that code after first fragment has been buffered
if(startPosition>=0&&currentTime<startPosition){if(media.seeking){this.log(`could not seek to ${startPosition}, already seeking at ${currentTime}`);return;}const buffered=BufferHelper.getBuffered(media);const bufferStart=buffered.length?buffered.start(0):0;const delta=bufferStart-startPosition;if(delta>0&&(delta<this.config.maxBufferHole||delta<this.config.maxFragLookUpTolerance)){this.log(`adjusting start position by ${delta} to match buffer start`);startPosition+=delta;this.startPosition=startPosition;}this.log(`seek to target start position ${startPosition} from current time ${currentTime}`);media.currentTime=startPosition;}}_getAudioCodec(currentLevel){let audioCodec=this.config.defaultAudioCodec||currentLevel.audioCodec;if(this.audioCodecSwap&&audioCodec){this.log('Swapping audio codec');if(audioCodec.indexOf('mp4a.40.5')!==-1){audioCodec='mp4a.40.2';}else {audioCodec='mp4a.40.5';}}return audioCodec;}_loadBitrateTestFrag(frag,level){frag.bitrateTest=true;this._doFragLoad(frag,level).then(data=>{const{hls}=this;if(!data||this.fragContextChanged(frag)){return;}level.fragmentError=0;this.state=State.IDLE;this.startFragRequested=false;this.bitrateTest=false;const stats=frag.stats;// Bitrate tests fragments are neither parsed nor buffered
stats.parsing.start=stats.parsing.end=stats.buffering.start=stats.buffering.end=self.performance.now();hls.trigger(Events$1.FRAG_LOADED,data);frag.bitrateTest=false;});}_handleTransmuxComplete(transmuxResult){var _id3$samples;const id='main';const{hls}=this;const{remuxResult,chunkMeta}=transmuxResult;const context=this.getCurrentContext(chunkMeta);if(!context){this.resetWhenMissingContext(chunkMeta);return;}const{frag,part,level}=context;const{video,text,id3,initSegment}=remuxResult;const{details}=level;// The audio-stream-controller handles audio buffering if Hls.js is playing an alternate audio track
const audio=this.altAudio?undefined:remuxResult.audio;// Check if the current fragment has been aborted. We check this by first seeing if we're still playing the current level.
// If we are, subsequently check if the currently loading fragment (fragCurrent) has changed.
if(this.fragContextChanged(frag)){this.fragmentTracker.removeFragment(frag);return;}this.state=State.PARSING;if(initSegment){if(initSegment!=null&&initSegment.tracks){const mapFragment=frag.initSegment||frag;this._bufferInitSegment(level,initSegment.tracks,mapFragment,chunkMeta);hls.trigger(Events$1.FRAG_PARSING_INIT_SEGMENT,{frag:mapFragment,id,tracks:initSegment.tracks});}// This would be nice if Number.isFinite acted as a typeguard, but it doesn't. See: https://github.com/Microsoft/TypeScript/issues/10038
const initPTS=initSegment.initPTS;const timescale=initSegment.timescale;if(isFiniteNumber(initPTS)){this.initPTS[frag.cc]={baseTime:initPTS,timescale};hls.trigger(Events$1.INIT_PTS_FOUND,{frag,id,initPTS,timescale});}}// Avoid buffering if backtracking this fragment
if(video&&details&&frag.sn!=='initSegment'){const prevFrag=details.fragments[frag.sn-1-details.startSN];const isFirstFragment=frag.sn===details.startSN;const isFirstInDiscontinuity=!prevFrag||frag.cc>prevFrag.cc;if(remuxResult.independent!==false){const{startPTS,endPTS,startDTS,endDTS}=video;if(part){part.elementaryStreams[video.type]={startPTS,endPTS,startDTS,endDTS};}else {if(video.firstKeyFrame&&video.independent&&chunkMeta.id===1&&!isFirstInDiscontinuity){this.couldBacktrack=true;}if(video.dropped&&video.independent){// Backtrack if dropped frames create a gap after currentTime
const bufferInfo=this.getMainFwdBufferInfo();const targetBufferTime=(bufferInfo?bufferInfo.end:this.getLoadPosition())+this.config.maxBufferHole;const startTime=video.firstKeyFramePTS?video.firstKeyFramePTS:startPTS;if(!isFirstFragment&&targetBufferTime<startTime-this.config.maxBufferHole&&!isFirstInDiscontinuity){this.backtrack(frag);return;}else if(isFirstInDiscontinuity){// Mark segment with a gap to avoid loop loading
frag.gap=true;}// Set video stream start to fragment start so that truncated samples do not distort the timeline, and mark it partial
frag.setElementaryStreamInfo(video.type,frag.start,endPTS,frag.start,endDTS,true);}else if(isFirstFragment&&startPTS>MAX_START_GAP_JUMP){// Mark segment with a gap to skip large start gap
frag.gap=true;}}frag.setElementaryStreamInfo(video.type,startPTS,endPTS,startDTS,endDTS);if(this.backtrackFragment){this.backtrackFragment=frag;}this.bufferFragmentData(video,frag,part,chunkMeta,isFirstFragment||isFirstInDiscontinuity);}else if(isFirstFragment||isFirstInDiscontinuity){// Mark segment with a gap to avoid loop loading
frag.gap=true;}else {this.backtrack(frag);return;}}if(audio){const{startPTS,endPTS,startDTS,endDTS}=audio;if(part){part.elementaryStreams[ElementaryStreamTypes.AUDIO]={startPTS,endPTS,startDTS,endDTS};}frag.setElementaryStreamInfo(ElementaryStreamTypes.AUDIO,startPTS,endPTS,startDTS,endDTS);this.bufferFragmentData(audio,frag,part,chunkMeta);}if(details&&id3!=null&&(_id3$samples=id3.samples)!=null&&_id3$samples.length){const emittedID3={id,frag,details,samples:id3.samples};hls.trigger(Events$1.FRAG_PARSING_METADATA,emittedID3);}if(details&&text){const emittedText={id,frag,details,samples:text.samples};hls.trigger(Events$1.FRAG_PARSING_USERDATA,emittedText);}}_bufferInitSegment(currentLevel,tracks,frag,chunkMeta){if(this.state!==State.PARSING){return;}this.audioOnly=!!tracks.audio&&!tracks.video;// if audio track is expected to come from audio stream controller, discard any coming from main
if(this.altAudio&&!this.audioOnly){delete tracks.audio;}// include levelCodec in audio and video tracks
const{audio,video,audiovideo}=tracks;if(audio){let audioCodec=currentLevel.audioCodec;const ua=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){if(audioCodec){if(audioCodec.indexOf('mp4a.40.5')!==-1){audioCodec='mp4a.40.2';}else {audioCodec='mp4a.40.5';}}// In the case that AAC and HE-AAC audio codecs are signalled in manifest,
// force HE-AAC, as it seems that most browsers prefers it.
// don't force HE-AAC if mono stream, or in Firefox
if(audio.metadata.channelCount!==1&&ua.indexOf('firefox')===-1){audioCodec='mp4a.40.5';}}// HE-AAC is broken on Android, always signal audio codec as AAC even if variant manifest states otherwise
if(audioCodec&&audioCodec.indexOf('mp4a.40.5')!==-1&&ua.indexOf('android')!==-1&&audio.container!=='audio/mpeg'){// Exclude mpeg audio
audioCodec='mp4a.40.2';this.log(`Android: force audio codec to ${audioCodec}`);}if(currentLevel.audioCodec&&currentLevel.audioCodec!==audioCodec){this.log(`Swapping manifest audio codec "${currentLevel.audioCodec}" for "${audioCodec}"`);}audio.levelCodec=audioCodec;audio.id='main';this.log(`Init audio buffer, container:${audio.container}, codecs[selected/level/parsed]=[${audioCodec||''}/${currentLevel.audioCodec||''}/${audio.codec}]`);}if(video){video.levelCodec=currentLevel.videoCodec;video.id='main';this.log(`Init video buffer, container:${video.container}, codecs[level/parsed]=[${currentLevel.videoCodec||''}/${video.codec}]`);}if(audiovideo){this.log(`Init audiovideo buffer, container:${audiovideo.container}, codecs[level/parsed]=[${currentLevel.codecs}/${audiovideo.codec}]`);}this.hls.trigger(Events$1.BUFFER_CODECS,tracks);// loop through tracks that are going to be provided to bufferController
Object.keys(tracks).forEach(trackName=>{const track=tracks[trackName];const initSegment=track.initSegment;if(initSegment!=null&&initSegment.byteLength){this.hls.trigger(Events$1.BUFFER_APPENDING,{type:trackName,data:initSegment,frag,part:null,chunkMeta,parent:frag.type});}});// trigger handler right now
this.tickImmediate();}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,PlaylistLevelType.MAIN);}backtrack(frag){this.couldBacktrack=true;// Causes findFragments to backtrack through fragments to find the keyframe
this.backtrackFragment=frag;this.resetTransmuxer();this.flushBufferGap(frag);this.fragmentTracker.removeFragment(frag);this.fragPrevious=null;this.nextLoadPosition=frag.start;this.state=State.IDLE;}checkFragmentChanged(){const video=this.media;let fragPlayingCurrent=null;if(video&&video.readyState>1&&video.seeking===false){const currentTime=video.currentTime;/* if video element is in seeked state, currentTime can only increase.
        (assuming that playback rate is positive ...)
        As sometimes currentTime jumps back to zero after a
        media decode error, check this, to avoid seeking back to
        wrong position after a media decode error
      */if(BufferHelper.isBuffered(video,currentTime)){fragPlayingCurrent=this.getAppendedFrag(currentTime);}else if(BufferHelper.isBuffered(video,currentTime+0.1)){/* ensure that FRAG_CHANGED event is triggered at startup,
          when first video frame is displayed and playback is paused.
          add a tolerance of 100ms, in case current position is not buffered,
          check if current pos+100ms is buffered and use that buffer range
          for FRAG_CHANGED event reporting */fragPlayingCurrent=this.getAppendedFrag(currentTime+0.1);}if(fragPlayingCurrent){this.backtrackFragment=null;const fragPlaying=this.fragPlaying;const fragCurrentLevel=fragPlayingCurrent.level;if(!fragPlaying||fragPlayingCurrent.sn!==fragPlaying.sn||fragPlaying.level!==fragCurrentLevel){this.fragPlaying=fragPlayingCurrent;this.hls.trigger(Events$1.FRAG_CHANGED,{frag:fragPlayingCurrent});if(!fragPlaying||fragPlaying.level!==fragCurrentLevel){this.hls.trigger(Events$1.LEVEL_SWITCHED,{level:fragCurrentLevel});}}}}}get nextLevel(){const frag=this.nextBufferedFrag;if(frag){return frag.level;}return -1;}get currentFrag(){const media=this.media;if(media){return this.fragPlaying||this.getAppendedFrag(media.currentTime);}return null;}get currentProgramDateTime(){const media=this.media;if(media){const currentTime=media.currentTime;const frag=this.currentFrag;if(frag&&isFiniteNumber(currentTime)&&isFiniteNumber(frag.programDateTime)){const epocMs=frag.programDateTime+(currentTime-frag.start)*1000;return new Date(epocMs);}}return null;}get currentLevel(){const frag=this.currentFrag;if(frag){return frag.level;}return -1;}get nextBufferedFrag(){const frag=this.currentFrag;if(frag){return this.followingBufferedFrag(frag);}return null;}get forceStartLoad(){return this._forceStartLoad;}}/**
 * The `Hls` class is the core of the HLS.js library used to instantiate player instances.
 * @public
 */class Hls{/**
   * Get the video-dev/hls.js package version.
   */static get version(){return "1.5.9";}/**
   * Check if the required MediaSource Extensions are available.
   */static isMSESupported(){return isMSESupported();}/**
   * Check if MediaSource Extensions are available and isTypeSupported checks pass for any baseline codecs.
   */static isSupported(){return isSupported();}/**
   * Get the MediaSource global used for MSE playback (ManagedMediaSource, MediaSource, or WebKitMediaSource).
   */static getMediaSource(){return getMediaSource();}static get Events(){return Events$1;}static get ErrorTypes(){return ErrorTypes;}static get ErrorDetails(){return ErrorDetails;}/**
   * Get the default configuration applied to new instances.
   */static get DefaultConfig(){if(!Hls.defaultConfig){return hlsDefaultConfig;}return Hls.defaultConfig;}/**
   * Replace the default configuration applied to new instances.
   */static set DefaultConfig(defaultConfig){Hls.defaultConfig=defaultConfig;}/**
   * Creates an instance of an HLS client that can attach to exactly one `HTMLMediaElement`.
   * @param userConfig - Configuration options applied over `Hls.DefaultConfig`
   */constructor(userConfig={}){/**
     * The runtime configuration used by the player. At instantiation this is combination of `hls.userConfig` merged over `Hls.DefaultConfig`.
     */this.config=void 0;/**
     * The configuration object provided on player instantiation.
     */this.userConfig=void 0;this.coreComponents=void 0;this.networkControllers=void 0;this.started=false;this._emitter=new EventEmitter$1();this._autoLevelCapping=-1;this._maxHdcpLevel=null;this.abrController=void 0;this.bufferController=void 0;this.capLevelController=void 0;this.latencyController=void 0;this.levelController=void 0;this.streamController=void 0;this.audioTrackController=void 0;this.subtitleTrackController=void 0;this.emeController=void 0;this.cmcdController=void 0;this._media=null;this.url=null;this.triggeringException=void 0;enableLogs(userConfig.debug||false,'Hls instance');const config=this.config=mergeConfig(Hls.DefaultConfig,userConfig);this.userConfig=userConfig;if(config.progressive){enableStreamingMode(config);}// core controllers and network loaders
const{abrController:ConfigAbrController,bufferController:ConfigBufferController,capLevelController:ConfigCapLevelController,errorController:ConfigErrorController,fpsController:ConfigFpsController}=config;const errorController=new ConfigErrorController(this);const abrController=this.abrController=new ConfigAbrController(this);const bufferController=this.bufferController=new ConfigBufferController(this);const capLevelController=this.capLevelController=new ConfigCapLevelController(this);const fpsController=new ConfigFpsController(this);const playListLoader=new PlaylistLoader(this);const id3TrackController=new ID3TrackController(this);const ConfigContentSteeringController=config.contentSteeringController;// ConentSteeringController is defined before LevelController to receive Multivariant Playlist events first
const contentSteering=ConfigContentSteeringController?new ConfigContentSteeringController(this):null;const levelController=this.levelController=new LevelController(this,contentSteering);// FragmentTracker must be defined before StreamController because the order of event handling is important
const fragmentTracker=new FragmentTracker(this);const keyLoader=new KeyLoader(this.config);const streamController=this.streamController=new StreamController(this,fragmentTracker,keyLoader);// Cap level controller uses streamController to flush the buffer
capLevelController.setStreamController(streamController);// fpsController uses streamController to switch when frames are being dropped
fpsController.setStreamController(streamController);const networkControllers=[playListLoader,levelController,streamController];if(contentSteering){networkControllers.splice(1,0,contentSteering);}this.networkControllers=networkControllers;const coreComponents=[abrController,bufferController,capLevelController,fpsController,id3TrackController,fragmentTracker];this.audioTrackController=this.createController(config.audioTrackController,networkControllers);const AudioStreamControllerClass=config.audioStreamController;if(AudioStreamControllerClass){networkControllers.push(new AudioStreamControllerClass(this,fragmentTracker,keyLoader));}// subtitleTrackController must be defined before subtitleStreamController because the order of event handling is important
this.subtitleTrackController=this.createController(config.subtitleTrackController,networkControllers);const SubtitleStreamControllerClass=config.subtitleStreamController;if(SubtitleStreamControllerClass){networkControllers.push(new SubtitleStreamControllerClass(this,fragmentTracker,keyLoader));}this.createController(config.timelineController,coreComponents);keyLoader.emeController=this.emeController=this.createController(config.emeController,coreComponents);this.cmcdController=this.createController(config.cmcdController,coreComponents);this.latencyController=this.createController(LatencyController,coreComponents);this.coreComponents=coreComponents;// Error controller handles errors before and after all other controllers
// This listener will be invoked after all other controllers error listeners
networkControllers.push(errorController);const onErrorOut=errorController.onErrorOut;if(typeof onErrorOut==='function'){this.on(Events$1.ERROR,onErrorOut,errorController);}}createController(ControllerClass,components){if(ControllerClass){const controllerInstance=new ControllerClass(this);if(components){components.push(controllerInstance);}return controllerInstance;}return null;}// Delegate the EventEmitter through the public API of Hls.js
on(event,listener,context=this){this._emitter.on(event,listener,context);}once(event,listener,context=this){this._emitter.once(event,listener,context);}removeAllListeners(event){this._emitter.removeAllListeners(event);}off(event,listener,context=this,once){this._emitter.off(event,listener,context,once);}listeners(event){return this._emitter.listeners(event);}emit(event,name,eventObject){return this._emitter.emit(event,name,eventObject);}trigger(event,eventObject){if(this.config.debug){return this.emit(event,event,eventObject);}else {try{return this.emit(event,event,eventObject);}catch(error){logger.error('An internal error happened while handling event '+event+'. Error message: "'+error.message+'". Here is a stacktrace:',error);// Prevent recursion in error event handlers that throw #5497
if(!this.triggeringException){this.triggeringException=true;const fatal=event===Events$1.ERROR;this.trigger(Events$1.ERROR,{type:ErrorTypes.OTHER_ERROR,details:ErrorDetails.INTERNAL_EXCEPTION,fatal,event,error});this.triggeringException=false;}}}return false;}listenerCount(event){return this._emitter.listenerCount(event);}/**
   * Dispose of the instance
   */destroy(){logger.log('destroy');this.trigger(Events$1.DESTROYING,undefined);this.detachMedia();this.removeAllListeners();this._autoLevelCapping=-1;this.url=null;this.networkControllers.forEach(component=>component.destroy());this.networkControllers.length=0;this.coreComponents.forEach(component=>component.destroy());this.coreComponents.length=0;// Remove any references that could be held in config options or callbacks
const config=this.config;config.xhrSetup=config.fetchSetup=undefined;// @ts-ignore
this.userConfig=null;}/**
   * Attaches Hls.js to a media element
   */attachMedia(media){logger.log('attachMedia');this._media=media;this.trigger(Events$1.MEDIA_ATTACHING,{media:media});}/**
   * Detach Hls.js from the media
   */detachMedia(){logger.log('detachMedia');this.trigger(Events$1.MEDIA_DETACHING,undefined);this._media=null;}/**
   * Set the source URL. Can be relative or absolute.
   */loadSource(url){this.stopLoad();const media=this.media;const loadedSource=this.url;const loadingSource=this.url=urlToolkitExports.buildAbsoluteURL(self.location.href,url,{alwaysNormalize:true});this._autoLevelCapping=-1;this._maxHdcpLevel=null;logger.log(`loadSource:${loadingSource}`);if(media&&loadedSource&&(loadedSource!==loadingSource||this.bufferController.hasSourceTypes())){this.detachMedia();this.attachMedia(media);}// when attaching to a source URL, trigger a playlist load
this.trigger(Events$1.MANIFEST_LOADING,{url:url});}/**
   * Start loading data from the stream source.
   * Depending on default config, client starts loading automatically when a source is set.
   *
   * @param startPosition - Set the start position to stream from.
   * Defaults to -1 (None: starts from earliest point)
   */startLoad(startPosition=-1){logger.log(`startLoad(${startPosition})`);this.started=true;this.networkControllers.forEach(controller=>{controller.startLoad(startPosition);});}/**
   * Stop loading of any stream data.
   */stopLoad(){logger.log('stopLoad');this.started=false;this.networkControllers.forEach(controller=>{controller.stopLoad();});}/**
   * Resumes stream controller segment loading if previously started.
   */resumeBuffering(){if(this.started){this.networkControllers.forEach(controller=>{if('fragmentLoader'in controller){controller.startLoad(-1);}});}}/**
   * Stops stream controller segment loading without changing 'started' state like stopLoad().
   * This allows for media buffering to be paused without interupting playlist loading.
   */pauseBuffering(){this.networkControllers.forEach(controller=>{if('fragmentLoader'in controller){controller.stopLoad();}});}/**
   * Swap through possible audio codecs in the stream (for example to switch from stereo to 5.1)
   */swapAudioCodec(){logger.log('swapAudioCodec');this.streamController.swapAudioCodec();}/**
   * When the media-element fails, this allows to detach and then re-attach it
   * as one call (convenience method).
   *
   * Automatic recovery of media-errors by this process is configurable.
   */recoverMediaError(){logger.log('recoverMediaError');const media=this._media;this.detachMedia();if(media){this.attachMedia(media);}}removeLevel(levelIndex){this.levelController.removeLevel(levelIndex);}/**
   * @returns an array of levels (variants) sorted by HDCP-LEVEL, RESOLUTION (height), FRAME-RATE, CODECS, VIDEO-RANGE, and BANDWIDTH
   */get levels(){const levels=this.levelController.levels;return levels?levels:[];}/**
   * Index of quality level (variant) currently played
   */get currentLevel(){return this.streamController.currentLevel;}/**
   * Set quality level index immediately. This will flush the current buffer to replace the quality asap. That means playback will interrupt at least shortly to re-buffer and re-sync eventually. Set to -1 for automatic level selection.
   */set currentLevel(newLevel){logger.log(`set currentLevel:${newLevel}`);this.levelController.manualLevel=newLevel;this.streamController.immediateLevelSwitch();}/**
   * Index of next quality level loaded as scheduled by stream controller.
   */get nextLevel(){return this.streamController.nextLevel;}/**
   * Set quality level index for next loaded data.
   * This will switch the video quality asap, without interrupting playback.
   * May abort current loading of data, and flush parts of buffer (outside currently played fragment region).
   * @param newLevel - Pass -1 for automatic level selection
   */set nextLevel(newLevel){logger.log(`set nextLevel:${newLevel}`);this.levelController.manualLevel=newLevel;this.streamController.nextLevelSwitch();}/**
   * Return the quality level of the currently or last (of none is loaded currently) segment
   */get loadLevel(){return this.levelController.level;}/**
   * Set quality level index for next loaded data in a conservative way.
   * This will switch the quality without flushing, but interrupt current loading.
   * Thus the moment when the quality switch will appear in effect will only be after the already existing buffer.
   * @param newLevel - Pass -1 for automatic level selection
   */set loadLevel(newLevel){logger.log(`set loadLevel:${newLevel}`);this.levelController.manualLevel=newLevel;}/**
   * get next quality level loaded
   */get nextLoadLevel(){return this.levelController.nextLoadLevel;}/**
   * Set quality level of next loaded segment in a fully "non-destructive" way.
   * Same as `loadLevel` but will wait for next switch (until current loading is done).
   */set nextLoadLevel(level){this.levelController.nextLoadLevel=level;}/**
   * Return "first level": like a default level, if not set,
   * falls back to index of first level referenced in manifest
   */get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel);}/**
   * Sets "first-level", see getter.
   */set firstLevel(newLevel){logger.log(`set firstLevel:${newLevel}`);this.levelController.firstLevel=newLevel;}/**
   * Return the desired start level for the first fragment that will be loaded.
   * The default value of -1 indicates automatic start level selection.
   * Setting hls.nextAutoLevel without setting a startLevel will result in
   * the nextAutoLevel value being used for one fragment load.
   */get startLevel(){const startLevel=this.levelController.startLevel;if(startLevel===-1&&this.abrController.forcedAutoLevel>-1){return this.abrController.forcedAutoLevel;}return startLevel;}/**
   * set  start level (level of first fragment that will be played back)
   * if not overrided by user, first level appearing in manifest will be used as start level
   * if -1 : automatic start level selection, playback will start from level matching download bandwidth
   * (determined from download of first segment)
   */set startLevel(newLevel){logger.log(`set startLevel:${newLevel}`);// if not in automatic start level detection, ensure startLevel is greater than minAutoLevel
if(newLevel!==-1){newLevel=Math.max(newLevel,this.minAutoLevel);}this.levelController.startLevel=newLevel;}/**
   * Whether level capping is enabled.
   * Default value is set via `config.capLevelToPlayerSize`.
   */get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize;}/**
   * Enables or disables level capping. If disabled after previously enabled, `nextLevelSwitch` will be immediately called.
   */set capLevelToPlayerSize(shouldStartCapping){const newCapLevelToPlayerSize=!!shouldStartCapping;if(newCapLevelToPlayerSize!==this.config.capLevelToPlayerSize){if(newCapLevelToPlayerSize){this.capLevelController.startCapping();// If capping occurs, nextLevelSwitch will happen based on size.
}else {this.capLevelController.stopCapping();this.autoLevelCapping=-1;this.streamController.nextLevelSwitch();// Now we're uncapped, get the next level asap.
}this.config.capLevelToPlayerSize=newCapLevelToPlayerSize;}}/**
   * Capping/max level value that should be used by automatic level selection algorithm (`ABRController`)
   */get autoLevelCapping(){return this._autoLevelCapping;}/**
   * Returns the current bandwidth estimate in bits per second, when available. Otherwise, `NaN` is returned.
   */get bandwidthEstimate(){const{bwEstimator}=this.abrController;if(!bwEstimator){return NaN;}return bwEstimator.getEstimate();}set bandwidthEstimate(abrEwmaDefaultEstimate){this.abrController.resetEstimator(abrEwmaDefaultEstimate);}/**
   * get time to first byte estimate
   * @type {number}
   */get ttfbEstimate(){const{bwEstimator}=this.abrController;if(!bwEstimator){return NaN;}return bwEstimator.getEstimateTTFB();}/**
   * Capping/max level value that should be used by automatic level selection algorithm (`ABRController`)
   */set autoLevelCapping(newLevel){if(this._autoLevelCapping!==newLevel){logger.log(`set autoLevelCapping:${newLevel}`);this._autoLevelCapping=newLevel;this.levelController.checkMaxAutoUpdated();}}get maxHdcpLevel(){return this._maxHdcpLevel;}set maxHdcpLevel(value){if(isHdcpLevel(value)&&this._maxHdcpLevel!==value){this._maxHdcpLevel=value;this.levelController.checkMaxAutoUpdated();}}/**
   * True when automatic level selection enabled
   */get autoLevelEnabled(){return this.levelController.manualLevel===-1;}/**
   * Level set manually (if any)
   */get manualLevel(){return this.levelController.manualLevel;}/**
   * min level selectable in auto mode according to config.minAutoBitrate
   */get minAutoLevel(){const{levels,config:{minAutoBitrate}}=this;if(!levels)return 0;const len=levels.length;for(let i=0;i<len;i++){if(levels[i].maxBitrate>=minAutoBitrate){return i;}}return 0;}/**
   * max level selectable in auto mode according to autoLevelCapping
   */get maxAutoLevel(){const{levels,autoLevelCapping,maxHdcpLevel}=this;let maxAutoLevel;if(autoLevelCapping===-1&&levels!=null&&levels.length){maxAutoLevel=levels.length-1;}else {maxAutoLevel=autoLevelCapping;}if(maxHdcpLevel){for(let i=maxAutoLevel;i--;){const hdcpLevel=levels[i].attrs['HDCP-LEVEL'];if(hdcpLevel&&hdcpLevel<=maxHdcpLevel){return i;}}}return maxAutoLevel;}get firstAutoLevel(){return this.abrController.firstAutoLevel;}/**
   * next automatically selected quality level
   */get nextAutoLevel(){return this.abrController.nextAutoLevel;}/**
   * this setter is used to force next auto level.
   * this is useful to force a switch down in auto mode:
   * in case of load error on level N, hls.js can set nextAutoLevel to N-1 for example)
   * forced value is valid for one fragment. upon successful frag loading at forced level,
   * this value will be resetted to -1 by ABR controller.
   */set nextAutoLevel(nextLevel){this.abrController.nextAutoLevel=nextLevel;}/**
   * get the datetime value relative to media.currentTime for the active level Program Date Time if present
   */get playingDate(){return this.streamController.currentProgramDateTime;}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo();}/**
   * Find and select the best matching audio track, making a level switch when a Group change is necessary.
   * Updates `hls.config.audioPreference`. Returns the selected track, or null when no matching track is found.
   */setAudioOption(audioOption){var _this$audioTrackContr;return (_this$audioTrackContr=this.audioTrackController)==null?void 0:_this$audioTrackContr.setAudioOption(audioOption);}/**
   * Find and select the best matching subtitle track, making a level switch when a Group change is necessary.
   * Updates `hls.config.subtitlePreference`. Returns the selected track, or null when no matching track is found.
   */setSubtitleOption(subtitleOption){var _this$subtitleTrackCo;(_this$subtitleTrackCo=this.subtitleTrackController)==null?void 0:_this$subtitleTrackCo.setSubtitleOption(subtitleOption);return null;}/**
   * Get the complete list of audio tracks across all media groups
   */get allAudioTracks(){const audioTrackController=this.audioTrackController;return audioTrackController?audioTrackController.allAudioTracks:[];}/**
   * Get the list of selectable audio tracks
   */get audioTracks(){const audioTrackController=this.audioTrackController;return audioTrackController?audioTrackController.audioTracks:[];}/**
   * index of the selected audio track (index in audio track lists)
   */get audioTrack(){const audioTrackController=this.audioTrackController;return audioTrackController?audioTrackController.audioTrack:-1;}/**
   * selects an audio track, based on its index in audio track lists
   */set audioTrack(audioTrackId){const audioTrackController=this.audioTrackController;if(audioTrackController){audioTrackController.audioTrack=audioTrackId;}}/**
   * get the complete list of subtitle tracks across all media groups
   */get allSubtitleTracks(){const subtitleTrackController=this.subtitleTrackController;return subtitleTrackController?subtitleTrackController.allSubtitleTracks:[];}/**
   * get alternate subtitle tracks list from playlist
   */get subtitleTracks(){const subtitleTrackController=this.subtitleTrackController;return subtitleTrackController?subtitleTrackController.subtitleTracks:[];}/**
   * index of the selected subtitle track (index in subtitle track lists)
   */get subtitleTrack(){const subtitleTrackController=this.subtitleTrackController;return subtitleTrackController?subtitleTrackController.subtitleTrack:-1;}get media(){return this._media;}/**
   * select an subtitle track, based on its index in subtitle track lists
   */set subtitleTrack(subtitleTrackId){const subtitleTrackController=this.subtitleTrackController;if(subtitleTrackController){subtitleTrackController.subtitleTrack=subtitleTrackId;}}/**
   * Whether subtitle display is enabled or not
   */get subtitleDisplay(){const subtitleTrackController=this.subtitleTrackController;return subtitleTrackController?subtitleTrackController.subtitleDisplay:false;}/**
   * Enable/disable subtitle display rendering
   */set subtitleDisplay(value){const subtitleTrackController=this.subtitleTrackController;if(subtitleTrackController){subtitleTrackController.subtitleDisplay=value;}}/**
   * get mode for Low-Latency HLS loading
   */get lowLatencyMode(){return this.config.lowLatencyMode;}/**
   * Enable/disable Low-Latency HLS part playlist and segment loading, and start live streams at playlist PART-HOLD-BACK rather than HOLD-BACK.
   */set lowLatencyMode(mode){this.config.lowLatencyMode=mode;}/**
   * Position (in seconds) of live sync point (ie edge of live position minus safety delay defined by ```hls.config.liveSyncDuration```)
   * @returns null prior to loading live Playlist
   */get liveSyncPosition(){return this.latencyController.liveSyncPosition;}/**
   * Estimated position (in seconds) of live edge (ie edge of live playlist plus time sync playlist advanced)
   * @returns 0 before first playlist is loaded
   */get latency(){return this.latencyController.latency;}/**
   * maximum distance from the edge before the player seeks forward to ```hls.liveSyncPosition```
   * configured using ```liveMaxLatencyDurationCount``` (multiple of target duration) or ```liveMaxLatencyDuration```
   * @returns 0 before first playlist is loaded
   */get maxLatency(){return this.latencyController.maxLatency;}/**
   * target distance from the edge as calculated by the latency controller
   */get targetLatency(){return this.latencyController.targetLatency;}/**
   * the rate at which the edge of the current live playlist is advancing or 1 if there is none
   */get drift(){return this.latencyController.drift;}/**
   * set to true when startLoad is called before MANIFEST_PARSED event
   */get forceStartLoad(){return this.streamController.forceStartLoad;}}Hls.defaultConfig=void 0;

var hls = /*#__PURE__*/Object.freeze({
  __proto__: null,
  AbrController: AbrController,
  AttrList: AttrList,
  AudioStreamController: AudioStreamController,
  AudioTrackController: AudioTrackController,
  BasePlaylistController: BasePlaylistController,
  BaseSegment: BaseSegment,
  BaseStreamController: BaseStreamController,
  BufferController: BufferController,
  CMCDController: CMCDController,
  CapLevelController: CapLevelController,
  ChunkMetadata: ChunkMetadata,
  ContentSteeringController: ContentSteeringController,
  DateRange: DateRange,
  EMEController: EMEController,
  ErrorActionFlags: ErrorActionFlags,
  ErrorController: ErrorController,
  ErrorDetails: ErrorDetails,
  ErrorTypes: ErrorTypes,
  Events: Events$1,
  FPSController: FPSController,
  Fragment: Fragment,
  Hls: Hls,
  HlsSkip: HlsSkip,
  HlsUrlParameters: HlsUrlParameters,
  KeySystemFormats: KeySystemFormats,
  KeySystems: KeySystems,
  Level: Level,
  LevelDetails: LevelDetails,
  LevelKey: LevelKey,
  LoadStats: LoadStats,
  MetadataSchema: MetadataSchema,
  NetworkErrorAction: NetworkErrorAction,
  Part: Part,
  PlaylistLevelType: PlaylistLevelType,
  SubtitleStreamController: SubtitleStreamController,
  SubtitleTrackController: SubtitleTrackController,
  TimelineController: TimelineController,
  'default': Hls,
  getMediaSource: getMediaSource,
  isMSESupported: isMSESupported,
  isSupported: isSupported
});

var require$$1 = getCjsExportFromNamespace(hls);

var vueAplayer_min = createCommonjsModule(function (module, exports) {
!function (t, e) {
  module.exports = e(Vue, function () {
    try {
      return require$$1;
    } catch (t) {}
  }()) ;
}("undefined" != typeof self ? self : commonjsGlobal, function (t, e) {
  return function (t) {
    function e(a) {
      if (i[a]) return i[a].exports;
      var r = i[a] = {
        i: a,
        l: !1,
        exports: {}
      };
      return t[a].call(r.exports, r, r.exports, e), r.l = !0, r.exports;
    }
    var i = {};
    return e.m = t, e.c = i, e.d = function (t, i, a) {
      e.o(t, i) || Object.defineProperty(t, i, {
        configurable: !1,
        enumerable: !0,
        get: a
      });
    }, e.n = function (t) {
      var i = t && t.__esModule ? function () {
        return t.default;
      } : function () {
        return t;
      };
      return e.d(i, "a", i), i;
    }, e.o = function (t, e) {
      return Object.prototype.hasOwnProperty.call(t, e);
    }, e.p = "", e(e.s = 15);
  }([function (t, e, i) {

    function a(t, e, i, a, r, n, o, s) {
      t = t || {};
      var l = typeof t.default;
      "object" !== l && "function" !== l || (t = t.default);
      var u = "function" == typeof t ? t.options : t;
      e && (u.render = e, u.staticRenderFns = i, u._compiled = !0), a && (u.functional = !0), n && (u._scopeId = n);
      var c;
      if (o ? (c = function (t) {
        t = t || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, t || "undefined" == typeof __VUE_SSR_CONTEXT__ || (t = __VUE_SSR_CONTEXT__), r && r.call(this, t), t && t._registeredComponents && t._registeredComponents.add(o);
      }, u._ssrRegister = c) : r && (c = s ? function () {
        r.call(this, this.$root.$options.shadowRoot);
      } : r), c) if (u.functional) {
        u._injectStyles = c;
        var p = u.render;
        u.render = function (t, e) {
          return c.call(e), p(t, e);
        };
      } else {
        var h = u.beforeCreate;
        u.beforeCreate = h ? [].concat(h, c) : [c];
      }
      return {
        exports: t,
        options: u
      };
    }
    e.a = a;
  }, function (t, e) {
    function i(t, e) {
      var i = t[1] || "",
        r = t[3];
      if (!r) return i;
      if (e && "function" == typeof btoa) {
        var n = a(r);
        return [i].concat(r.sources.map(function (t) {
          return "/*# sourceURL=" + r.sourceRoot + t + " */";
        })).concat([n]).join("\n");
      }
      return [i].join("\n");
    }
    function a(t) {
      return "/*# sourceMappingURL=data:application/json;charset=utf-8;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(t)))) + " */";
    }
    t.exports = function (t) {
      var e = [];
      return e.toString = function () {
        return this.map(function (e) {
          var a = i(e, t);
          return e[2] ? "@media " + e[2] + "{" + a + "}" : a;
        }).join("");
      }, e.i = function (t, i) {
        "string" == typeof t && (t = [[null, t, ""]]);
        for (var a = {}, r = 0; r < this.length; r++) {
          var n = this[r][0];
          "number" == typeof n && (a[n] = !0);
        }
        for (r = 0; r < t.length; r++) {
          var o = t[r];
          "number" == typeof o[0] && a[o[0]] || (i && !o[2] ? o[2] = i : i && (o[2] = "(" + o[2] + ") and (" + i + ")"), e.push(o));
        }
      }, e;
    };
  }, function (t, e, i) {

    function a(t, e, i, a) {
      v = i, m = a || {};
      var n = Object(u.a)(t, e);
      return r(n), function (e) {
        for (var i = [], a = 0; a < n.length; a++) {
          var o = n[a],
            s = p[o.id];
          s.refs--, i.push(s);
        }
        e ? (n = Object(u.a)(t, e), r(n)) : n = [];
        for (var a = 0; a < i.length; a++) {
          var s = i[a];
          if (0 === s.refs) {
            for (var l = 0; l < s.parts.length; l++) s.parts[l]();
            delete p[s.id];
          }
        }
      };
    }
    function r(t) {
      for (var e = 0; e < t.length; e++) {
        var i = t[e],
          a = p[i.id];
        if (a) {
          a.refs++;
          for (var r = 0; r < a.parts.length; r++) a.parts[r](i.parts[r]);
          for (; r < i.parts.length; r++) a.parts.push(o(i.parts[r]));
          a.parts.length > i.parts.length && (a.parts.length = i.parts.length);
        } else {
          for (var n = [], r = 0; r < i.parts.length; r++) n.push(o(i.parts[r]));
          p[i.id] = {
            id: i.id,
            refs: 1,
            parts: n
          };
        }
      }
    }
    function n() {
      var t = document.createElement("style");
      return t.type = "text/css", h.appendChild(t), t;
    }
    function o(t) {
      var e,
        i,
        a = document.querySelector("style[" + g + '~="' + t.id + '"]');
      if (a) {
        if (v) return y;
        a.parentNode.removeChild(a);
      }
      if (b) {
        var r = f++;
        a = d || (d = n()), e = s.bind(null, a, r, !1), i = s.bind(null, a, r, !0);
      } else a = n(), e = l.bind(null, a), i = function () {
        a.parentNode.removeChild(a);
      };
      return e(t), function (a) {
        if (a) {
          if (a.css === t.css && a.media === t.media && a.sourceMap === t.sourceMap) return;
          e(t = a);
        } else i();
      };
    }
    function s(t, e, i, a) {
      var r = i ? "" : a.css;
      if (t.styleSheet) t.styleSheet.cssText = x(e, r);else {
        var n = document.createTextNode(r),
          o = t.childNodes;
        o[e] && t.removeChild(o[e]), o.length ? t.insertBefore(n, o[e]) : t.appendChild(n);
      }
    }
    function l(t, e) {
      var i = e.css,
        a = e.media,
        r = e.sourceMap;
      if (a && t.setAttribute("media", a), m.ssrId && t.setAttribute(g, e.id), r && (i += "\n/*# sourceURL=" + r.sources[0] + " */", i += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(r)))) + " */"), t.styleSheet) t.styleSheet.cssText = i;else {
        for (; t.firstChild;) t.removeChild(t.firstChild);
        t.appendChild(document.createTextNode(i));
      }
    }
    Object.defineProperty(e, "__esModule", {
      value: !0
    }), e.default = a;
    var u = i(18),
      c = "undefined" != typeof document;
    if ("undefined" != typeof DEBUG && DEBUG && !c) throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");
    var p = {},
      h = c && (document.head || document.getElementsByTagName("head")[0]),
      d = null,
      f = 0,
      v = !1,
      y = function () {},
      m = null,
      g = "data-vue-ssr-id",
      b = "undefined" != typeof navigator && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase()),
      x = function () {
        var t = [];
        return function (e, i) {
          return t[e] = i, t.filter(Boolean).join("\n");
        };
      }();
  }, function (t, e, i) {

    function a(t) {
      if (t) {
        t = t.replace(/([^\]^\n])\[/g, function (t, e) {
          return e + "\n[";
        });
        for (var e = t.split("\n"), i = [], a = e.length, r = 0; r < a; r++) {
          var n = e[r].match(/\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/g),
            o = e[r].replace(/.*\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/g, "").replace(/<(\d{2}):(\d{2})(\.(\d{2,3}))?>/g, "").replace(/^\s+|\s+$/g, "");
          if (n) for (var s = n.length, l = 0; l < s; l++) {
            var u = /\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/.exec(n[l]),
              c = 60 * u[1],
              p = parseInt(u[2]),
              h = u[4] ? parseInt(u[4]) / (2 === (u[4] + "").length ? 100 : 1e3) : 0,
              d = c + p + h;
            i.push([d, o]);
          }
        }
        return i.sort(function (t, e) {
          return t[0] - e[0];
        }), i;
      }
      return [];
    }
    function r(t, e) {
      if (t === e) return 0;
      var i = t.split(".").map(Number),
        a = u(i, 3),
        r = a[0],
        n = a[1],
        o = a[2],
        s = e.split(".").map(Number),
        l = u(s, 3),
        c = l[0],
        p = l[1],
        h = l[2];
      if (r > c) return 1;
      if (r === c) {
        if (n > p) return 1;
        if (n === p && o > h) return 1;
      }
      return -1;
    }
    function n(t) {
      return console.warn("[Vue-APlayer] " + t);
    }
    function o(t, e, i) {
      return n("'" + t + "' is deprecated since v" + e + ", and will be removed in future releases, use '" + i + "' instead");
    }
    function s(t) {
      for (var e = t.offsetLeft, i = t.offsetParent, a = void 0; null !== i;) e += i.offsetLeft, i = i.offsetParent;
      return a = document.body.scrollLeft + document.documentElement.scrollLeft, e - a;
    }
    function l(t) {
      for (var e = t.offsetTop, i = t.offsetParent, a = void 0; null !== i;) e += i.offsetTop, i = i.offsetParent;
      return a = document.body.scrollTop + document.documentElement.scrollTop, e - a;
    }
    e.d = a, e.e = r, e.f = n, e.a = o, e.b = s, e.c = l;
    var u = function () {
      function t(t, e) {
        var i = [],
          a = !0,
          r = !1,
          n = void 0;
        try {
          for (var o, s = t[Symbol.iterator](); !(a = (o = s.next()).done) && (i.push(o.value), !e || i.length !== e); a = !0);
        } catch (t) {
          r = !0, n = t;
        } finally {
          try {
            !a && s.return && s.return();
          } finally {
            if (r) throw n;
          }
        }
        return i;
      }
      return function (e, i) {
        if (Array.isArray(e)) return e;
        if (Symbol.iterator in Object(e)) return t(e, i);
        throw new TypeError("Invalid attempt to destructure non-iterable instance");
      };
    }();
  }, function (t, e, i) {

    function a(t) {
      i(25);
    }
    var r = i(7),
      n = i(44),
      o = i(0),
      s = a,
      l = Object(o.a)(r.a, n.a, n.b, !1, s, null, null);
    e.a = l.exports;
  }, function (t, e, i) {

    function a(t) {
      if (Array.isArray(t)) {
        for (var e = 0, i = Array(t.length); e < t.length; e++) i[e] = t[e];
        return i;
      }
      return Array.from(t);
    }
    var r = i(19),
      n = i.n(r),
      o = i(20),
      s = i(46),
      l = i(50),
      u = i(62),
      c = i(3),
      p = function () {
        function t(t, e) {
          var i = [],
            a = !0,
            r = !1,
            n = void 0;
          try {
            for (var o, s = t[Symbol.iterator](); !(a = (o = s.next()).done) && (i.push(o.value), !e || i.length !== e); a = !0);
          } catch (t) {
            r = !0, n = t;
          } finally {
            try {
              !a && s.return && s.return();
            } finally {
              if (r) throw n;
            }
          }
          return i;
        }
        return function (e, i) {
          if (Array.isArray(e)) return e;
          if (Symbol.iterator in Object(e)) return t(e, i);
          throw new TypeError("Invalid attempt to destructure non-iterable instance");
        };
      }(),
      h = !1,
      d = Object(c.e)(n.a.version, "2.3.0") >= 0,
      f = {},
      v = null,
      y = {
        NONE: "none",
        MUSIC: "music",
        LIST: "list",
        NO_REPEAT: "no-repeat",
        REPEAT_ONE: "repeat-one",
        REPEAT_ALL: "repeat-all"
      },
      m = {
        name: "APlayer",
        disableVersionBadge: !1,
        components: {
          Thumbnail: o.a,
          Controls: l.a,
          MusicList: s.a,
          Lyrics: u.a
        },
        props: {
          music: {
            type: Object,
            required: !0,
            validator: function (t) {
              return t.url && Object(c.a)("music.url", "1.4.0", "music.src"), t.author && Object(c.a)("music.author", "1.4.1", "music.artist"), t.src || t.url;
            }
          },
          list: {
            type: Array,
            default: function () {
              return [];
            }
          },
          mini: {
            type: Boolean,
            default: !1
          },
          showLrc: {
            type: Boolean,
            default: !1
          },
          mutex: {
            type: Boolean,
            default: !0
          },
          theme: {
            type: String,
            default: "#41b883"
          },
          listMaxHeight: String,
          listFolded: {
            type: Boolean,
            default: !1
          },
          float: {
            type: Boolean,
            default: !1
          },
          autoplay: {
            type: Boolean,
            default: !1
          },
          controls: {
            type: Boolean,
            default: !1
          },
          muted: {
            type: Boolean,
            default: !1
          },
          preload: String,
          volume: {
            type: Number,
            default: .8,
            validator: function (t) {
              return t >= 0 && t <= 1;
            }
          },
          shuffle: {
            type: Boolean,
            default: !1
          },
          repeat: {
            type: String,
            default: y.NO_REPEAT
          },
          listmaxheight: {
            type: String,
            validator: function (t) {
              return t && Object(c.a)("listmaxheight", "1.1.2", "listMaxHeight"), !0;
            }
          },
          narrow: {
            type: Boolean,
            default: !1,
            validator: function (t) {
              return t && Object(c.a)("narrow", "1.1.2", "mini"), !0;
            }
          },
          showlrc: {
            type: Boolean,
            default: !1,
            validator: function (t) {
              return t && Object(c.a)("showlrc", "1.2.2", "showLrc"), !0;
            }
          }
        },
        data: function () {
          return {
            internalMusic: this.music,
            isPlaying: !1,
            isSeeking: !1,
            wasPlayingBeforeSeeking: !1,
            isMobile: /mobile/i.test(window.navigator.userAgent),
            playStat: {
              duration: 0,
              loadedTime: 0,
              playedTime: 0
            },
            showList: !this.listFolded,
            audioPlayPromise: Promise.resolve(),
            floatOriginX: 0,
            floatOriginY: 0,
            floatOffsetLeft: 0,
            floatOffsetTop: 0,
            selfAdaptingTheme: null,
            internalMuted: this.muted,
            internalVolume: this.volume,
            isLoading: !1,
            internalShuffle: this.shuffle,
            internalRepeat: this.repeat,
            shuffledList: []
          };
        },
        computed: {
          audio: function () {
            return this.$refs.audio;
          },
          currentMusic: {
            get: function () {
              return this.internalMusic;
            },
            set: function (t) {
              d && this.$emit("update:music", t), this.internalMusic = t;
            }
          },
          isMiniMode: function () {
            return this.mini || this.narrow;
          },
          shouldShowLrc: function () {
            return this.showLrc || this.showlrc;
          },
          currentTheme: function () {
            return this.selfAdaptingTheme || this.currentMusic.theme || this.theme;
          },
          isFloatMode: function () {
            return this.float && !this.isMobile;
          },
          shouldAutoplay: function () {
            return !this.isMobile && this.autoplay;
          },
          musicList: function () {
            return this.list;
          },
          shouldShowNativeControls: function () {
            return !1;
          },
          floatStyleObj: function () {
            return {
              transform: "translate(" + this.floatOffsetLeft + "px, " + this.floatOffsetTop + "px)",
              webkitTransform: "translate(" + this.floatOffsetLeft + "px, " + this.floatOffsetTop + "px)"
            };
          },
          currentPicStyleObj: function () {
            return this.currentMusic && this.currentMusic.pic ? {
              backgroundImage: "url(" + this.currentMusic.pic + ")"
            } : {};
          },
          loadProgress: function () {
            return 0 === this.playStat.duration ? 0 : this.playStat.loadedTime / this.playStat.duration;
          },
          playProgress: function () {
            return 0 === this.playStat.duration ? 0 : this.playStat.playedTime / this.playStat.duration;
          },
          playIndex: {
            get: function () {
              return this.shuffledList.indexOf(this.currentMusic);
            },
            set: function (t) {
              this.currentMusic = this.shuffledList[t % this.shuffledList.length];
            }
          },
          shouldRepeat: function () {
            return this.repeatMode !== y.NO_REPEAT;
          },
          isAudioMuted: {
            get: function () {
              return this.internalMuted;
            },
            set: function (t) {
              d && this.$emit("update:muted", t), this.internalMuted = t;
            }
          },
          audioVolume: {
            get: function () {
              return this.internalVolume;
            },
            set: function (t) {
              d && this.$emit("update:volume", t), this.internalVolume = t;
            }
          },
          shouldShuffle: {
            get: function () {
              return this.internalShuffle;
            },
            set: function (t) {
              d && this.$emit("update:shuffle", t), this.internalShuffle = t;
            }
          },
          repeatMode: {
            get: function () {
              switch (this.internalRepeat) {
                case y.NONE:
                case y.NO_REPEAT:
                  return y.NO_REPEAT;
                case y.MUSIC:
                case y.REPEAT_ONE:
                  return y.REPEAT_ONE;
                default:
                  return y.REPEAT_ALL;
              }
            },
            set: function (t) {
              d && this.$emit("update:repeat", t), this.internalRepeat = t;
            }
          }
        },
        methods: {
          onDragBegin: function () {
            this.floatOriginX = this.floatOffsetLeft, this.floatOriginY = this.floatOffsetTop;
          },
          onDragAround: function (t) {
            var e = t.offsetLeft,
              i = t.offsetTop;
            this.floatOffsetLeft = this.floatOriginX + e, this.floatOffsetTop = this.floatOriginY + i;
          },
          setNextMode: function () {
            this.repeatMode === y.REPEAT_ALL ? this.repeatMode = y.REPEAT_ONE : this.repeatMode === y.REPEAT_ONE ? this.repeatMode = y.NO_REPEAT : this.repeatMode = y.REPEAT_ALL;
          },
          thenPlay: function () {
            var t = this;
            this.$nextTick(function () {
              t.play();
            });
          },
          toggle: function () {
            this.audio.paused ? this.play() : this.pause();
          },
          play: function () {
            var t = this;
            this.mutex && (v && v !== this && v.pause(), v = this);
            var e = this.audio.play();
            if (e) return this.audioPlayPromise = new Promise(function (i, a) {
              t.rejectPlayPromise = a, e.then(function (e) {
                t.rejectPlayPromise = null, i(e);
              }).catch(c.f);
            });
          },
          pause: function () {
            var t = this;
            this.audioPlayPromise.then(function () {
              t.audio.pause();
            }).catch(function () {
              t.audio.pause();
            }), this.rejectPlayPromise && (this.rejectPlayPromise(), this.rejectPlayPromise = null);
          },
          onProgressDragBegin: function (t) {
            this.wasPlayingBeforeSeeking = this.isPlaying, this.pause(), this.isSeeking = !0, isNaN(this.audio.duration) || (this.audio.currentTime = this.audio.duration * t);
          },
          onProgressDragging: function (t) {
            isNaN(this.audio.duration) ? this.playStat.playedTime = 0 : this.audio.currentTime = this.audio.duration * t;
          },
          onProgressDragEnd: function (t) {
            this.isSeeking = !1, this.wasPlayingBeforeSeeking && this.thenPlay();
          },
          toggleMute: function () {
            this.setAudioMuted(!this.audio.muted);
          },
          setAudioMuted: function (t) {
            this.audio.muted = t;
          },
          setAudioVolume: function (t) {
            this.audio.volume = t, t > 0 && this.setAudioMuted(!1);
          },
          getShuffledList: function () {
            if (!this.list.length) return [this.internalMusic];
            var t = [].concat(a(this.list));
            if (!this.internalShuffle || t.length <= 1) return t;
            var e = t.indexOf(this.internalMusic);
            if (2 === t.length && -1 !== e) return 0 === e ? t : [this.internalMusic, t[0]];
            for (var i = t.length - 1; i > 0; i--) {
              var r = Math.floor(Math.random() * (i + 1)),
                n = t[i];
              t[i] = t[r], t[r] = n;
            }
            if (-1 !== e && 0 !== (e = t.indexOf(this.internalMusic))) {
              var o = [t[e], t[0]];
              t[0] = o[0], t[e] = o[1];
            }
            return t;
          },
          onSelectSong: function (t) {
            this.currentMusic === t ? this.toggle() : (this.currentMusic = t, this.thenPlay());
          },
          onAudioPlay: function () {
            this.isPlaying = !0;
          },
          onAudioPause: function () {
            this.isPlaying = !1;
          },
          onAudioWaiting: function () {
            this.isLoading = !0;
          },
          onAudioCanplay: function () {
            this.isLoading = !1;
          },
          onAudioDurationChange: function () {
            1 !== this.audio.duration && (this.playStat.duration = this.audio.duration);
          },
          onAudioProgress: function () {
            this.audio.buffered.length ? this.playStat.loadedTime = this.audio.buffered.end(this.audio.buffered.length - 1) : this.playStat.loadedTime = 0;
          },
          onAudioTimeUpdate: function () {
            this.playStat.playedTime = this.audio.currentTime;
          },
          onAudioSeeking: function () {
            this.playStat.playedTime = this.audio.currentTime;
          },
          onAudioSeeked: function () {
            this.playStat.playedTime = this.audio.currentTime;
          },
          onAudioVolumeChange: function () {
            this.audioVolume = this.audio.volume, this.isAudioMuted = this.audio.muted;
          },
          onAudioEnded: function () {
            this.repeatMode === y.REPEAT_ALL ? (this.shouldShuffle && this.playIndex === this.shuffledList.length - 1 && (this.shuffledList = this.getShuffledList()), this.playIndex++, this.thenPlay()) : this.repeatMode === y.REPEAT_ONE ? this.thenPlay() : (this.playIndex++, 0 !== this.playIndex ? this.thenPlay() : 1 === this.shuffledList.length && (this.audio.currentTime = 0));
          },
          initAudio: function () {
            var t = this;
            this.audio.controls = this.shouldShowNativeControls, this.audio.muted = this.muted, this.audio.preload = this.preload, this.audio.volume = this.volume, ["abort", "canplay", "canplaythrough", "durationchange", "emptied", "encrypted", "ended", "error", "interruptbegin", "interruptend", "loadeddata", "loadedmetadata", "loadstart", "mozaudioavailable", "pause", "play", "playing", "progress", "ratechange", "seeked", "seeking", "stalled", "suspend", "timeupdate", "volumechange", "waiting"].forEach(function (e) {
              t.audio.addEventListener(e, function (i) {
                return t.$emit(e, i);
              });
            }), this.audio.addEventListener("play", this.onAudioPlay), this.audio.addEventListener("pause", this.onAudioPause), this.audio.addEventListener("abort", this.onAudioPause), this.audio.addEventListener("waiting", this.onAudioWaiting), this.audio.addEventListener("canplay", this.onAudioCanplay), this.audio.addEventListener("progress", this.onAudioProgress), this.audio.addEventListener("durationchange", this.onAudioDurationChange), this.audio.addEventListener("seeking", this.onAudioSeeking), this.audio.addEventListener("seeked", this.onAudioSeeked), this.audio.addEventListener("timeupdate", this.onAudioTimeUpdate), this.audio.addEventListener("volumechange", this.onAudioVolumeChange), this.audio.addEventListener("ended", this.onAudioEnded), this.currentMusic && (this.audio.src = this.currentMusic.src || this.currentMusic.url);
          },
          setSelfAdaptingTheme: function () {
            var t = this;
            if ("pic" === (this.currentMusic.theme || this.theme)) {
              var e = this.currentMusic.pic;
              if (f[e]) this.selfAdaptingTheme = f[e];else try {
                new ColorThief().getColorAsync(e, function (i) {
                  var a = p(i, 3),
                    r = a[0],
                    n = a[1],
                    o = a[2];
                  f[e] = "rgb(" + r + ", " + n + ", " + o + ")", t.selfAdaptingTheme = "rgb(" + r + ", " + n + ", " + o + ")";
                });
              } catch (t) {
                Object(c.f)("color-thief is required to support self-adapting theme");
              }
            } else this.selfAdaptingTheme = null;
          }
        },
        watch: {
          music: function (t) {
            this.internalMusic = t;
          },
          currentMusic: {
            handler: function (t) {
              this.setSelfAdaptingTheme();
              var e = t.src || t.url;
              if (/\.m3u8(?=(#|\?|$))/.test(e)) {
                if (this.audio.canPlayType("application/x-mpegURL") || this.audio.canPlayType("application/vnd.apple.mpegURL")) this.audio.src = e;else try {
                  var a = i(66);
                  a.isSupported() ? (this.hls || (this.hls = new a()), this.hls.loadSource(e), this.hls.attachMedia(this.audio)) : (Object(c.f)("HLS is not supported on your browser"), this.audio.src = e);
                } catch (t) {
                  Object(c.f)("hls.js is required to support m3u8"), this.audio.src = e;
                }
              } else this.audio.src = e;
            }
          },
          shouldShowNativeControls: function (t) {
            this.audio.controls = t;
          },
          isAudioMuted: function (t) {
            this.audio.muted = t;
          },
          preload: function (t) {
            this.audio.preload = t;
          },
          audioVolume: function (t) {
            this.audio.volume = t;
          },
          muted: function (t) {
            this.internalMuted = t;
          },
          volume: function (t) {
            this.internalVolume = t;
          },
          shuffle: function (t) {
            this.internalShuffle = t;
          },
          repeat: function (t) {
            this.internalRepeat = t;
          }
        },
        beforeCreate: function () {
          m.disableVersionBadge || h || (console.log("\n\n %c Vue-APlayer 1.6.1 %c vue-aplayer.js.org \n", "color: #fff; background:#41b883; padding:5px 0;", "color: #fff; background: #35495e; padding:5px 0;"), h = !0);
        },
        created: function () {
          this.shuffledList = this.getShuffledList();
        },
        mounted: function () {
          this.initAudio(), this.setSelfAdaptingTheme(), this.autoplay && this.play();
        },
        beforeDestroy: function () {
          v === this && (v = null), this.hls && this.hls.destroy();
        }
      };
    e.a = m;
  }, function (t, e, i) {

    var a = i(4);
    e.a = {
      components: {
        IconButton: a.a
      },
      props: {
        pic: String,
        theme: String,
        playing: {
          type: Boolean,
          default: !1
        },
        enableDrag: {
          type: Boolean,
          default: !1
        }
      },
      data: function () {
        return {
          hasMovedSinceMouseDown: !1,
          dragStartX: 0,
          dragStartY: 0
        };
      },
      computed: {
        currentPicStyleObj: function () {
          return this.pic ? {
            backgroundImage: "url(" + this.pic + ")",
            backgroundColor: this.theme
          } : {};
        }
      },
      methods: {
        onDragBegin: function (t) {
          this.enableDrag && (this.hasMovedSinceMouseDown = !1, this.$emit("dragbegin"), this.dragStartX = t.clientX, this.dragStartY = t.clientY, document.addEventListener("mousemove", this.onDocumentMouseMove), document.addEventListener("mouseup", this.onDocumentMouseUp));
        },
        onDocumentMouseMove: function (t) {
          this.hasMovedSinceMouseDown = !0, this.$emit("dragging", {
            offsetLeft: t.clientX - this.dragStartX,
            offsetTop: t.clientY - this.dragStartY
          });
        },
        onDocumentMouseUp: function (t) {
          document.removeEventListener("mouseup", this.onDocumentMouseUp), document.removeEventListener("mousemove", this.onDocumentMouseMove), this.$emit("dragend");
        },
        onClick: function () {
          this.hasMovedSinceMouseDown || this.$emit("toggleplay");
        }
      }
    };
  }, function (t, e, i) {

    var a = i(8);
    e.a = {
      components: {
        Icon: a.a
      },
      props: ["icon"]
    };
  }, function (t, e, i) {

    var a = i(9),
      r = i(43),
      n = i(0),
      o = Object(n.a)(a.a, r.a, r.b, !1, null, null, null);
    e.a = o.exports;
  }, function (t, e, i) {

    var a = function () {
        function t(t, e) {
          var i = [],
            a = !0,
            r = !1,
            n = void 0;
          try {
            for (var o, s = t[Symbol.iterator](); !(a = (o = s.next()).done) && (i.push(o.value), !e || i.length !== e); a = !0);
          } catch (t) {
            r = !0, n = t;
          } finally {
            try {
              !a && s.return && s.return();
            } finally {
              if (r) throw n;
            }
          }
          return i;
        }
        return function (e, i) {
          if (Array.isArray(e)) return e;
          if (Symbol.iterator in Object(e)) return t(e, i);
          throw new TypeError("Invalid attempt to destructure non-iterable instance");
        };
      }(),
      r = i(27),
      n = r.keys().reduce(function (t, e) {
        var i = r(e),
          n = i.match(/^<svg.+?viewBox="(.+?)".*><path.+?d="(.+?)".*><\/path><\/svg>$/),
          o = a(n, 3),
          s = (o[0], o[1]),
          l = o[2];
        return t[e.match(/^.*\/(.+?)\.svg$/)[1]] = {
          viewBox: s,
          d: l
        }, t;
      }, {});
    e.a = {
      props: ["type"],
      computed: {
        svg: function () {
          this.type;
          return "prev" !== this.type && "next" !== this.type || "skip", n[this.type] || {};
        },
        style: function () {
          if ("next" === this.type) return {
            transform: "rotate(180deg)"
          };
        }
      }
    };
  }, function (t, e, i) {

    e.a = {
      props: {
        show: {
          type: Boolean,
          default: !0
        },
        currentMusic: Object,
        musicList: {
          type: Array,
          default: function () {
            return [];
          }
        },
        playIndex: {
          type: Number,
          default: 0
        },
        theme: String,
        listmaxheight: String
      },
      computed: {
        listHeightStyle: function () {
          return {
            height: 33 * this.musicList.length - 1 + "px",
            maxHeight: this.listmaxheight || ""
          };
        }
      }
    };
  }, function (t, e, i) {

    var a = i(4),
      r = i(53),
      n = i(57);
    e.a = {
      components: {
        IconButton: a.a,
        VProgress: r.a,
        Volume: n.a
      },
      props: ["shuffle", "repeat", "stat", "theme", "volume", "muted"],
      computed: {
        loadProgress: function () {
          return 0 === this.stat.duration ? 0 : this.stat.loadedTime / this.stat.duration;
        },
        playProgress: function () {
          return 0 === this.stat.duration ? 0 : this.stat.playedTime / this.stat.duration;
        }
      },
      methods: {
        secondToTime: function (t) {
          if (isNaN(t)) return "00:00";
          var e = function (t) {
              return t < 10 ? "0" + t : "" + t;
            },
            i = Math.trunc(t / 60),
            a = Math.trunc(t - 60 * i),
            r = Math.trunc(i / 60),
            n = Math.trunc(t / 60 - 60 * Math.trunc(t / 60 / 60));
          return t >= 3600 ? e(r) + ":" + e(n) + ":" + e(a) : e(i) + ":" + e(a);
        }
      }
    };
  }, function (t, e, i) {

    var a = i(3),
      r = i(8);
    e.a = {
      components: {
        Icon: r.a
      },
      props: ["loadProgress", "playProgress", "theme"],
      data: function () {
        return {
          thumbHovered: !1
        };
      },
      methods: {
        onThumbMouseDown: function (t) {
          var e = this.$refs.barWrap.clientWidth,
            i = (t.clientX - Object(a.b)(this.$refs.barWrap)) / e;
          i = i > 0 ? i : 0, i = i < 1 ? i : 1, this.$emit("dragbegin", i), document.addEventListener("mousemove", this.onDocumentMouseMove), document.addEventListener("mouseup", this.onDocumentMouseUp);
        },
        onDocumentMouseMove: function (t) {
          var e = this.$refs.barWrap.clientWidth,
            i = (t.clientX - Object(a.b)(this.$refs.barWrap)) / e;
          i = i > 0 ? i : 0, i = i < 1 ? i : 1, this.$emit("dragging", i);
        },
        onDocumentMouseUp: function (t) {
          document.removeEventListener("mouseup", this.onDocumentMouseUp), document.removeEventListener("mousemove", this.onDocumentMouseMove);
          var e = this.$refs.barWrap.clientWidth,
            i = (t.clientX - Object(a.b)(this.$refs.barWrap)) / e;
          i = i > 0 ? i : 0, i = i < 1 ? i : 1, this.$emit("dragend", i);
        },
        onThumbTouchStart: function (t) {
          var e = this.$refs.barWrap.clientWidth,
            i = (t.clientX - Object(a.b)(this.$refs.barWrap)) / e;
          i = i > 0 ? i : 0, i = i < 1 ? i : 1, this.$emit("dragbegin", i), document.addEventListener("touchmove", this.onDocumentTouchMove), document.addEventListener("touchend", this.onDocumentTouchEnd);
        },
        onDocumentTouchMove: function (t) {
          var e = t.changedTouches[0],
            i = this.$refs.barWrap.clientWidth,
            r = (e.clientX - Object(a.b)(this.$refs.barWrap)) / i;
          r = r > 0 ? r : 0, r = r < 1 ? r : 1, this.$emit("dragging", r);
        },
        onDocumentTouchEnd: function (t) {
          document.removeEventListener("touchend", this.onDocumentTouchEnd), document.removeEventListener("touchmove", this.onDocumentTouchMove);
          var e = t.changedTouches[0],
            i = this.$refs.barWrap.clientWidth,
            r = (e.clientX - Object(a.b)(this.$refs.barWrap)) / i;
          r = r > 0 ? r : 0, r = r < 1 ? r : 1, this.$emit("dragend", r);
        }
      }
    };
  }, function (t, e, i) {

    var a = i(4),
      r = i(3);
    e.a = {
      components: {
        IconButton: a.a
      },
      props: ["volume", "muted", "theme"],
      computed: {
        volumeIcon: function () {
          return this.muted || this.volume <= 0 ? "volume-off" : this.volume >= 1 ? "volume-up" : "volume-down";
        }
      },
      methods: {
        adjustVolume: function (t) {
          var e = (40 - t.clientY + Object(r.c)(this.$refs.bar)) / 40;
          e = e > 0 ? e : 0, e = e < 1 ? e : 1, this.$emit("setvolume", e);
        },
        onBarMouseDown: function () {
          document.addEventListener("mousemove", this.onDocumentMouseMove), document.addEventListener("mouseup", this.onDocumentMouseUp);
        },
        onDocumentMouseMove: function (t) {
          var e = (40 - t.clientY + Object(r.c)(this.$refs.bar)) / 40;
          e = e > 0 ? e : 0, e = e < 1 ? e : 1, this.$emit("setvolume", e);
        },
        onDocumentMouseUp: function (t) {
          document.removeEventListener("mouseup", this.onDocumentMouseUp), document.removeEventListener("mousemove", this.onDocumentMouseMove);
          var e = (40 - t.clientY + Object(r.c)(this.$refs.bar)) / 40;
          e = e > 0 ? e : 0, e = e < 1 ? e : 1, this.$emit("setvolume", e);
        }
      }
    };
  }, function (t, e, i) {

    var a = i(3);
    e.a = {
      props: {
        currentMusic: {
          type: Object,
          required: !0
        },
        playStat: {
          type: Object,
          required: !0
        }
      },
      data: function () {
        return {
          displayLrc: "",
          currentLineIndex: 0
        };
      },
      computed: {
        lrcLines: function () {
          return Object(a.d)(this.displayLrc);
        },
        currentLine: function () {
          return this.currentLineIndex > this.lrcLines.length - 1 ? null : this.lrcLines[this.currentLineIndex];
        },
        transformStyle: function () {
          return {
            transform: "translateY(" + 16 * -this.currentLineIndex + "px)",
            webkitTransform: "translateY(" + 16 * -this.currentLineIndex + "px)"
          };
        }
      },
      methods: {
        applyLrc: function (t) {
          /^https?:\/\//.test(t) ? this.fetchLrc(t) : this.displayLrc = t;
        },
        fetchLrc: function (t) {
          var e = this;
          fetch(t).then(function (t) {
            return t.text();
          }).then(function (t) {
            e.displayLrc = t;
          });
        },
        hideLrc: function () {
          this.displayLrc = "";
        }
      },
      watch: {
        currentMusic: {
          immediate: !0,
          handler: function (t) {
            this.currentLineIndex = 0, t.lrc ? this.applyLrc(t.lrc) : this.hideLrc();
          }
        },
        "playStat.playedTime": function (t) {
          for (var e = 0; e < this.lrcLines.length; e++) {
            var i = this.lrcLines[e],
              a = this.lrcLines[e + 1];
            t >= i[0] && (!a || t < a[0]) && (this.currentLineIndex = e);
          }
        }
      }
    };
  }, function (t, e, i) {

    function a(t) {
      i(16);
    }
    Object.defineProperty(e, "__esModule", {
      value: !0
    });
    var r = i(5),
      n = i(67),
      o = i(0),
      s = a,
      l = Object(o.a)(r.a, n.a, n.b, !1, s, null, null);
    e.default = l.exports;
  }, function (t, e, i) {
    var a = i(17);
    "string" == typeof a && (a = [[t.i, a, ""]]), a.locals && (t.exports = a.locals);
    var r = i(2).default;
    r("48028a76", a, !0, {});
  }, function (t, e, i) {
    e = t.exports = i(1)(!1), e.push([t.i, ".aplayer{font-family:Arial,Helvetica,sans-serif;color:#000;background-color:#fff;margin:5px;-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.07),0 1px 5px 0 rgba(0,0,0,.1);box-shadow:0 2px 2px 0 rgba(0,0,0,.07),0 1px 5px 0 rgba(0,0,0,.1);border-radius:2px;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:normal;position:relative}.aplayer *{-webkit-box-sizing:content-box;box-sizing:content-box}.aplayer .aplayer-lrc-content{display:none}.aplayer .aplayer-body{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.aplayer .aplayer-body .aplayer-info{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;text-align:start;padding:14px 7px 0 10px;height:66px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.aplayer .aplayer-body .aplayer-info .aplayer-music{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-left:5px;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;cursor:default;padding-bottom:2px}.aplayer .aplayer-body .aplayer-info .aplayer-music .aplayer-title{font-size:14px}.aplayer .aplayer-body .aplayer-info .aplayer-music .aplayer-author{font-size:12px;color:#666}.aplayer .aplayer-body .aplayer-info .aplayer-lrc{z-index:0}.aplayer audio[controls]{display:block;width:100%}.aplayer.aplayer-narrow{width:66px}.aplayer.aplayer-withlrc .aplayer-body .aplayer-pic{height:90px;width:90px}.aplayer.aplayer-withlrc .aplayer-body .aplayer-info{height:90px;padding:10px 7px 0}.aplayer.aplayer-withlist .aplayer-body .aplayer-info{border-bottom:1px solid #e9e9e9}.aplayer.aplayer-withlist .aplayer-body .aplayer-controller .aplayer-time .aplayer-icon.aplayer-icon-menu{display:block}.aplayer.aplayer-float{z-index:1}@-webkit-keyframes aplayer-roll{0%{left:0}to{left:-100%}}@keyframes aplayer-roll{0%{left:0}to{left:-100%}}", ""]);
  }, function (t, e, i) {

    function a(t, e) {
      for (var i = [], a = {}, r = 0; r < e.length; r++) {
        var n = e[r],
          o = n[0],
          s = n[1],
          l = n[2],
          u = n[3],
          c = {
            id: t + ":" + r,
            css: s,
            media: l,
            sourceMap: u
          };
        a[o] ? a[o].parts.push(c) : i.push(a[o] = {
          id: o,
          parts: [c]
        });
      }
      return i;
    }
    e.a = a;
  }, function (e, i) {
    e.exports = t;
  }, function (t, e, i) {

    function a(t) {
      i(21);
    }
    var r = i(6),
      n = i(45),
      o = i(0),
      s = a,
      l = Object(o.a)(r.a, n.a, n.b, !1, s, null, null);
    e.a = l.exports;
  }, function (t, e, i) {
    var a = i(22);
    "string" == typeof a && (a = [[t.i, a, ""]]), a.locals && (t.exports = a.locals);
    var r = i(2).default;
    r("082b31c5", a, !0, {});
  }, function (t, e, i) {
    var a = i(23);
    e = t.exports = i(1)(!1), e.push([t.i, ".aplayer-float .aplayer-pic:active{cursor:move}.aplayer-pic{-ms-flex-negative:0;flex-shrink:0;position:relative;height:66px;width:66px;background-image:url(" + a(i(24)) + ");background-size:cover;-webkit-transition:all .3s ease;transition:all .3s ease;cursor:pointer}.aplayer-pic:hover .aplayer-button{opacity:1}.aplayer-pic .aplayer-button{position:absolute;border-radius:50%;opacity:.8;text-shadow:0 1px 1px rgba(0,0,0,.2);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.2);box-shadow:0 1px 1px rgba(0,0,0,.2);background:rgba(0,0,0,.2);-webkit-transition:all .1s ease;transition:all .1s ease}.aplayer-pic .aplayer-button .aplayer-fill{fill:#fff}.aplayer-pic .aplayer-play{width:26px;height:26px;border:2px solid #fff;bottom:50%;right:50%;margin:0 -15px -15px 0}.aplayer-pic .aplayer-play .aplayer-icon-play{position:absolute;top:3px;left:4px;height:20px;width:20px}.aplayer-pic .aplayer-pause{width:16px;height:16px;border:2px solid #fff;bottom:4px;right:4px}.aplayer-pic .aplayer-pause .aplayer-icon-pause{position:absolute;top:2px;left:2px;height:12px;width:12px}", ""]);
  }, function (t, e) {
    t.exports = function (t) {
      return "string" != typeof t ? t : (/^['"].*['"]$/.test(t) && (t = t.slice(1, -1)), /["'() \t\n]/.test(t) ? '"' + t.replace(/"/g, '\\"').replace(/\n/g, "\\n") + '"' : t);
    };
  }, function (t, e) {
    t.exports = "data:image/jpeg;base64, ";
  }, function (t, e, i) {
    var a = i(26);
    "string" == typeof a && (a = [[t.i, a, ""]]), a.locals && (t.exports = a.locals);
    var r = i(2).default;
    r("a4518b4e", a, !0, {});
  }, function (t, e, i) {
    e = t.exports = i(1)(!1), e.push([t.i, ".aplayer-icon{width:15px;height:15px;border:none;background-color:transparent;outline:none;cursor:pointer;opacity:.8;vertical-align:middle;padding:0;font-size:12px;margin:0;display:inline}.aplayer-icon:hover{opacity:1}.aplayer-icon .aplayer-fill{-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}", ""]);
  }, function (t, e, i) {
    function a(t) {
      return i(r(t));
    }
    function r(t) {
      var e = n[t];
      if (!(e + 1)) throw new Error("Cannot find module '" + t + "'.");
      return e;
    }
    var n = {
      "./loading.svg": 28,
      "./lrc.svg": 29,
      "./menu.svg": 30,
      "./no-repeat.svg": 31,
      "./pause.svg": 32,
      "./play.svg": 33,
      "./repeat-all-legacy.svg": 34,
      "./repeat-all.svg": 35,
      "./repeat-one-legacy.svg": 36,
      "./repeat-one.svg": 37,
      "./shuffle.svg": 38,
      "./skip.svg": 39,
      "./volume-down.svg": 40,
      "./volume-off.svg": 41,
      "./volume-up.svg": 42
    };
    a.keys = function () {
      return Object.keys(n);
    }, a.resolve = r, t.exports = a, a.id = 27;
  }, function (t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M4 16c0-6.6 5.4-12 12-12s12 5.4 12 12c0 1.2-0.8 2-2 2s-2-0.8-2-2c0-4.4-3.6-8-8-8s-8 3.6-8 8 3.6 8 8 8c1.2 0 2 0.8 2 2s-0.8 2-2 2c-6.6 0-12-5.4-12-12z"></path></svg>';
  }, function (t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M26.667 5.333h-21.333c-0 0-0.001 0-0.001 0-1.472 0-2.666 1.194-2.666 2.666 0 0 0 0.001 0 0.001v-0 16c0 0 0 0.001 0 0.001 0 1.472 1.194 2.666 2.666 2.666 0 0 0.001 0 0.001 0h21.333c0 0 0.001 0 0.001 0 1.472 0 2.666-1.194 2.666-2.666 0-0 0-0.001 0-0.001v0-16c0-0 0-0.001 0-0.001 0-1.472-1.194-2.666-2.666-2.666-0 0-0.001 0-0.001 0h0zM5.333 16h5.333v2.667h-5.333v-2.667zM18.667 24h-13.333v-2.667h13.333v2.667zM26.667 24h-5.333v-2.667h5.333v2.667zM26.667 18.667h-13.333v-2.667h13.333v2.667z"></path></svg>';
  }, function (t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-5 0 32 32"><path d="M20.8 14.4q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2zM1.6 11.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2zM20.8 20.8q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2z"></path></svg>';
  }, function (t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M2.667 7.027l1.707-1.693 22.293 22.293-1.693 1.707-4-4h-11.64v4l-5.333-5.333 5.333-5.333v4h8.973l-8.973-8.973v0.973h-2.667v-3.64l-4-4zM22.667 17.333h2.667v5.573l-2.667-2.667v-2.907zM22.667 6.667v-4l5.333 5.333-5.333 5.333v-4h-10.907l-2.667-2.667h13.573z"></path></svg>';
  }, function (t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-8 0 32 32"><path d="M14.080 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048zM2.88 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048z"></path></svg>';
  }, function (t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-8 0 32 32"><path d="M15.552 15.168q0.448 0.32 0.448 0.832 0 0.448-0.448 0.768l-13.696 8.512q-0.768 0.512-1.312 0.192t-0.544-1.28v-16.448q0-0.96 0.544-1.28t1.312 0.192z"></path></svg>';
  }, function (t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-1 0 32 32"><path d="M25.6 9.92q1.344 0 2.272 0.928t0.928 2.272v9.28q0 1.28-0.928 2.24t-2.272 0.96h-22.4q-1.28 0-2.24-0.96t-0.96-2.24v-9.28q0-1.344 0.96-2.272t2.24-0.928h8v-3.52l6.4 5.76-6.4 5.76v-3.52h-6.72v6.72h19.84v-6.72h-4.8v-4.48h6.080z"></path></svg>';
  }, function (t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M9.333 9.333h13.333v4l5.333-5.333-5.333-5.333v4h-16v8h2.667v-5.333zM22.667 22.667h-13.333v-4l-5.333 5.333 5.333 5.333v-4h16v-8h-2.667v5.333z"></path></svg>';
  }, function (t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 38 32"><path d="M2.072 21.577c0.71-0.197 1.125-0.932 0.928-1.641-0.221-0.796-0.333-1.622-0.333-2.457 0-5.049 4.108-9.158 9.158-9.158h5.428c0.056-0.922 0.221-1.816 0.482-2.667h-5.911c-3.158 0-6.128 1.23-8.361 3.463s-3.463 5.203-3.463 8.361c0 1.076 0.145 2.143 0.431 3.171 0.164 0.59 0.7 0.976 1.284 0.976 0.117 0 0.238-0.016 0.357-0.049zM21.394 25.613h-12.409v-2.362c0-0.758-0.528-1.052-1.172-0.652l-5.685 3.522c-0.644 0.4-0.651 1.063-0.014 1.474l5.712 3.69c0.637 0.411 1.158 0.127 1.158-0.63v-2.374h12.409c3.158 0 6.128-1.23 8.361-3.463 1.424-1.424 2.44-3.148 2.99-5.029-0.985 0.368-2.033 0.606-3.125 0.691-1.492 3.038-4.619 5.135-8.226 5.135zM28.718 0c-4.985 0-9.026 4.041-9.026 9.026s4.041 9.026 9.026 9.026 9.026-4.041 9.026-9.026-4.041-9.026-9.026-9.026zM30.392 13.827h-1.728v-6.822c-0.635 0.576-1.433 1.004-2.407 1.285v-1.713c0.473-0.118 0.975-0.325 1.506-0.62 0.532-0.325 0.975-0.665 1.329-1.034h1.3v8.904z"></path></svg>';
  }, function (t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M9.333 9.333h13.333v4l5.333-5.333-5.333-5.333v4h-16v8h2.667v-5.333zM22.667 22.667h-13.333v-4l-5.333 5.333 5.333 5.333v-4h16v-8h-2.667v5.333zM17.333 20v-8h-1.333l-2.667 1.333v1.333h2v5.333h2z"></path></svg>';
  }, function (t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M22.667 4l7 6-7 6 7 6-7 6v-4h-3.653l-3.76-3.76 2.827-2.827 2.587 2.587h2v-8h-2l-12 12h-6v-4h4.347l12-12h3.653v-4zM2.667 8h6l3.76 3.76-2.827 2.827-2.587-2.587h-4.347v-4z"></path></svg>';
  }, function (t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M25.468 6.947c-0.326-0.172-0.724-0.151-1.030 0.057l-6.438 4.38v-3.553c0-0.371-0.205-0.71-0.532-0.884-0.326-0.172-0.724-0.151-1.030 0.057l-12 8.164c-0.274 0.186-0.438 0.496-0.438 0.827s0.164 0.641 0.438 0.827l12 8.168c0.169 0.115 0.365 0.174 0.562 0.174 0.16 0 0.321-0.038 0.468-0.116 0.327-0.173 0.532-0.514 0.532-0.884v-3.556l6.438 4.382c0.169 0.115 0.365 0.174 0.562 0.174 0.16 0 0.321-0.038 0.468-0.116 0.327-0.173 0.532-0.514 0.532-0.884v-16.333c0-0.371-0.205-0.71-0.532-0.884z"></path></svg>';
  }, function (t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528z"></path></svg>';
  }, function (t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8z"></path></svg>';
  }, function (t, e) {
    t.exports = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528zM25.152 16q0 2.72-1.536 5.056t-4 3.36q-0.256 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.704 0.672-1.056 1.024-0.512 1.376-0.8 1.312-0.96 2.048-2.4t0.736-3.104-0.736-3.104-2.048-2.4q-0.352-0.288-1.376-0.8-0.672-0.352-0.672-1.056 0-0.448 0.32-0.8t0.8-0.352q0.224 0 0.48 0.096 2.496 1.056 4 3.36t1.536 5.056zM29.728 16q0 4.096-2.272 7.552t-6.048 5.056q-0.224 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.64 0.704-1.056 0.128-0.064 0.384-0.192t0.416-0.192q0.8-0.448 1.44-0.896 2.208-1.632 3.456-4.064t1.216-5.152-1.216-5.152-3.456-4.064q-0.64-0.448-1.44-0.896-0.128-0.096-0.416-0.192t-0.384-0.192q-0.704-0.416-0.704-1.056 0-0.448 0.32-0.8t0.832-0.352q0.224 0 0.448 0.096 3.776 1.632 6.048 5.056t2.272 7.552z"></path></svg>';
  }, function (t, e, i) {

    i.d(e, "a", function () {
      return a;
    }), i.d(e, "b", function () {
      return r;
    });
    var a = function () {
        var t = this,
          e = t.$createElement,
          i = t._self._c || e;
        return i("svg", {
          style: t.style,
          attrs: {
            "xmlns:xlink": "http://www.w3.org/1999/xlink",
            height: "100%",
            version: "1.1",
            viewBox: t.svg.viewBox,
            width: "100%"
          }
        }, [i("use", {
          attrs: {
            "xlink:href": "#aplayer-${type}"
          }
        }), t._v(" "), i("path", {
          staticClass: "aplayer-fill",
          attrs: {
            d: t.svg.d
          }
        })]);
      },
      r = [];
  }, function (t, e, i) {

    i.d(e, "a", function () {
      return a;
    }), i.d(e, "b", function () {
      return r;
    });
    var a = function () {
        var t = this,
          e = t.$createElement,
          i = t._self._c || e;
        return i("button", {
          staticClass: "aplayer-icon",
          attrs: {
            type: "button"
          }
        }, [i("icon", {
          attrs: {
            type: t.icon
          }
        })], 1);
      },
      r = [];
  }, function (t, e, i) {

    i.d(e, "a", function () {
      return a;
    }), i.d(e, "b", function () {
      return r;
    });
    var a = function () {
        var t = this,
          e = t.$createElement,
          i = t._self._c || e;
        return i("div", {
          staticClass: "aplayer-pic",
          style: t.currentPicStyleObj,
          on: {
            mousedown: t.onDragBegin,
            click: t.onClick
          }
        }, [i("div", {
          staticClass: "aplayer-button",
          class: t.playing ? "aplayer-pause" : "aplayer-play"
        }, [i("icon-button", {
          class: t.playing ? "aplayer-icon-pause" : "aplayer-icon-play",
          attrs: {
            icon: t.playing ? "pause" : "play"
          }
        })], 1)]);
      },
      r = [];
  }, function (t, e, i) {

    function a(t) {
      i(47);
    }
    var r = i(10),
      n = i(49),
      o = i(0),
      s = a,
      l = Object(o.a)(r.a, n.a, n.b, !1, s, null, null);
    e.a = l.exports;
  }, function (t, e, i) {
    var a = i(48);
    "string" == typeof a && (a = [[t.i, a, ""]]), a.locals && (t.exports = a.locals);
    var r = i(2).default;
    r("7b9d1402", a, !0, {});
  }, function (t, e, i) {
    e = t.exports = i(1)(!1), e.push([t.i, ".aplayer-list{overflow:hidden}.aplayer-list.slide-v-enter-active,.aplayer-list.slide-v-leave-active{-webkit-transition:height .5s ease;transition:height .5s ease;will-change:height}.aplayer-list.slide-v-enter,.aplayer-list.slide-v-leave-to{height:0!important}.aplayer-list ol{list-style-type:none;margin:0;padding:0;overflow-y:auto}.aplayer-list ol::-webkit-scrollbar{width:5px}.aplayer-list ol::-webkit-scrollbar-track{background-color:#f9f9f9}.aplayer-list ol::-webkit-scrollbar-thumb{border-radius:3px;background-color:#eee}.aplayer-list ol::-webkit-scrollbar-thumb:hover{background-color:#ccc}.aplayer-list ol:hover li.aplayer-list-light:not(:hover){background-color:inherit;-webkit-transition:inherit;transition:inherit}.aplayer-list ol:not(:hover) li.aplayer-list-light{-webkit-transition:background-color .6s ease;transition:background-color .6s ease}.aplayer-list ol li{position:relative;height:32px;line-height:32px;padding:0 15px;font-size:12px;border-top:1px solid #e9e9e9;cursor:pointer;-webkit-transition:all .2s ease;transition:all .2s ease;overflow:hidden;margin:0;text-align:start;display:-webkit-box;display:-ms-flexbox;display:flex}.aplayer-list ol li:first-child{border-top:none}.aplayer-list ol li.aplayer-list-light,.aplayer-list ol li:hover{background:#efefef}.aplayer-list ol li.aplayer-list-light .aplayer-list-cur{display:inline-block}.aplayer-list ol li .aplayer-list-cur{display:none;width:3px;height:22px;position:absolute;left:0;top:5px;-webkit-transition:background-color .3s;transition:background-color .3s}.aplayer-list ol li .aplayer-list-index{color:#666;margin-right:12px}.aplayer-list ol li .aplayer-list-title{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.aplayer-list ol li .aplayer-list-author{-ms-flex-negative:0;flex-shrink:0;color:#666;float:right}", ""]);
  }, function (t, e, i) {

    i.d(e, "a", function () {
      return a;
    }), i.d(e, "b", function () {
      return r;
    });
    var a = function () {
        var t = this,
          e = t.$createElement,
          i = t._self._c || e;
        return i("transition", {
          attrs: {
            name: "slide-v"
          }
        }, [i("div", {
          directives: [{
            name: "show",
            rawName: "v-show",
            value: t.show,
            expression: "show"
          }],
          ref: "list",
          staticClass: "aplayer-list",
          style: t.listHeightStyle
        }, [i("ol", {
          ref: "ol",
          style: t.listHeightStyle
        }, t._l(t.musicList, function (e, a) {
          return i("li", {
            key: a,
            class: {
              "aplayer-list-light": e === t.currentMusic
            },
            on: {
              click: function (i) {
                t.$emit("selectsong", e);
              }
            }
          }, [i("span", {
            staticClass: "aplayer-list-cur",
            style: {
              background: t.theme
            }
          }), t._v(" "), i("span", {
            staticClass: "aplayer-list-index"
          }, [t._v(t._s(a + 1))]), t._v(" "), i("span", {
            staticClass: "aplayer-list-title"
          }, [t._v(t._s(e.title || "Untitled"))]), t._v(" "), i("span", {
            staticClass: "aplayer-list-author"
          }, [t._v(t._s(e.artist || e.author || "Unknown"))])]);
        }))])]);
      },
      r = [];
  }, function (t, e, i) {

    function a(t) {
      i(51);
    }
    var r = i(11),
      n = i(61),
      o = i(0),
      s = a,
      l = Object(o.a)(r.a, n.a, n.b, !1, s, null, null);
    e.a = l.exports;
  }, function (t, e, i) {
    var a = i(52);
    "string" == typeof a && (a = [[t.i, a, ""]]), a.locals && (t.exports = a.locals);
    var r = i(2).default;
    r("c97c1d8a", a, !0, {});
  }, function (t, e, i) {
    e = t.exports = i(1)(!1), e.push([t.i, ".aplayer-controller,.aplayer-controller .aplayer-time{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative}.aplayer-controller .aplayer-time{height:17px;color:#999;font-size:11px;padding-left:7px}.aplayer-controller .aplayer-time .aplayer-volume-wrap{margin-left:4px;margin-right:4px}.aplayer-controller .aplayer-time .aplayer-icon{cursor:pointer;-webkit-transition:all .2s ease;transition:all .2s ease;margin-left:4px}.aplayer-controller .aplayer-time .aplayer-icon.inactive{opacity:.3}.aplayer-controller .aplayer-time .aplayer-icon .aplayer-fill{fill:#666}.aplayer-controller .aplayer-time .aplayer-icon:hover .aplayer-fill{fill:#000}.aplayer-controller .aplayer-time .aplayer-icon.aplayer-icon-menu{display:none}.aplayer-controller .aplayer-time .aplayer-volume-wrap+.aplayer-icon{margin-left:0}.aplayer-controller .aplayer-time.aplayer-time-narrow .aplayer-icon-menu,.aplayer-controller .aplayer-time.aplayer-time-narrow .aplayer-icon-mode{display:none}", ""]);
  }, function (t, e, i) {

    function a(t) {
      i(54);
    }
    var r = i(12),
      n = i(56),
      o = i(0),
      s = a,
      l = Object(o.a)(r.a, n.a, n.b, !1, s, null, null);
    e.a = l.exports;
  }, function (t, e, i) {
    var a = i(55);
    "string" == typeof a && (a = [[t.i, a, ""]]), a.locals && (t.exports = a.locals);
    var r = i(2).default;
    r("6f66d8c5", a, !0, {});
  }, function (t, e, i) {
    e = t.exports = i(1)(!1), e.push([t.i, ".aplayer-bar-wrap{margin:0 0 0 5px;padding:4px 0;cursor:pointer;-webkit-box-flex:1;-ms-flex:1;flex:1}.aplayer-bar-wrap .aplayer-bar{position:relative;height:2px;width:100%;background:#cdcdcd}.aplayer-bar-wrap .aplayer-bar .aplayer-loaded{position:absolute;left:0;top:0;bottom:0;background:#aaa;height:2px;-webkit-transition:all .5s ease;transition:all .5s ease;will-change:width}.aplayer-bar-wrap .aplayer-bar .aplayer-played{position:absolute;left:0;top:0;bottom:0;height:2px;-webkit-transition:background-color .3s;transition:background-color .3s;will-change:width}.aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb{position:absolute;top:0;right:5px;margin-top:-5px;margin-right:-10px;width:10px;height:10px;border:1px solid;-webkit-transform:scale(.8);transform:scale(.8);will-change:transform;-webkit-transition:background-color .3s,border-color .3s,-webkit-transform .3s;transition:background-color .3s,border-color .3s,-webkit-transform .3s;transition:transform .3s,background-color .3s,border-color .3s;transition:transform .3s,background-color .3s,border-color .3s,-webkit-transform .3s;border-radius:50%;background:#fff;cursor:pointer;overflow:hidden}.aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb:hover{-webkit-transform:scale(1);transform:scale(1)}.aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb .aplayer-loading-icon{display:none;width:100%;height:100%}.aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb .aplayer-loading-icon svg{position:absolute;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;fill:#fff}.aplayer-loading .aplayer-bar-wrap .aplayer-bar .aplayer-thumb .aplayer-loading-icon{display:block}.aplayer-loading .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb{-webkit-transform:scale(1);transform:scale(1)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}", ""]);
  }, function (t, e, i) {

    i.d(e, "a", function () {
      return a;
    }), i.d(e, "b", function () {
      return r;
    });
    var a = function () {
        var t = this,
          e = t.$createElement,
          i = t._self._c || e;
        return i("div", {
          ref: "barWrap",
          staticClass: "aplayer-bar-wrap",
          on: {
            mousedown: t.onThumbMouseDown,
            touchstart: t.onThumbTouchStart
          }
        }, [i("div", {
          staticClass: "aplayer-bar"
        }, [i("div", {
          staticClass: "aplayer-loaded",
          style: {
            width: 100 * t.loadProgress + "%"
          }
        }), t._v(" "), i("div", {
          staticClass: "aplayer-played",
          style: {
            width: 100 * t.playProgress + "%",
            background: t.theme
          }
        }, [i("span", {
          ref: "thumb",
          staticClass: "aplayer-thumb",
          style: {
            borderColor: t.theme,
            backgroundColor: t.thumbHovered ? t.theme : "#fff"
          },
          on: {
            mouseover: function (e) {
              t.thumbHovered = !0;
            },
            mouseout: function (e) {
              t.thumbHovered = !1;
            }
          }
        }, [i("span", {
          staticClass: "aplayer-loading-icon",
          style: {
            backgroundColor: t.theme
          }
        }, [i("icon", {
          attrs: {
            type: "loading"
          }
        })], 1)])])])]);
      },
      r = [];
  }, function (t, e, i) {

    function a(t) {
      i(58);
    }
    var r = i(13),
      n = i(60),
      o = i(0),
      s = a,
      l = Object(o.a)(r.a, n.a, n.b, !1, s, null, null);
    e.a = l.exports;
  }, function (t, e, i) {
    var a = i(59);
    "string" == typeof a && (a = [[t.i, a, ""]]), a.locals && (t.exports = a.locals);
    var r = i(2).default;
    r("28c86b36", a, !0, {});
  }, function (t, e, i) {
    e = t.exports = i(1)(!1), e.push([t.i, '.aplayer-volume-wrap{position:relative;cursor:pointer;z-index:0}.aplayer-volume-wrap:hover .aplayer-volume-bar-wrap{display:block}.aplayer-volume-wrap .aplayer-volume-bar-wrap{display:none;position:absolute;bottom:15px;left:-4px;right:-4px;height:40px;z-index:-1;-webkit-transition:all .2s ease;transition:all .2s ease}.aplayer-volume-wrap .aplayer-volume-bar-wrap:after{content:"";position:absolute;bottom:-16px;left:0;right:0;height:62px;background-color:#fff;-webkit-box-shadow:0 0 2px 0 rgba(0,0,0,.07),0 0 5px 0 rgba(0,0,0,.1);box-shadow:0 0 2px 0 rgba(0,0,0,.07),0 0 5px 0 rgba(0,0,0,.1)}.aplayer-volume-wrap .aplayer-volume-bar-wrap .aplayer-volume-bar{position:absolute;bottom:0;left:11px;width:5px;height:40px;background:#aaa;border-radius:2.5px;overflow:hidden;z-index:1}.aplayer-volume-wrap .aplayer-volume-bar-wrap .aplayer-volume-bar .aplayer-volume{position:absolute;bottom:0;left:0;right:0;-webkit-transition:height .1s ease,background-color .3s;transition:height .1s ease,background-color .3s;will-change:height}', ""]);
  }, function (t, e, i) {

    i.d(e, "a", function () {
      return a;
    }), i.d(e, "b", function () {
      return r;
    });
    var a = function () {
        var t = this,
          e = t.$createElement,
          i = t._self._c || e;
        return i("div", {
          staticClass: "aplayer-volume-wrap"
        }, [i("icon-button", {
          class: "aplayer-icon-" + t.volumeIcon,
          attrs: {
            icon: t.volumeIcon
          },
          nativeOn: {
            click: function (e) {
              t.$emit("togglemute");
            }
          }
        }), t._v(" "), i("div", {
          staticClass: "aplayer-volume-bar-wrap",
          on: {
            mousedown: t.onBarMouseDown
          }
        }, [i("div", {
          ref: "bar",
          staticClass: "aplayer-volume-bar"
        }, [i("div", {
          staticClass: "aplayer-volume",
          style: {
            height: t.muted ? 0 : Math.trunc(100 * t.volume) + "%",
            background: t.theme
          }
        })])])], 1);
      },
      r = [];
  }, function (t, e, i) {

    i.d(e, "a", function () {
      return a;
    }), i.d(e, "b", function () {
      return r;
    });
    var a = function () {
        var t = this,
          e = t.$createElement,
          i = t._self._c || e;
        return i("div", {
          staticClass: "aplayer-controller"
        }, [i("v-progress", {
          attrs: {
            loadProgress: t.loadProgress,
            playProgress: t.playProgress,
            theme: t.theme
          },
          on: {
            dragbegin: function (e) {
              return t.$emit("dragbegin", e);
            },
            dragend: function (e) {
              return t.$emit("dragend", e);
            },
            dragging: function (e) {
              return t.$emit("dragging", e);
            }
          }
        }), t._v(" "), i("div", {
          staticClass: "aplayer-time"
        }, [i("div", {
          staticClass: "aplayer-time-inner"
        }, [t._v("\n      - "), i("span", {
          staticClass: "aplayer-ptime"
        }, [t._v(t._s(t.secondToTime(t.stat.playedTime)))]), t._v(" / "), i("span", {
          staticClass: "aplayer-dtime"
        }, [t._v(t._s(t.secondToTime(t.stat.duration)))])]), t._v(" "), t.$parent.isMobile ? t._e() : i("volume", {
          attrs: {
            volume: t.volume,
            theme: t.theme,
            muted: t.muted
          },
          on: {
            togglemute: function (e) {
              t.$emit("togglemute");
            },
            setvolume: function (e) {
              return t.$emit("setvolume", e);
            }
          }
        }), t._v(" "), i("icon-button", {
          staticClass: "aplayer-icon-mode",
          class: {
            inactive: !t.shuffle
          },
          attrs: {
            icon: "shuffle"
          },
          nativeOn: {
            click: function (e) {
              t.$emit("toggleshuffle");
            }
          }
        }), t._v(" "), i("icon-button", {
          staticClass: "aplayer-icon-mode",
          class: {
            inactive: "no-repeat" === t.repeat
          },
          attrs: {
            icon: "repeat-one" === t.repeat ? "repeat-one" : "repeat-all"
          },
          nativeOn: {
            click: function (e) {
              t.$emit("nextmode");
            }
          }
        }), t._v(" "), i("icon-button", {
          staticClass: "aplayer-icon-menu",
          class: {
            inactive: !t.$parent.showList
          },
          attrs: {
            icon: "menu"
          },
          nativeOn: {
            click: function (e) {
              t.$emit("togglelist");
            }
          }
        })], 1)], 1);
      },
      r = [];
  }, function (t, e, i) {

    function a(t) {
      i(63);
    }
    var r = i(14),
      n = i(65),
      o = i(0),
      s = a,
      l = Object(o.a)(r.a, n.a, n.b, !1, s, null, null);
    e.a = l.exports;
  }, function (t, e, i) {
    var a = i(64);
    "string" == typeof a && (a = [[t.i, a, ""]]), a.locals && (t.exports = a.locals);
    var r = i(2).default;
    r("229083b6", a, !0, {});
  }, function (t, e, i) {
    e = t.exports = i(1)(!1), e.push([t.i, '.aplayer-lrc{position:relative;height:30px;text-align:center;overflow:hidden;margin-bottom:7px}.aplayer-lrc:before{top:0;height:10%;background:-webkit-gradient(linear,left top,left bottom,from(#fff),to(hsla(0,0%,100%,0)));background:linear-gradient(180deg,#fff 0,hsla(0,0%,100%,0));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffffff",endColorstr="#00ffffff",GradientType=0)}.aplayer-lrc:after,.aplayer-lrc:before{position:absolute;z-index:1;display:block;overflow:hidden;width:100%;content:" "}.aplayer-lrc:after{bottom:0;height:33%;background:-webkit-gradient(linear,left top,left bottom,from(hsla(0,0%,100%,0)),to(hsla(0,0%,100%,.8)));background:linear-gradient(180deg,hsla(0,0%,100%,0) 0,hsla(0,0%,100%,.8));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffffff",endColorstr="#ccffffff",GradientType=0)}.aplayer-lrc p{font-size:12px;color:#666;line-height:16px;height:16px;padding:0;margin:0;-webkit-transition:all .5s ease-out;transition:all .5s ease-out;opacity:.4;overflow:hidden}.aplayer-lrc p.aplayer-lrc-current{opacity:1;overflow:visible;height:auto}.aplayer-lrc .aplayer-lrc-contents{width:100%;-webkit-transition:all .5s ease-out;transition:all .5s ease-out;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;cursor:default}', ""]);
  }, function (t, e, i) {

    i.d(e, "a", function () {
      return a;
    }), i.d(e, "b", function () {
      return r;
    });
    var a = function () {
        var t = this,
          e = t.$createElement,
          i = t._self._c || e;
        return i("div", {
          staticClass: "aplayer-lrc"
        }, [i("div", {
          staticClass: "aplayer-lrc-contents",
          style: t.transformStyle
        }, t._l(t.lrcLines, function (e, a) {
          return i("p", {
            key: a,
            class: {
              "aplayer-lrc-current": a === t.currentLineIndex
            }
          }, [t._v("\n      " + t._s(e[1]) + "\n    ")]);
        }))]);
      },
      r = [];
  }, function (t, i) {
    if (void 0 === e) {
      var a = new Error('Cannot find module "undefined"');
      throw a.code = "MODULE_NOT_FOUND", a;
    }
    t.exports = e;
  }, function (t, e, i) {

    i.d(e, "a", function () {
      return a;
    }), i.d(e, "b", function () {
      return r;
    });
    var a = function () {
        var t = this,
          e = t.$createElement,
          i = t._self._c || e;
        return i("div", {
          staticClass: "aplayer",
          class: {
            "aplayer-narrow": t.isMiniMode,
            "aplayer-withlist": !t.isMiniMode && t.musicList.length > 0,
            "aplayer-withlrc": !t.isMiniMode && (!!t.$slots.display || t.shouldShowLrc),
            "aplayer-float": t.isFloatMode,
            "aplayer-loading": t.isPlaying && t.isLoading
          },
          style: t.floatStyleObj
        }, [i("div", {
          staticClass: "aplayer-body"
        }, [i("thumbnail", {
          attrs: {
            pic: t.currentMusic.pic,
            playing: t.isPlaying,
            "enable-drag": t.isFloatMode,
            theme: t.currentTheme
          },
          on: {
            toggleplay: t.toggle,
            dragbegin: t.onDragBegin,
            dragging: t.onDragAround
          }
        }), t._v(" "), i("div", {
          directives: [{
            name: "show",
            rawName: "v-show",
            value: !t.isMiniMode,
            expression: "!isMiniMode"
          }],
          staticClass: "aplayer-info"
        }, [i("div", {
          staticClass: "aplayer-music"
        }, [i("span", {
          staticClass: "aplayer-title"
        }, [t._v(t._s(t.currentMusic.title || "Untitled"))]), t._v(" "), i("span", {
          staticClass: "aplayer-author"
        }, [t._v(t._s(t.currentMusic.artist || t.currentMusic.author || "Unknown"))])]), t._v(" "), t._t("display", [t.shouldShowLrc ? i("lyrics", {
          attrs: {
            "current-music": t.currentMusic,
            "play-stat": t.playStat
          }
        }) : t._e()], {
          currentMusic: t.currentMusic,
          playStat: t.playStat
        }), t._v(" "), i("controls", {
          attrs: {
            shuffle: t.shouldShuffle,
            repeat: t.repeatMode,
            stat: t.playStat,
            volume: t.audioVolume,
            muted: t.isAudioMuted,
            theme: t.currentTheme
          },
          on: {
            toggleshuffle: function (e) {
              t.shouldShuffle = !t.shouldShuffle;
            },
            togglelist: function (e) {
              t.showList = !t.showList;
            },
            togglemute: t.toggleMute,
            setvolume: t.setAudioVolume,
            dragbegin: t.onProgressDragBegin,
            dragend: t.onProgressDragEnd,
            dragging: t.onProgressDragging,
            nextmode: t.setNextMode
          }
        })], 2)], 1), t._v(" "), i("audio", {
          ref: "audio"
        }), t._v(" "), i("music-list", {
          attrs: {
            show: t.showList && !t.isMiniMode,
            "current-music": t.currentMusic,
            "music-list": t.musicList,
            "play-index": t.playIndex,
            listmaxheight: t.listmaxheight || t.listMaxHeight,
            theme: t.currentTheme
          },
          on: {
            selectsong: t.onSelectSong
          }
        })], 1);
      },
      r = [];
  }]).default;
});
});

var vueAplayer = unwrapExports(vueAplayer_min);
vueAplayer_min.VueAPlayer;

var playIcon$4 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABxBJREFUeF7dW2tsFFUU/s5sCygo7W4JwfggkZAYNNYnqBB31iI2jYnERwyiRuILFcJuwZQEAgYfDbSzii8CYqDlYRQhUQNIS3cFkRbERxXTYMCCgGI7U0ssXbbbOWa2bu1ruzOzM8suN9lfe+53vvPdc2fu4wwhBc1ddjYPjnA+VM4XBMdogHPAyGFoP2onQgsxt6is/g1QI1RuRFZWY9Cb22g3PbLLgcevFLKqFjKRm4AbTPth3gjQtmHZqNox13XWNE6cjpYK4C5TJhOpj4BQCNA4i8kqALZAVVcH5o86ZBW2JQKIkjID4BkAiqwilgBntVVCJCWA6FeKAC4BY3KKAu/lhsGlWWGhtLrE2WrWvykBCt5Uru5ktQRMs806tqofAT8xqDTgc24yg2lYgHvKW0SV1FUAxptxaFsfxocRYdiivd7hfxjxYUgAj7/5cWaqMOIgxbYNTFgc9Lq26PWrWwBRkr9I4UNOL/8B7ZhoUdDrfE0PiC4BREmuAlCgBzBdbJjopaDX+W4iPgkFEP3yWjBmJQJKy/+ZnwwU5w06ZQcVwF3etJRIWJKWwekkRcC0Gp9rVzzzuAJ4pObpDNqq0086m9ULwtB7d88bcWYgkgMK4Fl+5lrOzv4SzNemc2T6uVFlwOd8QrcAbkneSsB0/Q7S35KI59Z4897uy7RfBrjLlZlEXJn+IRlkyDjtECJTqr2jj/Xs2UuAwpU8NBRp+Qbgmw3CZ4r5moDP9WxcATySUsLgNzIlGlM8mYoCxc7tsb7dGVBQqozsHML1AK42BZwhnYiwrsbreqqfAJ5yZTYTv5chcSRDs41JuD523NadAaJf3mv3vn786CxMGJOF+lMdONrUmUwQSfallwM+5woNJCqAWCZPg4CdSaIO2n1J0QjcPX5It82+o2FU1oVw5EzETrfxsA8EfK6J3QLYveTtG3yMVaiDUVnXjs0HQykXgRl3BItdtV0ZICkBgN12sfj8xVwMHxJ/2/Hd7x3YUBvCDyc77KLQD5dApTU+50IqXClfHorA9JlaIsbavF814/JEZtH/Nx5oj06LcIR12Sdp1BDwua4jtyTfR8COJMHids+/MhvSw5fphm/4MxKdFvuP2Z8NHecdTnJLTc8ThPd1MzRoaFSAGPy2H0KorA3h73bVoEcD5qp6K3kk5Q3WjrZtamYF0OicUDqj2bC7IWwLO2I8ogmwmcGP2uIBQDICxDjtPHwey3e1WU6RmUpI9Ct7wWzbxYYVAmiRf3wohFV7zlkqAhGVkSjJPwOYYClyDzCrBNAgZ1W0olG2bgVJhA9I9MunwLgiEwQoq2rD9p/PW0aVgC1aBmh5dYllqH2ArMyA13f8g2prH4jVmgAtAHIyQYAn1rXiZIt1U4BBn5MoKd8DnJ/uAqyvbcf6/e3W0iSqII9f2cbMD1iL/D9aslNAWxRX2BF811b4LfL4ZT8z5qWjANomSQu+/qQ9W2Zm9RVNgKeZsSadBIioXaO+oc7ilO8bpMNRQGJZ0y0QhG/TRYCDx7tG/fBpe0a9R5yhYVnOHOo6Cle0N4Etr8JxoxxYPXNkQn3PRxjag+6j1B2OVAd8rqn/HYjI+wDcmZClSYPPXsjFiKHxD0Rqf+sadW0rnKqmzf9g8ailUVYX6kisLczRwD85lPojMXTypMCCvLquDFjRPBEOqrVT/YEORbXgf/3LuoWNbv6EuoDXNUmz73ksXgtG9KTUrqatCW68KgtfHQlbuqkxyjeW/r0EsHsaGCVppz3DcVvQlxN983VnwDSp1RlGR50NJa52xmIG+9OAz/VQrGOvR7PH3zKHWV1pBjVj+pDwYMCb21350u/dJPpl258FF0osIhys8bpu7+m/f4GEX3mMmDdcKJJ2+mWB7g/Oc2r1jt1twNWJW5K3E7SS94unaYXVQV/ewr4RDSiA6FfuAngXGJdeFBIQ9nBr/T3BpWK/pWbc9alban6JQP2KijJQEAUseALFuT8OxH3QQkmxXF4LytAq0f+iJVW4u2Z+7p54A5ewVNYtNX9HoJsycOTBRDODXufGwbgnFEDrLEpySq5rrRSZGWXBYteCRJi6BNBAMunNQKB3anzOOYmC77UU1mMsSspygBOqqgfLLhsCXq3xuRbrxdedATFAUZK9AJYBGK7XSYrsDH8tYjgDukVY0TyRBVpGhKkpCm5wNya/FzItQIxNdAstCM/Yebc4WOTazQ4ErO67vDUyKIanQF/wKf62MQ713HOpFMKKwGNxJC1ADEgTIhvhh1RWC23aR7SCeBN3CpuC851fGxnlpNcBRp25pdZxAqmFAHuYo+V3Zi9fTwHYycD+LIGqquc5TxjlksjesgwYzJF7RZMbAtyCIFzDTGMBHgtgLAgtYGh3EtqviUCNKtTjADc6OtVfdi8YrRVv29r+BTKBrQtOiFe6AAAAAElFTkSuQmCC";

var pauseIcon$3 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABrJJREFUeF7lm21sU1UYx//PXbcJQ0d7mREkuixqlqiwRA0MQdqymIAoIOAHooD4Fkkc6R0TSCCMQALK1js00YhRXNTEOExQJBOBtgg6UFFQTAxgggYRYe2GA2EvvY+5hc52Xdt7u1O4y863pv/zvPzuyzn3POcQrkFzqmfLwFQKULEE6XYGFwMoAmAHwQ6GHcBJgE4S8UlN035nSdq51yM3Zzs8yoaDivrQbd1aeJqEnMkMdgK4JUM/IQb2SCTt01hqCiiFJzK0k7SbUADO2tBEytHmgWkegELRwTLQJJHU1IW8rfs8BX+JsC8EgLM+NB0anifwoyKCSmuDcJo17e2wNPSt/oLoF4BrnnhvMjoIYHPAI69JCy2JICMAk9SLI23a5XUgLMrUsch+zNhFGq/yV484aNauaQBONTiHGGsBlJp1lmX9RQCr/IqsmvFjCoDb27KSQXryFm70vl9xzDcaoGEAbrXlJWZ6zajh66z7ya/IY43EYAiA0xusIqDWiEErafyKnDa/tAK3GlzKjI1WSsxoLAzeHlBGPJZKnxKAq651PkhrMOrQijrSuNK3dMTryWJLCsBdF5zAEnaCMcyKiZmJiUmaFfDYt/XVp08Azhq/jQrH7AHjITOOLKtlnGfSKgJK0feJc6k+onZ6W9YTaLllE8ogMP07IqDI09IC0Ke3pPH2DHxYvgsTPRnwOD6MDTThEXCrwW+Z8YDls8kkQMJBv0cenxSAS219HKx9kontVH3Gjs6FTQKOnu5GRzenNJ9vI9wzyoZuDThyqkt0KCCSKn0ee8+oEHcHuLzBrQBmi/TqnXsTykbbIiaPnw3jjb3/Jk1MB7V48lDceXNORH/4VDeUxn9EhgOAT+Qhd9xOpTCkG+4B4PS23U8IfyfS2+S78rD6kfhR9NMjHdjk079bEtsSdwFmjM2P+2PNjgvYe6xTZFhgQk30E7oHgMsbfBVAtUhPC8qHYMH4IXEmU13V2Lsl2qnhwCU0NF8SGZZ+2XveBREAD288U9CVk3sUgL5YKaxZFoCeYZjH6+sHEQDOupaFRLRFWOZXDVkZALO2JlBVVBMB4PIGdwBImCT0F4iVAQD4xq/ID14BoAb/BGNUfxPu3d/SAJgvc3u7nSrUtpIwh38Tnbxuz9IA9AGRUU7ZnPpaHgC0F8lZd66GSFo9GO8AItST2xusZ2DJ4ARA28ilhhrAbHgV1Qwoqz8CAB0mpzf0WbZKWtYHgDZyeYO7AFSYubJGtQMAwCX9HdDIwByjSZnRWR4A4TS51eDbzHjWTGJGtZYHAPxCbjW0kZmXGk3KjM7yAIj2k7MutIyIN5hJzKjW6gAI9BG564JzmfCx0aTM6AYAgA3kqj13HyQpYb3cTKLJtFYHwPpUeOL6NntufjiyPia6WR8Apl79HA4dAfOYQQeAJHsUwMtgfmWQATjgV+TyK0tiamsZsfbjYAJAoA0+xbEidlX4AIBxIiFY+R3AwNSAIn8RAyBUDbC+NC6sWRYAYb/fI0/SE/2/MKK2FhNr+tJ4gSgC7tI8rJwaXxj5/OcOeHf3XRhRKgow/d74wsi6pgvw/Sq2MEJMi31VjjfjAOg/3GpwCzMWigIwLJ+gFzvuKLpS6tKb0tiOw0lqfmWjc+Gde2OP9sS5cKQ0dqEjdT3RZLx/5HTSmN3LHecTALjqQtNArC+RC2t3j7ShvCQXtw7PQeB4Z9oyl64tL8lDWAMCxzqFF0gJtMKnOHqm/gnlcZc3uBnAc8IIWMoQ/XCDzT6hqZI6omElAKhQ/y4Ja7Z9IPF1guvNgpmeClQ5PoiNo889QgNsU6QhrsS0zVflmNVbnHyXWBZXigxFLFZ0lsM0JVDt0Ee5uJYUgLO2pZRySN8pJrxkJjY3Q9Ze8Cuy/m5LaKk3SqrBRWC8Y8iFdUUNfkVOOrSn3SqbzcpR1pkR3vV75GdS+UkLQO88ECEw0BhQ5CfSQTYEYABC2ONXZEO1DsMAIhCse1ok5kJn6cBE1IPVzgvFTWoI1T6PbOpcg6k7INaZSx8hgLVWGCb1550JaiYnTTMGEHkkaltKJYnWZqu0ZuAF1gyG6quSG9Npk/3fLwBRo25v69MMTT8taujFk2mwMf0OAdicbHJjxr4QAFGHrk1tU6CF50HDbJD4o7MENDPwnojEozELBRA16lRbh0MLz5QkaQYzzzRzReK1fIyZvpKAL7VcNAcq5VOZ2+q7Z1YA9HblVFuL0d1dDImKAS6WSBrORHZm2Ak8hIA2ENoAatOYzyCsHerScOjrZUXtohPube8/AMNbG4WK/N0AAAAASUVORK5CYII=";

var audioIcon$2 = "data:image/png;base64, ";

var coverLocal$2 = "5d9cf0a5d487a818.png";

var playRepeat$2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAaCAMAAADhRa4NAAAAAXNSR0IArs4c6QAAAi5QTFRFAAAAAID/QID/M5n/JJL/SZL/TYD/O4nrQJ/vR47xQIz/OovoQ5DpPYXrPYX1QJLtPo3tRJDuOI//QI/vOpL4QpLwOZzxQI7qRYr4Po/sPo/zPYztPZL5QIvuQJHuOZL1RI3vPYrwQYzwOY7xQo7sQo3tQpHtPY7vQY7zI4XzPI/wQI/sQZDtSpHtP4/uPo3nPo3xQYvuRoDuQY3vQIn1QI/tOpfxP4zvQY3sKrv1MYv1QJDtQI/tPpLwQJDxQo/sQI7tQYzuPI7vQZDvQY3xQI7sM6nyQY3sQJLvPpLtQI/tQI/vRIntQI7uQI7vQY7uQY7tQY3tQo7tPYzxP47wQpDuRJDxQo7tQo7vQI3tQ5PtRI3uQJXxQYvxQZDxQJDuQ5DsQI7uPozsOpPtQY7tQI7tQI7uQI/uQ43sQY7tQI/tQY7tQ43vQ4/tQY7tQovsQI/tQY7uQI/wQo7uQo7tQI/uQYztQ43vQYvtQY7tQI7qQI7vQY3uQo/tQI/rQY7uQY7tQo7uP43vQI3vQY7tQY7rQpDvQY7tQY/tQY7tQY7vQY7sQo7tQ5DrQY7sQY7tQo7tQY7tQI3sQI7qQI7sQI/qQI/tQI/uQY3rQY3sQY3tQY7rQY7sQY7tQY/sQY/tQozsQo3pQo3qQo3sQo3tQo7rQo7sQo7tQo7uQo/qQo/sQo/tQ4nrQ4vuQ4zsQ43sQ47qQ47rQ47sQ4/qQ4/sRIvrRobsSI/qS3/qS5DpVRNwpwAAAJJ0Uk5TAAIEBQcHCg0QEhQWFxkZHB0eICAjIyQkJSkpKiosLDExMjM2Njo6Pz9BRERHSElKSktMTlBUXV1eYmNjZGdsbXN2fH6Ch4iJjI+Pj4+Tk5WZmpqgpaWmq6usrq+wsLGzs7a4ubm8vsLHyMvLy8vMzc/V1tbZ3N3e4ePm5ubp6+vs7e7u8PHy8/T29vj5+vz8/P6b5lOEAAABY0lEQVQYGY3BhztVYRwH8C+XsiIjM3tlFZGSPcsoM5SVUXZ2ocgOmSUj76+Lm3OsZEb/HR5d93iPp8fnAyn3+JzyqlfpoddxoeC6n0QkkJJYtgNkHCqVIpU9CguMTG2gLywFHL+Z3wuPLXHqdpmgKlVAyuuv0GgFjYjpjRpIXJlgFbqQunv49Qk08nbfgxOy+OsW1DzWlzzBK9ivh5pzfyFkDH4o7fFfr/8k4J/7VyFz7V7sQr7eA5x4xrpNwHsx16V820o49lIg6jIHJ+ibSMQ+AcjcpkkS+0zAubNGRC4A3k2VjH8cITvw/FfGXHDM2MZU6HF1gpy+OU4pBma9IeemgFrGchNkbrAOqFnQwUPwauff4MzT5VEznBcn7DlCo32r1xZSUcSiIWE9vPrZF2e0k1SbuTjnZqdIxQFaOGEU1bYznQiO4XNSfR+qTkvOaiaRPoRDzqdokIgYI2qJ0cGlHQE0EGWmZ0WkvQAAAABJRU5ErkJggg==";

var playOnce$2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAgCAMAAAA2a+hwAAAAAXNSR0IArs4c6QAAAlJQTFRFAAAAgID/QID/QID/OY7jRovoO4nrSZLtRIjuPIfwQIzyQJnySZLzRpfzQ4X0QIrqQo7sPo3tEN73RI/wPI3yQZDrPo/sQ4ztQ4zzO4jtQY7tPo7uPYvuQI/vOY3vPo3vPIzrQZHwNqL1QI7wRYTrK4b2QY/uP47uR47yQIvvP43rQI/wP5DwSXz0QozuPYvxQY/uQI3uQY3vQI/yQZDzQpDwQ472QI3uPIn3P4vqQo7vQo3tQI3uQJDuQI7uQI3uQI7sQo7sQpHxQY3sPo7vQI7tQI/xQY7tQY3tQY3vPo7vQo/rP5HuQY3uQJDxQorsQo7sQo7vOI3xQovrQo3rQY7tQY3tQI7tQI3sPY/wN5vvQo7vNKPyQY7tQ43tQY/uQorsQI7sQY3uPJfwQI7wPpPuP4/vQY7tTnTsRJPxP47vQYzsPZDvP43uQo7sO5jvQY3uPZDwQ4ftQI7tQo3uQY7uQo7uQY7tQY7tQ43wQY7tQI3tQI7uQI7tQI/wP4zuQ5DtQY7tRJHsQI7tQY7tQI7tQY7uQI7uQY3uQo7tPpHtQI7tQY/sQY7sQY/tQY7tQY7tQY3sQY/uQI7tQY7tQo7uQo/uSY7tQY/tTXnqQY3tQY7tQY7tQY7tQY7tQY7uQY7tPZXtQY3tQY7tQY7tQY7tQo/tP5LqQI/rQI/sQY3sQY7rQY7sQY7tQY/rQY/sQY/tQZDtQozsQo3rQo3sQo3tQo7qQo7rQo7sQo7tQo/tQ4vsQ4zrQ47qQ47sRIfrRInsRI/rRI/sRYnsR4TqR4fqvnKd/wAAAKd0Uk5TAAIECAkLDQ4PERQUFRYXGBsdHyImJykqKisrLS4wMTEzMzQ0NDs7PT1AQURFRklLS0xOUFNVWFxdYWFlZ2doa2xsbW5vb3BxcnJzdHl5fHx8fH+AgIGCg4iJjIyOjpGSkpOUlZeZm56goaKio6OjpKaqqq6vsLO0t7i5vL7GxsfHyMjLy8zN0tTW2trc4ubn6erq7Ozs7Ozu7vHz9Pb3+Pn6+/v9/v6utNnsAAABnklEQVQYGY3BhVsTcQDH4c8QRbCwu7tbVFQsPLu7u3t2YRfYXRhg7r4GMnYzMPm/nLf7nTjkeXxf/lv7I3OoVP+IllCpvg80l39rNiTrkrQymQpqTD4rV7QriabkRx3tnXdP9tQqkDGAP1IPKXw6qy7ZciYCqbLnY6RdkDKBUVI2MUlL39jr8eQV3elATKdTI4kb+6FsMa7NZY/rkWDw8589ielS8qU3FWwquRoAcu0N+Opg3AxNgFalr2rhSd/3qBuece8vwszvOXjGFEiz8dQOC46GRuNK3iMVaDzG+TBct3vgSpGGrpOFse0rPH3blLhGrdkqC2P5OyhUQ3y7ZWEs/AG31RlfUBbGmiLIdQbiC8rC2P8SNkaW4QvKwrgfhkGhu/h2aRKedsVhqGnb/TAOazqend8OAit0BWP4ycbEdXxR2hJIeRJZS6LArc87+K2Xo2n8Len46xsBXAs+fVxFeU3OhJ61wTNL0XPdMarOkPOwLb7M/GIdGNE8rVr1+n1WX3OcYw0oJ32LnKhcjvKGkaDFohOFirm8PQPPL6EvjEOwGD5qAAAAAElFTkSuQmCC";

//
var script$4K = {
  name: 'XmlAudioModalPlayer',
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    playStyle: {
      type: String,
      default: 'yuan-wen'
    },
    styleMode: {
      type: String,
      default: 'A'
    },
    url: {
      type: String,
      default: '',
      require: true
    },
    title: {
      type: String,
      default: '音频文件'
    },
    coverImageUrl: {
      type: String,
      default: ''
    },
    //进度是否能控制
    scheduleControl: {
      type: String,
      default: ''
    },
    loop: {
      type: Boolean,
      default: true
    },
    playMode: {
      type: String,
      default: 'xun-huan'
    },
    content: {
      type: String,
      default: '暂无简介'
    },
    targerLink: {
      type: String,
      default: ''
    }
  },
  computed: {
    videoAndMusicStop() {
      let playState = sessionStorage.getItem('SET_PLAY_STATE');
      return playState;
    },
    playModeIconSrc() {
      let srcMap = {
        'xun-huan': playRepeat$2,
        'dan-ci': playOnce$2
      };
      return srcMap[this.playMode];
    }
  },
  watch: {
    url: {
      handler(newVal) {
        let _this = this;
        this.isPlay = false;
        let ua = navigator.userAgent;
        /micromessenger/.test(ua.toLowerCase());
        let isIOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        if (isIOS && newVal) {
          try {
            this.$nextTick(() => {
              _this.$refs.musicAudio.muted = true;
              const playPromise = _this.$refs.musicAudio.play();
              _this.$refs.musicAudio.muted = false;
              if (playPromise) {
                playPromise.then(() => {
                  _this.$refs.musicAudio.pause();
                }).catch(error => {
                  _this.$refs.musicAudio.pause();
                  console.log(error);
                });
              }
            });
          } catch (error) {
            console.log(error);
            this.$message({
              type: 'warning',
              message: error,
              duration: 5000
            });
          }
        }
      },
      immediate: true
    },
    videoAndMusicStop(val) {
      console.log('watch', val);
      let currentPlayStamp = val || '--';
      if (`${this.url}__playTimeStamp__${this.lastOperateTimeStamp}` !== currentPlayStamp) {
        this.musicAudio.pause();
      }
    }
  },
  data() {
    return {
      playIcon: playIcon$4,
      pauseIcon: pauseIcon$3,
      audioIcon: audioIcon$2,
      coverLocal: coverLocal$2,
      isPlay: false,
      playTime: 0,
      playDuration: '00:00',
      playCurrentTime: '00:00',
      totalDuration: 0,
      link: {
        type: String,
        default: ''
      },
      //链接地址
      lastOperateTimeStamp: '',
      musicAudio: null,
      manualPlay: false
    };
  },
  mounted() {
    // 加载完毕后，先获取<video>标签DOM对象
    this.musicAudio = this.$refs.musicAudio;
    // this.videoContainer = this.$refs.videoContainer
    if (this.mode === 'preview' && this.playStyle === 'yuan-wen') {
      this.$emit('resetTimeUpdate');
    }
  },
  methods: {
    changeDuration() {
      this.$nextTick(() => {
        this.playDuration = this.timeFormat(this.$refs.musicAudio.duration);
        this.totalDuration = this.$refs.musicAudio.duration;
      });
    },
    //将单位为秒的的时间转换成mm:ss的形式
    timeFormat(num) {
      let minute = parseInt(num / 60);
      let second = parseInt(num % 60);
      minute = minute >= 10 ? minute : `0${minute}`;
      second = second >= 10 ? second : `0${second}`;
      return `${minute}:${second}`;
    },
    play() {
      // if (this.mode==='editor') {
      //   this.$message.warning('音频仅支持在预览模式下播放')
      //   return
      // }
      if (this.playStyle === 'yuan-wen') {
        this.doPlay();
      }
      if (this.playStyle === 'tiao-zhuan') {
        if (this.targerLink) {
          // window.location.href=this.targerLink
          window.open(this.targerLink, '_blank');
        } else {
          this.$message.warning('获取资源链接失败，请检查链接地址');
        }
      }
      if (this.playStyle === 'tan-chuang') {
        this.$emit('showDialog', {
          url: this.url,
          title: this.title,
          coverFileUrl: this.coverImageUrl
        });
      }
    },
    doPlay() {
      console.log('暂停');
      let audio = document.querySelectorAll('audio');
      audio.forEach(i => i.pause());
      let video = document.querySelectorAll('video');
      if (video && video.length) {
        video.forEach(i => i.pause());
      }
      if (this.isPlay) {
        this.$refs.musicAudio.pause();
        this.isPlay = !this.isPlay;
      } else {
        this.manualPlay = true;
        this.$refs.musicAudio.play().then(() => {
          this.isPlay = !this.isPlay;
          let timeStamp = new Date().getTime();
          this.lastOperateTimeStamp = timeStamp;
          let playStamp = `${this.url}__playTimeStamp__${timeStamp}`;
          sessionStorage.setItem('SET_PLAY_STATE', playStamp); //存储
        }).catch(error => {
          this.$message.warning('无效音频资源，请检查资源地址');
          console.log('音频播放catch', error);
        });
      }
      // this.isPlay ? this.$refs.musicAudio.pause() : this.$refs.musicAudio.play()
      // this.isPlay = !this.isPlay
      // let timeStamp = new Date().getTime()
      // this.lastOperateTimeStamp = timeStamp
      // let playStamp = `${this.url}__playTimeStamp__${timeStamp}`
      // // !this.isPlay && this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // // this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // sessionStorage.setItem('SET_PLAY_STATE', playStamp) //存储
    },
    updateTime(e) {
      this.playTime = this.$refs.musicAudio.currentTime;
      this.playCurrentTime = this.timeFormat(this.$refs.musicAudio.currentTime);
      if (this.playTime >= this.totalDuration) {
        this.isPlay = false;
      }
      this.$emit('timeUpdate', {
        event: e,
        time: this.$refs.musicAudio.currentTime
      });
    },
    changeTime(val) {
      this.$refs.musicAudio.currentTime = val;
    },
    onPlay() {
      if (!this.manualPlay) {
        this.$refs.musicAudio.pause();
      }
    }
  }
};

/* script */
const __vue_script__$4K = script$4K;

/* template */
var __vue_render__$4K = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticClass: "xml-audio-player" }, [
    _c("div", { staticClass: "audio-cover" }, [
      _c(
        "div",
        { staticClass: "square-wrapper" },
        [
          _c("el-image", {
            attrs: {
              src: _vm.coverImageUrl ? _vm.coverImageUrl : _vm.coverLocal,
              alt: "",
            },
          }),
          _vm._v(" "),
          _c("div", { staticClass: "play-button style-a" }, [
            _c("img", {
              staticClass: "button-image",
              attrs: { src: _vm.isPlay ? _vm.pauseIcon : _vm.playIcon },
              on: {
                click: function ($event) {
                  $event.stopPropagation();
                  return _vm.play.apply(null, arguments)
                },
              },
            }),
          ]),
        ],
        1
      ),
    ]),
    _vm._v(" "),
    _c("div", { staticClass: "audio-player-control" }, [
      _c(
        "div",
        {
          class: [
            "audio-player-title",
            "audio-player-title--modal",
            _vm.mode == "preview" && _vm.title.length >= 16 ? "preview" : "",
          ],
        },
        [
          _c(
            "div",
            {
              staticClass: "scroll-text",
              style:
                _vm.mode == "preview" && _vm.title.length >= 16
                  ? {
                      animation:
                        "fadeNum " +
                        _vm.title.length / 3 +
                        "s linear infinite backwards",
                    }
                  : "",
            },
            [_vm._v("\n        " + _vm._s(_vm.title) + "\n      ")]
          ),
        ]
      ),
      _vm._v(" "),
      _c("div", { staticClass: "audio-controls" }, [
        _c("div", { staticClass: "audio-controls__handler" }, [
          _c("div", { staticClass: "play-times" }, [
            _c("div", { staticClass: "current-time" }, [
              _vm._v(_vm._s(_vm.playCurrentTime)),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "progress" },
              [
                _c("el-slider", {
                  attrs: {
                    max: _vm.totalDuration,
                    disabled: _vm.scheduleControl !== "yes",
                    "show-tooltip": false,
                  },
                  on: { change: _vm.changeTime },
                  model: {
                    value: _vm.playTime,
                    callback: function ($$v) {
                      _vm.playTime = $$v;
                    },
                    expression: "playTime",
                  },
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "total-time" }, [
              _vm._v(_vm._s(_vm.playDuration)),
            ]),
          ]),
        ]),
      ]),
    ]),
    _vm._v(" "),
    _c("audio", {
      ref: "musicAudio",
      staticClass: "audio-component",
      attrs: {
        controls: "",
        preload: "auto",
        src: _vm.url,
        loop: _vm.loop,
        link: _vm.link,
      },
      on: {
        canplay: _vm.changeDuration,
        timeupdate: _vm.updateTime,
        pause: function ($event) {
          _vm.isPlay = false;
        },
        play: _vm.onPlay,
      },
    }),
  ])
};
var __vue_staticRenderFns__$4K = [];
__vue_render__$4K._withStripped = true;

  /* style */
  const __vue_inject_styles__$4K = undefined;
  /* scoped */
  const __vue_scope_id__$4K = undefined;
  /* module identifier */
  const __vue_module_identifier__$4K = undefined;
  /* functional template */
  const __vue_is_functional_template__$4K = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4K = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4K, staticRenderFns: __vue_staticRenderFns__$4K },
    __vue_inject_styles__$4K,
    __vue_script__$4K,
    __vue_scope_id__$4K,
    __vue_is_functional_template__$4K,
    __vue_module_identifier__$4K,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4J = {
  name: 'XmlMusicRender',
  components: {
    vueAplayer,
    XmlAudioModalPlayer: __vue_component__$4K
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    //属性中传递过来的块儿数据
    pBlockData: {},
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  watch: {
    pBlockData: {
      handler(newValue) {
        this.$nextTick(() => {
          console.log('新data', newValue);
          this.blockData = Object.assign({}, this.blockData, newValue);
        });
      },
      deep: true,
      immediate: true
    }
  },
  data() {
    return {
      blockId: 'blockId' + Math.random(),
      //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
      blockData: {
        playMode: 'xun-huan',
        scheduleControl: 'yes',
        playStyle: 'yuan-wen',
        styleMode: 'A'
      },
      //属性组件名
      propertyComponentsName: 'xml-music-property',
      dialogShow: false,
      curMusicUrl: '',
      curMusicTitle: '',
      curCoverFileUrl: '',
      curMusicContent: '',
      currentPlayer: {},
      modalPlayerKey: 'mpk' + new Date().getTime()
    };
  },
  methods: {
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    showDialog(param) {
      this.curMusicUrl = param.url;
      this.curMusicTitle = param.title;
      this.curCoverFileUrl = param.coverFileUrl;
      this.curMusicContent = param.content;
      this.currentPlayer = this.blockData.musicSetList[param.playerIndex];
      this.modalPlayerKey = 'mpk' + new Date().getTime();
      this.$nextTick(() => {
        this.dialogShow = true;
      });
    },
    timeUpdate({
      event,
      time
    }, data) {
      // console.log({event, time, data});
      this.$EventBus.$emit('audioTimeUpdate', {
        event,
        time,
        data
      });
    },
    resetTimeUpdate(data) {
      this.$EventBus.$emit('resetTimeUpdate', data);
    }
  },
  created() {},
  computed: {
    isEmpty() {
      return !(this.blockData.musicSetList && this.blockData.musicSetList.length);
    }
  }
};

/* script */
const __vue_script__$4J = script$4J;

/* template */
var __vue_render__$4J = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "xml-music-container",
      class: "xml-music-container-" + _vm.pageType,
      attrs: { id: _vm.blockId },
      on: { click: _vm.blockClick },
    },
    [
      _vm.blockData.musicSetList && _vm.blockData.musicSetList.length
        ? _vm._l(_vm.blockData.musicSetList, function (item, index) {
            return _c(
              "div",
              {
                key: index,
                staticClass: "fixed-ratio-container xml-group-item",
              },
              [
                _c(
                  "div",
                  {
                    class: [
                      "xml-music__wrapper",
                      "style-mode--" + _vm.blockData.styleMode,
                      _vm.mode,
                    ],
                  },
                  [
                    _c(
                      "div",
                      { staticClass: "xml-music-player-box" },
                      [
                        _c("xml-audio-play", {
                          attrs: {
                            "targer-link": item.link,
                            mode: _vm.mode,
                            styleMode: _vm.blockData.styleMode,
                            "play-style": _vm.blockData.playStyle,
                            "play-mode": _vm.blockData.playMode,
                            url: item.uploadFileUrl
                              ? _vm.resourceBasisPath
                                ? _vm.resourceBasisPath +
                                  item.uploadFileUrl.split("./")[1]
                                : item.uploadFileUrl
                              : "",
                            loop: _vm.blockData.playMode === "xun-huan",
                            title: item.title,
                            playerIndex: index,
                            content: item.content,
                            scheduleControl: _vm.blockData.scheduleControl,
                            "cover-image-url": item.coverFileUrl
                              ? _vm.resourceBasisPath
                                ? _vm.resourceBasisPath +
                                  item.coverFileUrl.split("./")[1]
                                : item.coverFileUrl
                              : "",
                          },
                          on: {
                            showDialog: _vm.showDialog,
                            timeUpdate: function (e) {
                              return _vm.timeUpdate(e, item)
                            },
                            resetTimeUpdate: function ($event) {
                              return _vm.resetTimeUpdate(item)
                            },
                          },
                        }),
                      ],
                      1
                    ),
                  ]
                ),
              ]
            )
          })
        : [
            _c("div", { staticClass: "fixed-ratio-container" }, [
              _c(
                "div",
                {
                  class: [
                    "xml-music__wrapper",
                    "style-mode--" + _vm.blockData.styleMode,
                    _vm.mode,
                  ],
                },
                [
                  _c(
                    "div",
                    { staticClass: "xml-music-player-box" },
                    [
                      _c("xml-audio-play", {
                        attrs: {
                          mode: _vm.mode,
                          styleMode: _vm.blockData.styleMode,
                          "play-mode": _vm.blockData.playMode,
                          title: "这是音频",
                        },
                      }),
                    ],
                    1
                  ),
                ]
              ),
            ]),
          ],
      _vm._v(" "),
      _c(
        "el-dialog",
        {
          staticClass: "resource-preview player-dialog",
          attrs: {
            title: "",
            visible: _vm.dialogShow,
            "destroy-on-close": true,
            width: "100%",
            modal: false,
            "show-close": false,
            "append-to-body": "",
            "custom-class": "preview-modal-music",
            "close-on-click-modal": true,
          },
          on: {
            "update:visible": function ($event) {
              _vm.dialogShow = $event;
            },
          },
        },
        [
          _c(
            "div",
            { staticClass: "xml-modal-player__wrapper" },
            [
              _c("xml-audio-modal-player", {
                key: _vm.modalPlayerKey,
                attrs: {
                  mode: _vm.mode,
                  styleMode: _vm.blockData.styleMode,
                  "play-style": "yuan-wen",
                  "play-mode": _vm.blockData.playMode,
                  url: _vm.curMusicUrl,
                  loop: _vm.blockData.playMode === "xun-huan",
                  title: _vm.curMusicTitle,
                  content: _vm.curMusicContent,
                  scheduleControl: _vm.blockData.scheduleControl,
                  "cover-image-url": _vm.curCoverFileUrl,
                },
                on: {
                  timeUpdate: function (e) {
                    return _vm.timeUpdate(e, _vm.currentPlayer)
                  },
                  resetTimeUpdate: function ($event) {
                    return _vm.resetTimeUpdate(_vm.currentPlayer)
                  },
                },
              }),
            ],
            1
          ),
        ]
      ),
    ],
    2
  )
};
var __vue_staticRenderFns__$4J = [];
__vue_render__$4J._withStripped = true;

  /* style */
  const __vue_inject_styles__$4J = undefined;
  /* scoped */
  const __vue_scope_id__$4J = undefined;
  /* module identifier */
  const __vue_module_identifier__$4J = undefined;
  /* functional template */
  const __vue_is_functional_template__$4J = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4J = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4J, staticRenderFns: __vue_staticRenderFns__$4J },
    __vue_inject_styles__$4J,
    __vue_script__$4J,
    __vue_scope_id__$4J,
    __vue_is_functional_template__$4J,
    __vue_module_identifier__$4J,
    false,
    undefined,
    undefined,
    undefined
  );

var playIcon2 = "data:image/png;base64, ";

var pauseIcon2 = "data:image/png;base64, ";

var recordIcon = "a6071719aecd4e53.png";

//
var script$4I = {
  name: 'AudioPlay',
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    playStyle: {
      type: String,
      default: 'yuan-wen'
    },
    styleMode: {
      type: String,
      default: 'A'
    },
    url: {
      type: String,
      default: '',
      require: true
    },
    title: {
      type: String,
      default: '音频文件'
    },
    content: {
      type: String,
      default: '暂无简介'
    },
    coverImageUrl: {
      type: String,
      default: ''
    },
    //进度是否能控制
    scheduleControl: {
      type: String,
      default: ''
    },
    loop: {
      type: Boolean,
      default: true
    },
    playMode: {
      type: String,
      default: 'xun-huan'
    },
    targerLink: {
      type: String,
      default: ''
    },
    playerIndex: {
      type: Number,
      default: -1
    }
  },
  computed: {
    videoAndMusicStop() {
      let playState = sessionStorage.getItem('SET_PLAY_STATE');
      return playState;
    },
    playModeIconSrc() {
      let srcMap = {
        'xun-huan': playRepeat$2,
        'dan-ci': playOnce$2
      };
      return srcMap[this.playMode];
    }
  },
  watch: {
    url: {
      handler(newVal) {
        let _this = this;
        this.isPlay = false;
        let ua = navigator.userAgent;
        console.log('浏览器 UA', ua);
        /micromessenger/.test(ua.toLowerCase());
        let isIOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        // isWeixin && isIOS && newVal && this.$message({
        //   message: `当前UA为${ua}`,
        //   duration: 3000
        // })
        if (isIOS && newVal) {
          try {
            this.$nextTick(() => {
              _this.$refs.musicAudio.muted = true;
              const playPromise = _this.$refs.musicAudio.play();
              _this.$refs.musicAudio.muted = false;
              if (playPromise) {
                playPromise.then(() => {
                  _this.$refs.musicAudio.pause();
                }).catch(error => {
                  _this.$refs.musicAudio.pause();
                  console.log(error);
                });
              }
            });
          } catch (error) {
            console.log(error);
            this.$message({
              type: 'warning',
              message: error,
              duration: 5000
            });
          }
        }
      },
      immediate: true
    },
    videoAndMusicStop(val) {
      console.log('watch', val);
      let currentPlayStamp = val || '--';
      if (`${this.url}__playTimeStamp__${this.lastOperateTimeStamp}` !== currentPlayStamp) {
        this.musicAudio.pause();
      }
    }
  },
  data() {
    return {
      playIcon: playIcon$4,
      playIcon2,
      pauseIcon: pauseIcon$3,
      pauseIcon2,
      audioIcon: audioIcon$2,
      coverLocal: coverLocal$2,
      recordIcon,
      isPlay: false,
      playTime: 0,
      playDuration: '00:00',
      playCurrentTime: '00:00',
      totalDuration: 0,
      link: {
        type: String,
        default: ''
      },
      //链接地址
      lastOperateTimeStamp: '',
      musicAudio: null,
      manualPlay: false
    };
  },
  mounted() {
    // 加载完毕后，先获取<video>标签DOM对象
    this.musicAudio = this.$refs.musicAudio;
    // this.videoContainer = this.$refs.videoContainer
    if (this.mode === 'preview' && this.playStyle === 'yuan-wen') {
      this.$emit('resetTimeUpdate');
    }
  },
  methods: {
    changeDuration() {
      this.$nextTick(() => {
        this.playDuration = this.timeFormat(this.$refs.musicAudio.duration);
        this.totalDuration = this.$refs.musicAudio.duration;
      });
    },
    //将单位为秒的的时间转换成mm:ss的形式
    timeFormat(num) {
      let minute = parseInt(num / 60);
      let second = parseInt(num % 60);
      minute = minute >= 10 ? minute : `0${minute}`;
      second = second >= 10 ? second : `0${second}`;
      return `${minute}:${second}`;
    },
    play() {
      // if (this.mode==='editor') {
      //   this.$message.warning('音频仅支持在预览模式下播放')
      //   return
      // }
      if (this.playStyle === 'yuan-wen') {
        this.doPlay();
      }
      if (this.playStyle === 'tiao-zhuan') {
        if (this.targerLink) {
          // window.location.href=this.targerLink
          window.open(this.targerLink, '_blank');
        } else {
          this.$message.warning('获取资源链接失败，请检查链接地址');
        }
      }
      if (this.playStyle === 'tan-chuang') {
        this.$emit('showDialog', {
          url: this.url,
          title: this.title,
          coverFileUrl: this.coverImageUrl,
          content: this.content,
          playerIndex: this.playerIndex
        });
      }
    },
    doPlay() {
      let audio = document.querySelectorAll('audio');
      audio.forEach(i => i.pause());
      let video = document.querySelectorAll('video');
      if (video && video.length) {
        video.forEach(i => i.pause());
      }
      if (this.isPlay) {
        this.$refs.musicAudio.pause();
        this.isPlay = !this.isPlay;
      } else {
        this.manualPlay = true;
        this.$refs.musicAudio.play().then(() => {
          this.isPlay = !this.isPlay;
          let timeStamp = new Date().getTime();
          this.lastOperateTimeStamp = timeStamp;
          let playStamp = `${this.url}__playTimeStamp__${timeStamp}`;
          sessionStorage.setItem('SET_PLAY_STATE', playStamp); //存储
        }).catch(error => {
          this.$message.warning('无效音频资源，请检查资源地址');
          console.log('音频播放catch', error);
        });
      }
      // this.isPlay ? this.$refs.musicAudio.pause() : this.$refs.musicAudio.play()
      // this.isPlay = !this.isPlay
      // let timeStamp = new Date().getTime()
      // this.lastOperateTimeStamp = timeStamp
      // let playStamp = `${this.url}__playTimeStamp__${timeStamp}`
      // // !this.isPlay && this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // // this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // sessionStorage.setItem('SET_PLAY_STATE', playStamp) //存储
    },
    updateTime(e) {
      this.playTime = this.$refs.musicAudio.currentTime;
      this.playCurrentTime = this.timeFormat(this.$refs.musicAudio.currentTime);
      if (this.playTime >= this.totalDuration) {
        this.isPlay = false;
      }
      this.$emit('timeUpdate', {
        event: e,
        time: this.$refs.musicAudio.currentTime
      });
    },
    changeTime(val) {
      this.$refs.musicAudio.currentTime = val;
    },
    onPlay() {
      if (!this.manualPlay) {
        this.$refs.musicAudio.pause();
      }
    }
  }
};

/* script */
const __vue_script__$4I = script$4I;

/* template */
var __vue_render__$4I = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { class: ["xml-audio-player", _vm.mode] }, [
    _c("div", { staticClass: "play-mode-wrap" }, [
      _c("img", {
        staticClass: "play-control-image",
        attrs: { src: _vm.playModeIconSrc },
      }),
    ]),
    _vm._v(" "),
    _vm.styleMode == "A" || _vm.styleMode == "B" || _vm.styleMode == "C"
      ? _c("div", { staticStyle: { width: "100%", display: "flex" } }, [
          _vm.styleMode !== "C"
            ? _c(
                "div",
                { staticClass: "audio-cover" },
                [
                  _c("el-image", {
                    staticClass: "xml-round-6",
                    attrs: {
                      src: _vm.coverImageUrl
                        ? _vm.coverImageUrl
                        : _vm.coverLocal,
                      alt: "",
                    },
                  }),
                  _vm._v(" "),
                  _vm.styleMode === "A"
                    ? _c("div", { staticClass: "play-button style-a" }, [
                        _c("img", {
                          staticClass: "button-image",
                          attrs: {
                            src: _vm.isPlay ? _vm.pauseIcon : _vm.playIcon,
                          },
                          on: {
                            click: function ($event) {
                              $event.stopPropagation();
                              return _vm.play.apply(null, arguments)
                            },
                          },
                        }),
                      ])
                    : _vm._e(),
                ],
                1
              )
            : _vm._e(),
          _vm._v(" "),
          _c("div", { staticClass: "audio-player-control" }, [
            _c(
              "div",
              {
                class: [
                  "audio-player-title",
                  _vm.mode == "preview" && _vm.title.length >= 16
                    ? "preview"
                    : "",
                ],
              },
              [
                _c(
                  "div",
                  {
                    staticClass: "xml-audio-title scroll-text",
                    style:
                      _vm.mode == "preview" && _vm.title.length >= 16
                        ? {
                            animation:
                              "fadeNum " +
                              _vm.title.length / 3 +
                              "s linear infinite backwards",
                          }
                        : "",
                  },
                  [_vm._v("\n          " + _vm._s(_vm.title) + "\n        ")]
                ),
              ]
            ),
            _vm._v(" "),
            _c("div", { staticClass: "audio-controls" }, [
              _vm.styleMode !== "A"
                ? _c(
                    "div",
                    { staticClass: "audio-controls__play-button-wrapper" },
                    [
                      _c("div", { staticClass: "play-button" }, [
                        _c("img", {
                          staticClass: "button-image",
                          attrs: {
                            src: _vm.isPlay ? _vm.pauseIcon : _vm.playIcon,
                          },
                          on: {
                            click: function ($event) {
                              $event.stopPropagation();
                              return _vm.play.apply(null, arguments)
                            },
                          },
                        }),
                      ]),
                    ]
                  )
                : _vm._e(),
              _vm._v(" "),
              _c("div", { staticClass: "audio-controls__handler" }, [
                _c(
                  "div",
                  { staticClass: "progress" },
                  [
                    _c("el-slider", {
                      attrs: {
                        max: _vm.totalDuration,
                        disabled: _vm.scheduleControl !== "yes",
                        "show-tooltip": false,
                      },
                      on: { change: _vm.changeTime },
                      model: {
                        value: _vm.playTime,
                        callback: function ($$v) {
                          _vm.playTime = $$v;
                        },
                        expression: "playTime",
                      },
                    }),
                  ],
                  1
                ),
                _vm._v(" "),
                _c("div", { staticClass: "play-times" }, [
                  _c("div", { staticClass: "current-time" }, [
                    _vm._v(_vm._s(_vm.playCurrentTime)),
                  ]),
                  _vm._v(" "),
                  _c("div", { staticClass: "total-time" }, [
                    _vm._v(_vm._s(_vm.playDuration)),
                  ]),
                ]),
              ]),
            ]),
          ]),
        ])
      : _c("div", { staticClass: "audio-play-box" }, [
          _c(
            "div",
            { staticClass: "audio-cover" },
            [
              _c("div", { staticClass: "video-pause-btn" }, [
                _c(
                  "div",
                  { staticClass: "audio-controls__play-button-wrapper" },
                  [
                    _c("div", { staticClass: "play-button" }, [
                      _c("img", {
                        staticClass: "button-image",
                        attrs: {
                          src: _vm.isPlay ? _vm.pauseIcon2 : _vm.playIcon2,
                        },
                        on: {
                          click: function ($event) {
                            $event.stopPropagation();
                            return _vm.play.apply(null, arguments)
                          },
                        },
                      }),
                    ]),
                  ]
                ),
              ]),
              _vm._v(" "),
              _c("el-image", {
                staticClass: "xml-round-6",
                attrs: { src: _vm.recordIcon, alt: "" },
              }),
            ],
            1
          ),
          _vm._v(" "),
          _c("div", { staticClass: "audio-player-control" }, [
            _c(
              "div",
              {
                class: [
                  "audio-player-title",
                  _vm.mode == "preview" && _vm.title.length >= 16
                    ? "preview"
                    : "",
                ],
              },
              [
                _c(
                  "div",
                  {
                    staticClass: "xml-audio-title scroll-text",
                    style:
                      _vm.mode == "preview" && _vm.title.length >= 16
                        ? {
                            animation:
                              "fadeNum " +
                              _vm.title.length / 3 +
                              "s linear infinite backwards",
                          }
                        : "",
                  },
                  [_vm._v("\n          " + _vm._s(_vm.title) + "\n        ")]
                ),
              ]
            ),
            _vm._v(" "),
            _c("div", { staticClass: "audio-controls" }, [
              _c("div", { staticClass: "audio-controls__handler" }, [
                _c(
                  "div",
                  { staticClass: "progress" },
                  [
                    _c("el-slider", {
                      attrs: {
                        max: _vm.totalDuration,
                        disabled: _vm.scheduleControl !== "yes",
                        "show-tooltip": false,
                        "tooltip-class": "silder-bg",
                      },
                      on: { change: _vm.changeTime },
                      model: {
                        value: _vm.playTime,
                        callback: function ($$v) {
                          _vm.playTime = $$v;
                        },
                        expression: "playTime",
                      },
                    }),
                  ],
                  1
                ),
                _vm._v(" "),
                _c("div", { staticClass: "play-times" }, [
                  _c("div", { staticClass: "current-time" }, [
                    _vm._v(_vm._s(_vm.playCurrentTime)),
                  ]),
                  _vm._v(" "),
                  _c("div", { staticClass: "total-time" }, [
                    _vm._v(_vm._s(_vm.playDuration)),
                  ]),
                ]),
              ]),
            ]),
          ]),
        ]),
    _vm._v(" "),
    _c("audio", {
      ref: "musicAudio",
      staticClass: "audio-component",
      attrs: {
        controls: "",
        preload: "auto",
        src: _vm.url,
        loop: _vm.loop,
        link: _vm.link,
      },
      on: {
        canplay: _vm.changeDuration,
        timeupdate: _vm.updateTime,
        pause: function ($event) {
          _vm.isPlay = false;
        },
        play: _vm.onPlay,
      },
    }),
  ])
};
var __vue_staticRenderFns__$4I = [];
__vue_render__$4I._withStripped = true;

  /* style */
  const __vue_inject_styles__$4I = undefined;
  /* scoped */
  const __vue_scope_id__$4I = undefined;
  /* module identifier */
  const __vue_module_identifier__$4I = undefined;
  /* functional template */
  const __vue_is_functional_template__$4I = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4I = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4I, staticRenderFns: __vue_staticRenderFns__$4I },
    __vue_inject_styles__$4I,
    __vue_script__$4I,
    __vue_scope_id__$4I,
    __vue_is_functional_template__$4I,
    __vue_module_identifier__$4I,
    false,
    undefined,
    undefined,
    undefined
  );

const MusicComponents = [__vue_component__$4J, __vue_component__$4I];
var XmlMusic = {
  ...MusicComponents
};

const radioType = ['1', '4'];
const checkType = ['2', '5'];
const showOptionsType = ['1', '2', '4', '5'];
const showJudgeAnswerType = ['3'];
const showSortType = ['7'];
const showRichTextAnswerType = ['10', '13'];
const isclozeType = ['10', '11', '12'];
const isRadio = type => {
  return radioType.includes(type);
};
const isCheck = type => checkType.includes(type);
const showOptions = type => showOptionsType.includes(type);
const showJudgeAnswer = type => showJudgeAnswerType.includes(type);
const showSort = type => showSortType.includes(type);
const showRichTextAnswer = type => showRichTextAnswerType.includes(type);
const isCloze = type => isclozeType.includes(type);

var playIcon$3 = "data:image/png;base64, ";

var pauseIcon$2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAACvBJREFUeF7tnW2MHVUZx//PbHaTtiGQ9IOagCE1pnywInwQElstqUCB1iABPrb2bZ7ZYGo0UWkgiKGm1UQTFbNzbtwV9yOEVC2lLa8l+KFtImDBlCaFGCQYTCRW0y7srvOYczNX9uW+zMuZuTP3PpPc7LZ7znPO839+c2bumWfOIQzgMTU1tWZ2dvYaIloLYG38c6WIND9EtALAyvhjFbhERBftTxFpfjzP+0BEznqed3Z+fv7N0dHRs7t37/5g0OSiujs0PT29amZmZiOArQC+ZAMOYLQgv94norMi8oLneSdmZmZO792796OC2irFbC0BCMPwWiL6CoCb4sCPlKLW8kY+BPA8gFNRFJ0eHx8/3qd+ZG62NgAYY24AsBnAbQDs71U8zovIUc/zjvq+f7SKHVzap0oDUJOgd4pzLWCoJACNRmOLiPjx8F6HE6lXH48BmGLmJ3oVLPvvlQJgAAO/NJ4vichUEATTZQe6U3uVAGAIAr9IfyI6HUVRGATBb/oNQl8BmJiYuNrzvH0A7HA/jMeTnucd2LNnz5/65XzfADDG3AfgfgBX9sv5KrQrIjNEdADAQWaeK7tPpQNgjFkvIvuI6Payna1ye0R0Moqig0EQ/L7MfpYKgDHmAQD7y3Swhm09zMw/LKvfpQBgZ+48z9svIlvKcqzO7YjIISL6LjO/VbQfhQMQhmFARPasX120MwNm/y0Lge/7h4r0q1AAjDGPAdhepANDYLvQS0JhADQajWdE5OYhCFDhLorIZBAEu4toqBAAjDGvALiuiA4Pq00ROR4EgX0Y5vRwDkAYhu8Q0VVOe6nGWgr8hZk/51IOpwAYY2xWjc200aMgBUTk30EQXO7KvDMAjDH/AuCsY64cHFA7/2DmT7jwzQkAxpgzANa56JDaSKYAEb3g+/6mZKU7l8oNgDHmKQB35O2I1k+vgIj8MgiCvelrflwjFwDGmMcB3JOnA1o3twI/YebvZ7WSGQCd5MkqeSH1Mk8WZQIgnt6dKMQVNZpJASK6K8u0cWoA4pRsmwqtc/uZQlVYJfvg6Na0D5BSA9BoNA7rU73CgpjLsH2KGATBXWmMpAJAn+enkbZvZVPdDyQGwGbyAHi5b25pw4kVEJE7k2YWJQYgDMMjmsaVOAZ9LWjTy0Tky0lyDBMBECdwPtpXr7TxtAo8xMyP9KrUE4A4ddsO/UOdvdtLyKr93WYbj4yMbOiVct4TAGOMGeK8/arFNW1/nmTmu7tV6gpA/MbO4bStavnqKCAiO7u9gdQVAGPMHwboBc3qRKXEntjX0Hzf7/g6fUcA9OwvMUoFNyUi2zu9kNoRgCqf/UR0QkROJNDt4QRlkhTpaYeINoqIXaqmisdLzNy2b20BqPrZbwHwfd8uD9PxmJiY2Oh53osuohFF0U3j4+NdgWs0Gi9WGAArw73t1idoC0CVz37riQKQCetjzGyX11l0LAMgXpblZKYmSqqkAGQT2s7kLl27qB0APwDQ85qXrQtuaikA2XRsl0LWDgB79ld1Fa6m5wpANgAAnGfmzy6svQiAOgz/CkDm4LdOnkWXgaUAVH74VwDyAbD0MrAUgMoP/wpAPgCWXgb+D4Ax5noAfVusKI1beg+QRq3lZYlos+/7zWVtFwLwPQA/zme6nNoKQG6dH2Hmh5YCYIm4JbfpEgwoAPlEtqudB0HQfK2sOQJMTk5eNj8/b1/u9PKZLqe2ApBb54/Gxsau2LFjx4dNAMIwvJuIKreObSc3FYDcAEBEbgmC4NkWAL8mol35zZZjQQFwonPzPqAJgDHmdQBOV55w0sUORhSA/Oq2NGwBMFvgNiv5e7vEggLgRNL3mfmTZDdYmpubK3xBQiddjo0oAG7UHBkZWU1hGN5OREfcmCzHigLgRucoitaTMebbAH7mxmQ5VhQANzp7nrfbAhACYDcmy7GiADjT+adUg1y2Zd4qAG4AIKKnLQCnROSLbkyWY0UBcKOziJy0l4BazQFY1xUANwAAOGO/Bdhlydc4M1mCIQXAjchEdN6OAO8B+JQbk+VYUQDc6ExE71kAarfEqwLgBgAAFywAtZoG1nsAZ8G3huYUgAR6DsirYe08bQKgl4AeEAwwAM1LgN4EDi8Af9evgUN8CRCRt3UiaIgBAPCGTgUPMQB2+Rh9GDTcAJzQx8FDDIBNB9WEkOEG4DuaEjbEAIjIHZoUOsQAjI6OfkbTwocXgDlmHtMXQ4YXgDeYeV0LgFolhurj4ATU9i5imDloAWA3frQbQNbiUACchGkLMx9pAjA9Pb1qZmbmAoARJ6YLNqIA5Bb4vytWrLh827ZtFxeuEHIIwJ25TZdgQAHILfLvmPnrzeSaliljjN2D9ue5TZdgQAHILfK3mPkXiwCIN4R8LbfpEgwoAPlEFpEvBEHw50UA2H8YY3SZuDbaDlhG0ClmvrHlpi4UmeBkGjAAFm0sqUvFDh8ANzLzqbYjQF0uA3oPkIDa9kUWDf/L7gFiACq/XrACkBmAZfsK64YRCbQcoHuARcN/2xEgHgUqvV2cjgAJqF1e5DAzf23pf+umUQm0HIQRgIi2+r6/7HmPbhuXAIAkW+hUfNu4tmd/x0uA/UPVt45LFjct1Qxyh7O/KwB1uBfQ8CZSoOPZ3xMAHQUSCVzpQt3O/p4AxKOAbh9f6RB37VyDmbsuAdh193BremJi4mrP814GcGV9dRjKnr8bRdGG8fHxv3bzvicA8ShwH4BHh1LG+jr9TWb+Va/uJwLAGgnD8IjderSXQf17/xUQkaeDILB5nj2PxAAYY9YDsJcCPaqvwAZm/mOSbiYGIL4UPABgfxLDWqZvCjzIzD9K2noqAKzRRqNxWES2JG1Ay5WnABE95fv+1jQtpgYgzh18HsDqNA1p2cIV+KeIbGrl+iVtLTUA8Q1hQEQTSRvRcsUrICLjQRDYN7xSHZkAiO8HHgOwPVVrWrgoBX7LzN/IYjwzAPH9wDMicnOWhrWOGwWI6Fnf9zPv+JoLgHgkeAXAdW7cUSspFXiVme2m35mP3ADE9wTvENFVmXuhFVMrICJ/C4Lg06krLqngBIB4JLgIYGXeDmn9RApcYuZViUr2KOQMgBiC2q077ELEkm1cYOYrXLXpFIAYgjMA1rnqoNpZpMDrzPx5l5o4ByCGwCYfJnoY4dKZAbd1hJmdz8AWAkAMweMA7hnwoJTl3hPMfG8RjRUGQAyBThblj1rmSZ4kTRcKQPwV0U4b2yeI+uwgSUQ+LmPn9h/MMr2bppnCAYghuNbzvP36FDFZaOxTvSiKbPCbizgUeZQCQMsBY4zmE/SOZqrn+b3NdS9RKgDxfcF6Edmn6WWLA2PTuIjoQNJMnryBb9UvHYAFo4FNNL1fs43xLoCDSRI4XQV9oZ2+AWA7Eaec7wPgF+FcDWw2oig60Ct1u0g/+gpAy7H4DSQLQap0piKFKdj2YSJqtHtbt+B2l5mvBABDBEJlAt/3e4BupA/giFC5wFcagAU3ijcA2AzgNgD29zoddiWuowCOLVyVq2oOVOoS0E0cY0wdYKhF0CvzLSDr2WCMsWlQXwWwKf7pZbWVs14E4DkANk3+OWa26XG1OmozAnRSdXJy8rK5ublb7aWCiOwosRbAaEFRmANwTkTsmX5sdHT0+K5du/5TUFulmK09AO1UmpqaWjM7O3sNEVkY1sY/V4pI80NEK+L0tVYK2yUAl0Rkhogu2U/873NxwM+NjY29uXPnzrdLiUqJjfwPv88HKuMCFxkAAAAASUVORK5CYII=";

var audioIcon$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAAzxJREFUWEftmE1rU1EQhp+5N2msQVCogtWCC0EwG4OCG3+ClGpxobhQ8GMjKFjbFBfWVBQpght3LvzoxoVYwT8gLkQQNyKKigEXpXXhB9LEmOSMTK7R1sTkRpOmggMhJ+TcmefOmXPeuVeYZzo6uhPnDgIJRLrn/9eG8WfgCdHoFRkff1TxLzbQoaE4kchNYFcbAtd36XmObDYtly+ftYkBUCp1F+hfdJhKQFXw/SE5f/6S6PDwAJ53p2MwP6FyqG4UHRm5jcjujgOVl0pPiKZSL4BNSwIIbhjQW6BviQDdaj2QFahZqQSFghUrdHWFvd8WADkXBDZbtgxWrYLeXujrC77fvYOpqQCssf0BUD4PkQgsXw5r1sC6dUFwG69eDbFYVVg9dw6Zm2uMA00C2V3u2RMArFwJnhcmCDo+jmSzYeY2AeQcum0bYkBN2pIAcrlcWQaku3txM6SquOlp3OwsxUwGMhl0ZgZvdpaukyfxtmxpP1Dh6VOKjx/jMhm8Dx/w8nk8Efx4HM92mghYER8+DIlE+4Hc1avIy5dINGrHffD51ayIjxxZHCAmJ+HZs/ql/R/on8mQSUmlrg4c6HANmaAmEtDfH2ia/fb9Nuyy7/qlySSydy81i9qyEo/DyEiVurf2pDYRHRiADRvQfB7p6akNVEdaNJ1GcrkwgtNAy6ytOHasDLPAam17VUpr1+IfP75gqrMDMp3GCyfEdYBsCVasQE+fDh5N5plOTiI1dpn78oXi4CBdO3aUZ2upRP76dWLPnyPWsjS2+hlyIsjYGDKv47MzWScm8N6/r3YvQuHjRwq9veWl1TdviBUK+CYn4aw+kBaLfE0mie3b98Pd1/v3iUxNBZr1OxMpZ0esf6olK7+/snE/VJqbI9/Tg5dM4l69Ivr6NVFrzpoLFC4/zXSMznZYLFZVT2EjhZzXOEMhHbVqWhnIZHtzqzz+lR/VawZkbz32/5WjVl3s3CHR0dHtOPcQsTavg6Y6Qza7qfI6ZgzVM+XWszNWpFTaJRMT934QaCp1CjgDxBeNyY4OkWlEjsqFC/cs7oKU6PDwekQGEdmKc9WPoK0i9X1FJIdzD1C9LRcvfqq4/gYOF90Ot1xnCQAAAABJRU5ErkJggg==";

//
var script$4H = {
  name: 'audio-play',
  props: {
    url: {
      type: String,
      default: '',
      require: true
    },
    mobile: {
      type: Boolean,
      default: false
    },
    isLineFile: {
      type: Boolean,
      default: false
    },
    playbackControl: {
      type: String,
      default: '0'
    }
  },
  data() {
    return {
      playIcon: playIcon$3,
      pauseIcon: pauseIcon$2,
      audioIcon: audioIcon$1,
      isPlay: false,
      playTime: 0,
      playDuration: '00:00',
      playCurrentTime: '00:00',
      totalDuration: 0,
      isShowPlay: false
    };
  },
  watch: {
    url: {
      handler() {
        this.isPlay = false;
      }
    }
  },
  methods: {
    changeDuration() {
      this.$nextTick(() => {
        this.playDuration = this.timeFormat(this.$refs.musicAudio.duration);
        this.totalDuration = this.$refs.musicAudio.duration;
      });
    },
    //将单位为秒的的时间转换成mm:ss的形式
    timeFormat(num) {
      let minute = parseInt(num / 60);
      let second = parseInt(num % 60);
      minute = minute >= 10 ? minute : "0" + minute;
      second = second >= 10 ? second : "0" + second;
      return minute + ":" + second;
    },
    play() {
      // console.log()
      let audio = document.querySelectorAll('audio');
      audio.forEach(i => i.pause());
      let video = document.querySelectorAll('video');
      if (video && video.length) {
        video.forEach(i => i.pause());
      }
      this.isPlay ? this.$refs.musicAudio.pause() : this.$refs.musicAudio.play();
      this.isPlay = !this.isPlay;
      this.$emit('play');
    },
    updateTime() {
      this.playTime = this.$refs.musicAudio.currentTime;
      this.playCurrentTime = this.timeFormat(this.$refs.musicAudio.currentTime);
      if (this.playTime >= this.totalDuration) {
        this.isPlay = false;
      }
    },
    changeTime(val) {
      this.$refs.musicAudio.currentTime = val;
    }
  }
};

/* script */
const __vue_script__$4H = script$4H;
/* template */
var __vue_render__$4H = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticStyle: { width: "100%" } }, [
    !_vm.mobile && !_vm.isLineFile
      ? _c("div", { staticClass: "audio", attrs: { flex: "" } }, [
          _c("div", { staticClass: "audio-icon" }, [
            _c("img", { attrs: { src: _vm.audioIcon, alt: "" } }),
          ]),
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "audio-controls",
              attrs: { flex: "dir:top main:justify" },
            },
            [
              _c(
                "div",
                {
                  staticClass: "audio-controls--handler",
                  attrs: { flex: "main:justify cross:center" },
                },
                [
                  _c("div", { staticClass: "current-time" }, [
                    _vm._v(_vm._s(_vm.playCurrentTime)),
                  ]),
                  _vm._v(" "),
                  _c("div", { staticClass: "play" }, [
                    _c("img", {
                      staticClass: "play-handler",
                      attrs: { src: _vm.isPlay ? _vm.pauseIcon : _vm.playIcon },
                      on: {
                        click: function ($event) {
                          $event.stopPropagation();
                          return _vm.play.apply(null, arguments)
                        },
                      },
                    }),
                  ]),
                  _vm._v(" "),
                  _c("div", { staticClass: "total-time" }, [
                    _vm._v(_vm._s(_vm.playDuration)),
                  ]),
                ]
              ),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "audio-controls--progress" },
                [
                  _c("el-slider", {
                    attrs: {
                      disabled: _vm.playbackControl === "1",
                      max: _vm.totalDuration,
                      "show-tooltip": false,
                    },
                    on: { change: _vm.changeTime },
                    model: {
                      value: _vm.playTime,
                      callback: function ($$v) {
                        _vm.playTime = $$v;
                      },
                      expression: "playTime",
                    },
                  }),
                ],
                1
              ),
            ]
          ),
        ])
      : _c(
          "div",
          [
            _c("img", {
              staticClass: "play-handler mobile",
              attrs: { src: _vm.isPlay ? _vm.pauseIcon : _vm.playIcon },
              on: {
                click: function ($event) {
                  $event.stopPropagation();
                  _vm.isShowPlay = true;
                },
              },
            }),
            _vm._v(" "),
            _c(
              "el-dialog",
              {
                attrs: {
                  width: "100%",
                  top: "60px",
                  "custom-class": "video-play--dialog",
                  "destroy-on-close": "",
                  "append-to-body": "",
                  visible: _vm.isShowPlay,
                },
                on: {
                  "update:visible": function ($event) {
                    _vm.isShowPlay = $event;
                  },
                },
              },
              [
                _c("div", { staticClass: "audio", attrs: { flex: "" } }, [
                  _c("div", { staticClass: "audio-icon" }, [
                    _c("img", { attrs: { src: _vm.audioIcon, alt: "" } }),
                  ]),
                  _vm._v(" "),
                  _c(
                    "div",
                    {
                      staticClass: "audio-controls",
                      attrs: { flex: "dir:top main:justify" },
                    },
                    [
                      _c(
                        "div",
                        {
                          staticClass: "audio-controls--handler",
                          attrs: { flex: "main:justify cross:center" },
                        },
                        [
                          _c("div", { staticClass: "current-time" }, [
                            _vm._v(_vm._s(_vm.playCurrentTime)),
                          ]),
                          _vm._v(" "),
                          _c("div", { staticClass: "play" }, [
                            _c("img", {
                              staticClass: "play-handler",
                              attrs: {
                                src: _vm.isPlay ? _vm.pauseIcon : _vm.playIcon,
                              },
                              on: {
                                click: function ($event) {
                                  $event.stopPropagation();
                                  return _vm.play.apply(null, arguments)
                                },
                              },
                            }),
                          ]),
                          _vm._v(" "),
                          _c("div", { staticClass: "total-time" }, [
                            _vm._v(_vm._s(_vm.playDuration)),
                          ]),
                        ]
                      ),
                      _vm._v(" "),
                      _c(
                        "div",
                        { staticClass: "audio-controls--progress" },
                        [
                          _c("el-slider", {
                            attrs: {
                              disabled: _vm.playbackControl === "1",
                              max: _vm.totalDuration,
                              "show-tooltip": false,
                            },
                            on: { change: _vm.changeTime },
                            model: {
                              value: _vm.playTime,
                              callback: function ($$v) {
                                _vm.playTime = $$v;
                              },
                              expression: "playTime",
                            },
                          }),
                        ],
                        1
                      ),
                    ]
                  ),
                ]),
              ]
            ),
          ],
          1
        ),
    _vm._v(" "),
    _c("audio", {
      ref: "musicAudio",
      staticClass: "audio-component",
      attrs: { controls: "", preload: "auto", src: _vm.url },
      on: {
        canplay: _vm.changeDuration,
        timeupdate: _vm.updateTime,
        pause: function ($event) {
          _vm.isPlay = false;
        },
      },
    }),
  ])
};
var __vue_staticRenderFns__$4H = [];
__vue_render__$4H._withStripped = true;

  /* style */
  const __vue_inject_styles__$4H = undefined;
  /* scoped */
  const __vue_scope_id__$4H = "data-v-25355b9e";
  /* module identifier */
  const __vue_module_identifier__$4H = undefined;
  /* functional template */
  const __vue_is_functional_template__$4H = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4H = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4H, staticRenderFns: __vue_staticRenderFns__$4H },
    __vue_inject_styles__$4H,
    __vue_script__$4H,
    __vue_scope_id__$4H,
    __vue_is_functional_template__$4H,
    __vue_module_identifier__$4H,
    false,
    undefined,
    undefined,
    undefined
  );

var videoIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAaRJREFUSEu91surTXEUwPHP8iiSyAQTpRRTUkqu3CHFkETdy8BcKFNGir/AwKM8YuRRjOTGnfEHGJgwwUQMjDyWftr7dhxn733O0blruNfju9dvPX6/0CKZuQYHcQBbsL4y/4S3eILHEfG1KUwMUmTmOpzHKRRIm5TgV3EpIj73G/4DyMy9uIcNHYH71R9xJCJe9Cr+AmTmMdzE0hGD1+Y/MRMRt+sPC4DM3IPnWDZm8NrtB6YjYr58+APIzLV401PE/2QoTbAtIr7UgMs42xC1pP0AO7B5BPKViDgXmbkaH7CqwXk+IqYys+gv4nSdeQfsGzYWwCyutxjPRcR0rc/M3VUjlLnokhMFcAdHhwVUNVuJCziDJS2+dwvgFXaOAujJZleVzdYG/9cF8A6bxgFU2azAM5Sj65f3iwKY+BFNvMgzuDFsDUZs09nJD1rVCV2r4iG2j7UqFmXZVZApzHVMZtdqKPpf2BcRLxfWdc9kHsc1LB8m0gCb7zgZEbdq3aArs2Ryf8wr83D9542A6rgmd+n3pl09Ww5hf8Oz5SketT1bfgPyir14bBOMeQAAAABJRU5ErkJggg==";

var win;
if (typeof window !== "undefined") {
  win = window;
} else if (typeof commonjsGlobal !== "undefined") {
  win = commonjsGlobal;
} else if (typeof self !== "undefined") {
  win = self;
} else {
  win = {};
}
var window_1 = win;

var slice = Array.prototype.slice;
var domWalk = iterativelyWalk;
function iterativelyWalk(nodes, cb) {
  if (!('length' in nodes)) {
    nodes = [nodes];
  }
  nodes = slice.call(nodes);
  while (nodes.length) {
    var node = nodes.shift(),
      ret = cb(node);
    if (ret) {
      return ret;
    }
    if (node.childNodes && node.childNodes.length) {
      nodes = slice.call(node.childNodes).concat(nodes);
    }
  }
}

var domComment = Comment;
function Comment(data, owner) {
  if (!(this instanceof Comment)) {
    return new Comment(data, owner);
  }
  this.data = data;
  this.nodeValue = data;
  this.length = data.length;
  this.ownerDocument = owner || null;
}
Comment.prototype.nodeType = 8;
Comment.prototype.nodeName = "#comment";
Comment.prototype.toString = function _Comment_toString() {
  return "[object Comment]";
};

var domText = DOMText;
function DOMText(value, owner) {
  if (!(this instanceof DOMText)) {
    return new DOMText(value);
  }
  this.data = value || "";
  this.length = this.data.length;
  this.ownerDocument = owner || null;
}
DOMText.prototype.type = "DOMTextNode";
DOMText.prototype.nodeType = 3;
DOMText.prototype.nodeName = "#text";
DOMText.prototype.toString = function _Text_toString() {
  return this.data;
};
DOMText.prototype.replaceData = function replaceData(index, length, value) {
  var current = this.data;
  var left = current.substring(0, index);
  var right = current.substring(index + length, current.length);
  this.data = left + value + right;
  this.length = this.data.length;
};

var dispatchEvent_1 = dispatchEvent;
function dispatchEvent(ev) {
  var elem = this;
  var type = ev.type;
  if (!ev.target) {
    ev.target = elem;
  }
  if (!elem.listeners) {
    elem.listeners = {};
  }
  var listeners = elem.listeners[type];
  if (listeners) {
    return listeners.forEach(function (listener) {
      ev.currentTarget = elem;
      if (typeof listener === 'function') {
        listener(ev);
      } else {
        listener.handleEvent(ev);
      }
    });
  }
  if (elem.parentNode) {
    elem.parentNode.dispatchEvent(ev);
  }
}

var addEventListener_1 = addEventListener;
function addEventListener(type, listener) {
  var elem = this;
  if (!elem.listeners) {
    elem.listeners = {};
  }
  if (!elem.listeners[type]) {
    elem.listeners[type] = [];
  }
  if (elem.listeners[type].indexOf(listener) === -1) {
    elem.listeners[type].push(listener);
  }
}

var removeEventListener_1 = removeEventListener;
function removeEventListener(type, listener) {
  var elem = this;
  if (!elem.listeners) {
    return;
  }
  if (!elem.listeners[type]) {
    return;
  }
  var list = elem.listeners[type];
  var index = list.indexOf(listener);
  if (index !== -1) {
    list.splice(index, 1);
  }
}

var serialize = serializeNode;
var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr"];
function serializeNode(node) {
  switch (node.nodeType) {
    case 3:
      return escapeText(node.data);
    case 8:
      return "<!--" + node.data + "-->";
    default:
      return serializeElement(node);
  }
}
function serializeElement(elem) {
  var strings = [];
  var tagname = elem.tagName;
  if (elem.namespaceURI === "http://www.w3.org/1999/xhtml") {
    tagname = tagname.toLowerCase();
  }
  strings.push("<" + tagname + properties(elem) + datasetify(elem));
  if (voidElements.indexOf(tagname) > -1) {
    strings.push(" />");
  } else {
    strings.push(">");
    if (elem.childNodes.length) {
      strings.push.apply(strings, elem.childNodes.map(serializeNode));
    } else if (elem.textContent || elem.innerText) {
      strings.push(escapeText(elem.textContent || elem.innerText));
    } else if (elem.innerHTML) {
      strings.push(elem.innerHTML);
    }
    strings.push("</" + tagname + ">");
  }
  return strings.join("");
}
function isProperty(elem, key) {
  var type = typeof elem[key];
  if (key === "style" && Object.keys(elem.style).length > 0) {
    return true;
  }
  return elem.hasOwnProperty(key) && (type === "string" || type === "boolean" || type === "number") && key !== "nodeName" && key !== "className" && key !== "tagName" && key !== "textContent" && key !== "innerText" && key !== "namespaceURI" && key !== "innerHTML";
}
function stylify(styles) {
  if (typeof styles === 'string') return styles;
  var attr = "";
  Object.keys(styles).forEach(function (key) {
    var value = styles[key];
    key = key.replace(/[A-Z]/g, function (c) {
      return "-" + c.toLowerCase();
    });
    attr += key + ":" + value + ";";
  });
  return attr;
}
function datasetify(elem) {
  var ds = elem.dataset;
  var props = [];
  for (var key in ds) {
    props.push({
      name: "data-" + key,
      value: ds[key]
    });
  }
  return props.length ? stringify(props) : "";
}
function stringify(list) {
  var attributes = [];
  list.forEach(function (tuple) {
    var name = tuple.name;
    var value = tuple.value;
    if (name === "style") {
      value = stylify(value);
    }
    attributes.push(name + "=" + "\"" + escapeAttributeValue(value) + "\"");
  });
  return attributes.length ? " " + attributes.join(" ") : "";
}
function properties(elem) {
  var props = [];
  for (var key in elem) {
    if (isProperty(elem, key)) {
      props.push({
        name: key,
        value: elem[key]
      });
    }
  }
  for (var ns in elem._attributes) {
    for (var attribute in elem._attributes[ns]) {
      var prop = elem._attributes[ns][attribute];
      var name = (prop.prefix ? prop.prefix + ":" : "") + attribute;
      props.push({
        name: name,
        value: prop.value
      });
    }
  }
  if (elem.className) {
    props.push({
      name: "class",
      value: elem.className
    });
  }
  return props.length ? stringify(props) : "";
}
function escapeText(s) {
  var str = '';
  if (typeof s === 'string') {
    str = s;
  } else if (s) {
    str = s.toString();
  }
  return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
}
function escapeAttributeValue(str) {
  return escapeText(str).replace(/"/g, "&quot;");
}

var htmlns = "http://www.w3.org/1999/xhtml";
var domElement = DOMElement;
function DOMElement(tagName, owner, namespace) {
  if (!(this instanceof DOMElement)) {
    return new DOMElement(tagName);
  }
  var ns = namespace === undefined ? htmlns : namespace || null;
  this.tagName = ns === htmlns ? String(tagName).toUpperCase() : tagName;
  this.nodeName = this.tagName;
  this.className = "";
  this.dataset = {};
  this.childNodes = [];
  this.parentNode = null;
  this.style = {};
  this.ownerDocument = owner || null;
  this.namespaceURI = ns;
  this._attributes = {};
  if (this.tagName === 'INPUT') {
    this.type = 'text';
  }
}
DOMElement.prototype.type = "DOMElement";
DOMElement.prototype.nodeType = 1;
DOMElement.prototype.appendChild = function _Element_appendChild(child) {
  if (child.parentNode) {
    child.parentNode.removeChild(child);
  }
  this.childNodes.push(child);
  child.parentNode = this;
  return child;
};
DOMElement.prototype.replaceChild = function _Element_replaceChild(elem, needle) {
  // TODO: Throw NotFoundError if needle.parentNode !== this

  if (elem.parentNode) {
    elem.parentNode.removeChild(elem);
  }
  var index = this.childNodes.indexOf(needle);
  needle.parentNode = null;
  this.childNodes[index] = elem;
  elem.parentNode = this;
  return needle;
};
DOMElement.prototype.removeChild = function _Element_removeChild(elem) {
  // TODO: Throw NotFoundError if elem.parentNode !== this

  var index = this.childNodes.indexOf(elem);
  this.childNodes.splice(index, 1);
  elem.parentNode = null;
  return elem;
};
DOMElement.prototype.insertBefore = function _Element_insertBefore(elem, needle) {
  // TODO: Throw NotFoundError if referenceElement is a dom node
  // and parentNode !== this

  if (elem.parentNode) {
    elem.parentNode.removeChild(elem);
  }
  var index = needle === null || needle === undefined ? -1 : this.childNodes.indexOf(needle);
  if (index > -1) {
    this.childNodes.splice(index, 0, elem);
  } else {
    this.childNodes.push(elem);
  }
  elem.parentNode = this;
  return elem;
};
DOMElement.prototype.setAttributeNS = function _Element_setAttributeNS(namespace, name, value) {
  var prefix = null;
  var localName = name;
  var colonPosition = name.indexOf(":");
  if (colonPosition > -1) {
    prefix = name.substr(0, colonPosition);
    localName = name.substr(colonPosition + 1);
  }
  if (this.tagName === 'INPUT' && name === 'type') {
    this.type = value;
  } else {
    var attributes = this._attributes[namespace] || (this._attributes[namespace] = {});
    attributes[localName] = {
      value: value,
      prefix: prefix
    };
  }
};
DOMElement.prototype.getAttributeNS = function _Element_getAttributeNS(namespace, name) {
  var attributes = this._attributes[namespace];
  var value = attributes && attributes[name] && attributes[name].value;
  if (this.tagName === 'INPUT' && name === 'type') {
    return this.type;
  }
  if (typeof value !== "string") {
    return null;
  }
  return value;
};
DOMElement.prototype.removeAttributeNS = function _Element_removeAttributeNS(namespace, name) {
  var attributes = this._attributes[namespace];
  if (attributes) {
    delete attributes[name];
  }
};
DOMElement.prototype.hasAttributeNS = function _Element_hasAttributeNS(namespace, name) {
  var attributes = this._attributes[namespace];
  return !!attributes && name in attributes;
};
DOMElement.prototype.setAttribute = function _Element_setAttribute(name, value) {
  return this.setAttributeNS(null, name, value);
};
DOMElement.prototype.getAttribute = function _Element_getAttribute(name) {
  return this.getAttributeNS(null, name);
};
DOMElement.prototype.removeAttribute = function _Element_removeAttribute(name) {
  return this.removeAttributeNS(null, name);
};
DOMElement.prototype.hasAttribute = function _Element_hasAttribute(name) {
  return this.hasAttributeNS(null, name);
};
DOMElement.prototype.removeEventListener = removeEventListener_1;
DOMElement.prototype.addEventListener = addEventListener_1;
DOMElement.prototype.dispatchEvent = dispatchEvent_1;

// Un-implemented
DOMElement.prototype.focus = function _Element_focus() {
  return void 0;
};
DOMElement.prototype.toString = function _Element_toString() {
  return serialize(this);
};
DOMElement.prototype.getElementsByClassName = function _Element_getElementsByClassName(classNames) {
  var classes = classNames.split(" ");
  var elems = [];
  domWalk(this, function (node) {
    if (node.nodeType === 1) {
      var nodeClassName = node.className || "";
      var nodeClasses = nodeClassName.split(" ");
      if (classes.every(function (item) {
        return nodeClasses.indexOf(item) !== -1;
      })) {
        elems.push(node);
      }
    }
  });
  return elems;
};
DOMElement.prototype.getElementsByTagName = function _Element_getElementsByTagName(tagName) {
  tagName = tagName.toLowerCase();
  var elems = [];
  domWalk(this.childNodes, function (node) {
    if (node.nodeType === 1 && (tagName === '*' || node.tagName.toLowerCase() === tagName)) {
      elems.push(node);
    }
  });
  return elems;
};
DOMElement.prototype.contains = function _Element_contains(element) {
  return domWalk(this, function (node) {
    return element === node;
  }) || false;
};

var domFragment = DocumentFragment;
function DocumentFragment(owner) {
  if (!(this instanceof DocumentFragment)) {
    return new DocumentFragment();
  }
  this.childNodes = [];
  this.parentNode = null;
  this.ownerDocument = owner || null;
}
DocumentFragment.prototype.type = "DocumentFragment";
DocumentFragment.prototype.nodeType = 11;
DocumentFragment.prototype.nodeName = "#document-fragment";
DocumentFragment.prototype.appendChild = domElement.prototype.appendChild;
DocumentFragment.prototype.replaceChild = domElement.prototype.replaceChild;
DocumentFragment.prototype.removeChild = domElement.prototype.removeChild;
DocumentFragment.prototype.toString = function _DocumentFragment_toString() {
  return this.childNodes.map(function (node) {
    return String(node);
  }).join("");
};

var event$1 = Event$1;
function Event$1(family) {}
Event$1.prototype.initEvent = function _Event_initEvent(type, bubbles, cancelable) {
  this.type = type;
  this.bubbles = bubbles;
  this.cancelable = cancelable;
};
Event$1.prototype.preventDefault = function _Event_preventDefault() {};

var document$2 = Document;
function Document() {
  if (!(this instanceof Document)) {
    return new Document();
  }
  this.head = this.createElement("head");
  this.body = this.createElement("body");
  this.documentElement = this.createElement("html");
  this.documentElement.appendChild(this.head);
  this.documentElement.appendChild(this.body);
  this.childNodes = [this.documentElement];
  this.nodeType = 9;
}
var proto = Document.prototype;
proto.createTextNode = function createTextNode(value) {
  return new domText(value, this);
};
proto.createElementNS = function createElementNS(namespace, tagName) {
  var ns = namespace === null ? null : String(namespace);
  return new domElement(tagName, this, ns);
};
proto.createElement = function createElement(tagName) {
  return new domElement(tagName, this);
};
proto.createDocumentFragment = function createDocumentFragment() {
  return new domFragment(this);
};
proto.createEvent = function createEvent(family) {
  return new event$1();
};
proto.createComment = function createComment(data) {
  return new domComment(data, this);
};
proto.getElementById = function getElementById(id) {
  id = String(id);
  var result = domWalk(this.childNodes, function (node) {
    if (String(node.id) === id) {
      return node;
    }
  });
  return result || null;
};
proto.getElementsByClassName = domElement.prototype.getElementsByClassName;
proto.getElementsByTagName = domElement.prototype.getElementsByTagName;
proto.contains = domElement.prototype.contains;
proto.removeEventListener = removeEventListener_1;
proto.addEventListener = addEventListener_1;
proto.dispatchEvent = dispatchEvent_1;

var minDocument = new document$2();

var topLevel = typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : typeof window !== 'undefined' ? window : {};

var doccy;
if (typeof document !== 'undefined') {
  doccy = document;
} else {
  doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];
  if (!doccy) {
    doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDocument;
  }
}
var document_1 = doccy;

function clean(s) {
  return s.replace(/\n\r?\s*/g, '');
}
var tsml$1 = function tsml(sa) {
  var s = '',
    i = 0;
  for (; i < arguments.length; i++) s += clean(sa[i]) + (arguments[i + 1] || '');
  return s;
};

var tuple = SafeParseTuple;
function SafeParseTuple(obj, reviver) {
  var json;
  var error = null;
  try {
    json = JSON.parse(obj, reviver);
  } catch (err) {
    error = err;
  }
  return [error, json];
}

var isFunction_1 = isFunction;
var toString$1 = Object.prototype.toString;
function isFunction(fn) {
  if (!fn) {
    return false;
  }
  var string = toString$1.call(fn);
  return string === '[object Function]' || typeof fn === 'function' && string !== '[object RegExp]' || typeof window !== 'undefined' && (
  // IE8 and below
  fn === window.setTimeout || fn === window.alert || fn === window.confirm || fn === window.prompt);
}

var trim = function (string) {
    return string.replace(/^\s+|\s+$/g, '');
  },
  isArray = function (arg) {
    return Object.prototype.toString.call(arg) === '[object Array]';
  };
var parseHeaders = function (headers) {
  if (!headers) return {};
  var result = {};
  var headersArr = trim(headers).split('\n');
  for (var i = 0; i < headersArr.length; i++) {
    var row = headersArr[i];
    var index = row.indexOf(':'),
      key = trim(row.slice(0, index)).toLowerCase(),
      value = trim(row.slice(index + 1));
    if (typeof result[key] === 'undefined') {
      result[key] = value;
    } else if (isArray(result[key])) {
      result[key].push(value);
    } else {
      result[key] = [result[key], value];
    }
  }
  return result;
};

var immutable = extend$2;
var hasOwnProperty = Object.prototype.hasOwnProperty;
function extend$2() {
  var target = {};
  for (var i = 0; i < arguments.length; i++) {
    var source = arguments[i];
    for (var key in source) {
      if (hasOwnProperty.call(source, key)) {
        target[key] = source[key];
      }
    }
  }
  return target;
}

var xhr$1 = createXHR;
createXHR.XMLHttpRequest = window_1.XMLHttpRequest || noop$2;
createXHR.XDomainRequest = "withCredentials" in new createXHR.XMLHttpRequest() ? createXHR.XMLHttpRequest : window_1.XDomainRequest;
forEachArray(["get", "put", "post", "patch", "head", "delete"], function (method) {
  createXHR[method === "delete" ? "del" : method] = function (uri, options, callback) {
    options = initParams(uri, options, callback);
    options.method = method.toUpperCase();
    return _createXHR(options);
  };
});
function forEachArray(array, iterator) {
  for (var i = 0; i < array.length; i++) {
    iterator(array[i]);
  }
}
function isEmpty(obj) {
  for (var i in obj) {
    if (obj.hasOwnProperty(i)) return false;
  }
  return true;
}
function initParams(uri, options, callback) {
  var params = uri;
  if (isFunction_1(options)) {
    callback = options;
    if (typeof uri === "string") {
      params = {
        uri: uri
      };
    }
  } else {
    params = immutable(options, {
      uri: uri
    });
  }
  params.callback = callback;
  return params;
}
function createXHR(uri, options, callback) {
  options = initParams(uri, options, callback);
  return _createXHR(options);
}
function _createXHR(options) {
  if (typeof options.callback === "undefined") {
    throw new Error("callback argument missing");
  }
  var called = false;
  var callback = function cbOnce(err, response, body) {
    if (!called) {
      called = true;
      options.callback(err, response, body);
    }
  };
  function readystatechange() {
    if (xhr.readyState === 4) {
      setTimeout(loadFunc, 0);
    }
  }
  function getBody() {
    // Chrome with requestType=blob throws errors arround when even testing access to responseText
    var body = undefined;
    if (xhr.response) {
      body = xhr.response;
    } else {
      body = xhr.responseText || getXml(xhr);
    }
    if (isJson) {
      try {
        body = JSON.parse(body);
      } catch (e) {}
    }
    return body;
  }
  function errorFunc(evt) {
    clearTimeout(timeoutTimer);
    if (!(evt instanceof Error)) {
      evt = new Error("" + (evt || "Unknown XMLHttpRequest Error"));
    }
    evt.statusCode = 0;
    return callback(evt, failureResponse);
  }

  // will load the data & process the response in a special response object
  function loadFunc() {
    if (aborted) return;
    var status;
    clearTimeout(timeoutTimer);
    if (options.useXDR && xhr.status === undefined) {
      //IE8 CORS GET successful response doesn't have a status field, but body is fine
      status = 200;
    } else {
      status = xhr.status === 1223 ? 204 : xhr.status;
    }
    var response = failureResponse;
    var err = null;
    if (status !== 0) {
      response = {
        body: getBody(),
        statusCode: status,
        method: method,
        headers: {},
        url: uri,
        rawRequest: xhr
      };
      if (xhr.getAllResponseHeaders) {
        //remember xhr can in fact be XDR for CORS in IE
        response.headers = parseHeaders(xhr.getAllResponseHeaders());
      }
    } else {
      err = new Error("Internal XMLHttpRequest Error");
    }
    return callback(err, response, response.body);
  }
  var xhr = options.xhr || null;
  if (!xhr) {
    if (options.cors || options.useXDR) {
      xhr = new createXHR.XDomainRequest();
    } else {
      xhr = new createXHR.XMLHttpRequest();
    }
  }
  var key;
  var aborted;
  var uri = xhr.url = options.uri || options.url;
  var method = xhr.method = options.method || "GET";
  var body = options.body || options.data;
  var headers = xhr.headers = options.headers || {};
  var sync = !!options.sync;
  var isJson = false;
  var timeoutTimer;
  var failureResponse = {
    body: undefined,
    headers: {},
    statusCode: 0,
    method: method,
    url: uri,
    rawRequest: xhr
  };
  if ("json" in options && options.json !== false) {
    isJson = true;
    headers["accept"] || headers["Accept"] || (headers["Accept"] = "application/json"); //Don't override existing accept header declared by user
    if (method !== "GET" && method !== "HEAD") {
      headers["content-type"] || headers["Content-Type"] || (headers["Content-Type"] = "application/json"); //Don't override existing accept header declared by user
      body = JSON.stringify(options.json === true ? body : options.json);
    }
  }
  xhr.onreadystatechange = readystatechange;
  xhr.onload = loadFunc;
  xhr.onerror = errorFunc;
  // IE9 must have onprogress be set to a unique function.
  xhr.onprogress = function () {
    // IE must die
  };
  xhr.onabort = function () {
    aborted = true;
  };
  xhr.ontimeout = errorFunc;
  xhr.open(method, uri, !sync, options.username, options.password);
  //has to be after open
  if (!sync) {
    xhr.withCredentials = !!options.withCredentials;
  }
  // Cannot set timeout with sync request
  // not setting timeout on the xhr object, because of old webkits etc. not handling that correctly
  // both npm's request and jquery 1.x use this kind of timeout, so this is being consistent
  if (!sync && options.timeout > 0) {
    timeoutTimer = setTimeout(function () {
      if (aborted) return;
      aborted = true; //IE9 may still call readystatechange
      xhr.abort("timeout");
      var e = new Error("XMLHttpRequest timeout");
      e.code = "ETIMEDOUT";
      errorFunc(e);
    }, options.timeout);
  }
  if (xhr.setRequestHeader) {
    for (key in headers) {
      if (headers.hasOwnProperty(key)) {
        xhr.setRequestHeader(key, headers[key]);
      }
    }
  } else if (options.headers && !isEmpty(options.headers)) {
    throw new Error("Headers cannot be set on an XDomainRequest object");
  }
  if ("responseType" in options) {
    xhr.responseType = options.responseType;
  }
  if ("beforeSend" in options && typeof options.beforeSend === "function") {
    options.beforeSend(xhr);
  }

  // Microsoft Edge browser sends "undefined" when send is called with undefined value.
  // XMLHttpRequest spec says to pass null as body to indicate no body
  // See https://github.com/naugtur/xhr/issues/100.
  xhr.send(body || null);
  return xhr;
}
function getXml(xhr) {
  if (xhr.responseType === "document") {
    return xhr.responseXML;
  }
  var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === "parsererror";
  if (xhr.responseType === "" && !firefoxBugTakenEffect) {
    return xhr.responseXML;
  }
  return null;
}
function noop$2() {}

/**
 * Copyright 2013 vtt.js Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
var _objCreate = Object.create || function () {
  function F() {}
  return function (o) {
    if (arguments.length !== 1) {
      throw new Error('Object.create shim only accepts one parameter.');
    }
    F.prototype = o;
    return new F();
  };
}();

// Creates a new ParserError object from an errorData object. The errorData
// object should have default code and message properties. The default message
// property can be overriden by passing in a message parameter.
// See ParsingError.Errors below for acceptable errors.
function ParsingError(errorData, message) {
  this.name = "ParsingError";
  this.code = errorData.code;
  this.message = message || errorData.message;
}
ParsingError.prototype = _objCreate(Error.prototype);
ParsingError.prototype.constructor = ParsingError;

// ParsingError metadata for acceptable ParsingErrors.
ParsingError.Errors = {
  BadSignature: {
    code: 0,
    message: "Malformed WebVTT signature."
  },
  BadTimeStamp: {
    code: 1,
    message: "Malformed time stamp."
  }
};

// Try to parse input as a time stamp.
function parseTimeStamp(input) {
  function computeSeconds(h, m, s, f) {
    return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;
  }
  var m = input.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);
  if (!m) {
    return null;
  }
  if (m[3]) {
    // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]
    return computeSeconds(m[1], m[2], m[3].replace(":", ""), m[4]);
  } else if (m[1] > 59) {
    // Timestamp takes the form of [hours]:[minutes].[milliseconds]
    // First position is hours as it's over 59.
    return computeSeconds(m[1], m[2], 0, m[4]);
  } else {
    // Timestamp takes the form of [minutes]:[seconds].[milliseconds]
    return computeSeconds(0, m[1], m[2], m[4]);
  }
}

// A settings object holds key/value pairs and will ignore anything but the first
// assignment to a specific key.
function Settings() {
  this.values = _objCreate(null);
}
Settings.prototype = {
  // Only accept the first assignment to any key.
  set: function (k, v) {
    if (!this.get(k) && v !== "") {
      this.values[k] = v;
    }
  },
  // Return the value for a key, or a default value.
  // If 'defaultKey' is passed then 'dflt' is assumed to be an object with
  // a number of possible default values as properties where 'defaultKey' is
  // the key of the property that will be chosen; otherwise it's assumed to be
  // a single value.
  get: function (k, dflt, defaultKey) {
    if (defaultKey) {
      return this.has(k) ? this.values[k] : dflt[defaultKey];
    }
    return this.has(k) ? this.values[k] : dflt;
  },
  // Check whether we have a value for a key.
  has: function (k) {
    return k in this.values;
  },
  // Accept a setting if its one of the given alternatives.
  alt: function (k, v, a) {
    for (var n = 0; n < a.length; ++n) {
      if (v === a[n]) {
        this.set(k, v);
        break;
      }
    }
  },
  // Accept a setting if its a valid (signed) integer.
  integer: function (k, v) {
    if (/^-?\d+$/.test(v)) {
      // integer
      this.set(k, parseInt(v, 10));
    }
  },
  // Accept a setting if its a valid percentage.
  percent: function (k, v) {
    if (v.match(/^([\d]{1,3})(\.[\d]*)?%$/)) {
      v = parseFloat(v);
      if (v >= 0 && v <= 100) {
        this.set(k, v);
        return true;
      }
    }
    return false;
  }
};

// Helper function to parse input into groups separated by 'groupDelim', and
// interprete each group as a key/value pair separated by 'keyValueDelim'.
function parseOptions(input, callback, keyValueDelim, groupDelim) {
  var groups = groupDelim ? input.split(groupDelim) : [input];
  for (var i in groups) {
    if (typeof groups[i] !== "string") {
      continue;
    }
    var kv = groups[i].split(keyValueDelim);
    if (kv.length !== 2) {
      continue;
    }
    var k = kv[0];
    var v = kv[1];
    callback(k, v);
  }
}
function parseCue(input, cue, regionList) {
  // Remember the original input if we need to throw an error.
  var oInput = input;
  // 4.1 WebVTT timestamp
  function consumeTimeStamp() {
    var ts = parseTimeStamp(input);
    if (ts === null) {
      throw new ParsingError(ParsingError.Errors.BadTimeStamp, "Malformed timestamp: " + oInput);
    }
    // Remove time stamp from input.
    input = input.replace(/^[^\sa-zA-Z-]+/, "");
    return ts;
  }

  // 4.4.2 WebVTT cue settings
  function consumeCueSettings(input, cue) {
    var settings = new Settings();
    parseOptions(input, function (k, v) {
      switch (k) {
        case "region":
          // Find the last region we parsed with the same region id.
          for (var i = regionList.length - 1; i >= 0; i--) {
            if (regionList[i].id === v) {
              settings.set(k, regionList[i].region);
              break;
            }
          }
          break;
        case "vertical":
          settings.alt(k, v, ["rl", "lr"]);
          break;
        case "line":
          var vals = v.split(","),
            vals0 = vals[0];
          settings.integer(k, vals0);
          settings.percent(k, vals0) ? settings.set("snapToLines", false) : null;
          settings.alt(k, vals0, ["auto"]);
          if (vals.length === 2) {
            settings.alt("lineAlign", vals[1], ["start", "middle", "end"]);
          }
          break;
        case "position":
          vals = v.split(",");
          settings.percent(k, vals[0]);
          if (vals.length === 2) {
            settings.alt("positionAlign", vals[1], ["start", "middle", "end"]);
          }
          break;
        case "size":
          settings.percent(k, v);
          break;
        case "align":
          settings.alt(k, v, ["start", "middle", "end", "left", "right"]);
          break;
      }
    }, /:/, /\s/);

    // Apply default values for any missing fields.
    cue.region = settings.get("region", null);
    cue.vertical = settings.get("vertical", "");
    cue.line = settings.get("line", "auto");
    cue.lineAlign = settings.get("lineAlign", "start");
    cue.snapToLines = settings.get("snapToLines", true);
    cue.size = settings.get("size", 100);
    cue.align = settings.get("align", "middle");
    cue.position = settings.get("position", {
      start: 0,
      left: 0,
      middle: 50,
      end: 100,
      right: 100
    }, cue.align);
    cue.positionAlign = settings.get("positionAlign", {
      start: "start",
      left: "start",
      middle: "middle",
      end: "end",
      right: "end"
    }, cue.align);
  }
  function skipWhitespace() {
    input = input.replace(/^\s+/, "");
  }

  // 4.1 WebVTT cue timings.
  skipWhitespace();
  cue.startTime = consumeTimeStamp(); // (1) collect cue start time
  skipWhitespace();
  if (input.substr(0, 3) !== "-->") {
    // (3) next characters must match "-->"
    throw new ParsingError(ParsingError.Errors.BadTimeStamp, "Malformed time stamp (time stamps must be separated by '-->'): " + oInput);
  }
  input = input.substr(3);
  skipWhitespace();
  cue.endTime = consumeTimeStamp(); // (5) collect cue end time

  // 4.1 WebVTT cue settings list.
  skipWhitespace();
  consumeCueSettings(input, cue);
}
var ESCAPE = {
  "&amp;": "&",
  "&lt;": "<",
  "&gt;": ">",
  "&lrm;": "\u200e",
  "&rlm;": "\u200f",
  "&nbsp;": "\u00a0"
};
var TAG_NAME = {
  c: "span",
  i: "i",
  b: "b",
  u: "u",
  ruby: "ruby",
  rt: "rt",
  v: "span",
  lang: "span"
};
var TAG_ANNOTATION = {
  v: "title",
  lang: "lang"
};
var NEEDS_PARENT = {
  rt: "ruby"
};

// Parse content into a document fragment.
function parseContent(window, input) {
  function nextToken() {
    // Check for end-of-string.
    if (!input) {
      return null;
    }

    // Consume 'n' characters from the input.
    function consume(result) {
      input = input.substr(result.length);
      return result;
    }
    var m = input.match(/^([^<]*)(<[^>]*>?)?/);
    // If there is some text before the next tag, return it, otherwise return
    // the tag.
    return consume(m[1] ? m[1] : m[2]);
  }

  // Unescape a string 's'.
  function unescape1(e) {
    return ESCAPE[e];
  }
  function unescape(s) {
    while (m = s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/)) {
      s = s.replace(m[0], unescape1);
    }
    return s;
  }
  function shouldAdd(current, element) {
    return !NEEDS_PARENT[element.localName] || NEEDS_PARENT[element.localName] === current.localName;
  }

  // Create an element for this tag.
  function createElement(type, annotation) {
    var tagName = TAG_NAME[type];
    if (!tagName) {
      return null;
    }
    var element = window.document.createElement(tagName);
    element.localName = tagName;
    var name = TAG_ANNOTATION[type];
    if (name && annotation) {
      element[name] = annotation.trim();
    }
    return element;
  }
  var rootDiv = window.document.createElement("div"),
    current = rootDiv,
    t,
    tagStack = [];
  while ((t = nextToken()) !== null) {
    if (t[0] === '<') {
      if (t[1] === "/") {
        // If the closing tag matches, move back up to the parent node.
        if (tagStack.length && tagStack[tagStack.length - 1] === t.substr(2).replace(">", "")) {
          tagStack.pop();
          current = current.parentNode;
        }
        // Otherwise just ignore the end tag.
        continue;
      }
      var ts = parseTimeStamp(t.substr(1, t.length - 2));
      var node;
      if (ts) {
        // Timestamps are lead nodes as well.
        node = window.document.createProcessingInstruction("timestamp", ts);
        current.appendChild(node);
        continue;
      }
      var m = t.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);
      // If we can't parse the tag, skip to the next tag.
      if (!m) {
        continue;
      }
      // Try to construct an element, and ignore the tag if we couldn't.
      node = createElement(m[1], m[3]);
      if (!node) {
        continue;
      }
      // Determine if the tag should be added based on the context of where it
      // is placed in the cuetext.
      if (!shouldAdd(current, node)) {
        continue;
      }
      // Set the class list (as a list of classes, separated by space).
      if (m[2]) {
        node.className = m[2].substr(1).replace('.', ' ');
      }
      // Append the node to the current node, and enter the scope of the new
      // node.
      tagStack.push(m[1]);
      current.appendChild(node);
      current = node;
      continue;
    }

    // Text nodes are leaf nodes.
    current.appendChild(window.document.createTextNode(unescape(t)));
  }
  return rootDiv;
}

// This is a list of all the Unicode characters that have a strong
// right-to-left category. What this means is that these characters are
// written right-to-left for sure. It was generated by pulling all the strong
// right-to-left characters out of the Unicode data table. That table can
// found at: http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
var strongRTLRanges = [[0x5be, 0x5be], [0x5c0, 0x5c0], [0x5c3, 0x5c3], [0x5c6, 0x5c6], [0x5d0, 0x5ea], [0x5f0, 0x5f4], [0x608, 0x608], [0x60b, 0x60b], [0x60d, 0x60d], [0x61b, 0x61b], [0x61e, 0x64a], [0x66d, 0x66f], [0x671, 0x6d5], [0x6e5, 0x6e6], [0x6ee, 0x6ef], [0x6fa, 0x70d], [0x70f, 0x710], [0x712, 0x72f], [0x74d, 0x7a5], [0x7b1, 0x7b1], [0x7c0, 0x7ea], [0x7f4, 0x7f5], [0x7fa, 0x7fa], [0x800, 0x815], [0x81a, 0x81a], [0x824, 0x824], [0x828, 0x828], [0x830, 0x83e], [0x840, 0x858], [0x85e, 0x85e], [0x8a0, 0x8a0], [0x8a2, 0x8ac], [0x200f, 0x200f], [0xfb1d, 0xfb1d], [0xfb1f, 0xfb28], [0xfb2a, 0xfb36], [0xfb38, 0xfb3c], [0xfb3e, 0xfb3e], [0xfb40, 0xfb41], [0xfb43, 0xfb44], [0xfb46, 0xfbc1], [0xfbd3, 0xfd3d], [0xfd50, 0xfd8f], [0xfd92, 0xfdc7], [0xfdf0, 0xfdfc], [0xfe70, 0xfe74], [0xfe76, 0xfefc], [0x10800, 0x10805], [0x10808, 0x10808], [0x1080a, 0x10835], [0x10837, 0x10838], [0x1083c, 0x1083c], [0x1083f, 0x10855], [0x10857, 0x1085f], [0x10900, 0x1091b], [0x10920, 0x10939], [0x1093f, 0x1093f], [0x10980, 0x109b7], [0x109be, 0x109bf], [0x10a00, 0x10a00], [0x10a10, 0x10a13], [0x10a15, 0x10a17], [0x10a19, 0x10a33], [0x10a40, 0x10a47], [0x10a50, 0x10a58], [0x10a60, 0x10a7f], [0x10b00, 0x10b35], [0x10b40, 0x10b55], [0x10b58, 0x10b72], [0x10b78, 0x10b7f], [0x10c00, 0x10c48], [0x1ee00, 0x1ee03], [0x1ee05, 0x1ee1f], [0x1ee21, 0x1ee22], [0x1ee24, 0x1ee24], [0x1ee27, 0x1ee27], [0x1ee29, 0x1ee32], [0x1ee34, 0x1ee37], [0x1ee39, 0x1ee39], [0x1ee3b, 0x1ee3b], [0x1ee42, 0x1ee42], [0x1ee47, 0x1ee47], [0x1ee49, 0x1ee49], [0x1ee4b, 0x1ee4b], [0x1ee4d, 0x1ee4f], [0x1ee51, 0x1ee52], [0x1ee54, 0x1ee54], [0x1ee57, 0x1ee57], [0x1ee59, 0x1ee59], [0x1ee5b, 0x1ee5b], [0x1ee5d, 0x1ee5d], [0x1ee5f, 0x1ee5f], [0x1ee61, 0x1ee62], [0x1ee64, 0x1ee64], [0x1ee67, 0x1ee6a], [0x1ee6c, 0x1ee72], [0x1ee74, 0x1ee77], [0x1ee79, 0x1ee7c], [0x1ee7e, 0x1ee7e], [0x1ee80, 0x1ee89], [0x1ee8b, 0x1ee9b], [0x1eea1, 0x1eea3], [0x1eea5, 0x1eea9], [0x1eeab, 0x1eebb], [0x10fffd, 0x10fffd]];
function isStrongRTLChar(charCode) {
  for (var i = 0; i < strongRTLRanges.length; i++) {
    var currentRange = strongRTLRanges[i];
    if (charCode >= currentRange[0] && charCode <= currentRange[1]) {
      return true;
    }
  }
  return false;
}
function determineBidi(cueDiv) {
  var nodeStack = [],
    text = "",
    charCode;
  if (!cueDiv || !cueDiv.childNodes) {
    return "ltr";
  }
  function pushNodes(nodeStack, node) {
    for (var i = node.childNodes.length - 1; i >= 0; i--) {
      nodeStack.push(node.childNodes[i]);
    }
  }
  function nextTextNode(nodeStack) {
    if (!nodeStack || !nodeStack.length) {
      return null;
    }
    var node = nodeStack.pop(),
      text = node.textContent || node.innerText;
    if (text) {
      // TODO: This should match all unicode type B characters (paragraph
      // separator characters). See issue #115.
      var m = text.match(/^.*(\n|\r)/);
      if (m) {
        nodeStack.length = 0;
        return m[0];
      }
      return text;
    }
    if (node.tagName === "ruby") {
      return nextTextNode(nodeStack);
    }
    if (node.childNodes) {
      pushNodes(nodeStack, node);
      return nextTextNode(nodeStack);
    }
  }
  pushNodes(nodeStack, cueDiv);
  while (text = nextTextNode(nodeStack)) {
    for (var i = 0; i < text.length; i++) {
      charCode = text.charCodeAt(i);
      if (isStrongRTLChar(charCode)) {
        return "rtl";
      }
    }
  }
  return "ltr";
}
function computeLinePos(cue) {
  if (typeof cue.line === "number" && (cue.snapToLines || cue.line >= 0 && cue.line <= 100)) {
    return cue.line;
  }
  if (!cue.track || !cue.track.textTrackList || !cue.track.textTrackList.mediaElement) {
    return -1;
  }
  var track = cue.track,
    trackList = track.textTrackList,
    count = 0;
  for (var i = 0; i < trackList.length && trackList[i] !== track; i++) {
    if (trackList[i].mode === "showing") {
      count++;
    }
  }
  return ++count * -1;
}
function StyleBox() {}

// Apply styles to a div. If there is no div passed then it defaults to the
// div on 'this'.
StyleBox.prototype.applyStyles = function (styles, div) {
  div = div || this.div;
  for (var prop in styles) {
    if (styles.hasOwnProperty(prop)) {
      div.style[prop] = styles[prop];
    }
  }
};
StyleBox.prototype.formatStyle = function (val, unit) {
  return val === 0 ? 0 : val + unit;
};

// Constructs the computed display state of the cue (a div). Places the div
// into the overlay which should be a block level element (usually a div).
function CueStyleBox(window, cue, styleOptions) {
  var isIE8 = /MSIE\s8\.0/.test(navigator.userAgent);
  var color = "rgba(255, 255, 255, 1)";
  var backgroundColor = "rgba(0, 0, 0, 0.8)";
  if (isIE8) {
    color = "rgb(255, 255, 255)";
    backgroundColor = "rgb(0, 0, 0)";
  }
  StyleBox.call(this);
  this.cue = cue;

  // Parse our cue's text into a DOM tree rooted at 'cueDiv'. This div will
  // have inline positioning and will function as the cue background box.
  this.cueDiv = parseContent(window, cue.text);
  var styles = {
    color: color,
    backgroundColor: backgroundColor,
    position: "relative",
    left: 0,
    right: 0,
    top: 0,
    bottom: 0,
    display: "inline"
  };
  if (!isIE8) {
    styles.writingMode = cue.vertical === "" ? "horizontal-tb" : cue.vertical === "lr" ? "vertical-lr" : "vertical-rl";
    styles.unicodeBidi = "plaintext";
  }
  this.applyStyles(styles, this.cueDiv);

  // Create an absolutely positioned div that will be used to position the cue
  // div. Note, all WebVTT cue-setting alignments are equivalent to the CSS
  // mirrors of them except "middle" which is "center" in CSS.
  this.div = window.document.createElement("div");
  styles = {
    textAlign: cue.align === "middle" ? "center" : cue.align,
    font: styleOptions.font,
    whiteSpace: "pre-line",
    position: "absolute"
  };
  if (!isIE8) {
    styles.direction = determineBidi(this.cueDiv);
    styles.writingMode = cue.vertical === "" ? "horizontal-tb" : cue.vertical === "lr" ? "vertical-lr" : "vertical-rl".stylesunicodeBidi = "plaintext";
  }
  this.applyStyles(styles);
  this.div.appendChild(this.cueDiv);

  // Calculate the distance from the reference edge of the viewport to the text
  // position of the cue box. The reference edge will be resolved later when
  // the box orientation styles are applied.
  var textPos = 0;
  switch (cue.positionAlign) {
    case "start":
      textPos = cue.position;
      break;
    case "middle":
      textPos = cue.position - cue.size / 2;
      break;
    case "end":
      textPos = cue.position - cue.size;
      break;
  }

  // Horizontal box orientation; textPos is the distance from the left edge of the
  // area to the left edge of the box and cue.size is the distance extending to
  // the right from there.
  if (cue.vertical === "") {
    this.applyStyles({
      left: this.formatStyle(textPos, "%"),
      width: this.formatStyle(cue.size, "%")
    });
    // Vertical box orientation; textPos is the distance from the top edge of the
    // area to the top edge of the box and cue.size is the height extending
    // downwards from there.
  } else {
    this.applyStyles({
      top: this.formatStyle(textPos, "%"),
      height: this.formatStyle(cue.size, "%")
    });
  }
  this.move = function (box) {
    this.applyStyles({
      top: this.formatStyle(box.top, "px"),
      bottom: this.formatStyle(box.bottom, "px"),
      left: this.formatStyle(box.left, "px"),
      right: this.formatStyle(box.right, "px"),
      height: this.formatStyle(box.height, "px"),
      width: this.formatStyle(box.width, "px")
    });
  };
}
CueStyleBox.prototype = _objCreate(StyleBox.prototype);
CueStyleBox.prototype.constructor = CueStyleBox;

// Represents the co-ordinates of an Element in a way that we can easily
// compute things with such as if it overlaps or intersects with another Element.
// Can initialize it with either a StyleBox or another BoxPosition.
function BoxPosition(obj) {
  var isIE8 = /MSIE\s8\.0/.test(navigator.userAgent);

  // Either a BoxPosition was passed in and we need to copy it, or a StyleBox
  // was passed in and we need to copy the results of 'getBoundingClientRect'
  // as the object returned is readonly. All co-ordinate values are in reference
  // to the viewport origin (top left).
  var lh, height, width, top;
  if (obj.div) {
    height = obj.div.offsetHeight;
    width = obj.div.offsetWidth;
    top = obj.div.offsetTop;
    var rects = (rects = obj.div.childNodes) && (rects = rects[0]) && rects.getClientRects && rects.getClientRects();
    obj = obj.div.getBoundingClientRect();
    // In certain cases the outter div will be slightly larger then the sum of
    // the inner div's lines. This could be due to bold text, etc, on some platforms.
    // In this case we should get the average line height and use that. This will
    // result in the desired behaviour.
    lh = rects ? Math.max(rects[0] && rects[0].height || 0, obj.height / rects.length) : 0;
  }
  this.left = obj.left;
  this.right = obj.right;
  this.top = obj.top || top;
  this.height = obj.height || height;
  this.bottom = obj.bottom || top + (obj.height || height);
  this.width = obj.width || width;
  this.lineHeight = lh !== undefined ? lh : obj.lineHeight;
  if (isIE8 && !this.lineHeight) {
    this.lineHeight = 13;
  }
}

// Move the box along a particular axis. Optionally pass in an amount to move
// the box. If no amount is passed then the default is the line height of the
// box.
BoxPosition.prototype.move = function (axis, toMove) {
  toMove = toMove !== undefined ? toMove : this.lineHeight;
  switch (axis) {
    case "+x":
      this.left += toMove;
      this.right += toMove;
      break;
    case "-x":
      this.left -= toMove;
      this.right -= toMove;
      break;
    case "+y":
      this.top += toMove;
      this.bottom += toMove;
      break;
    case "-y":
      this.top -= toMove;
      this.bottom -= toMove;
      break;
  }
};

// Check if this box overlaps another box, b2.
BoxPosition.prototype.overlaps = function (b2) {
  return this.left < b2.right && this.right > b2.left && this.top < b2.bottom && this.bottom > b2.top;
};

// Check if this box overlaps any other boxes in boxes.
BoxPosition.prototype.overlapsAny = function (boxes) {
  for (var i = 0; i < boxes.length; i++) {
    if (this.overlaps(boxes[i])) {
      return true;
    }
  }
  return false;
};

// Check if this box is within another box.
BoxPosition.prototype.within = function (container) {
  return this.top >= container.top && this.bottom <= container.bottom && this.left >= container.left && this.right <= container.right;
};

// Check if this box is entirely within the container or it is overlapping
// on the edge opposite of the axis direction passed. For example, if "+x" is
// passed and the box is overlapping on the left edge of the container, then
// return true.
BoxPosition.prototype.overlapsOppositeAxis = function (container, axis) {
  switch (axis) {
    case "+x":
      return this.left < container.left;
    case "-x":
      return this.right > container.right;
    case "+y":
      return this.top < container.top;
    case "-y":
      return this.bottom > container.bottom;
  }
};

// Find the percentage of the area that this box is overlapping with another
// box.
BoxPosition.prototype.intersectPercentage = function (b2) {
  var x = Math.max(0, Math.min(this.right, b2.right) - Math.max(this.left, b2.left)),
    y = Math.max(0, Math.min(this.bottom, b2.bottom) - Math.max(this.top, b2.top)),
    intersectArea = x * y;
  return intersectArea / (this.height * this.width);
};

// Convert the positions from this box to CSS compatible positions using
// the reference container's positions. This has to be done because this
// box's positions are in reference to the viewport origin, whereas, CSS
// values are in referecne to their respective edges.
BoxPosition.prototype.toCSSCompatValues = function (reference) {
  return {
    top: this.top - reference.top,
    bottom: reference.bottom - this.bottom,
    left: this.left - reference.left,
    right: reference.right - this.right,
    height: this.height,
    width: this.width
  };
};

// Get an object that represents the box's position without anything extra.
// Can pass a StyleBox, HTMLElement, or another BoxPositon.
BoxPosition.getSimpleBoxPosition = function (obj) {
  var height = obj.div ? obj.div.offsetHeight : obj.tagName ? obj.offsetHeight : 0;
  var width = obj.div ? obj.div.offsetWidth : obj.tagName ? obj.offsetWidth : 0;
  var top = obj.div ? obj.div.offsetTop : obj.tagName ? obj.offsetTop : 0;
  obj = obj.div ? obj.div.getBoundingClientRect() : obj.tagName ? obj.getBoundingClientRect() : obj;
  var ret = {
    left: obj.left,
    right: obj.right,
    top: obj.top || top,
    height: obj.height || height,
    bottom: obj.bottom || top + (obj.height || height),
    width: obj.width || width
  };
  return ret;
};

// Move a StyleBox to its specified, or next best, position. The containerBox
// is the box that contains the StyleBox, such as a div. boxPositions are
// a list of other boxes that the styleBox can't overlap with.
function moveBoxToLinePosition(window, styleBox, containerBox, boxPositions) {
  // Find the best position for a cue box, b, on the video. The axis parameter
  // is a list of axis, the order of which, it will move the box along. For example:
  // Passing ["+x", "-x"] will move the box first along the x axis in the positive
  // direction. If it doesn't find a good position for it there it will then move
  // it along the x axis in the negative direction.
  function findBestPosition(b, axis) {
    var bestPosition,
      specifiedPosition = new BoxPosition(b),
      percentage = 1; // Highest possible so the first thing we get is better.

    for (var i = 0; i < axis.length; i++) {
      while (b.overlapsOppositeAxis(containerBox, axis[i]) || b.within(containerBox) && b.overlapsAny(boxPositions)) {
        b.move(axis[i]);
      }
      // We found a spot where we aren't overlapping anything. This is our
      // best position.
      if (b.within(containerBox)) {
        return b;
      }
      var p = b.intersectPercentage(containerBox);
      // If we're outside the container box less then we were on our last try
      // then remember this position as the best position.
      if (percentage > p) {
        bestPosition = new BoxPosition(b);
        percentage = p;
      }
      // Reset the box position to the specified position.
      b = new BoxPosition(specifiedPosition);
    }
    return bestPosition || specifiedPosition;
  }
  var boxPosition = new BoxPosition(styleBox),
    cue = styleBox.cue,
    linePos = computeLinePos(cue),
    axis = [];

  // If we have a line number to align the cue to.
  if (cue.snapToLines) {
    var size;
    switch (cue.vertical) {
      case "":
        axis = ["+y", "-y"];
        size = "height";
        break;
      case "rl":
        axis = ["+x", "-x"];
        size = "width";
        break;
      case "lr":
        axis = ["-x", "+x"];
        size = "width";
        break;
    }
    var step = boxPosition.lineHeight,
      position = step * Math.round(linePos),
      maxPosition = containerBox[size] + step,
      initialAxis = axis[0];

    // If the specified intial position is greater then the max position then
    // clamp the box to the amount of steps it would take for the box to
    // reach the max position.
    if (Math.abs(position) > maxPosition) {
      position = position < 0 ? -1 : 1;
      position *= Math.ceil(maxPosition / step) * step;
    }

    // If computed line position returns negative then line numbers are
    // relative to the bottom of the video instead of the top. Therefore, we
    // need to increase our initial position by the length or width of the
    // video, depending on the writing direction, and reverse our axis directions.
    if (linePos < 0) {
      position += cue.vertical === "" ? containerBox.height : containerBox.width;
      axis = axis.reverse();
    }

    // Move the box to the specified position. This may not be its best
    // position.
    boxPosition.move(initialAxis, position);
  } else {
    // If we have a percentage line value for the cue.
    var calculatedPercentage = boxPosition.lineHeight / containerBox.height * 100;
    switch (cue.lineAlign) {
      case "middle":
        linePos -= calculatedPercentage / 2;
        break;
      case "end":
        linePos -= calculatedPercentage;
        break;
    }

    // Apply initial line position to the cue box.
    switch (cue.vertical) {
      case "":
        styleBox.applyStyles({
          top: styleBox.formatStyle(linePos, "%")
        });
        break;
      case "rl":
        styleBox.applyStyles({
          left: styleBox.formatStyle(linePos, "%")
        });
        break;
      case "lr":
        styleBox.applyStyles({
          right: styleBox.formatStyle(linePos, "%")
        });
        break;
    }
    axis = ["+y", "-x", "+x", "-y"];

    // Get the box position again after we've applied the specified positioning
    // to it.
    boxPosition = new BoxPosition(styleBox);
  }
  var bestPosition = findBestPosition(boxPosition, axis);
  styleBox.move(bestPosition.toCSSCompatValues(containerBox));
}
function WebVTT$1() {
  // Nothing
}

// Helper to allow strings to be decoded instead of the default binary utf8 data.
WebVTT$1.StringDecoder = function () {
  return {
    decode: function (data) {
      if (!data) {
        return "";
      }
      if (typeof data !== "string") {
        throw new Error("Error - expected string data.");
      }
      return decodeURIComponent(encodeURIComponent(data));
    }
  };
};
WebVTT$1.convertCueToDOMTree = function (window, cuetext) {
  if (!window || !cuetext) {
    return null;
  }
  return parseContent(window, cuetext);
};
var FONT_SIZE_PERCENT = 0.05;
var FONT_STYLE = "sans-serif";
var CUE_BACKGROUND_PADDING = "1.5%";

// Runs the processing model over the cues and regions passed to it.
// @param overlay A block level element (usually a div) that the computed cues
//                and regions will be placed into.
WebVTT$1.processCues = function (window, cues, overlay) {
  if (!window || !cues || !overlay) {
    return null;
  }

  // Remove all previous children.
  while (overlay.firstChild) {
    overlay.removeChild(overlay.firstChild);
  }
  var paddedOverlay = window.document.createElement("div");
  paddedOverlay.style.position = "absolute";
  paddedOverlay.style.left = "0";
  paddedOverlay.style.right = "0";
  paddedOverlay.style.top = "0";
  paddedOverlay.style.bottom = "0";
  paddedOverlay.style.margin = CUE_BACKGROUND_PADDING;
  overlay.appendChild(paddedOverlay);

  // Determine if we need to compute the display states of the cues. This could
  // be the case if a cue's state has been changed since the last computation or
  // if it has not been computed yet.
  function shouldCompute(cues) {
    for (var i = 0; i < cues.length; i++) {
      if (cues[i].hasBeenReset || !cues[i].displayState) {
        return true;
      }
    }
    return false;
  }

  // We don't need to recompute the cues' display states. Just reuse them.
  if (!shouldCompute(cues)) {
    for (var i = 0; i < cues.length; i++) {
      paddedOverlay.appendChild(cues[i].displayState);
    }
    return;
  }
  var boxPositions = [],
    containerBox = BoxPosition.getSimpleBoxPosition(paddedOverlay),
    fontSize = Math.round(containerBox.height * FONT_SIZE_PERCENT * 100) / 100;
  var styleOptions = {
    font: fontSize + "px " + FONT_STYLE
  };
  (function () {
    var styleBox, cue;
    for (var i = 0; i < cues.length; i++) {
      cue = cues[i];

      // Compute the intial position and styles of the cue div.
      styleBox = new CueStyleBox(window, cue, styleOptions);
      paddedOverlay.appendChild(styleBox.div);

      // Move the cue div to it's correct line position.
      moveBoxToLinePosition(window, styleBox, containerBox, boxPositions);

      // Remember the computed div so that we don't have to recompute it later
      // if we don't have too.
      cue.displayState = styleBox.div;
      boxPositions.push(BoxPosition.getSimpleBoxPosition(styleBox));
    }
  })();
};
WebVTT$1.Parser = function (window, vttjs, decoder) {
  if (!decoder) {
    decoder = vttjs;
    vttjs = {};
  }
  if (!vttjs) {
    vttjs = {};
  }
  this.window = window;
  this.vttjs = vttjs;
  this.state = "INITIAL";
  this.buffer = "";
  this.decoder = decoder || new TextDecoder("utf8");
  this.regionList = [];
};
WebVTT$1.Parser.prototype = {
  // If the error is a ParsingError then report it to the consumer if
  // possible. If it's not a ParsingError then throw it like normal.
  reportOrThrowError: function (e) {
    if (e instanceof ParsingError) {
      this.onparsingerror && this.onparsingerror(e);
    } else {
      throw e;
    }
  },
  parse: function (data) {
    var self = this;

    // If there is no data then we won't decode it, but will just try to parse
    // whatever is in buffer already. This may occur in circumstances, for
    // example when flush() is called.
    if (data) {
      // Try to decode the data that we received.
      self.buffer += self.decoder.decode(data, {
        stream: true
      });
    }
    function collectNextLine() {
      var buffer = self.buffer;
      var pos = 0;
      while (pos < buffer.length && buffer[pos] !== '\r' && buffer[pos] !== '\n') {
        ++pos;
      }
      var line = buffer.substr(0, pos);
      // Advance the buffer early in case we fail below.
      if (buffer[pos] === '\r') {
        ++pos;
      }
      if (buffer[pos] === '\n') {
        ++pos;
      }
      self.buffer = buffer.substr(pos);
      return line;
    }

    // 3.4 WebVTT region and WebVTT region settings syntax
    function parseRegion(input) {
      var settings = new Settings();
      parseOptions(input, function (k, v) {
        switch (k) {
          case "id":
            settings.set(k, v);
            break;
          case "width":
            settings.percent(k, v);
            break;
          case "lines":
            settings.integer(k, v);
            break;
          case "regionanchor":
          case "viewportanchor":
            var xy = v.split(',');
            if (xy.length !== 2) {
              break;
            }
            // We have to make sure both x and y parse, so use a temporary
            // settings object here.
            var anchor = new Settings();
            anchor.percent("x", xy[0]);
            anchor.percent("y", xy[1]);
            if (!anchor.has("x") || !anchor.has("y")) {
              break;
            }
            settings.set(k + "X", anchor.get("x"));
            settings.set(k + "Y", anchor.get("y"));
            break;
          case "scroll":
            settings.alt(k, v, ["up"]);
            break;
        }
      }, /=/, /\s/);

      // Create the region, using default values for any values that were not
      // specified.
      if (settings.has("id")) {
        var region = new (self.vttjs.VTTRegion || self.window.VTTRegion)();
        region.width = settings.get("width", 100);
        region.lines = settings.get("lines", 3);
        region.regionAnchorX = settings.get("regionanchorX", 0);
        region.regionAnchorY = settings.get("regionanchorY", 100);
        region.viewportAnchorX = settings.get("viewportanchorX", 0);
        region.viewportAnchorY = settings.get("viewportanchorY", 100);
        region.scroll = settings.get("scroll", "");
        // Register the region.
        self.onregion && self.onregion(region);
        // Remember the VTTRegion for later in case we parse any VTTCues that
        // reference it.
        self.regionList.push({
          id: settings.get("id"),
          region: region
        });
      }
    }

    // draft-pantos-http-live-streaming-20
    // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-3.5
    // 3.5 WebVTT
    function parseTimestampMap(input) {
      var settings = new Settings();
      parseOptions(input, function (k, v) {
        switch (k) {
          case "MPEGT":
            settings.integer(k + 'S', v);
            break;
          case "LOCA":
            settings.set(k + 'L', parseTimeStamp(v));
            break;
        }
      }, /[^\d]:/, /,/);
      self.ontimestampmap && self.ontimestampmap({
        "MPEGTS": settings.get("MPEGTS"),
        "LOCAL": settings.get("LOCAL")
      });
    }

    // 3.2 WebVTT metadata header syntax
    function parseHeader(input) {
      if (input.match(/X-TIMESTAMP-MAP/)) {
        // This line contains HLS X-TIMESTAMP-MAP metadata
        parseOptions(input, function (k, v) {
          switch (k) {
            case "X-TIMESTAMP-MAP":
              parseTimestampMap(v);
              break;
          }
        }, /=/);
      } else {
        parseOptions(input, function (k, v) {
          switch (k) {
            case "Region":
              // 3.3 WebVTT region metadata header syntax
              parseRegion(v);
              break;
          }
        }, /:/);
      }
    }

    // 5.1 WebVTT file parsing.
    try {
      var line;
      if (self.state === "INITIAL") {
        // We can't start parsing until we have the first line.
        if (!/\r\n|\n/.test(self.buffer)) {
          return this;
        }
        line = collectNextLine();
        var m = line.match(/^WEBVTT([ \t].*)?$/);
        if (!m || !m[0]) {
          throw new ParsingError(ParsingError.Errors.BadSignature);
        }
        self.state = "HEADER";
      }
      var alreadyCollectedLine = false;
      while (self.buffer) {
        // We can't parse a line until we have the full line.
        if (!/\r\n|\n/.test(self.buffer)) {
          return this;
        }
        if (!alreadyCollectedLine) {
          line = collectNextLine();
        } else {
          alreadyCollectedLine = false;
        }
        switch (self.state) {
          case "HEADER":
            // 13-18 - Allow a header (metadata) under the WEBVTT line.
            if (/:/.test(line)) {
              parseHeader(line);
            } else if (!line) {
              // An empty line terminates the header and starts the body (cues).
              self.state = "ID";
            }
            continue;
          case "NOTE":
            // Ignore NOTE blocks.
            if (!line) {
              self.state = "ID";
            }
            continue;
          case "ID":
            // Check for the start of NOTE blocks.
            if (/^NOTE($|[ \t])/.test(line)) {
              self.state = "NOTE";
              break;
            }
            // 19-29 - Allow any number of line terminators, then initialize new cue values.
            if (!line) {
              continue;
            }
            self.cue = new (self.vttjs.VTTCue || self.window.VTTCue)(0, 0, "");
            self.state = "CUE";
            // 30-39 - Check if self line contains an optional identifier or timing data.
            if (line.indexOf("-->") === -1) {
              self.cue.id = line;
              continue;
            }
          // Process line as start of a cue.
          /*falls through*/
          case "CUE":
            // 40 - Collect cue timings and settings.
            try {
              parseCue(line, self.cue, self.regionList);
            } catch (e) {
              self.reportOrThrowError(e);
              // In case of an error ignore rest of the cue.
              self.cue = null;
              self.state = "BADCUE";
              continue;
            }
            self.state = "CUETEXT";
            continue;
          case "CUETEXT":
            var hasSubstring = line.indexOf("-->") !== -1;
            // 34 - If we have an empty line then report the cue.
            // 35 - If we have the special substring '-->' then report the cue,
            // but do not collect the line as we need to process the current
            // one as a new cue.
            if (!line || hasSubstring && (alreadyCollectedLine = true)) {
              // We are done parsing self cue.
              self.oncue && self.oncue(self.cue);
              self.cue = null;
              self.state = "ID";
              continue;
            }
            if (self.cue.text) {
              self.cue.text += "\n";
            }
            self.cue.text += line;
            continue;
          case "BADCUE":
            // BADCUE
            // 54-62 - Collect and discard the remaining cue.
            if (!line) {
              self.state = "ID";
            }
            continue;
        }
      }
    } catch (e) {
      self.reportOrThrowError(e);

      // If we are currently parsing a cue, report what we have.
      if (self.state === "CUETEXT" && self.cue && self.oncue) {
        self.oncue(self.cue);
      }
      self.cue = null;
      // Enter BADWEBVTT state if header was not parsed correctly otherwise
      // another exception occurred so enter BADCUE state.
      self.state = self.state === "INITIAL" ? "BADWEBVTT" : "BADCUE";
    }
    return this;
  },
  flush: function () {
    var self = this;
    try {
      // Finish decoding the stream.
      self.buffer += self.decoder.decode();
      // Synthesize the end of the current cue or region.
      if (self.cue || self.state === "HEADER") {
        self.buffer += "\n\n";
        self.parse();
      }
      // If we've flushed, parsed, and we're still on the INITIAL state then
      // that means we don't have enough of the stream to parse the first
      // line.
      if (self.state === "INITIAL") {
        throw new ParsingError(ParsingError.Errors.BadSignature);
      }
    } catch (e) {
      self.reportOrThrowError(e);
    }
    self.onflush && self.onflush();
    return this;
  }
};
var vtt$1 = WebVTT$1;

/**
 * Copyright 2013 vtt.js Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

var autoKeyword = "auto";
var directionSetting = {
  "": true,
  "lr": true,
  "rl": true
};
var alignSetting = {
  "start": true,
  "middle": true,
  "end": true,
  "left": true,
  "right": true
};
function findDirectionSetting(value) {
  if (typeof value !== "string") {
    return false;
  }
  var dir = directionSetting[value.toLowerCase()];
  return dir ? value.toLowerCase() : false;
}
function findAlignSetting(value) {
  if (typeof value !== "string") {
    return false;
  }
  var align = alignSetting[value.toLowerCase()];
  return align ? value.toLowerCase() : false;
}
function extend$1(obj) {
  var i = 1;
  for (; i < arguments.length; i++) {
    var cobj = arguments[i];
    for (var p in cobj) {
      obj[p] = cobj[p];
    }
  }
  return obj;
}
function VTTCue(startTime, endTime, text) {
  var cue = this;
  var isIE8 = /MSIE\s8\.0/.test(navigator.userAgent);
  var baseObj = {};
  if (isIE8) {
    cue = document.createElement('custom');
  } else {
    baseObj.enumerable = true;
  }

  /**
   * Shim implementation specific properties. These properties are not in
   * the spec.
   */

  // Lets us know when the VTTCue's data has changed in such a way that we need
  // to recompute its display state. This lets us compute its display state
  // lazily.
  cue.hasBeenReset = false;

  /**
   * VTTCue and TextTrackCue properties
   * http://dev.w3.org/html5/webvtt/#vttcue-interface
   */

  var _id = "";
  var _pauseOnExit = false;
  var _startTime = startTime;
  var _endTime = endTime;
  var _text = text;
  var _region = null;
  var _vertical = "";
  var _snapToLines = true;
  var _line = "auto";
  var _lineAlign = "start";
  var _position = 50;
  var _positionAlign = "middle";
  var _size = 50;
  var _align = "middle";
  Object.defineProperty(cue, "id", extend$1({}, baseObj, {
    get: function () {
      return _id;
    },
    set: function (value) {
      _id = "" + value;
    }
  }));
  Object.defineProperty(cue, "pauseOnExit", extend$1({}, baseObj, {
    get: function () {
      return _pauseOnExit;
    },
    set: function (value) {
      _pauseOnExit = !!value;
    }
  }));
  Object.defineProperty(cue, "startTime", extend$1({}, baseObj, {
    get: function () {
      return _startTime;
    },
    set: function (value) {
      if (typeof value !== "number") {
        throw new TypeError("Start time must be set to a number.");
      }
      _startTime = value;
      this.hasBeenReset = true;
    }
  }));
  Object.defineProperty(cue, "endTime", extend$1({}, baseObj, {
    get: function () {
      return _endTime;
    },
    set: function (value) {
      if (typeof value !== "number") {
        throw new TypeError("End time must be set to a number.");
      }
      _endTime = value;
      this.hasBeenReset = true;
    }
  }));
  Object.defineProperty(cue, "text", extend$1({}, baseObj, {
    get: function () {
      return _text;
    },
    set: function (value) {
      _text = "" + value;
      this.hasBeenReset = true;
    }
  }));
  Object.defineProperty(cue, "region", extend$1({}, baseObj, {
    get: function () {
      return _region;
    },
    set: function (value) {
      _region = value;
      this.hasBeenReset = true;
    }
  }));
  Object.defineProperty(cue, "vertical", extend$1({}, baseObj, {
    get: function () {
      return _vertical;
    },
    set: function (value) {
      var setting = findDirectionSetting(value);
      // Have to check for false because the setting an be an empty string.
      if (setting === false) {
        throw new SyntaxError("An invalid or illegal string was specified.");
      }
      _vertical = setting;
      this.hasBeenReset = true;
    }
  }));
  Object.defineProperty(cue, "snapToLines", extend$1({}, baseObj, {
    get: function () {
      return _snapToLines;
    },
    set: function (value) {
      _snapToLines = !!value;
      this.hasBeenReset = true;
    }
  }));
  Object.defineProperty(cue, "line", extend$1({}, baseObj, {
    get: function () {
      return _line;
    },
    set: function (value) {
      if (typeof value !== "number" && value !== autoKeyword) {
        throw new SyntaxError("An invalid number or illegal string was specified.");
      }
      _line = value;
      this.hasBeenReset = true;
    }
  }));
  Object.defineProperty(cue, "lineAlign", extend$1({}, baseObj, {
    get: function () {
      return _lineAlign;
    },
    set: function (value) {
      var setting = findAlignSetting(value);
      if (!setting) {
        throw new SyntaxError("An invalid or illegal string was specified.");
      }
      _lineAlign = setting;
      this.hasBeenReset = true;
    }
  }));
  Object.defineProperty(cue, "position", extend$1({}, baseObj, {
    get: function () {
      return _position;
    },
    set: function (value) {
      if (value < 0 || value > 100) {
        throw new Error("Position must be between 0 and 100.");
      }
      _position = value;
      this.hasBeenReset = true;
    }
  }));
  Object.defineProperty(cue, "positionAlign", extend$1({}, baseObj, {
    get: function () {
      return _positionAlign;
    },
    set: function (value) {
      var setting = findAlignSetting(value);
      if (!setting) {
        throw new SyntaxError("An invalid or illegal string was specified.");
      }
      _positionAlign = setting;
      this.hasBeenReset = true;
    }
  }));
  Object.defineProperty(cue, "size", extend$1({}, baseObj, {
    get: function () {
      return _size;
    },
    set: function (value) {
      if (value < 0 || value > 100) {
        throw new Error("Size must be between 0 and 100.");
      }
      _size = value;
      this.hasBeenReset = true;
    }
  }));
  Object.defineProperty(cue, "align", extend$1({}, baseObj, {
    get: function () {
      return _align;
    },
    set: function (value) {
      var setting = findAlignSetting(value);
      if (!setting) {
        throw new SyntaxError("An invalid or illegal string was specified.");
      }
      _align = setting;
      this.hasBeenReset = true;
    }
  }));

  /**
   * Other <track> spec defined properties
   */

  // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state
  cue.displayState = undefined;
  if (isIE8) {
    return cue;
  }
}

/**
 * VTTCue methods
 */

VTTCue.prototype.getCueAsHTML = function () {
  // Assume WebVTT.convertCueToDOMTree is on the global.
  return WebVTT.convertCueToDOMTree(window, this.text);
};
var vttcue = VTTCue;

/**
 * Copyright 2013 vtt.js Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

var scrollSetting = {
  "": true,
  "up": true
};
function findScrollSetting(value) {
  if (typeof value !== "string") {
    return false;
  }
  var scroll = scrollSetting[value.toLowerCase()];
  return scroll ? value.toLowerCase() : false;
}
function isValidPercentValue(value) {
  return typeof value === "number" && value >= 0 && value <= 100;
}

// VTTRegion shim http://dev.w3.org/html5/webvtt/#vttregion-interface
function VTTRegion() {
  var _width = 100;
  var _lines = 3;
  var _regionAnchorX = 0;
  var _regionAnchorY = 100;
  var _viewportAnchorX = 0;
  var _viewportAnchorY = 100;
  var _scroll = "";
  Object.defineProperties(this, {
    "width": {
      enumerable: true,
      get: function () {
        return _width;
      },
      set: function (value) {
        if (!isValidPercentValue(value)) {
          throw new Error("Width must be between 0 and 100.");
        }
        _width = value;
      }
    },
    "lines": {
      enumerable: true,
      get: function () {
        return _lines;
      },
      set: function (value) {
        if (typeof value !== "number") {
          throw new TypeError("Lines must be set to a number.");
        }
        _lines = value;
      }
    },
    "regionAnchorY": {
      enumerable: true,
      get: function () {
        return _regionAnchorY;
      },
      set: function (value) {
        if (!isValidPercentValue(value)) {
          throw new Error("RegionAnchorX must be between 0 and 100.");
        }
        _regionAnchorY = value;
      }
    },
    "regionAnchorX": {
      enumerable: true,
      get: function () {
        return _regionAnchorX;
      },
      set: function (value) {
        if (!isValidPercentValue(value)) {
          throw new Error("RegionAnchorY must be between 0 and 100.");
        }
        _regionAnchorX = value;
      }
    },
    "viewportAnchorY": {
      enumerable: true,
      get: function () {
        return _viewportAnchorY;
      },
      set: function (value) {
        if (!isValidPercentValue(value)) {
          throw new Error("ViewportAnchorY must be between 0 and 100.");
        }
        _viewportAnchorY = value;
      }
    },
    "viewportAnchorX": {
      enumerable: true,
      get: function () {
        return _viewportAnchorX;
      },
      set: function (value) {
        if (!isValidPercentValue(value)) {
          throw new Error("ViewportAnchorX must be between 0 and 100.");
        }
        _viewportAnchorX = value;
      }
    },
    "scroll": {
      enumerable: true,
      get: function () {
        return _scroll;
      },
      set: function (value) {
        var setting = findScrollSetting(value);
        // Have to check for false as an empty string is a legal value.
        if (setting === false) {
          throw new SyntaxError("An invalid or illegal string was specified.");
        }
        _scroll = setting;
      }
    }
  });
}
var vttregion = VTTRegion;

var browserIndex = createCommonjsModule(function (module) {
/**
 * Copyright 2013 vtt.js Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Default exports for Node. Export the extended versions of VTTCue and
// VTTRegion in Node since we likely want the capability to convert back and
// forth between JSON. If we don't then it's not that big of a deal since we're
// off browser.


var vttjs = module.exports = {
  WebVTT: vtt$1,
  VTTCue: vttcue,
  VTTRegion: vttregion
};
window_1.vttjs = vttjs;
window_1.WebVTT = vttjs.WebVTT;
var cueShim = vttjs.VTTCue;
var regionShim = vttjs.VTTRegion;
var nativeVTTCue = window_1.VTTCue;
var nativeVTTRegion = window_1.VTTRegion;
vttjs.shim = function () {
  window_1.VTTCue = cueShim;
  window_1.VTTRegion = regionShim;
};
vttjs.restore = function () {
  window_1.VTTCue = nativeVTTCue;
  window_1.VTTRegion = nativeVTTRegion;
};
if (!window_1.VTTCue) {
  vttjs.shim();
}
});
browserIndex.WebVTT;
browserIndex.VTTCue;
browserIndex.VTTRegion;

/**
 * @license
 * Video.js 6.13.0 <http://videojs.com/>
 * Copyright Brightcove, Inc. <https://www.brightcove.com/>
 * Available under Apache License Version 2.0
 * <https://github.com/videojs/video.js/blob/master/LICENSE>
 *
 * Includes vtt.js <https://github.com/mozilla/vtt.js>
 * Available under Apache License Version 2.0
 * <https://github.com/mozilla/vtt.js/blob/master/LICENSE>
 */function _interopDefault(ex){return ex&&typeof ex==='object'&&'default'in ex?ex['default']:ex;}var window$1=_interopDefault(window_1);var document$1=_interopDefault(document_1);var tsml=_interopDefault(tsml$1);var safeParseTuple=_interopDefault(tuple);var xhr=_interopDefault(xhr$1);var vtt=_interopDefault(browserIndex);var version="6.13.0";/**
 * @file browser.js
 * @module browser
 */var USER_AGENT=window$1.navigator&&window$1.navigator.userAgent||'';var webkitVersionMap=/AppleWebKit\/([\d.]+)/i.exec(USER_AGENT);var appleWebkitVersion=webkitVersionMap?parseFloat(webkitVersionMap.pop()):null;/*
 * Device is an iPhone
 *
 * @type {Boolean}
 * @constant
 * @private
 */var IS_IPAD=/iPad/i.test(USER_AGENT);// The Facebook app's UIWebView identifies as both an iPhone and iPad, so
// to identify iPhones, we need to exclude iPads.
// http://artsy.github.io/blog/2012/10/18/the-perils-of-ios-user-agent-sniffing/
var IS_IPHONE=/iPhone/i.test(USER_AGENT)&&!IS_IPAD;var IS_IPOD=/iPod/i.test(USER_AGENT);var IS_IOS=IS_IPHONE||IS_IPAD||IS_IPOD;var IOS_VERSION=function(){var match=USER_AGENT.match(/OS (\d+)_/i);if(match&&match[1]){return match[1];}return null;}();var IS_ANDROID=/Android/i.test(USER_AGENT);var ANDROID_VERSION=function(){// This matches Android Major.Minor.Patch versions
// ANDROID_VERSION is Major.Minor as a Number, if Minor isn't available, then only Major is returned
var match=USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!match){return null;}var major=match[1]&&parseFloat(match[1]);var minor=match[2]&&parseFloat(match[2]);if(major&&minor){return parseFloat(match[1]+'.'+match[2]);}else if(major){return major;}return null;}();// Old Android is defined as Version older than 2.3, and requiring a webkit version of the android browser
var IS_OLD_ANDROID=IS_ANDROID&&/webkit/i.test(USER_AGENT)&&ANDROID_VERSION<2.3;var IS_NATIVE_ANDROID=IS_ANDROID&&ANDROID_VERSION<5&&appleWebkitVersion<537;var IS_FIREFOX=/Firefox/i.test(USER_AGENT);var IS_EDGE=/Edge/i.test(USER_AGENT);var IS_CHROME=!IS_EDGE&&(/Chrome/i.test(USER_AGENT)||/CriOS/i.test(USER_AGENT));var CHROME_VERSION=function(){var match=USER_AGENT.match(/(Chrome|CriOS)\/(\d+)/);if(match&&match[2]){return parseFloat(match[2]);}return null;}();var IS_IE8=/MSIE\s8\.0/.test(USER_AGENT);var IE_VERSION=function(){var result=/MSIE\s(\d+)\.\d/.exec(USER_AGENT);var version=result&&parseFloat(result[1]);if(!version&&/Trident\/7.0/i.test(USER_AGENT)&&/rv:11.0/.test(USER_AGENT)){// IE 11 has a different user agent string than other IE versions
version=11.0;}return version;}();var IS_SAFARI=/Safari/i.test(USER_AGENT)&&!IS_CHROME&&!IS_ANDROID&&!IS_EDGE;var IS_ANY_SAFARI=(IS_SAFARI||IS_IOS)&&!IS_CHROME;var TOUCH_ENABLED=isReal()&&('ontouchstart'in window$1||window$1.navigator.maxTouchPoints||window$1.DocumentTouch&&window$1.document instanceof window$1.DocumentTouch);var BACKGROUND_SIZE_SUPPORTED=isReal()&&'backgroundSize'in window$1.document.createElement('video').style;var browser=(Object.freeze||Object)({IS_IPAD:IS_IPAD,IS_IPHONE:IS_IPHONE,IS_IPOD:IS_IPOD,IS_IOS:IS_IOS,IOS_VERSION:IOS_VERSION,IS_ANDROID:IS_ANDROID,ANDROID_VERSION:ANDROID_VERSION,IS_OLD_ANDROID:IS_OLD_ANDROID,IS_NATIVE_ANDROID:IS_NATIVE_ANDROID,IS_FIREFOX:IS_FIREFOX,IS_EDGE:IS_EDGE,IS_CHROME:IS_CHROME,CHROME_VERSION:CHROME_VERSION,IS_IE8:IS_IE8,IE_VERSION:IE_VERSION,IS_SAFARI:IS_SAFARI,IS_ANY_SAFARI:IS_ANY_SAFARI,TOUCH_ENABLED:TOUCH_ENABLED,BACKGROUND_SIZE_SUPPORTED:BACKGROUND_SIZE_SUPPORTED});var _typeof$2=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};var classCallCheck=function(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}};var inherits=function(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;};var possibleConstructorReturn=function(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;};var taggedTemplateLiteralLoose=function(strings,raw){strings.raw=raw;return strings;};/**
 * @file obj.js
 * @module obj
 */ /**
 * @callback obj:EachCallback
 *
 * @param {Mixed} value
 *        The current key for the object that is being iterated over.
 *
 * @param {string} key
 *        The current key-value for object that is being iterated over
 */ /**
 * @callback obj:ReduceCallback
 *
 * @param {Mixed} accum
 *        The value that is accumulating over the reduce loop.
 *
 * @param {Mixed} value
 *        The current key for the object that is being iterated over.
 *
 * @param {string} key
 *        The current key-value for object that is being iterated over
 *
 * @return {Mixed}
 *         The new accumulated value.
 */var toString=Object.prototype.toString;/**
 * Get the keys of an Object
 *
 * @param {Object}
 *        The Object to get the keys from
 *
 * @return {string[]}
 *         An array of the keys from the object. Returns an empty array if the
 *         object passed in was invalid or had no keys.
 *
 * @private
 */var keys=function keys(object){return isObject(object)?Object.keys(object):[];};/**
 * Array-like iteration for objects.
 *
 * @param {Object} object
 *        The object to iterate over
 *
 * @param {obj:EachCallback} fn
 *        The callback function which is called for each key in the object.
 */function each(object,fn){keys(object).forEach(function(key){return fn(object[key],key);});}/**
 * Array-like reduce for objects.
 *
 * @param {Object} object
 *        The Object that you want to reduce.
 *
 * @param {Function} fn
 *         A callback function which is called for each key in the object. It
 *         receives the accumulated value and the per-iteration value and key
 *         as arguments.
 *
 * @param {Mixed} [initial = 0]
 *        Starting value
 *
 * @return {Mixed}
 *         The final accumulated value.
 */function reduce(object,fn){var initial=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;return keys(object).reduce(function(accum,key){return fn(accum,object[key],key);},initial);}/**
 * Object.assign-style object shallow merge/extend.
 *
 * @param  {Object} target
 * @param  {Object} ...sources
 * @return {Object}
 */function assign(target){for(var _len=arguments.length,sources=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){sources[_key-1]=arguments[_key];}if(Object.assign){return Object.assign.apply(Object,[target].concat(sources));}sources.forEach(function(source){if(!source){return;}each(source,function(value,key){target[key]=value;});});return target;}/**
 * Returns whether a value is an object of any kind - including DOM nodes,
 * arrays, regular expressions, etc. Not functions, though.
 *
 * This avoids the gotcha where using `typeof` on a `null` value
 * results in `'object'`.
 *
 * @param  {Object} value
 * @return {Boolean}
 */function isObject(value){return !!value&&(typeof value==='undefined'?'undefined':_typeof$2(value))==='object';}/**
 * Returns whether an object appears to be a "plain" object - that is, a
 * direct instance of `Object`.
 *
 * @param  {Object} value
 * @return {Boolean}
 */function isPlain(value){return isObject(value)&&toString.call(value)==='[object Object]'&&value.constructor===Object;}/**
 * @file create-logger.js
 * @module create-logger
 */ // This is the private tracking variable for the logging history.
var history=[];/**
 * Log messages to the console and history based on the type of message
 *
 * @private
 * @param  {string} type
 *         The name of the console method to use.
 *
 * @param  {Array} args
 *         The arguments to be passed to the matching console method.
 */var LogByTypeFactory=function LogByTypeFactory(name,log){return function(type,level,args,stringify){var lvl=log.levels[level];var lvlRegExp=new RegExp('^('+lvl+')$');if(type!=='log'){// Add the type to the front of the message when it's not "log".
args.unshift(type.toUpperCase()+':');}// Add console prefix after adding to history.
args.unshift(name+':');// Add a clone of the args at this point to history.
if(history){history.push([].concat(args));}// If there's no console then don't try to output messages, but they will
// still be stored in history.
if(!window$1.console){return;}// Was setting these once outside of this function, but containing them
// in the function makes it easier to test cases where console doesn't exist
// when the module is executed.
var fn=window$1.console[type];if(!fn&&type==='debug'){// Certain browsers don't have support for console.debug. For those, we
// should default to the closest comparable log.
fn=window$1.console.info||window$1.console.log;}// Bail out if there's no console or if this type is not allowed by the
// current logging level.
if(!fn||!lvl||!lvlRegExp.test(type)){return;}// IEs previous to 11 log objects uselessly as "[object Object]"; so, JSONify
// objects and arrays for those less-capable browsers.
if(stringify){args=args.map(function(a){if(isObject(a)||Array.isArray(a)){try{return JSON.stringify(a);}catch(x){return String(a);}}// Cast to string before joining, so we get null and undefined explicitly
// included in output (as we would in a modern console).
return String(a);}).join(' ');}// Old IE versions do not allow .apply() for console methods (they are
// reported as objects rather than functions).
if(!fn.apply){fn(args);}else {fn[Array.isArray(args)?'apply':'call'](window$1.console,args);}};};function createLogger$1(name){// This is the private tracking variable for logging level.
var level='info';// the curried logByType bound to the specific log and history
var logByType=void 0;/**
   * Logs plain debug messages. Similar to `console.log`.
   *
   * Due to [limitations](https://github.com/jsdoc3/jsdoc/issues/955#issuecomment-313829149)
   * of our JSDoc template, we cannot properly document this as both a function
   * and a namespace, so its function signature is documented here.
   *
   * #### Arguments
   * ##### *args
   * Mixed[]
   *
   * Any combination of values that could be passed to `console.log()`.
   *
   * #### Return Value
   *
   * `undefined`
   *
   * @namespace
   * @param    {Mixed[]} args
   *           One or more messages or objects that should be logged.
   */var log=function log(){var stringify=log.stringify||IE_VERSION&&IE_VERSION<11;for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}logByType('log',level,args,stringify);};// This is the logByType helper that the logging methods below use
logByType=LogByTypeFactory(name,log);/**
   * Create a new sublogger which chains the old name to the new name.
   *
   * For example, doing `videojs.log.createLogger('player')` and then using that logger will log the following:
   * ```js
   *  mylogger('foo');
   *  // > VIDEOJS: player: foo
   * ```
   *
   * @param {string} name
   *        The name to add call the new logger
   * @return {Object}
   */log.createLogger=function(subname){return createLogger$1(name+': '+subname);};/**
   * Enumeration of available logging levels, where the keys are the level names
   * and the values are `|`-separated strings containing logging methods allowed
   * in that logging level. These strings are used to create a regular expression
   * matching the function name being called.
   *
   * Levels provided by Video.js are:
   *
   * - `off`: Matches no calls. Any value that can be cast to `false` will have
   *   this effect. The most restrictive.
   * - `all`: Matches only Video.js-provided functions (`debug`, `log`,
   *   `log.warn`, and `log.error`).
   * - `debug`: Matches `log.debug`, `log`, `log.warn`, and `log.error` calls.
   * - `info` (default): Matches `log`, `log.warn`, and `log.error` calls.
   * - `warn`: Matches `log.warn` and `log.error` calls.
   * - `error`: Matches only `log.error` calls.
   *
   * @type {Object}
   */log.levels={all:'debug|log|warn|error',off:'',debug:'debug|log|warn|error',info:'log|warn|error',warn:'warn|error',error:'error',DEFAULT:level};/**
   * Get or set the current logging level.
   *
   * If a string matching a key from {@link module:log.levels} is provided, acts
   * as a setter.
   *
   * @param  {string} [lvl]
   *         Pass a valid level to set a new logging level.
   *
   * @return {string}
   *         The current logging level.
   */log.level=function(lvl){if(typeof lvl==='string'){if(!log.levels.hasOwnProperty(lvl)){throw new Error('"'+lvl+'" in not a valid log level');}level=lvl;}return level;};/**
   * Returns an array containing everything that has been logged to the history.
   *
   * This array is a shallow clone of the internal history record. However, its
   * contents are _not_ cloned; so, mutating objects inside this array will
   * mutate them in history.
   *
   * @return {Array}
   */log.history=function(){return history?[].concat(history):[];};/**
   * Allows you to filter the history by the given logger name
   *
   * @param {string} fname
   *        The name to filter by
   *
   * @return {Array}
   *         The filtered list to return
   */log.history.filter=function(fname){return (history||[]).filter(function(historyItem){// if the first item in each historyItem includes `fname`, then it's a match
return new RegExp('.*'+fname+'.*').test(historyItem[0]);});};/**
   * Clears the internal history tracking, but does not prevent further history
   * tracking.
   */log.history.clear=function(){if(history){history.length=0;}};/**
   * Disable history tracking if it is currently enabled.
   */log.history.disable=function(){if(history!==null){history.length=0;history=null;}};/**
   * Enable history tracking if it is currently disabled.
   */log.history.enable=function(){if(history===null){history=[];}};/**
   * Logs error messages. Similar to `console.error`.
   *
   * @param {Mixed[]} args
   *        One or more messages or objects that should be logged as an error
   */log.error=function(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}return logByType('error',level,args);};/**
   * Logs warning messages. Similar to `console.warn`.
   *
   * @param {Mixed[]} args
   *        One or more messages or objects that should be logged as a warning.
   */log.warn=function(){for(var _len3=arguments.length,args=Array(_len3),_key3=0;_key3<_len3;_key3++){args[_key3]=arguments[_key3];}return logByType('warn',level,args);};/**
   * Logs debug messages. Similar to `console.debug`, but may also act as a comparable
   * log if `console.debug` is not available
   *
   * @param {Mixed[]} args
   *        One or more messages or objects that should be logged as debug.
   */log.debug=function(){for(var _len4=arguments.length,args=Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4];}return logByType('debug',level,args);};return log;}/**
 * @file log.js
 * @module log
 */var log=createLogger$1('VIDEOJS');var createLogger=log.createLogger;/**
 * @file computed-style.js
 * @module computed-style
 */ /**
 * A safe getComputedStyle with an IE8 fallback.
 *
 * This is needed because in Firefox, if the player is loaded in an iframe with
 * `display:none`, then `getComputedStyle` returns `null`, so, we do a null-check to
 * make sure  that the player doesn't break in these cases.
 *
 * @param {Element} el
 *        The element you want the computed style of
 *
 * @param {string} prop
 *        The property name you want
 *
 * @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397
 *
 * @static
 * @const
 */function computedStyle(el,prop){if(!el||!prop){return '';}if(typeof window$1.getComputedStyle==='function'){var cs=window$1.getComputedStyle(el);return cs?cs[prop]:'';}return el.currentStyle[prop]||'';}var _templateObject=taggedTemplateLiteralLoose(['Setting attributes in the second argument of createEl()\n                has been deprecated. Use the third argument instead.\n                createEl(type, properties, attributes). Attempting to set ',' to ','.'],['Setting attributes in the second argument of createEl()\n                has been deprecated. Use the third argument instead.\n                createEl(type, properties, attributes). Attempting to set ',' to ','.']);/**
 * @file dom.js
 * @module dom
 */ /**
 * Detect if a value is a string with any non-whitespace characters.
 *
 * @param {string} str
 *        The string to check
 *
 * @return {boolean}
 *         - True if the string is non-blank
 *         - False otherwise
 *
 */function isNonBlankString(str){return typeof str==='string'&&/\S/.test(str);}/**
 * Throws an error if the passed string has whitespace. This is used by
 * class methods to be relatively consistent with the classList API.
 *
 * @param {string} str
 *         The string to check for whitespace.
 *
 * @throws {Error}
 *         Throws an error if there is whitespace in the string.
 *
 */function throwIfWhitespace(str){if(/\s/.test(str)){throw new Error('class has illegal whitespace characters');}}/**
 * Produce a regular expression for matching a className within an elements className.
 *
 * @param {string} className
 *         The className to generate the RegExp for.
 *
 * @return {RegExp}
 *         The RegExp that will check for a specific `className` in an elements
 *         className.
 */function classRegExp(className){return new RegExp('(^|\\s)'+className+'($|\\s)');}/**
 * Whether the current DOM interface appears to be real.
 *
 * @return {Boolean}
 */function isReal(){return(// Both document and window will never be undefined thanks to `global`.
document$1===window$1.document&&// In IE < 9, DOM methods return "object" as their type, so all we can
// confidently check is that it exists.
typeof document$1.createElement!=='undefined');}/**
 * Determines, via duck typing, whether or not a value is a DOM element.
 *
 * @param {Mixed} value
 *        The thing to check
 *
 * @return {boolean}
 *         - True if it is a DOM element
 *         - False otherwise
 */function isEl(value){return isObject(value)&&value.nodeType===1;}/**
 * Determines if the current DOM is embedded in an iframe.
 *
 * @return {boolean}
 *
 */function isInFrame(){// We need a try/catch here because Safari will throw errors when attempting
// to get either `parent` or `self`
try{return window$1.parent!==window$1.self;}catch(x){return true;}}/**
 * Creates functions to query the DOM using a given method.
 *
 * @param {string} method
 *         The method to create the query with.
 *
 * @return {Function}
 *         The query method
 */function createQuerier(method){return function(selector,context){if(!isNonBlankString(selector)){return document$1[method](null);}if(isNonBlankString(context)){context=document$1.querySelector(context);}var ctx=isEl(context)?context:document$1;return ctx[method]&&ctx[method](selector);};}/**
 * Creates an element and applies properties.
 *
 * @param {string} [tagName='div']
 *         Name of tag to be created.
 *
 * @param {Object} [properties={}]
 *         Element properties to be applied.
 *
 * @param {Object} [attributes={}]
 *         Element attributes to be applied.
 *
 * @param {String|Element|TextNode|Array|Function} [content]
 *         Contents for the element (see: {@link dom:normalizeContent})
 *
 * @return {Element}
 *         The element that was created.
 */function createEl(){var tagName=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'div';var properties=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var attributes=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var content=arguments[3];var el=document$1.createElement(tagName);Object.getOwnPropertyNames(properties).forEach(function(propName){var val=properties[propName];// See #2176
// We originally were accepting both properties and attributes in the
// same object, but that doesn't work so well.
if(propName.indexOf('aria-')!==-1||propName==='role'||propName==='type'){log.warn(tsml(_templateObject,propName,val));el.setAttribute(propName,val);// Handle textContent since it's not supported everywhere and we have a
// method for it.
}else if(propName==='textContent'){textContent(el,val);}else {el[propName]=val;}});Object.getOwnPropertyNames(attributes).forEach(function(attrName){el.setAttribute(attrName,attributes[attrName]);});if(content){appendContent(el,content);}return el;}/**
 * Injects text into an element, replacing any existing contents entirely.
 *
 * @param {Element} el
 *        The element to add text content into
 *
 * @param {string} text
 *        The text content to add.
 *
 * @return {Element}
 *         The element with added text content.
 */function textContent(el,text){if(typeof el.textContent==='undefined'){el.innerText=text;}else {el.textContent=text;}return el;}/**
 * Insert an element as the first child node of another
 *
 * @param {Element} child
 *        Element to insert
 *
 * @param {Element} parent
 *        Element to insert child into
 */function prependTo(child,parent){if(parent.firstChild){parent.insertBefore(child,parent.firstChild);}else {parent.appendChild(child);}}/**
 * Check if an element has a CSS class
 *
 * @param {Element} element
 *        Element to check
 *
 * @param {string} classToCheck
 *        Class name to check for
 *
 * @return {boolean}
 *         - True if the element had the class
 *         - False otherwise.
 *
 * @throws {Error}
 *         Throws an error if `classToCheck` has white space.
 */function hasClass$1(element,classToCheck){throwIfWhitespace(classToCheck);if(element.classList){return element.classList.contains(classToCheck);}return classRegExp(classToCheck).test(element.className);}/**
 * Add a CSS class name to an element
 *
 * @param {Element} element
 *        Element to add class name to.
 *
 * @param {string} classToAdd
 *        Class name to add.
 *
 * @return {Element}
 *         The dom element with the added class name.
 */function addClass(element,classToAdd){if(element.classList){element.classList.add(classToAdd);// Don't need to `throwIfWhitespace` here because `hasElClass` will do it
// in the case of classList not being supported.
}else if(!hasClass$1(element,classToAdd)){element.className=(element.className+' '+classToAdd).trim();}return element;}/**
 * Remove a CSS class name from an element
 *
 * @param {Element} element
 *        Element to remove a class name from.
 *
 * @param {string} classToRemove
 *        Class name to remove
 *
 * @return {Element}
 *         The dom element with class name removed.
 */function removeClass(element,classToRemove){if(element.classList){element.classList.remove(classToRemove);}else {throwIfWhitespace(classToRemove);element.className=element.className.split(/\s+/).filter(function(c){return c!==classToRemove;}).join(' ');}return element;}/**
 * The callback definition for toggleElClass.
 *
 * @callback Dom~PredicateCallback
 * @param {Element} element
 *        The DOM element of the Component.
 *
 * @param {string} classToToggle
 *        The `className` that wants to be toggled
 *
 * @return {boolean|undefined}
 *         - If true the `classToToggle` will get added to `element`.
 *         - If false the `classToToggle` will get removed from `element`.
 *         - If undefined this callback will be ignored
 */ /**
 * Adds or removes a CSS class name on an element depending on an optional
 * condition or the presence/absence of the class name.
 *
 * @param {Element} element
 *        The element to toggle a class name on.
 *
 * @param {string} classToToggle
 *        The class that should be toggled
 *
 * @param {boolean|PredicateCallback} [predicate]
 *        See the return value for {@link Dom~PredicateCallback}
 *
 * @return {Element}
 *         The element with a class that has been toggled.
 */function toggleClass(element,classToToggle,predicate){// This CANNOT use `classList` internally because IE does not support the
// second parameter to the `classList.toggle()` method! Which is fine because
// `classList` will be used by the add/remove functions.
var has=hasClass$1(element,classToToggle);if(typeof predicate==='function'){predicate=predicate(element,classToToggle);}if(typeof predicate!=='boolean'){predicate=!has;}// If the necessary class operation matches the current state of the
// element, no action is required.
if(predicate===has){return;}if(predicate){addClass(element,classToToggle);}else {removeClass(element,classToToggle);}return element;}/**
 * Apply attributes to an HTML element.
 *
 * @param {Element} el
 *        Element to add attributes to.
 *
 * @param {Object} [attributes]
 *        Attributes to be applied.
 */function setAttributes(el,attributes){Object.getOwnPropertyNames(attributes).forEach(function(attrName){var attrValue=attributes[attrName];if(attrValue===null||typeof attrValue==='undefined'||attrValue===false){el.removeAttribute(attrName);}else {el.setAttribute(attrName,attrValue===true?'':attrValue);}});}/**
 * Get an element's attribute values, as defined on the HTML tag
 * Attributes are not the same as properties. They're defined on the tag
 * or with setAttribute (which shouldn't be used with HTML)
 * This will return true or false for boolean attributes.
 *
 * @param {Element} tag
 *        Element from which to get tag attributes.
 *
 * @return {Object}
 *         All attributes of the element.
 */function getAttributes(tag){var obj={};// known boolean attributes
// we can check for matching boolean properties, but older browsers
// won't know about HTML5 boolean attributes that we still read from
var knownBooleans=','+'autoplay,controls,playsinline,loop,muted,default,defaultMuted'+',';if(tag&&tag.attributes&&tag.attributes.length>0){var attrs=tag.attributes;for(var i=attrs.length-1;i>=0;i--){var attrName=attrs[i].name;var attrVal=attrs[i].value;// check for known booleans
// the matching element property will return a value for typeof
if(typeof tag[attrName]==='boolean'||knownBooleans.indexOf(','+attrName+',')!==-1){// the value of an included boolean attribute is typically an empty
// string ('') which would equal false if we just check for a false value.
// we also don't want support bad code like autoplay='false'
attrVal=attrVal!==null?true:false;}obj[attrName]=attrVal;}}return obj;}/**
 * Get the value of an element's attribute
 *
 * @param {Element} el
 *        A DOM element
 *
 * @param {string} attribute
 *        Attribute to get the value of
 *
 * @return {string}
 *         value of the attribute
 */function getAttribute(el,attribute){return el.getAttribute(attribute);}/**
 * Set the value of an element's attribute
 *
 * @param {Element} el
 *        A DOM element
 *
 * @param {string} attribute
 *        Attribute to set
 *
 * @param {string} value
 *        Value to set the attribute to
 */function setAttribute(el,attribute,value){el.setAttribute(attribute,value);}/**
 * Remove an element's attribute
 *
 * @param {Element} el
 *        A DOM element
 *
 * @param {string} attribute
 *        Attribute to remove
 */function removeAttribute(el,attribute){el.removeAttribute(attribute);}/**
 * Attempt to block the ability to select text while dragging controls
 */function blockTextSelection(){document$1.body.focus();document$1.onselectstart=function(){return false;};}/**
 * Turn off text selection blocking
 */function unblockTextSelection(){document$1.onselectstart=function(){return true;};}/**
 * Identical to the native `getBoundingClientRect` function, but ensures that
 * the method is supported at all (it is in all browsers we claim to support)
 * and that the element is in the DOM before continuing.
 *
 * This wrapper function also shims properties which are not provided by some
 * older browsers (namely, IE8).
 *
 * Additionally, some browsers do not support adding properties to a
 * `ClientRect`/`DOMRect` object; so, we shallow-copy it with the standard
 * properties (except `x` and `y` which are not widely supported). This helps
 * avoid implementations where keys are non-enumerable.
 *
 * @param  {Element} el
 *         Element whose `ClientRect` we want to calculate.
 *
 * @return {Object|undefined}
 *         Always returns a plain
 */function getBoundingClientRect(el){if(el&&el.getBoundingClientRect&&el.parentNode){var rect=el.getBoundingClientRect();var result={};['bottom','height','left','right','top','width'].forEach(function(k){if(rect[k]!==undefined){result[k]=rect[k];}});if(!result.height){result.height=parseFloat(computedStyle(el,'height'));}if(!result.width){result.width=parseFloat(computedStyle(el,'width'));}return result;}}/**
 * The postion of a DOM element on the page.
 *
 * @typedef {Object} module:dom~Position
 *
 * @property {number} left
 *           Pixels to the left
 *
 * @property {number} top
 *           Pixels on top
 */ /**
 * Offset Left.
 * getBoundingClientRect technique from
 * John Resig
 *
 * @see http://ejohn.org/blog/getboundingclientrect-is-awesome/
 *
 * @param {Element} el
 *        Element from which to get offset
 *
 * @return {module:dom~Position}
 *         The position of the element that was passed in.
 */function findPosition(el){var box=void 0;if(el.getBoundingClientRect&&el.parentNode){box=el.getBoundingClientRect();}if(!box){return {left:0,top:0};}var docEl=document$1.documentElement;var body=document$1.body;var clientLeft=docEl.clientLeft||body.clientLeft||0;var scrollLeft=window$1.pageXOffset||body.scrollLeft;var left=box.left+scrollLeft-clientLeft;var clientTop=docEl.clientTop||body.clientTop||0;var scrollTop=window$1.pageYOffset||body.scrollTop;var top=box.top+scrollTop-clientTop;// Android sometimes returns slightly off decimal values, so need to round
return {left:Math.round(left),top:Math.round(top)};}/**
 * x and y coordinates for a dom element or mouse pointer
 *
 * @typedef {Object} Dom~Coordinates
 *
 * @property {number} x
 *           x coordinate in pixels
 *
 * @property {number} y
 *           y coordinate in pixels
 */ /**
 * Get pointer position in element
 * Returns an object with x and y coordinates.
 * The base on the coordinates are the bottom left of the element.
 *
 * @param {Element} el
 *        Element on which to get the pointer position on
 *
 * @param {EventTarget~Event} event
 *        Event object
 *
 * @return {Dom~Coordinates}
 *         A Coordinates object corresponding to the mouse position.
 *
 */function getPointerPosition(el,event){var position={};var box=findPosition(el);var boxW=el.offsetWidth;var boxH=el.offsetHeight;var boxY=box.top;var boxX=box.left;var pageY=event.pageY;var pageX=event.pageX;if(event.changedTouches){pageX=event.changedTouches[0].pageX;pageY=event.changedTouches[0].pageY;}position.y=Math.max(0,Math.min(1,(boxY-pageY+boxH)/boxH));position.x=Math.max(0,Math.min(1,(pageX-boxX)/boxW));return position;}/**
 * Determines, via duck typing, whether or not a value is a text node.
 *
 * @param {Mixed} value
 *        Check if this value is a text node.
 *
 * @return {boolean}
 *         - True if it is a text node
 *         - False otherwise
 */function isTextNode(value){return isObject(value)&&value.nodeType===3;}/**
 * Empties the contents of an element.
 *
 * @param {Element} el
 *        The element to empty children from
 *
 * @return {Element}
 *         The element with no children
 */function emptyEl(el){while(el.firstChild){el.removeChild(el.firstChild);}return el;}/**
 * Normalizes content for eventual insertion into the DOM.
 *
 * This allows a wide range of content definition methods, but protects
 * from falling into the trap of simply writing to `innerHTML`, which is
 * an XSS concern.
 *
 * The content for an element can be passed in multiple types and
 * combinations, whose behavior is as follows:
 *
 * @param {String|Element|TextNode|Array|Function} content
 *        - String: Normalized into a text node.
 *        - Element/TextNode: Passed through.
 *        - Array: A one-dimensional array of strings, elements, nodes, or functions
 *          (which return single strings, elements, or nodes).
 *        - Function: If the sole argument, is expected to produce a string, element,
 *          node, or array as defined above.
 *
 * @return {Array}
 *         All of the content that was passed in normalized.
 */function normalizeContent(content){// First, invoke content if it is a function. If it produces an array,
// that needs to happen before normalization.
if(typeof content==='function'){content=content();}// Next up, normalize to an array, so one or many items can be normalized,
// filtered, and returned.
return (Array.isArray(content)?content:[content]).map(function(value){// First, invoke value if it is a function to produce a new value,
// which will be subsequently normalized to a Node of some kind.
if(typeof value==='function'){value=value();}if(isEl(value)||isTextNode(value)){return value;}if(typeof value==='string'&&/\S/.test(value)){return document$1.createTextNode(value);}}).filter(function(value){return value;});}/**
 * Normalizes and appends content to an element.
 *
 * @param {Element} el
 *        Element to append normalized content to.
 *
 *
 * @param {String|Element|TextNode|Array|Function} content
 *        See the `content` argument of {@link dom:normalizeContent}
 *
 * @return {Element}
 *         The element with appended normalized content.
 */function appendContent(el,content){normalizeContent(content).forEach(function(node){return el.appendChild(node);});return el;}/**
 * Normalizes and inserts content into an element; this is identical to
 * `appendContent()`, except it empties the element first.
 *
 * @param {Element} el
 *        Element to insert normalized content into.
 *
 * @param {String|Element|TextNode|Array|Function} content
 *        See the `content` argument of {@link dom:normalizeContent}
 *
 * @return {Element}
 *         The element with inserted normalized content.
 *
 */function insertContent(el,content){return appendContent(emptyEl(el),content);}/**
 * Check if event was a single left click
 *
 * @param {EventTarget~Event} event
 *        Event object
 *
 * @return {boolean}
 *         - True if a left click
 *         - False if not a left click
 */function isSingleLeftClick(event){// Note: if you create something draggable, be sure to
// call it on both `mousedown` and `mousemove` event,
// otherwise `mousedown` should be enough for a button
if(event.button===undefined&&event.buttons===undefined){// Why do we need `buttons` ?
// Because, middle mouse sometimes have this:
// e.button === 0 and e.buttons === 4
// Furthermore, we want to prevent combination click, something like
// HOLD middlemouse then left click, that would be
// e.button === 0, e.buttons === 5
// just `button` is not gonna work
// Alright, then what this block does ?
// this is for chrome `simulate mobile devices`
// I want to support this as well
return true;}if(event.button===0&&event.buttons===undefined){// Touch screen, sometimes on some specific device, `buttons`
// doesn't have anything (safari on ios, blackberry...)
return true;}if(IE_VERSION===9){// Ignore IE9
return true;}if(event.button!==0||event.buttons!==1){// This is the reason we have those if else block above
// if any special case we can catch and let it slide
// we do it above, when get to here, this definitely
// is-not-left-click
return false;}return true;}/**
 * Finds a single DOM element matching `selector` within the optional
 * `context` of another DOM element (defaulting to `document`).
 *
 * @param {string} selector
 *        A valid CSS selector, which will be passed to `querySelector`.
 *
 * @param {Element|String} [context=document]
 *        A DOM element within which to query. Can also be a selector
 *        string in which case the first matching element will be used
 *        as context. If missing (or no element matches selector), falls
 *        back to `document`.
 *
 * @return {Element|null}
 *         The element that was found or null.
 */var $$1=createQuerier('querySelector');/**
 * Finds a all DOM elements matching `selector` within the optional
 * `context` of another DOM element (defaulting to `document`).
 *
 * @param {string} selector
 *           A valid CSS selector, which will be passed to `querySelectorAll`.
 *
 * @param {Element|String} [context=document]
 *           A DOM element within which to query. Can also be a selector
 *           string in which case the first matching element will be used
 *           as context. If missing (or no element matches selector), falls
 *           back to `document`.
 *
 * @return {NodeList}
 *         A element list of elements that were found. Will be empty if none were found.
 *
 */var $$=createQuerier('querySelectorAll');var Dom=(Object.freeze||Object)({isReal:isReal,isEl:isEl,isInFrame:isInFrame,createEl:createEl,textContent:textContent,prependTo:prependTo,hasClass:hasClass$1,addClass:addClass,removeClass:removeClass,toggleClass:toggleClass,setAttributes:setAttributes,getAttributes:getAttributes,getAttribute:getAttribute,setAttribute:setAttribute,removeAttribute:removeAttribute,blockTextSelection:blockTextSelection,unblockTextSelection:unblockTextSelection,getBoundingClientRect:getBoundingClientRect,findPosition:findPosition,getPointerPosition:getPointerPosition,isTextNode:isTextNode,emptyEl:emptyEl,normalizeContent:normalizeContent,appendContent:appendContent,insertContent:insertContent,isSingleLeftClick:isSingleLeftClick,$:$$1,$$:$$});/**
 * @file guid.js
 * @module guid
 */ /**
 * Unique ID for an element or function
 * @type {Number}
 */var _guid=1;/**
 * Get a unique auto-incrementing ID by number that has not been returned before.
 *
 * @return {number}
 *         A new unique ID.
 */function newGUID(){return _guid++;}/**
 * @file dom-data.js
 * @module dom-data
 */ /**
 * Element Data Store.
 *
 * Allows for binding data to an element without putting it directly on the
 * element. Ex. Event listeners are stored here.
 * (also from jsninja.com, slightly modified and updated for closure compiler)
 *
 * @type {Object}
 * @private
 */var elData={};/*
 * Unique attribute name to store an element's guid in
 *
 * @type {String}
 * @constant
 * @private
 */var elIdAttr='vdata'+new Date().getTime();/**
 * Returns the cache object where data for an element is stored
 *
 * @param {Element} el
 *        Element to store data for.
 *
 * @return {Object}
 *         The cache object for that el that was passed in.
 */function getData(el){var id=el[elIdAttr];if(!id){id=el[elIdAttr]=newGUID();}if(!elData[id]){elData[id]={};}return elData[id];}/**
 * Returns whether or not an element has cached data
 *
 * @param {Element} el
 *        Check if this element has cached data.
 *
 * @return {boolean}
 *         - True if the DOM element has cached data.
 *         - False otherwise.
 */function hasData(el){var id=el[elIdAttr];if(!id){return false;}return !!Object.getOwnPropertyNames(elData[id]).length;}/**
 * Delete data for the element from the cache and the guid attr from getElementById
 *
 * @param {Element} el
 *        Remove cached data for this element.
 */function removeData(el){var id=el[elIdAttr];if(!id){return;}// Remove all stored data
delete elData[id];// Remove the elIdAttr property from the DOM node
try{delete el[elIdAttr];}catch(e){if(el.removeAttribute){el.removeAttribute(elIdAttr);}else {// IE doesn't appear to support removeAttribute on the document element
el[elIdAttr]=null;}}}/**
 * @file events.js. An Event System (John Resig - Secrets of a JS Ninja http://jsninja.com/)
 * (Original book version wasn't completely usable, so fixed some things and made Closure Compiler compatible)
 * This should work very similarly to jQuery's events, however it's based off the book version which isn't as
 * robust as jquery's, so there's probably some differences.
 *
 * @module events
 */ /**
 * Clean up the listener cache and dispatchers
 *
 * @param {Element|Object} elem
 *        Element to clean up
 *
 * @param {string} type
 *        Type of event to clean up
 */function _cleanUpEvents(elem,type){var data=getData(elem);// Remove the events of a particular type if there are none left
if(data.handlers[type].length===0){delete data.handlers[type];// data.handlers[type] = null;
// Setting to null was causing an error with data.handlers
// Remove the meta-handler from the element
if(elem.removeEventListener){elem.removeEventListener(type,data.dispatcher,false);}else if(elem.detachEvent){elem.detachEvent('on'+type,data.dispatcher);}}// Remove the events object if there are no types left
if(Object.getOwnPropertyNames(data.handlers).length<=0){delete data.handlers;delete data.dispatcher;delete data.disabled;}// Finally remove the element data if there is no data left
if(Object.getOwnPropertyNames(data).length===0){removeData(elem);}}/**
 * Loops through an array of event types and calls the requested method for each type.
 *
 * @param {Function} fn
 *        The event method we want to use.
 *
 * @param {Element|Object} elem
 *        Element or object to bind listeners to
 *
 * @param {string} type
 *        Type of event to bind to.
 *
 * @param {EventTarget~EventListener} callback
 *        Event listener.
 */function _handleMultipleEvents(fn,elem,types,callback){types.forEach(function(type){// Call the event method for each one of the types
fn(elem,type,callback);});}/**
 * Fix a native event to have standard property values
 *
 * @param {Object} event
 *        Event object to fix.
 *
 * @return {Object}
 *         Fixed event object.
 */function fixEvent(event){function returnTrue(){return true;}function returnFalse(){return false;}// Test if fixing up is needed
// Used to check if !event.stopPropagation instead of isPropagationStopped
// But native events return true for stopPropagation, but don't have
// other expected methods like isPropagationStopped. Seems to be a problem
// with the Javascript Ninja code. So we're just overriding all events now.
if(!event||!event.isPropagationStopped){var old=event||window$1.event;event={};// Clone the old object so that we can modify the values event = {};
// IE8 Doesn't like when you mess with native event properties
// Firefox returns false for event.hasOwnProperty('type') and other props
//  which makes copying more difficult.
// TODO: Probably best to create a whitelist of event props
for(var key in old){// Safari 6.0.3 warns you if you try to copy deprecated layerX/Y
// Chrome warns you if you try to copy deprecated keyboardEvent.keyLocation
// and webkitMovementX/Y
if(key!=='layerX'&&key!=='layerY'&&key!=='keyLocation'&&key!=='webkitMovementX'&&key!=='webkitMovementY'){// Chrome 32+ warns if you try to copy deprecated returnValue, but
// we still want to if preventDefault isn't supported (IE8).
if(!(key==='returnValue'&&old.preventDefault)){event[key]=old[key];}}}// The event occurred on this element
if(!event.target){event.target=event.srcElement||document$1;}// Handle which other element the event is related to
if(!event.relatedTarget){event.relatedTarget=event.fromElement===event.target?event.toElement:event.fromElement;}// Stop the default browser action
event.preventDefault=function(){if(old.preventDefault){old.preventDefault();}event.returnValue=false;old.returnValue=false;event.defaultPrevented=true;};event.defaultPrevented=false;// Stop the event from bubbling
event.stopPropagation=function(){if(old.stopPropagation){old.stopPropagation();}event.cancelBubble=true;old.cancelBubble=true;event.isPropagationStopped=returnTrue;};event.isPropagationStopped=returnFalse;// Stop the event from bubbling and executing other handlers
event.stopImmediatePropagation=function(){if(old.stopImmediatePropagation){old.stopImmediatePropagation();}event.isImmediatePropagationStopped=returnTrue;event.stopPropagation();};event.isImmediatePropagationStopped=returnFalse;// Handle mouse position
if(event.clientX!==null&&event.clientX!==undefined){var doc=document$1.documentElement;var body=document$1.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0);}// Handle key presses
event.which=event.charCode||event.keyCode;// Fix button for mouse clicks:
// 0 == left; 1 == middle; 2 == right
if(event.button!==null&&event.button!==undefined){// The following is disabled because it does not pass videojs-standard
// and... yikes.
/* eslint-disable */event.button=event.button&1?0:event.button&4?1:event.button&2?2:0;/* eslint-enable */}}// Returns fixed-up instance
return event;}/**
 * Whether passive event listeners are supported
 */var _supportsPassive=false;(function(){try{var opts=Object.defineProperty({},'passive',{get:function get(){_supportsPassive=true;}});window$1.addEventListener('test',null,opts);window$1.removeEventListener('test',null,opts);}catch(e){// disregard
}})();/**
 * Touch events Chrome expects to be passive
 */var passiveEvents=['touchstart','touchmove'];/**
 * Add an event listener to element
 * It stores the handler function in a separate cache object
 * and adds a generic handler to the element's event,
 * along with a unique id (guid) to the element.
 *
 * @param {Element|Object} elem
 *        Element or object to bind listeners to
 *
 * @param {string|string[]} type
 *        Type of event to bind to.
 *
 * @param {EventTarget~EventListener} fn
 *        Event listener.
 */function on(elem,type,fn){if(Array.isArray(type)){return _handleMultipleEvents(on,elem,type,fn);}var data=getData(elem);// We need a place to store all our handler data
if(!data.handlers){data.handlers={};}if(!data.handlers[type]){data.handlers[type]=[];}if(!fn.guid){fn.guid=newGUID();}data.handlers[type].push(fn);if(!data.dispatcher){data.disabled=false;data.dispatcher=function(event,hash){if(data.disabled){return;}event=fixEvent(event);var handlers=data.handlers[event.type];if(handlers){// Copy handlers so if handlers are added/removed during the process it doesn't throw everything off.
var handlersCopy=handlers.slice(0);for(var m=0,n=handlersCopy.length;m<n;m++){if(event.isImmediatePropagationStopped()){break;}else {try{handlersCopy[m].call(elem,event,hash);}catch(e){log.error(e);}}}}};}if(data.handlers[type].length===1){if(elem.addEventListener){var options=false;if(_supportsPassive&&passiveEvents.indexOf(type)>-1){options={passive:true};}elem.addEventListener(type,data.dispatcher,options);}else if(elem.attachEvent){elem.attachEvent('on'+type,data.dispatcher);}}}/**
 * Removes event listeners from an element
 *
 * @param {Element|Object} elem
 *        Object to remove listeners from.
 *
 * @param {string|string[]} [type]
 *        Type of listener to remove. Don't include to remove all events from element.
 *
 * @param {EventTarget~EventListener} [fn]
 *        Specific listener to remove. Don't include to remove listeners for an event
 *        type.
 */function off(elem,type,fn){// Don't want to add a cache object through getElData if not needed
if(!hasData(elem)){return;}var data=getData(elem);// If no events exist, nothing to unbind
if(!data.handlers){return;}if(Array.isArray(type)){return _handleMultipleEvents(off,elem,type,fn);}// Utility function
var removeType=function removeType(el,t){data.handlers[t]=[];_cleanUpEvents(el,t);};// Are we removing all bound events?
if(type===undefined){for(var t in data.handlers){if(Object.prototype.hasOwnProperty.call(data.handlers||{},t)){removeType(elem,t);}}return;}var handlers=data.handlers[type];// If no handlers exist, nothing to unbind
if(!handlers){return;}// If no listener was provided, remove all listeners for type
if(!fn){removeType(elem,type);return;}// We're only removing a single handler
if(fn.guid){for(var n=0;n<handlers.length;n++){if(handlers[n].guid===fn.guid){handlers.splice(n--,1);}}}_cleanUpEvents(elem,type);}/**
 * Trigger an event for an element
 *
 * @param {Element|Object} elem
 *        Element to trigger an event on
 *
 * @param {EventTarget~Event|string} event
 *        A string (the type) or an event object with a type attribute
 *
 * @param {Object} [hash]
 *        data hash to pass along with the event
 *
 * @return {boolean|undefined}
 *         - Returns the opposite of `defaultPrevented` if default was prevented
 *         - Otherwise returns undefined
 */function trigger(elem,event,hash){// Fetches element data and a reference to the parent (for bubbling).
// Don't want to add a data object to cache for every parent,
// so checking hasElData first.
var elemData=hasData(elem)?getData(elem):{};var parent=elem.parentNode||elem.ownerDocument;// type = event.type || event,
// handler;
// If an event name was passed as a string, creates an event out of it
if(typeof event==='string'){event={type:event,target:elem};}else if(!event.target){event.target=elem;}// Normalizes the event properties.
event=fixEvent(event);// If the passed element has a dispatcher, executes the established handlers.
if(elemData.dispatcher){elemData.dispatcher.call(elem,event,hash);}// Unless explicitly stopped or the event does not bubble (e.g. media events)
// recursively calls this function to bubble the event up the DOM.
if(parent&&!event.isPropagationStopped()&&event.bubbles===true){trigger.call(null,parent,event,hash);// If at the top of the DOM, triggers the default action unless disabled.
}else if(!parent&&!event.defaultPrevented){var targetData=getData(event.target);// Checks if the target has a default action for this event.
if(event.target[event.type]){// Temporarily disables event dispatching on the target as we have already executed the handler.
targetData.disabled=true;// Executes the default action.
if(typeof event.target[event.type]==='function'){event.target[event.type]();}// Re-enables event dispatching.
targetData.disabled=false;}}// Inform the triggerer if the default was prevented by returning false
return !event.defaultPrevented;}/**
 * Trigger a listener only once for an event
 *
 * @param {Element|Object} elem
 *        Element or object to bind to.
 *
 * @param {string|string[]} type
 *        Name/type of event
 *
 * @param {Event~EventListener} fn
 *        Event Listener function
 */function one(elem,type,fn){if(Array.isArray(type)){return _handleMultipleEvents(one,elem,type,fn);}var func=function func(){off(elem,type,func);fn.apply(this,arguments);};// copy the guid to the new function so it can removed using the original function's ID
func.guid=fn.guid=fn.guid||newGUID();on(elem,type,func);}var Events=(Object.freeze||Object)({fixEvent:fixEvent,on:on,off:off,trigger:trigger,one:one});/**
 * @file setup.js - Functions for setting up a player without
 * user interaction based on the data-setup `attribute` of the video tag.
 *
 * @module setup
 */var _windowLoaded=false;var videojs$2=void 0;/**
 * Set up any tags that have a data-setup `attribute` when the player is started.
 */var autoSetup=function autoSetup(){// Protect against breakage in non-browser environments and check global autoSetup option.
if(!isReal()||videojs$2.options.autoSetup===false){return;}// One day, when we stop supporting IE8, go back to this, but in the meantime...*hack hack hack*
// var vids = Array.prototype.slice.call(document.getElementsByTagName('video'));
// var audios = Array.prototype.slice.call(document.getElementsByTagName('audio'));
// var mediaEls = vids.concat(audios);
// Because IE8 doesn't support calling slice on a node list, we need to loop
// through each list of elements to build up a new, combined list of elements.
var vids=document$1.getElementsByTagName('video');var audios=document$1.getElementsByTagName('audio');var divs=document$1.getElementsByTagName('video-js');var mediaEls=[];if(vids&&vids.length>0){for(var i=0,e=vids.length;i<e;i++){mediaEls.push(vids[i]);}}if(audios&&audios.length>0){for(var _i=0,_e=audios.length;_i<_e;_i++){mediaEls.push(audios[_i]);}}if(divs&&divs.length>0){for(var _i2=0,_e2=divs.length;_i2<_e2;_i2++){mediaEls.push(divs[_i2]);}}// Check if any media elements exist
if(mediaEls&&mediaEls.length>0){for(var _i3=0,_e3=mediaEls.length;_i3<_e3;_i3++){var mediaEl=mediaEls[_i3];// Check if element exists, has getAttribute func.
// IE seems to consider typeof el.getAttribute == 'object' instead of
// 'function' like expected, at least when loading the player immediately.
if(mediaEl&&mediaEl.getAttribute){// Make sure this player hasn't already been set up.
if(mediaEl.player===undefined){var options=mediaEl.getAttribute('data-setup');// Check if data-setup attr exists.
// We only auto-setup if they've added the data-setup attr.
if(options!==null){// Create new video.js instance.
videojs$2(mediaEl);}}// If getAttribute isn't defined, we need to wait for the DOM.
}else {autoSetupTimeout(1);break;}}// No videos were found, so keep looping unless page is finished loading.
}else if(!_windowLoaded){autoSetupTimeout(1);}};/**
 * Wait until the page is loaded before running autoSetup. This will be called in
 * autoSetup if `hasLoaded` returns false.
 *
 * @param {number} wait
 *        How long to wait in ms
 *
 * @param {module:videojs} [vjs]
 *        The videojs library function
 */function autoSetupTimeout(wait,vjs){if(vjs){videojs$2=vjs;}window$1.setTimeout(autoSetup,wait);}if(isReal()&&document$1.readyState==='complete'){_windowLoaded=true;}else {/**
   * Listen for the load event on window, and set _windowLoaded to true.
   *
   * @listens load
   */one(window$1,'load',function(){_windowLoaded=true;});}/**
 * @file stylesheet.js
 * @module stylesheet
 */ /**
 * Create a DOM syle element given a className for it.
 *
 * @param {string} className
 *        The className to add to the created style element.
 *
 * @return {Element}
 *         The element that was created.
 */var createStyleElement=function createStyleElement(className){var style=document$1.createElement('style');style.className=className;return style;};/**
 * Add text to a DOM element.
 *
 * @param {Element} el
 *        The Element to add text content to.
 *
 * @param {string} content
 *        The text to add to the element.
 */var setTextContent=function setTextContent(el,content){if(el.styleSheet){el.styleSheet.cssText=content;}else {el.textContent=content;}};/**
 * @file fn.js
 * @module fn
 */ /**
 * Bind (a.k.a proxy or Context). A simple method for changing the context of a function
 * It also stores a unique id on the function so it can be easily removed from events.
 *
 * @param {Mixed} context
 *        The object to bind as scope.
 *
 * @param {Function} fn
 *        The function to be bound to a scope.
 *
 * @param {number} [uid]
 *        An optional unique ID for the function to be set
 *
 * @return {Function}
 *         The new function that will be bound into the context given
 */var bind=function bind(context,fn,uid){// Make sure the function has a unique ID
if(!fn.guid){fn.guid=newGUID();}// Create the new function that changes the context
var bound=function bound(){return fn.apply(context,arguments);};// Allow for the ability to individualize this function
// Needed in the case where multiple objects might share the same prototype
// IF both items add an event listener with the same function, then you try to remove just one
// it will remove both because they both have the same guid.
// when using this, you need to use the bind method when you remove the listener as well.
// currently used in text tracks
bound.guid=uid?uid+'_'+fn.guid:fn.guid;return bound;};/**
 * Wraps the given function, `fn`, with a new function that only invokes `fn`
 * at most once per every `wait` milliseconds.
 *
 * @param  {Function} fn
 *         The function to be throttled.
 *
 * @param  {Number}   wait
 *         The number of milliseconds by which to throttle.
 *
 * @return {Function}
 */var throttle=function throttle(fn,wait){var last=Date.now();var throttled=function throttled(){var now=Date.now();if(now-last>=wait){fn.apply(undefined,arguments);last=now;}};return throttled;};/**
 * Creates a debounced function that delays invoking `func` until after `wait`
 * milliseconds have elapsed since the last time the debounced function was
 * invoked.
 *
 * Inspired by lodash and underscore implementations.
 *
 * @param  {Function} func
 *         The function to wrap with debounce behavior.
 *
 * @param  {number} wait
 *         The number of milliseconds to wait after the last invocation.
 *
 * @param  {boolean} [immediate]
 *         Whether or not to invoke the function immediately upon creation.
 *
 * @param  {Object} [context=window]
 *         The "context" in which the debounced function should debounce. For
 *         example, if this function should be tied to a Video.js player,
 *         the player can be passed here. Alternatively, defaults to the
 *         global `window` object.
 *
 * @return {Function}
 *         A debounced function.
 */var debounce=function debounce(func,wait,immediate){var context=arguments.length>3&&arguments[3]!==undefined?arguments[3]:window$1;var timeout=void 0;var cancel=function cancel(){context.clearTimeout(timeout);timeout=null;};/* eslint-disable consistent-this */var debounced=function debounced(){var self=this;var args=arguments;var _later=function later(){timeout=null;_later=null;if(!immediate){func.apply(self,args);}};if(!timeout&&immediate){func.apply(self,args);}context.clearTimeout(timeout);timeout=context.setTimeout(_later,wait);};/* eslint-enable consistent-this */debounced.cancel=cancel;return debounced;};/**
 * @file src/js/event-target.js
 */ /**
 * `EventTarget` is a class that can have the same API as the DOM `EventTarget`. It
 * adds shorthand functions that wrap around lengthy functions. For example:
 * the `on` function is a wrapper around `addEventListener`.
 *
 * @see [EventTarget Spec]{@link https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget}
 * @class EventTarget
 */var EventTarget=function EventTarget(){};/**
 * A Custom DOM event.
 *
 * @typedef {Object} EventTarget~Event
 * @see [Properties]{@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent}
 */ /**
 * All event listeners should follow the following format.
 *
 * @callback EventTarget~EventListener
 * @this {EventTarget}
 *
 * @param {EventTarget~Event} event
 *        the event that triggered this function
 *
 * @param {Object} [hash]
 *        hash of data sent during the event
 */ /**
 * An object containing event names as keys and booleans as values.
 *
 * > NOTE: If an event name is set to a true value here {@link EventTarget#trigger}
 *         will have extra functionality. See that function for more information.
 *
 * @property EventTarget.prototype.allowedEvents_
 * @private
 */EventTarget.prototype.allowedEvents_={};/**
 * Adds an `event listener` to an instance of an `EventTarget`. An `event listener` is a
 * function that will get called when an event with a certain name gets triggered.
 *
 * @param {string|string[]} type
 *        An event name or an array of event names.
 *
 * @param {EventTarget~EventListener} fn
 *        The function to call with `EventTarget`s
 */EventTarget.prototype.on=function(type,fn){// Remove the addEventListener alias before calling Events.on
// so we don't get into an infinite type loop
var ael=this.addEventListener;this.addEventListener=function(){};on(this,type,fn);this.addEventListener=ael;};/**
 * An alias of {@link EventTarget#on}. Allows `EventTarget` to mimic
 * the standard DOM API.
 *
 * @function
 * @see {@link EventTarget#on}
 */EventTarget.prototype.addEventListener=EventTarget.prototype.on;/**
 * Removes an `event listener` for a specific event from an instance of `EventTarget`.
 * This makes it so that the `event listener` will no longer get called when the
 * named event happens.
 *
 * @param {string|string[]} type
 *        An event name or an array of event names.
 *
 * @param {EventTarget~EventListener} fn
 *        The function to remove.
 */EventTarget.prototype.off=function(type,fn){off(this,type,fn);};/**
 * An alias of {@link EventTarget#off}. Allows `EventTarget` to mimic
 * the standard DOM API.
 *
 * @function
 * @see {@link EventTarget#off}
 */EventTarget.prototype.removeEventListener=EventTarget.prototype.off;/**
 * This function will add an `event listener` that gets triggered only once. After the
 * first trigger it will get removed. This is like adding an `event listener`
 * with {@link EventTarget#on} that calls {@link EventTarget#off} on itself.
 *
 * @param {string|string[]} type
 *        An event name or an array of event names.
 *
 * @param {EventTarget~EventListener} fn
 *        The function to be called once for each event name.
 */EventTarget.prototype.one=function(type,fn){// Remove the addEventListener alialing Events.on
// so we don't get into an infinite type loop
var ael=this.addEventListener;this.addEventListener=function(){};one(this,type,fn);this.addEventListener=ael;};/**
 * This function causes an event to happen. This will then cause any `event listeners`
 * that are waiting for that event, to get called. If there are no `event listeners`
 * for an event then nothing will happen.
 *
 * If the name of the `Event` that is being triggered is in `EventTarget.allowedEvents_`.
 * Trigger will also call the `on` + `uppercaseEventName` function.
 *
 * Example:
 * 'click' is in `EventTarget.allowedEvents_`, so, trigger will attempt to call
 * `onClick` if it exists.
 *
 * @param {string|EventTarget~Event|Object} event
 *        The name of the event, an `Event`, or an object with a key of type set to
 *        an event name.
 */EventTarget.prototype.trigger=function(event){var type=event.type||event;if(typeof event==='string'){event={type:type};}event=fixEvent(event);if(this.allowedEvents_[type]&&this['on'+type]){this['on'+type](event);}trigger(this,event);};/**
 * An alias of {@link EventTarget#trigger}. Allows `EventTarget` to mimic
 * the standard DOM API.
 *
 * @function
 * @see {@link EventTarget#trigger}
 */EventTarget.prototype.dispatchEvent=EventTarget.prototype.trigger;/**
 * @file mixins/evented.js
 * @module evented
 */ /**
 * Returns whether or not an object has had the evented mixin applied.
 *
 * @param  {Object} object
 *         An object to test.
 *
 * @return {boolean}
 *         Whether or not the object appears to be evented.
 */var isEvented=function isEvented(object){return object instanceof EventTarget||!!object.eventBusEl_&&['on','one','off','trigger'].every(function(k){return typeof object[k]==='function';});};/**
 * Whether a value is a valid event type - non-empty string or array.
 *
 * @private
 * @param  {string|Array} type
 *         The type value to test.
 *
 * @return {boolean}
 *         Whether or not the type is a valid event type.
 */var isValidEventType=function isValidEventType(type){return(// The regex here verifies that the `type` contains at least one non-
// whitespace character.
typeof type==='string'&&/\S/.test(type)||Array.isArray(type)&&!!type.length);};/**
 * Validates a value to determine if it is a valid event target. Throws if not.
 *
 * @private
 * @throws {Error}
 *         If the target does not appear to be a valid event target.
 *
 * @param  {Object} target
 *         The object to test.
 */var validateTarget=function validateTarget(target){if(!target.nodeName&&!isEvented(target)){throw new Error('Invalid target; must be a DOM node or evented object.');}};/**
 * Validates a value to determine if it is a valid event target. Throws if not.
 *
 * @private
 * @throws {Error}
 *         If the type does not appear to be a valid event type.
 *
 * @param  {string|Array} type
 *         The type to test.
 */var validateEventType=function validateEventType(type){if(!isValidEventType(type)){throw new Error('Invalid event type; must be a non-empty string or array.');}};/**
 * Validates a value to determine if it is a valid listener. Throws if not.
 *
 * @private
 * @throws {Error}
 *         If the listener is not a function.
 *
 * @param  {Function} listener
 *         The listener to test.
 */var validateListener=function validateListener(listener){if(typeof listener!=='function'){throw new Error('Invalid listener; must be a function.');}};/**
 * Takes an array of arguments given to `on()` or `one()`, validates them, and
 * normalizes them into an object.
 *
 * @private
 * @param  {Object} self
 *         The evented object on which `on()` or `one()` was called. This
 *         object will be bound as the `this` value for the listener.
 *
 * @param  {Array} args
 *         An array of arguments passed to `on()` or `one()`.
 *
 * @return {Object}
 *         An object containing useful values for `on()` or `one()` calls.
 */var normalizeListenArgs=function normalizeListenArgs(self,args){// If the number of arguments is less than 3, the target is always the
// evented object itself.
var isTargetingSelf=args.length<3||args[0]===self||args[0]===self.eventBusEl_;var target=void 0;var type=void 0;var listener=void 0;if(isTargetingSelf){target=self.eventBusEl_;// Deal with cases where we got 3 arguments, but we are still listening to
// the evented object itself.
if(args.length>=3){args.shift();}type=args[0];listener=args[1];}else {target=args[0];type=args[1];listener=args[2];}validateTarget(target);validateEventType(type);validateListener(listener);listener=bind(self,listener);return {isTargetingSelf:isTargetingSelf,target:target,type:type,listener:listener};};/**
 * Adds the listener to the event type(s) on the target, normalizing for
 * the type of target.
 *
 * @private
 * @param  {Element|Object} target
 *         A DOM node or evented object.
 *
 * @param  {string} method
 *         The event binding method to use ("on" or "one").
 *
 * @param  {string|Array} type
 *         One or more event type(s).
 *
 * @param  {Function} listener
 *         A listener function.
 */var listen=function listen(target,method,type,listener){validateTarget(target);if(target.nodeName){Events[method](target,type,listener);}else {target[method](type,listener);}};/**
 * Contains methods that provide event capabilites to an object which is passed
 * to {@link module:evented|evented}.
 *
 * @mixin EventedMixin
 */var EventedMixin={/**
   * Add a listener to an event (or events) on this object or another evented
   * object.
   *
   * @param  {string|Array|Element|Object} targetOrType
   *         If this is a string or array, it represents the event type(s)
   *         that will trigger the listener.
   *
   *         Another evented object can be passed here instead, which will
   *         cause the listener to listen for events on _that_ object.
   *
   *         In either case, the listener's `this` value will be bound to
   *         this object.
   *
   * @param  {string|Array|Function} typeOrListener
   *         If the first argument was a string or array, this should be the
   *         listener function. Otherwise, this is a string or array of event
   *         type(s).
   *
   * @param  {Function} [listener]
   *         If the first argument was another evented object, this will be
   *         the listener function.
   */on:function on$$1(){var _this=this;for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}var _normalizeListenArgs=normalizeListenArgs(this,args),isTargetingSelf=_normalizeListenArgs.isTargetingSelf,target=_normalizeListenArgs.target,type=_normalizeListenArgs.type,listener=_normalizeListenArgs.listener;listen(target,'on',type,listener);// If this object is listening to another evented object.
if(!isTargetingSelf){// If this object is disposed, remove the listener.
var removeListenerOnDispose=function removeListenerOnDispose(){return _this.off(target,type,listener);};// Use the same function ID as the listener so we can remove it later it
// using the ID of the original listener.
removeListenerOnDispose.guid=listener.guid;// Add a listener to the target's dispose event as well. This ensures
// that if the target is disposed BEFORE this object, we remove the
// removal listener that was just added. Otherwise, we create a memory leak.
var removeRemoverOnTargetDispose=function removeRemoverOnTargetDispose(){return _this.off('dispose',removeListenerOnDispose);};// Use the same function ID as the listener so we can remove it later
// it using the ID of the original listener.
removeRemoverOnTargetDispose.guid=listener.guid;listen(this,'on','dispose',removeListenerOnDispose);listen(target,'on','dispose',removeRemoverOnTargetDispose);}},/**
   * Add a listener to an event (or events) on this object or another evented
   * object. The listener will only be called once and then removed.
   *
   * @param  {string|Array|Element|Object} targetOrType
   *         If this is a string or array, it represents the event type(s)
   *         that will trigger the listener.
   *
   *         Another evented object can be passed here instead, which will
   *         cause the listener to listen for events on _that_ object.
   *
   *         In either case, the listener's `this` value will be bound to
   *         this object.
   *
   * @param  {string|Array|Function} typeOrListener
   *         If the first argument was a string or array, this should be the
   *         listener function. Otherwise, this is a string or array of event
   *         type(s).
   *
   * @param  {Function} [listener]
   *         If the first argument was another evented object, this will be
   *         the listener function.
   */one:function one$$1(){var _this2=this;for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}var _normalizeListenArgs2=normalizeListenArgs(this,args),isTargetingSelf=_normalizeListenArgs2.isTargetingSelf,target=_normalizeListenArgs2.target,type=_normalizeListenArgs2.type,listener=_normalizeListenArgs2.listener;// Targeting this evented object.
if(isTargetingSelf){listen(target,'one',type,listener);// Targeting another evented object.
}else {var wrapper=function wrapper(){for(var _len3=arguments.length,largs=Array(_len3),_key3=0;_key3<_len3;_key3++){largs[_key3]=arguments[_key3];}_this2.off(target,type,wrapper);listener.apply(null,largs);};// Use the same function ID as the listener so we can remove it later
// it using the ID of the original listener.
wrapper.guid=listener.guid;listen(target,'one',type,wrapper);}},/**
   * Removes listener(s) from event(s) on an evented object.
   *
   * @param  {string|Array|Element|Object} [targetOrType]
   *         If this is a string or array, it represents the event type(s).
   *
   *         Another evented object can be passed here instead, in which case
   *         ALL 3 arguments are _required_.
   *
   * @param  {string|Array|Function} [typeOrListener]
   *         If the first argument was a string or array, this may be the
   *         listener function. Otherwise, this is a string or array of event
   *         type(s).
   *
   * @param  {Function} [listener]
   *         If the first argument was another evented object, this will be
   *         the listener function; otherwise, _all_ listeners bound to the
   *         event type(s) will be removed.
   */off:function off$$1(targetOrType,typeOrListener,listener){// Targeting this evented object.
if(!targetOrType||isValidEventType(targetOrType)){off(this.eventBusEl_,targetOrType,typeOrListener);// Targeting another evented object.
}else {var target=targetOrType;var type=typeOrListener;// Fail fast and in a meaningful way!
validateTarget(target);validateEventType(type);validateListener(listener);// Ensure there's at least a guid, even if the function hasn't been used
listener=bind(this,listener);// Remove the dispose listener on this evented object, which was given
// the same guid as the event listener in on().
this.off('dispose',listener);if(target.nodeName){off(target,type,listener);off(target,'dispose',listener);}else if(isEvented(target)){target.off(type,listener);target.off('dispose',listener);}}},/**
   * Fire an event on this evented object, causing its listeners to be called.
   *
   * @param   {string|Object} event
   *          An event type or an object with a type property.
   *
   * @param   {Object} [hash]
   *          An additional object to pass along to listeners.
   *
   * @returns {boolean}
   *          Whether or not the default behavior was prevented.
   */trigger:function trigger$$1(event,hash){return trigger(this.eventBusEl_,event,hash);}};/**
 * Applies {@link module:evented~EventedMixin|EventedMixin} to a target object.
 *
 * @param  {Object} target
 *         The object to which to add event methods.
 *
 * @param  {Object} [options={}]
 *         Options for customizing the mixin behavior.
 *
 * @param  {String} [options.eventBusKey]
 *         By default, adds a `eventBusEl_` DOM element to the target object,
 *         which is used as an event bus. If the target object already has a
 *         DOM element that should be used, pass its key here.
 *
 * @return {Object}
 *         The target object.
 */function evented(target){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var eventBusKey=options.eventBusKey;// Set or create the eventBusEl_.
if(eventBusKey){if(!target[eventBusKey].nodeName){throw new Error('The eventBusKey "'+eventBusKey+'" does not refer to an element.');}target.eventBusEl_=target[eventBusKey];}else {target.eventBusEl_=createEl('span',{className:'vjs-event-bus'});}assign(target,EventedMixin);// When any evented object is disposed, it removes all its listeners.
target.on('dispose',function(){target.off();window$1.setTimeout(function(){target.eventBusEl_=null;},0);});return target;}/**
 * @file mixins/stateful.js
 * @module stateful
 */ /**
 * Contains methods that provide statefulness to an object which is passed
 * to {@link module:stateful}.
 *
 * @mixin StatefulMixin
 */var StatefulMixin={/**
   * A hash containing arbitrary keys and values representing the state of
   * the object.
   *
   * @type {Object}
   */state:{},/**
   * Set the state of an object by mutating its
   * {@link module:stateful~StatefulMixin.state|state} object in place.
   *
   * @fires   module:stateful~StatefulMixin#statechanged
   * @param   {Object|Function} stateUpdates
   *          A new set of properties to shallow-merge into the plugin state.
   *          Can be a plain object or a function returning a plain object.
   *
   * @returns {Object|undefined}
   *          An object containing changes that occurred. If no changes
   *          occurred, returns `undefined`.
   */setState:function setState(stateUpdates){var _this=this;// Support providing the `stateUpdates` state as a function.
if(typeof stateUpdates==='function'){stateUpdates=stateUpdates();}var changes=void 0;each(stateUpdates,function(value,key){// Record the change if the value is different from what's in the
// current state.
if(_this.state[key]!==value){changes=changes||{};changes[key]={from:_this.state[key],to:value};}_this.state[key]=value;});// Only trigger "statechange" if there were changes AND we have a trigger
// function. This allows us to not require that the target object be an
// evented object.
if(changes&&isEvented(this)){/**
       * An event triggered on an object that is both
       * {@link module:stateful|stateful} and {@link module:evented|evented}
       * indicating that its state has changed.
       *
       * @event    module:stateful~StatefulMixin#statechanged
       * @type     {Object}
       * @property {Object} changes
       *           A hash containing the properties that were changed and
       *           the values they were changed `from` and `to`.
       */this.trigger({changes:changes,type:'statechanged'});}return changes;}};/**
 * Applies {@link module:stateful~StatefulMixin|StatefulMixin} to a target
 * object.
 *
 * If the target object is {@link module:evented|evented} and has a
 * `handleStateChanged` method, that method will be automatically bound to the
 * `statechanged` event on itself.
 *
 * @param   {Object} target
 *          The object to be made stateful.
 *
 * @param   {Object} [defaultState]
 *          A default set of properties to populate the newly-stateful object's
 *          `state` property.
 *
 * @returns {Object}
 *          Returns the `target`.
 */function stateful(target,defaultState){assign(target,StatefulMixin);// This happens after the mixing-in because we need to replace the `state`
// added in that step.
target.state=assign({},target.state,defaultState);// Auto-bind the `handleStateChanged` method of the target object if it exists.
if(typeof target.handleStateChanged==='function'&&isEvented(target)){target.on('statechanged',target.handleStateChanged);}return target;}/**
 * @file to-title-case.js
 * @module to-title-case
 */ /**
 * Uppercase the first letter of a string.
 *
 * @param {string} string
 *        String to be uppercased
 *
 * @return {string}
 *         The string with an uppercased first letter
 */function toTitleCase(string){if(typeof string!=='string'){return string;}return string.charAt(0).toUpperCase()+string.slice(1);}/**
 * Compares the TitleCase versions of the two strings for equality.
 *
 * @param {string} str1
 *        The first string to compare
 *
 * @param {string} str2
 *        The second string to compare
 *
 * @return {boolean}
 *         Whether the TitleCase versions of the strings are equal
 */function titleCaseEquals(str1,str2){return toTitleCase(str1)===toTitleCase(str2);}/**
 * @file merge-options.js
 * @module merge-options
 */ /**
 * Deep-merge one or more options objects, recursively merging **only** plain
 * object properties.
 *
 * @param   {Object[]} sources
 *          One or more objects to merge into a new object.
 *
 * @returns {Object}
 *          A new object that is the merged result of all sources.
 */function mergeOptions(){var result={};for(var _len=arguments.length,sources=Array(_len),_key=0;_key<_len;_key++){sources[_key]=arguments[_key];}sources.forEach(function(source){if(!source){return;}each(source,function(value,key){if(!isPlain(value)){result[key]=value;return;}if(!isPlain(result[key])){result[key]={};}result[key]=mergeOptions(result[key],value);});});return result;}/**
 * Player Component - Base class for all UI objects
 *
 * @file component.js
 */ /**
 * Base class for all UI Components.
 * Components are UI objects which represent both a javascript object and an element
 * in the DOM. They can be children of other components, and can have
 * children themselves.
 *
 * Components can also use methods from {@link EventTarget}
 */var Component=function(){/**
   * A callback that is called when a component is ready. Does not have any
   * paramters and any callback value will be ignored.
   *
   * @callback Component~ReadyCallback
   * @this Component
   */ /**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   *
   * @param {Object[]} [options.children]
   *        An array of children objects to intialize this component with. Children objects have
   *        a name property that will be used if more than one component of the same type needs to be
   *        added.
   *
   * @param {Component~ReadyCallback} [ready]
   *        Function that gets called when the `Component` is ready.
   */function Component(player,options,ready){classCallCheck(this,Component);// The component might be the player itself and we can't pass `this` to super
if(!player&&this.play){this.player_=player=this;// eslint-disable-line
}else {this.player_=player;}// Make a copy of prototype.options_ to protect against overriding defaults
this.options_=mergeOptions({},this.options_);// Updated options with supplied options
options=this.options_=mergeOptions(this.options_,options);// Get ID from options or options element if one is supplied
this.id_=options.id||options.el&&options.el.id;// If there was no ID from the options, generate one
if(!this.id_){// Don't require the player ID function in the case of mock players
var id=player&&player.id&&player.id()||'no_player';this.id_=id+'_component_'+newGUID();}this.name_=options.name||null;// Create element if one wasn't provided in options
if(options.el){this.el_=options.el;}else if(options.createEl!==false){this.el_=this.createEl();}// if evented is anything except false, we want to mixin in evented
if(options.evented!==false){// Make this an evented object and use `el_`, if available, as its event bus
evented(this,{eventBusKey:this.el_?'el_':null});}stateful(this,this.constructor.defaultState);this.children_=[];this.childIndex_={};this.childNameIndex_={};// Add any child components in options
if(options.initChildren!==false){this.initChildren();}this.ready(ready);// Don't want to trigger ready here or it will before init is actually
// finished for all children that run this constructor
if(options.reportTouchActivity!==false){this.enableTouchActivity();}}/**
   * Dispose of the `Component` and all child components.
   *
   * @fires Component#dispose
   */Component.prototype.dispose=function dispose(){/**
     * Triggered when a `Component` is disposed.
     *
     * @event Component#dispose
     * @type {EventTarget~Event}
     *
     * @property {boolean} [bubbles=false]
     *           set to false so that the close event does not
     *           bubble up
     */this.trigger({type:'dispose',bubbles:false});// Dispose all children.
if(this.children_){for(var i=this.children_.length-1;i>=0;i--){if(this.children_[i].dispose){this.children_[i].dispose();}}}// Delete child references
this.children_=null;this.childIndex_=null;this.childNameIndex_=null;if(this.el_){// Remove element from DOM
if(this.el_.parentNode){this.el_.parentNode.removeChild(this.el_);}removeData(this.el_);this.el_=null;}// remove reference to the player after disposing of the element
this.player_=null;};/**
   * Return the {@link Player} that the `Component` has attached to.
   *
   * @return {Player}
   *         The player that this `Component` has attached to.
   */Component.prototype.player=function player(){return this.player_;};/**
   * Deep merge of options objects with new options.
   * > Note: When both `obj` and `options` contain properties whose values are objects.
   *         The two properties get merged using {@link module:mergeOptions}
   *
   * @param {Object} obj
   *        The object that contains new options.
   *
   * @return {Object}
   *         A new object of `this.options_` and `obj` merged together.
   *
   * @deprecated since version 5
   */Component.prototype.options=function options(obj){log.warn('this.options() has been deprecated and will be moved to the constructor in 6.0');if(!obj){return this.options_;}this.options_=mergeOptions(this.options_,obj);return this.options_;};/**
   * Get the `Component`s DOM element
   *
   * @return {Element}
   *         The DOM element for this `Component`.
   */Component.prototype.el=function el(){return this.el_;};/**
   * Create the `Component`s DOM element.
   *
   * @param {string} [tagName]
   *        Element's DOM node type. e.g. 'div'
   *
   * @param {Object} [properties]
   *        An object of properties that should be set.
   *
   * @param {Object} [attributes]
   *        An object of attributes that should be set.
   *
   * @return {Element}
   *         The element that gets created.
   */Component.prototype.createEl=function createEl$$1(tagName,properties,attributes){return createEl(tagName,properties,attributes);};/**
   * Localize a string given the string in english.
   *
   * If tokens are provided, it'll try and run a simple token replacement on the provided string.
   * The tokens it looks for look like `{1}` with the index being 1-indexed into the tokens array.
   *
   * If a `defaultValue` is provided, it'll use that over `string`,
   * if a value isn't found in provided language files.
   * This is useful if you want to have a descriptive key for token replacement
   * but have a succinct localized string and not require `en.json` to be included.
   *
   * Currently, it is used for the progress bar timing.
   * ```js
   * {
   *   "progress bar timing: currentTime={1} duration={2}": "{1} of {2}"
   * }
   * ```
   * It is then used like so:
   * ```js
   * this.localize('progress bar timing: currentTime={1} duration{2}',
   *               [this.player_.currentTime(), this.player_.duration()],
   *               '{1} of {2}');
   * ```
   *
   * Which outputs something like: `01:23 of 24:56`.
   *
   *
   * @param {string} string
   *        The string to localize and the key to lookup in the language files.
   * @param {string[]} [tokens]
   *        If the current item has token replacements, provide the tokens here.
   * @param {string} [defaultValue]
   *        Defaults to `string`. Can be a default value to use for token replacement
   *        if the lookup key is needed to be separate.
   *
   * @return {string}
   *         The localized string or if no localization exists the english string.
   */Component.prototype.localize=function localize(string,tokens){var defaultValue=arguments.length>2&&arguments[2]!==undefined?arguments[2]:string;var code=this.player_.language&&this.player_.language();var languages=this.player_.languages&&this.player_.languages();var language=languages&&languages[code];var primaryCode=code&&code.split('-')[0];var primaryLang=languages&&languages[primaryCode];var localizedString=defaultValue;if(language&&language[string]){localizedString=language[string];}else if(primaryLang&&primaryLang[string]){localizedString=primaryLang[string];}if(tokens){localizedString=localizedString.replace(/\{(\d+)\}/g,function(match,index){var value=tokens[index-1];var ret=value;if(typeof value==='undefined'){ret=match;}return ret;});}return localizedString;};/**
   * Return the `Component`s DOM element. This is where children get inserted.
   * This will usually be the the same as the element returned in {@link Component#el}.
   *
   * @return {Element}
   *         The content element for this `Component`.
   */Component.prototype.contentEl=function contentEl(){return this.contentEl_||this.el_;};/**
   * Get this `Component`s ID
   *
   * @return {string}
   *         The id of this `Component`
   */Component.prototype.id=function id(){return this.id_;};/**
   * Get the `Component`s name. The name gets used to reference the `Component`
   * and is set during registration.
   *
   * @return {string}
   *         The name of this `Component`.
   */Component.prototype.name=function name(){return this.name_;};/**
   * Get an array of all child components
   *
   * @return {Array}
   *         The children
   */Component.prototype.children=function children(){return this.children_;};/**
   * Returns the child `Component` with the given `id`.
   *
   * @param {string} id
   *        The id of the child `Component` to get.
   *
   * @return {Component|undefined}
   *         The child `Component` with the given `id` or undefined.
   */Component.prototype.getChildById=function getChildById(id){return this.childIndex_[id];};/**
   * Returns the child `Component` with the given `name`.
   *
   * @param {string} name
   *        The name of the child `Component` to get.
   *
   * @return {Component|undefined}
   *         The child `Component` with the given `name` or undefined.
   */Component.prototype.getChild=function getChild(name){if(!name){return;}name=toTitleCase(name);return this.childNameIndex_[name];};/**
   * Add a child `Component` inside the current `Component`.
   *
   *
   * @param {string|Component} child
   *        The name or instance of a child to add.
   *
   * @param {Object} [options={}]
   *        The key/value store of options that will get passed to children of
   *        the child.
   *
   * @param {number} [index=this.children_.length]
   *        The index to attempt to add a child into.
   *
   * @return {Component}
   *         The `Component` that gets added as a child. When using a string the
   *         `Component` will get created by this process.
   */Component.prototype.addChild=function addChild(child){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var index=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.children_.length;var component=void 0;var componentName=void 0;// If child is a string, create component with options
if(typeof child==='string'){componentName=toTitleCase(child);var componentClassName=options.componentClass||componentName;// Set name through options
options.name=componentName;// Create a new object & element for this controls set
// If there's no .player_, this is a player
var ComponentClass=Component.getComponent(componentClassName);if(!ComponentClass){throw new Error('Component '+componentClassName+' does not exist');}// data stored directly on the videojs object may be
// misidentified as a component to retain
// backwards-compatibility with 4.x. check to make sure the
// component class can be instantiated.
if(typeof ComponentClass!=='function'){return null;}component=new ComponentClass(this.player_||this,options);// child is a component instance
}else {component=child;}this.children_.splice(index,0,component);if(typeof component.id==='function'){this.childIndex_[component.id()]=component;}// If a name wasn't used to create the component, check if we can use the
// name function of the component
componentName=componentName||component.name&&toTitleCase(component.name());if(componentName){this.childNameIndex_[componentName]=component;}// Add the UI object's element to the container div (box)
// Having an element is not required
if(typeof component.el==='function'&&component.el()){var childNodes=this.contentEl().children;var refNode=childNodes[index]||null;this.contentEl().insertBefore(component.el(),refNode);}// Return so it can stored on parent object if desired.
return component;};/**
   * Remove a child `Component` from this `Component`s list of children. Also removes
   * the child `Component`s element from this `Component`s element.
   *
   * @param {Component} component
   *        The child `Component` to remove.
   */Component.prototype.removeChild=function removeChild(component){if(typeof component==='string'){component=this.getChild(component);}if(!component||!this.children_){return;}var childFound=false;for(var i=this.children_.length-1;i>=0;i--){if(this.children_[i]===component){childFound=true;this.children_.splice(i,1);break;}}if(!childFound){return;}this.childIndex_[component.id()]=null;this.childNameIndex_[component.name()]=null;var compEl=component.el();if(compEl&&compEl.parentNode===this.contentEl()){this.contentEl().removeChild(component.el());}};/**
   * Add and initialize default child `Component`s based upon options.
   */Component.prototype.initChildren=function initChildren(){var _this=this;var children=this.options_.children;if(children){// `this` is `parent`
var parentOptions=this.options_;var handleAdd=function handleAdd(child){var name=child.name;var opts=child.opts;// Allow options for children to be set at the parent options
// e.g. videojs(id, { controlBar: false });
// instead of videojs(id, { children: { controlBar: false });
if(parentOptions[name]!==undefined){opts=parentOptions[name];}// Allow for disabling default components
// e.g. options['children']['posterImage'] = false
if(opts===false){return;}// Allow options to be passed as a simple boolean if no configuration
// is necessary.
if(opts===true){opts={};}// We also want to pass the original player options
// to each component as well so they don't need to
// reach back into the player for options later.
opts.playerOptions=_this.options_.playerOptions;// Create and add the child component.
// Add a direct reference to the child by name on the parent instance.
// If two of the same component are used, different names should be supplied
// for each
var newChild=_this.addChild(name,opts);if(newChild){_this[name]=newChild;}};// Allow for an array of children details to passed in the options
var workingChildren=void 0;var Tech=Component.getComponent('Tech');if(Array.isArray(children)){workingChildren=children;}else {workingChildren=Object.keys(children);}workingChildren// children that are in this.options_ but also in workingChildren  would
// give us extra children we do not want. So, we want to filter them out.
.concat(Object.keys(this.options_).filter(function(child){return !workingChildren.some(function(wchild){if(typeof wchild==='string'){return child===wchild;}return child===wchild.name;});})).map(function(child){var name=void 0;var opts=void 0;if(typeof child==='string'){name=child;opts=children[name]||_this.options_[name]||{};}else {name=child.name;opts=child;}return {name:name,opts:opts};}).filter(function(child){// we have to make sure that child.name isn't in the techOrder since
// techs are registerd as Components but can't aren't compatible
// See https://github.com/videojs/video.js/issues/2772
var c=Component.getComponent(child.opts.componentClass||toTitleCase(child.name));return c&&!Tech.isTech(c);}).forEach(handleAdd);}};/**
   * Builds the default DOM class name. Should be overriden by sub-components.
   *
   * @return {string}
   *         The DOM class name for this object.
   *
   * @abstract
   */Component.prototype.buildCSSClass=function buildCSSClass(){// Child classes can include a function that does:
// return 'CLASS NAME' + this._super();
return '';};/**
   * Bind a listener to the component's ready state.
   * Different from event listeners in that if the ready event has already happened
   * it will trigger the function immediately.
   *
   * @return {Component}
   *         Returns itself; method can be chained.
   */Component.prototype.ready=function ready(fn){var sync=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!fn){return;}if(!this.isReady_){this.readyQueue_=this.readyQueue_||[];this.readyQueue_.push(fn);return;}if(sync){fn.call(this);}else {// Call the function asynchronously by default for consistency
this.setTimeout(fn,1);}};/**
   * Trigger all the ready listeners for this `Component`.
   *
   * @fires Component#ready
   */Component.prototype.triggerReady=function triggerReady(){this.isReady_=true;// Ensure ready is triggered asynchronously
this.setTimeout(function(){var readyQueue=this.readyQueue_;// Reset Ready Queue
this.readyQueue_=[];if(readyQueue&&readyQueue.length>0){readyQueue.forEach(function(fn){fn.call(this);},this);}// Allow for using event listeners also
/**
       * Triggered when a `Component` is ready.
       *
       * @event Component#ready
       * @type {EventTarget~Event}
       */this.trigger('ready');},1);};/**
   * Find a single DOM element matching a `selector`. This can be within the `Component`s
   * `contentEl()` or another custom context.
   *
   * @param {string} selector
   *        A valid CSS selector, which will be passed to `querySelector`.
   *
   * @param {Element|string} [context=this.contentEl()]
   *        A DOM element within which to query. Can also be a selector string in
   *        which case the first matching element will get used as context. If
   *        missing `this.contentEl()` gets used. If  `this.contentEl()` returns
   *        nothing it falls back to `document`.
   *
   * @return {Element|null}
   *         the dom element that was found, or null
   *
   * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors)
   */Component.prototype.$=function $$$1(selector,context){return $$1(selector,context||this.contentEl());};/**
   * Finds all DOM element matching a `selector`. This can be within the `Component`s
   * `contentEl()` or another custom context.
   *
   * @param {string} selector
   *        A valid CSS selector, which will be passed to `querySelectorAll`.
   *
   * @param {Element|string} [context=this.contentEl()]
   *        A DOM element within which to query. Can also be a selector string in
   *        which case the first matching element will get used as context. If
   *        missing `this.contentEl()` gets used. If  `this.contentEl()` returns
   *        nothing it falls back to `document`.
   *
   * @return {NodeList}
   *         a list of dom elements that were found
   *
   * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors)
   */Component.prototype.$$=function $$$$1(selector,context){return $$(selector,context||this.contentEl());};/**
   * Check if a component's element has a CSS class name.
   *
   * @param {string} classToCheck
   *        CSS class name to check.
   *
   * @return {boolean}
   *         - True if the `Component` has the class.
   *         - False if the `Component` does not have the class`
   */Component.prototype.hasClass=function hasClass$$1(classToCheck){return hasClass$1(this.el_,classToCheck);};/**
   * Add a CSS class name to the `Component`s element.
   *
   * @param {string} classToAdd
   *        CSS class name to add
   */Component.prototype.addClass=function addClass$$1(classToAdd){addClass(this.el_,classToAdd);};/**
   * Remove a CSS class name from the `Component`s element.
   *
   * @param {string} classToRemove
   *        CSS class name to remove
   */Component.prototype.removeClass=function removeClass$$1(classToRemove){removeClass(this.el_,classToRemove);};/**
   * Add or remove a CSS class name from the component's element.
   * - `classToToggle` gets added when {@link Component#hasClass} would return false.
   * - `classToToggle` gets removed when {@link Component#hasClass} would return true.
   *
   * @param  {string} classToToggle
   *         The class to add or remove based on (@link Component#hasClass}
   *
   * @param  {boolean|Dom~predicate} [predicate]
   *         An {@link Dom~predicate} function or a boolean
   */Component.prototype.toggleClass=function toggleClass$$1(classToToggle,predicate){toggleClass(this.el_,classToToggle,predicate);};/**
   * Show the `Component`s element if it is hidden by removing the
   * 'vjs-hidden' class name from it.
   */Component.prototype.show=function show(){this.removeClass('vjs-hidden');};/**
   * Hide the `Component`s element if it is currently showing by adding the
   * 'vjs-hidden` class name to it.
   */Component.prototype.hide=function hide(){this.addClass('vjs-hidden');};/**
   * Lock a `Component`s element in its visible state by adding the 'vjs-lock-showing'
   * class name to it. Used during fadeIn/fadeOut.
   *
   * @private
   */Component.prototype.lockShowing=function lockShowing(){this.addClass('vjs-lock-showing');};/**
   * Unlock a `Component`s element from its visible state by removing the 'vjs-lock-showing'
   * class name from it. Used during fadeIn/fadeOut.
   *
   * @private
   */Component.prototype.unlockShowing=function unlockShowing(){this.removeClass('vjs-lock-showing');};/**
   * Get the value of an attribute on the `Component`s element.
   *
   * @param {string} attribute
   *        Name of the attribute to get the value from.
   *
   * @return {string|null}
   *         - The value of the attribute that was asked for.
   *         - Can be an empty string on some browsers if the attribute does not exist
   *           or has no value
   *         - Most browsers will return null if the attibute does not exist or has
   *           no value.
   *
   * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute}
   */Component.prototype.getAttribute=function getAttribute$$1(attribute){return getAttribute(this.el_,attribute);};/**
   * Set the value of an attribute on the `Component`'s element
   *
   * @param {string} attribute
   *        Name of the attribute to set.
   *
   * @param {string} value
   *        Value to set the attribute to.
   *
   * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute}
   */Component.prototype.setAttribute=function setAttribute$$1(attribute,value){setAttribute(this.el_,attribute,value);};/**
   * Remove an attribute from the `Component`s element.
   *
   * @param {string} attribute
   *        Name of the attribute to remove.
   *
   * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute}
   */Component.prototype.removeAttribute=function removeAttribute$$1(attribute){removeAttribute(this.el_,attribute);};/**
   * Get or set the width of the component based upon the CSS styles.
   * See {@link Component#dimension} for more detailed information.
   *
   * @param {number|string} [num]
   *        The width that you want to set postfixed with '%', 'px' or nothing.
   *
   * @param {boolean} [skipListeners]
   *        Skip the componentresize event trigger
   *
   * @return {number|string}
   *         The width when getting, zero if there is no width. Can be a string
   *           postpixed with '%' or 'px'.
   */Component.prototype.width=function width(num,skipListeners){return this.dimension('width',num,skipListeners);};/**
   * Get or set the height of the component based upon the CSS styles.
   * See {@link Component#dimension} for more detailed information.
   *
   * @param {number|string} [num]
   *        The height that you want to set postfixed with '%', 'px' or nothing.
   *
   * @param {boolean} [skipListeners]
   *        Skip the componentresize event trigger
   *
   * @return {number|string}
   *         The width when getting, zero if there is no width. Can be a string
   *         postpixed with '%' or 'px'.
   */Component.prototype.height=function height(num,skipListeners){return this.dimension('height',num,skipListeners);};/**
   * Set both the width and height of the `Component` element at the same time.
   *
   * @param  {number|string} width
   *         Width to set the `Component`s element to.
   *
   * @param  {number|string} height
   *         Height to set the `Component`s element to.
   */Component.prototype.dimensions=function dimensions(width,height){// Skip componentresize listeners on width for optimization
this.width(width,true);this.height(height);};/**
   * Get or set width or height of the `Component` element. This is the shared code
   * for the {@link Component#width} and {@link Component#height}.
   *
   * Things to know:
   * - If the width or height in an number this will return the number postfixed with 'px'.
   * - If the width/height is a percent this will return the percent postfixed with '%'
   * - Hidden elements have a width of 0 with `window.getComputedStyle`. This function
   *   defaults to the `Component`s `style.width` and falls back to `window.getComputedStyle`.
   *   See [this]{@link http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/}
   *   for more information
   * - If you want the computed style of the component, use {@link Component#currentWidth}
   *   and {@link {Component#currentHeight}
   *
   * @fires Component#componentresize
   *
   * @param {string} widthOrHeight
   8        'width' or 'height'
   *
   * @param  {number|string} [num]
   8         New dimension
   *
   * @param  {boolean} [skipListeners]
   *         Skip componentresize event trigger
   *
   * @return {number}
   *         The dimension when getting or 0 if unset
   */Component.prototype.dimension=function dimension(widthOrHeight,num,skipListeners){if(num!==undefined){// Set to zero if null or literally NaN (NaN !== NaN)
if(num===null||num!==num){num=0;}// Check if using css width/height (% or px) and adjust
if((''+num).indexOf('%')!==-1||(''+num).indexOf('px')!==-1){this.el_.style[widthOrHeight]=num;}else if(num==='auto'){this.el_.style[widthOrHeight]='';}else {this.el_.style[widthOrHeight]=num+'px';}// skipListeners allows us to avoid triggering the resize event when setting both width and height
if(!skipListeners){/**
         * Triggered when a component is resized.
         *
         * @event Component#componentresize
         * @type {EventTarget~Event}
         */this.trigger('componentresize');}return;}// Not setting a value, so getting it
// Make sure element exists
if(!this.el_){return 0;}// Get dimension value from style
var val=this.el_.style[widthOrHeight];var pxIndex=val.indexOf('px');if(pxIndex!==-1){// Return the pixel value with no 'px'
return parseInt(val.slice(0,pxIndex),10);}// No px so using % or no style was set, so falling back to offsetWidth/height
// If component has display:none, offset will return 0
// TODO: handle display:none and no dimension style using px
return parseInt(this.el_['offset'+toTitleCase(widthOrHeight)],10);};/**
   * Get the computed width or the height of the component's element.
   *
   * Uses `window.getComputedStyle`.
   *
   * @param {string} widthOrHeight
   *        A string containing 'width' or 'height'. Whichever one you want to get.
   *
   * @return {number}
   *         The dimension that gets asked for or 0 if nothing was set
   *         for that dimension.
   */Component.prototype.currentDimension=function currentDimension(widthOrHeight){var computedWidthOrHeight=0;if(widthOrHeight!=='width'&&widthOrHeight!=='height'){throw new Error('currentDimension only accepts width or height value');}if(typeof window$1.getComputedStyle==='function'){var computedStyle=window$1.getComputedStyle(this.el_);computedWidthOrHeight=computedStyle.getPropertyValue(widthOrHeight)||computedStyle[widthOrHeight];}// remove 'px' from variable and parse as integer
computedWidthOrHeight=parseFloat(computedWidthOrHeight);// if the computed value is still 0, it's possible that the browser is lying
// and we want to check the offset values.
// This code also runs on IE8 and wherever getComputedStyle doesn't exist.
if(computedWidthOrHeight===0){var rule='offset'+toTitleCase(widthOrHeight);computedWidthOrHeight=this.el_[rule];}return computedWidthOrHeight;};/**
   * An object that contains width and height values of the `Component`s
   * computed style. Uses `window.getComputedStyle`.
   *
   * @typedef {Object} Component~DimensionObject
   *
   * @property {number} width
   *           The width of the `Component`s computed style.
   *
   * @property {number} height
   *           The height of the `Component`s computed style.
   */ /**
   * Get an object that contains computed width and height values of the
   * component's element.
   *
   * Uses `window.getComputedStyle`.
   *
   * @return {Component~DimensionObject}
   *         The computed dimensions of the component's element.
   */Component.prototype.currentDimensions=function currentDimensions(){return {width:this.currentDimension('width'),height:this.currentDimension('height')};};/**
   * Get the computed width of the component's element.
   *
   * Uses `window.getComputedStyle`.
   *
   * @return {number}
   *         The computed width of the component's element.
   */Component.prototype.currentWidth=function currentWidth(){return this.currentDimension('width');};/**
   * Get the computed height of the component's element.
   *
   * Uses `window.getComputedStyle`.
   *
   * @return {number}
   *         The computed height of the component's element.
   */Component.prototype.currentHeight=function currentHeight(){return this.currentDimension('height');};/**
   * Set the focus to this component
   */Component.prototype.focus=function focus(){this.el_.focus();};/**
   * Remove the focus from this component
   */Component.prototype.blur=function blur(){this.el_.blur();};/**
   * Emit a 'tap' events when touch event support gets detected. This gets used to
   * support toggling the controls through a tap on the video. They get enabled
   * because every sub-component would have extra overhead otherwise.
   *
   * @private
   * @fires Component#tap
   * @listens Component#touchstart
   * @listens Component#touchmove
   * @listens Component#touchleave
   * @listens Component#touchcancel
   * @listens Component#touchend
    */Component.prototype.emitTapEvents=function emitTapEvents(){// Track the start time so we can determine how long the touch lasted
var touchStart=0;var firstTouch=null;// Maximum movement allowed during a touch event to still be considered a tap
// Other popular libs use anywhere from 2 (hammer.js) to 15,
// so 10 seems like a nice, round number.
var tapMovementThreshold=10;// The maximum length a touch can be while still being considered a tap
var touchTimeThreshold=200;var couldBeTap=void 0;this.on('touchstart',function(event){// If more than one finger, don't consider treating this as a click
if(event.touches.length===1){// Copy pageX/pageY from the object
firstTouch={pageX:event.touches[0].pageX,pageY:event.touches[0].pageY};// Record start time so we can detect a tap vs. "touch and hold"
touchStart=new Date().getTime();// Reset couldBeTap tracking
couldBeTap=true;}});this.on('touchmove',function(event){// If more than one finger, don't consider treating this as a click
if(event.touches.length>1){couldBeTap=false;}else if(firstTouch){// Some devices will throw touchmoves for all but the slightest of taps.
// So, if we moved only a small distance, this could still be a tap
var xdiff=event.touches[0].pageX-firstTouch.pageX;var ydiff=event.touches[0].pageY-firstTouch.pageY;var touchDistance=Math.sqrt(xdiff*xdiff+ydiff*ydiff);if(touchDistance>tapMovementThreshold){couldBeTap=false;}}});var noTap=function noTap(){couldBeTap=false;};// TODO: Listen to the original target. http://youtu.be/DujfpXOKUp8?t=13m8s
this.on('touchleave',noTap);this.on('touchcancel',noTap);// When the touch ends, measure how long it took and trigger the appropriate
// event
this.on('touchend',function(event){firstTouch=null;// Proceed only if the touchmove/leave/cancel event didn't happen
if(couldBeTap===true){// Measure how long the touch lasted
var touchTime=new Date().getTime()-touchStart;// Make sure the touch was less than the threshold to be considered a tap
if(touchTime<touchTimeThreshold){// Don't let browser turn this into a click
event.preventDefault();/**
           * Triggered when a `Component` is tapped.
           *
           * @event Component#tap
           * @type {EventTarget~Event}
           */this.trigger('tap');// It may be good to copy the touchend event object and change the
// type to tap, if the other event properties aren't exact after
// Events.fixEvent runs (e.g. event.target)
}}});};/**
   * This function reports user activity whenever touch events happen. This can get
   * turned off by any sub-components that wants touch events to act another way.
   *
   * Report user touch activity when touch events occur. User activity gets used to
   * determine when controls should show/hide. It is simple when it comes to mouse
   * events, because any mouse event should show the controls. So we capture mouse
   * events that bubble up to the player and report activity when that happens.
   * With touch events it isn't as easy as `touchstart` and `touchend` toggle player
   * controls. So touch events can't help us at the player level either.
   *
   * User activity gets checked asynchronously. So what could happen is a tap event
   * on the video turns the controls off. Then the `touchend` event bubbles up to
   * the player. Which, if it reported user activity, would turn the controls right
   * back on. We also don't want to completely block touch events from bubbling up.
   * Furthermore a `touchmove` event and anything other than a tap, should not turn
   * controls back on.
   *
   * @listens Component#touchstart
   * @listens Component#touchmove
   * @listens Component#touchend
   * @listens Component#touchcancel
   */Component.prototype.enableTouchActivity=function enableTouchActivity(){// Don't continue if the root player doesn't support reporting user activity
if(!this.player()||!this.player().reportUserActivity){return;}// listener for reporting that the user is active
var report=bind(this.player(),this.player().reportUserActivity);var touchHolding=void 0;this.on('touchstart',function(){report();// For as long as the they are touching the device or have their mouse down,
// we consider them active even if they're not moving their finger or mouse.
// So we want to continue to update that they are active
this.clearInterval(touchHolding);// report at the same interval as activityCheck
touchHolding=this.setInterval(report,250);});var touchEnd=function touchEnd(event){report();// stop the interval that maintains activity if the touch is holding
this.clearInterval(touchHolding);};this.on('touchmove',report);this.on('touchend',touchEnd);this.on('touchcancel',touchEnd);};/**
   * A callback that has no parameters and is bound into `Component`s context.
   *
   * @callback Component~GenericCallback
   * @this Component
   */ /**
   * Creates a function that runs after an `x` millisecond timeout. This function is a
   * wrapper around `window.setTimeout`. There are a few reasons to use this one
   * instead though:
   * 1. It gets cleared via  {@link Component#clearTimeout} when
   *    {@link Component#dispose} gets called.
   * 2. The function callback will gets turned into a {@link Component~GenericCallback}
   *
   * > Note: You can't use `window.clearTimeout` on the id returned by this function. This
   *         will cause its dispose listener not to get cleaned up! Please use
   *         {@link Component#clearTimeout} or {@link Component#dispose} instead.
   *
   * @param {Component~GenericCallback} fn
   *        The function that will be run after `timeout`.
   *
   * @param {number} timeout
   *        Timeout in milliseconds to delay before executing the specified function.
   *
   * @return {number}
   *         Returns a timeout ID that gets used to identify the timeout. It can also
   *         get used in {@link Component#clearTimeout} to clear the timeout that
   *         was set.
   *
   * @listens Component#dispose
   * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout}
   */Component.prototype.setTimeout=function setTimeout(fn,timeout){var _this2=this;// declare as variables so they are properly available in timeout function
// eslint-disable-next-line
var timeoutId,disposeFn;fn=bind(this,fn);timeoutId=window$1.setTimeout(function(){_this2.off('dispose',disposeFn);fn();},timeout);disposeFn=function disposeFn(){return _this2.clearTimeout(timeoutId);};disposeFn.guid='vjs-timeout-'+timeoutId;this.on('dispose',disposeFn);return timeoutId;};/**
   * Clears a timeout that gets created via `window.setTimeout` or
   * {@link Component#setTimeout}. If you set a timeout via {@link Component#setTimeout}
   * use this function instead of `window.clearTimout`. If you don't your dispose
   * listener will not get cleaned up until {@link Component#dispose}!
   *
   * @param {number} timeoutId
   *        The id of the timeout to clear. The return value of
   *        {@link Component#setTimeout} or `window.setTimeout`.
   *
   * @return {number}
   *         Returns the timeout id that was cleared.
   *
   * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearTimeout}
   */Component.prototype.clearTimeout=function clearTimeout(timeoutId){window$1.clearTimeout(timeoutId);var disposeFn=function disposeFn(){};disposeFn.guid='vjs-timeout-'+timeoutId;this.off('dispose',disposeFn);return timeoutId;};/**
   * Creates a function that gets run every `x` milliseconds. This function is a wrapper
   * around `window.setInterval`. There are a few reasons to use this one instead though.
   * 1. It gets cleared via  {@link Component#clearInterval} when
   *    {@link Component#dispose} gets called.
   * 2. The function callback will be a {@link Component~GenericCallback}
   *
   * @param {Component~GenericCallback} fn
   *        The function to run every `x` seconds.
   *
   * @param {number} interval
   *        Execute the specified function every `x` milliseconds.
   *
   * @return {number}
   *         Returns an id that can be used to identify the interval. It can also be be used in
   *         {@link Component#clearInterval} to clear the interval.
   *
   * @listens Component#dispose
   * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval}
   */Component.prototype.setInterval=function setInterval(fn,interval){var _this3=this;fn=bind(this,fn);var intervalId=window$1.setInterval(fn,interval);var disposeFn=function disposeFn(){return _this3.clearInterval(intervalId);};disposeFn.guid='vjs-interval-'+intervalId;this.on('dispose',disposeFn);return intervalId;};/**
   * Clears an interval that gets created via `window.setInterval` or
   * {@link Component#setInterval}. If you set an inteval via {@link Component#setInterval}
   * use this function instead of `window.clearInterval`. If you don't your dispose
   * listener will not get cleaned up until {@link Component#dispose}!
   *
   * @param {number} intervalId
   *        The id of the interval to clear. The return value of
   *        {@link Component#setInterval} or `window.setInterval`.
   *
   * @return {number}
   *         Returns the interval id that was cleared.
   *
   * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearInterval}
   */Component.prototype.clearInterval=function clearInterval(intervalId){window$1.clearInterval(intervalId);var disposeFn=function disposeFn(){};disposeFn.guid='vjs-interval-'+intervalId;this.off('dispose',disposeFn);return intervalId;};/**
   * Queues up a callback to be passed to requestAnimationFrame (rAF), but
   * with a few extra bonuses:
   *
   * - Supports browsers that do not support rAF by falling back to
   *   {@link Component#setTimeout}.
   *
   * - The callback is turned into a {@link Component~GenericCallback} (i.e.
   *   bound to the component).
   *
   * - Automatic cancellation of the rAF callback is handled if the component
   *   is disposed before it is called.
   *
   * @param  {Component~GenericCallback} fn
   *         A function that will be bound to this component and executed just
   *         before the browser's next repaint.
   *
   * @return {number}
   *         Returns an rAF ID that gets used to identify the timeout. It can
   *         also be used in {@link Component#cancelAnimationFrame} to cancel
   *         the animation frame callback.
   *
   * @listens Component#dispose
   * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame}
   */Component.prototype.requestAnimationFrame=function requestAnimationFrame(fn){var _this4=this;// declare as variables so they are properly available in rAF function
// eslint-disable-next-line
var id,disposeFn;if(this.supportsRaf_){fn=bind(this,fn);id=window$1.requestAnimationFrame(function(){_this4.off('dispose',disposeFn);fn();});disposeFn=function disposeFn(){return _this4.cancelAnimationFrame(id);};disposeFn.guid='vjs-raf-'+id;this.on('dispose',disposeFn);return id;}// Fall back to using a timer.
return this.setTimeout(fn,1000/60);};/**
   * Cancels a queued callback passed to {@link Component#requestAnimationFrame}
   * (rAF).
   *
   * If you queue an rAF callback via {@link Component#requestAnimationFrame},
   * use this function instead of `window.cancelAnimationFrame`. If you don't,
   * your dispose listener will not get cleaned up until {@link Component#dispose}!
   *
   * @param {number} id
   *        The rAF ID to clear. The return value of {@link Component#requestAnimationFrame}.
   *
   * @return {number}
   *         Returns the rAF ID that was cleared.
   *
   * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/cancelAnimationFrame}
   */Component.prototype.cancelAnimationFrame=function cancelAnimationFrame(id){if(this.supportsRaf_){window$1.cancelAnimationFrame(id);var disposeFn=function disposeFn(){};disposeFn.guid='vjs-raf-'+id;this.off('dispose',disposeFn);return id;}// Fall back to using a timer.
return this.clearTimeout(id);};/**
   * Register a `Component` with `videojs` given the name and the component.
   *
   * > NOTE: {@link Tech}s should not be registered as a `Component`. {@link Tech}s
   *         should be registered using {@link Tech.registerTech} or
   *         {@link videojs:videojs.registerTech}.
   *
   * > NOTE: This function can also be seen on videojs as
   *         {@link videojs:videojs.registerComponent}.
   *
   * @param {string} name
   *        The name of the `Component` to register.
   *
   * @param {Component} ComponentToRegister
   *        The `Component` class to register.
   *
   * @return {Component}
   *         The `Component` that was registered.
   */Component.registerComponent=function registerComponent(name,ComponentToRegister){if(typeof name!=='string'||!name){throw new Error('Illegal component name, "'+name+'"; must be a non-empty string.');}var Tech=Component.getComponent('Tech');// We need to make sure this check is only done if Tech has been registered.
var isTech=Tech&&Tech.isTech(ComponentToRegister);var isComp=Component===ComponentToRegister||Component.prototype.isPrototypeOf(ComponentToRegister.prototype);if(isTech||!isComp){var reason=void 0;if(isTech){reason='techs must be registered using Tech.registerTech()';}else {reason='must be a Component subclass';}throw new Error('Illegal component, "'+name+'"; '+reason+'.');}name=toTitleCase(name);if(!Component.components_){Component.components_={};}var Player=Component.getComponent('Player');if(name==='Player'&&Player&&Player.players){var players=Player.players;var playerNames=Object.keys(players);// If we have players that were disposed, then their name will still be
// in Players.players. So, we must loop through and verify that the value
// for each item is not null. This allows registration of the Player component
// after all players have been disposed or before any were created.
if(players&&playerNames.length>0&&playerNames.map(function(pname){return players[pname];}).every(Boolean)){throw new Error('Can not register Player component after player has been created.');}}Component.components_[name]=ComponentToRegister;return ComponentToRegister;};/**
   * Get a `Component` based on the name it was registered with.
   *
   * @param {string} name
   *        The Name of the component to get.
   *
   * @return {Component}
   *         The `Component` that got registered under the given name.
   *
   * @deprecated In `videojs` 6 this will not return `Component`s that were not
   *             registered using {@link Component.registerComponent}. Currently we
   *             check the global `videojs` object for a `Component` name and
   *             return that if it exists.
   */Component.getComponent=function getComponent(name){if(!name){return;}name=toTitleCase(name);if(Component.components_&&Component.components_[name]){return Component.components_[name];}};return Component;}();/**
 * Whether or not this component supports `requestAnimationFrame`.
 *
 * This is exposed primarily for testing purposes.
 *
 * @private
 * @type {Boolean}
 */Component.prototype.supportsRaf_=typeof window$1.requestAnimationFrame==='function'&&typeof window$1.cancelAnimationFrame==='function';Component.registerComponent('Component',Component);/**
 * @file time-ranges.js
 * @module time-ranges
 */ /**
 * Returns the time for the specified index at the start or end
 * of a TimeRange object.
 *
 * @function time-ranges:indexFunction
 *
 * @param {number} [index=0]
 *        The range number to return the time for.
 *
 * @return {number}
 *         The time that offset at the specified index.
 *
 * @depricated index must be set to a value, in the future this will throw an error.
 */ /**
 * An object that contains ranges of time for various reasons.
 *
 * @typedef {Object} TimeRange
 *
 * @property {number} length
 *           The number of time ranges represented by this Object
 *
 * @property {time-ranges:indexFunction} start
 *           Returns the time offset at which a specified time range begins.
 *
 * @property {time-ranges:indexFunction} end
 *           Returns the time offset at which a specified time range ends.
 *
 * @see https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges
 */ /**
 * Check if any of the time ranges are over the maximum index.
 *
 * @param {string} fnName
 *        The function name to use for logging
 *
 * @param {number} index
 *        The index to check
 *
 * @param {number} maxIndex
 *        The maximum possible index
 *
 * @throws {Error} if the timeRanges provided are over the maxIndex
 */function rangeCheck(fnName,index,maxIndex){if(typeof index!=='number'||index<0||index>maxIndex){throw new Error('Failed to execute \''+fnName+'\' on \'TimeRanges\': The index provided ('+index+') is non-numeric or out of bounds (0-'+maxIndex+').');}}/**
 * Get the time for the specified index at the start or end
 * of a TimeRange object.
 *
 * @param {string} fnName
 *        The function name to use for logging
 *
 * @param {string} valueIndex
 *        The proprety that should be used to get the time. should be 'start' or 'end'
 *
 * @param {Array} ranges
 *        An array of time ranges
 *
 * @param {Array} [rangeIndex=0]
 *        The index to start the search at
 *
 * @return {number}
 *         The time that offset at the specified index.
 *
 *
 * @depricated rangeIndex must be set to a value, in the future this will throw an error.
 * @throws {Error} if rangeIndex is more than the length of ranges
 */function getRange(fnName,valueIndex,ranges,rangeIndex){rangeCheck(fnName,rangeIndex,ranges.length-1);return ranges[rangeIndex][valueIndex];}/**
 * Create a time range object given ranges of time.
 *
 * @param {Array} [ranges]
 *        An array of time ranges.
 */function createTimeRangesObj(ranges){if(ranges===undefined||ranges.length===0){return {length:0,start:function start(){throw new Error('This TimeRanges object is empty');},end:function end(){throw new Error('This TimeRanges object is empty');}};}return {length:ranges.length,start:getRange.bind(null,'start',0,ranges),end:getRange.bind(null,'end',1,ranges)};}/**
 * Should create a fake `TimeRange` object which mimics an HTML5 time range instance.
 *
 * @param {number|Array} start
 *        The start of a single range or an array of ranges
 *
 * @param {number} end
 *        The end of a single range.
 *
 * @private
 */function createTimeRanges(start,end){if(Array.isArray(start)){return createTimeRangesObj(start);}else if(start===undefined||end===undefined){return createTimeRangesObj();}return createTimeRangesObj([[start,end]]);}/**
 * @file buffer.js
 * @module buffer
 */ /**
 * Compute the percentage of the media that has been buffered.
 *
 * @param {TimeRange} buffered
 *        The current `TimeRange` object representing buffered time ranges
 *
 * @param {number} duration
 *        Total duration of the media
 *
 * @return {number}
 *         Percent buffered of the total duration in decimal form.
 */function bufferedPercent(buffered,duration){var bufferedDuration=0;var start=void 0;var end=void 0;if(!duration){return 0;}if(!buffered||!buffered.length){buffered=createTimeRanges(0,0);}for(var i=0;i<buffered.length;i++){start=buffered.start(i);end=buffered.end(i);// buffered end can be bigger than duration by a very small fraction
if(end>duration){end=duration;}bufferedDuration+=end-start;}return bufferedDuration/duration;}/**
 * @file fullscreen-api.js
 * @module fullscreen-api
 * @private
 */ /**
 * Store the browser-specific methods for the fullscreen API.
 *
 * @type {Object}
 * @see [Specification]{@link https://fullscreen.spec.whatwg.org}
 * @see [Map Approach From Screenfull.js]{@link https://github.com/sindresorhus/screenfull.js}
 */var FullscreenApi={};// browser API methods
var apiMap=[['requestFullscreen','exitFullscreen','fullscreenElement','fullscreenEnabled','fullscreenchange','fullscreenerror'],// WebKit
['webkitRequestFullscreen','webkitExitFullscreen','webkitFullscreenElement','webkitFullscreenEnabled','webkitfullscreenchange','webkitfullscreenerror'],// Old WebKit (Safari 5.1)
['webkitRequestFullScreen','webkitCancelFullScreen','webkitCurrentFullScreenElement','webkitCancelFullScreen','webkitfullscreenchange','webkitfullscreenerror'],// Mozilla
['mozRequestFullScreen','mozCancelFullScreen','mozFullScreenElement','mozFullScreenEnabled','mozfullscreenchange','mozfullscreenerror'],// Microsoft
['msRequestFullscreen','msExitFullscreen','msFullscreenElement','msFullscreenEnabled','MSFullscreenChange','MSFullscreenError']];var specApi=apiMap[0];var browserApi=void 0;// determine the supported set of functions
for(var i=0;i<apiMap.length;i++){// check for exitFullscreen function
if(apiMap[i][1]in document$1){browserApi=apiMap[i];break;}}// map the browser API names to the spec API names
if(browserApi){for(var _i=0;_i<browserApi.length;_i++){FullscreenApi[specApi[_i]]=browserApi[_i];}}/**
 * @file media-error.js
 */ /**
 * A Custom `MediaError` class which mimics the standard HTML5 `MediaError` class.
 *
 * @param {number|string|Object|MediaError} value
 *        This can be of multiple types:
 *        - number: should be a standard error code
 *        - string: an error message (the code will be 0)
 *        - Object: arbitrary properties
 *        - `MediaError` (native): used to populate a video.js `MediaError` object
 *        - `MediaError` (video.js): will return itself if it's already a
 *          video.js `MediaError` object.
 *
 * @see [MediaError Spec]{@link https://dev.w3.org/html5/spec-author-view/video.html#mediaerror}
 * @see [Encrypted MediaError Spec]{@link https://www.w3.org/TR/2013/WD-encrypted-media-20130510/#error-codes}
 *
 * @class MediaError
 */function MediaError(value){// Allow redundant calls to this constructor to avoid having `instanceof`
// checks peppered around the code.
if(value instanceof MediaError){return value;}if(typeof value==='number'){this.code=value;}else if(typeof value==='string'){// default code is zero, so this is a custom error
this.message=value;}else if(isObject(value)){// We assign the `code` property manually because native `MediaError` objects
// do not expose it as an own/enumerable property of the object.
if(typeof value.code==='number'){this.code=value.code;}assign(this,value);}if(!this.message){this.message=MediaError.defaultMessages[this.code]||'';}}/**
 * The error code that refers two one of the defined `MediaError` types
 *
 * @type {Number}
 */MediaError.prototype.code=0;/**
 * An optional message that to show with the error. Message is not part of the HTML5
 * video spec but allows for more informative custom errors.
 *
 * @type {String}
 */MediaError.prototype.message='';/**
 * An optional status code that can be set by plugins to allow even more detail about
 * the error. For example a plugin might provide a specific HTTP status code and an
 * error message for that code. Then when the plugin gets that error this class will
 * know how to display an error message for it. This allows a custom message to show
 * up on the `Player` error overlay.
 *
 * @type {Array}
 */MediaError.prototype.status=null;/**
 * Errors indexed by the W3C standard. The order **CANNOT CHANGE**! See the
 * specification listed under {@link MediaError} for more information.
 *
 * @enum {array}
 * @readonly
 * @property {string} 0 - MEDIA_ERR_CUSTOM
 * @property {string} 1 - MEDIA_ERR_CUSTOM
 * @property {string} 2 - MEDIA_ERR_ABORTED
 * @property {string} 3 - MEDIA_ERR_NETWORK
 * @property {string} 4 - MEDIA_ERR_SRC_NOT_SUPPORTED
 * @property {string} 5 - MEDIA_ERR_ENCRYPTED
 */MediaError.errorTypes=['MEDIA_ERR_CUSTOM','MEDIA_ERR_ABORTED','MEDIA_ERR_NETWORK','MEDIA_ERR_DECODE','MEDIA_ERR_SRC_NOT_SUPPORTED','MEDIA_ERR_ENCRYPTED'];/**
 * The default `MediaError` messages based on the {@link MediaError.errorTypes}.
 *
 * @type {Array}
 * @constant
 */MediaError.defaultMessages={1:'You aborted the media playback',2:'A network error caused the media download to fail part-way.',3:'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.',4:'The media could not be loaded, either because the server or network failed or because the format is not supported.',5:'The media is encrypted and we do not have the keys to decrypt it.'};// Add types as properties on MediaError
// e.g. MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
for(var errNum=0;errNum<MediaError.errorTypes.length;errNum++){MediaError[MediaError.errorTypes[errNum]]=errNum;// values should be accessible on both the class and instance
MediaError.prototype[MediaError.errorTypes[errNum]]=errNum;}/**
 * Returns whether an object is `Promise`-like (i.e. has a `then` method).
 *
 * @param  {Object}  value
 *         An object that may or may not be `Promise`-like.
 *
 * @return {Boolean}
 *         Whether or not the object is `Promise`-like.
 */function isPromise(value){return value!==undefined&&value!==null&&typeof value.then==='function';}/**
 * Silence a Promise-like object.
 *
 * This is useful for avoiding non-harmful, but potentially confusing "uncaught
 * play promise" rejection error messages.
 *
 * @param  {Object} value
 *         An object that may or may not be `Promise`-like.
 */function silencePromise(value){if(isPromise(value)){value.then(null,function(e){});}}/**
 * @file text-track-list-converter.js Utilities for capturing text track state and
 * re-creating tracks based on a capture.
 *
 * @module text-track-list-converter
 */ /**
 * Examine a single {@link TextTrack} and return a JSON-compatible javascript object that
 * represents the {@link TextTrack}'s state.
 *
 * @param {TextTrack} track
 *        The text track to query.
 *
 * @return {Object}
 *         A serializable javascript representation of the TextTrack.
 * @private
 */var trackToJson_=function trackToJson_(track){var ret=['kind','label','language','id','inBandMetadataTrackDispatchType','mode','src'].reduce(function(acc,prop,i){if(track[prop]){acc[prop]=track[prop];}return acc;},{cues:track.cues&&Array.prototype.map.call(track.cues,function(cue){return {startTime:cue.startTime,endTime:cue.endTime,text:cue.text,id:cue.id};})});return ret;};/**
 * Examine a {@link Tech} and return a JSON-compatible javascript array that represents the
 * state of all {@link TextTrack}s currently configured. The return array is compatible with
 * {@link text-track-list-converter:jsonToTextTracks}.
 *
 * @param {Tech} tech
 *        The tech object to query
 *
 * @return {Array}
 *         A serializable javascript representation of the {@link Tech}s
 *         {@link TextTrackList}.
 */var textTracksToJson=function textTracksToJson(tech){var trackEls=tech.$$('track');var trackObjs=Array.prototype.map.call(trackEls,function(t){return t.track;});var tracks=Array.prototype.map.call(trackEls,function(trackEl){var json=trackToJson_(trackEl.track);if(trackEl.src){json.src=trackEl.src;}return json;});return tracks.concat(Array.prototype.filter.call(tech.textTracks(),function(track){return trackObjs.indexOf(track)===-1;}).map(trackToJson_));};/**
 * Create a set of remote {@link TextTrack}s on a {@link Tech} based on an array of javascript
 * object {@link TextTrack} representations.
 *
 * @param {Array} json
 *        An array of `TextTrack` representation objects, like those that would be
 *        produced by `textTracksToJson`.
 *
 * @param {Tech} tech
 *        The `Tech` to create the `TextTrack`s on.
 */var jsonToTextTracks=function jsonToTextTracks(json,tech){json.forEach(function(track){var addedTrack=tech.addRemoteTextTrack(track).track;if(!track.src&&track.cues){track.cues.forEach(function(cue){return addedTrack.addCue(cue);});}});return tech.textTracks();};var textTrackConverter={textTracksToJson:textTracksToJson,jsonToTextTracks:jsonToTextTracks,trackToJson_:trackToJson_};/**
 * @file modal-dialog.js
 */var MODAL_CLASS_NAME='vjs-modal-dialog';var ESC=27;/**
 * The `ModalDialog` displays over the video and its controls, which blocks
 * interaction with the player until it is closed.
 *
 * Modal dialogs include a "Close" button and will close when that button
 * is activated - or when ESC is pressed anywhere.
 *
 * @extends Component
 */var ModalDialog=function(_Component){inherits(ModalDialog,_Component);/**
   * Create an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   *
   * @param {Mixed} [options.content=undefined]
   *        Provide customized content for this modal.
   *
   * @param {string} [options.description]
   *        A text description for the modal, primarily for accessibility.
   *
   * @param {boolean} [options.fillAlways=false]
   *        Normally, modals are automatically filled only the first time
   *        they open. This tells the modal to refresh its content
   *        every time it opens.
   *
   * @param {string} [options.label]
   *        A text label for the modal, primarily for accessibility.
   *
   * @param {boolean} [options.temporary=true]
   *        If `true`, the modal can only be opened once; it will be
   *        disposed as soon as it's closed.
   *
   * @param {boolean} [options.uncloseable=false]
   *        If `true`, the user will not be able to close the modal
   *        through the UI in the normal ways. Programmatic closing is
   *        still possible.
   */function ModalDialog(player,options){classCallCheck(this,ModalDialog);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.opened_=_this.hasBeenOpened_=_this.hasBeenFilled_=false;_this.closeable(!_this.options_.uncloseable);_this.content(_this.options_.content);// Make sure the contentEl is defined AFTER any children are initialized
// because we only want the contents of the modal in the contentEl
// (not the UI elements like the close button).
_this.contentEl_=createEl('div',{className:MODAL_CLASS_NAME+'-content'},{role:'document'});_this.descEl_=createEl('p',{className:MODAL_CLASS_NAME+'-description vjs-control-text',id:_this.el().getAttribute('aria-describedby')});textContent(_this.descEl_,_this.description());_this.el_.appendChild(_this.descEl_);_this.el_.appendChild(_this.contentEl_);return _this;}/**
   * Create the `ModalDialog`'s DOM element
   *
   * @return {Element}
   *         The DOM element that gets created.
   */ModalDialog.prototype.createEl=function createEl$$1(){return _Component.prototype.createEl.call(this,'div',{className:this.buildCSSClass(),tabIndex:-1},{'aria-describedby':this.id()+'_description','aria-hidden':'true','aria-label':this.label(),'role':'dialog'});};ModalDialog.prototype.dispose=function dispose(){this.contentEl_=null;this.descEl_=null;this.previouslyActiveEl_=null;_Component.prototype.dispose.call(this);};/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */ModalDialog.prototype.buildCSSClass=function buildCSSClass(){return MODAL_CLASS_NAME+' vjs-hidden '+_Component.prototype.buildCSSClass.call(this);};/**
   * Handles `keydown` events on the document, looking for ESC, which closes
   * the modal.
   *
   * @param {EventTarget~Event} e
   *        The keypress that triggered this event.
   *
   * @listens keydown
   */ModalDialog.prototype.handleKeyPress=function handleKeyPress(e){if(e.which===ESC&&this.closeable()){this.close();}};/**
   * Returns the label string for this modal. Primarily used for accessibility.
   *
   * @return {string}
   *         the localized or raw label of this modal.
   */ModalDialog.prototype.label=function label(){return this.localize(this.options_.label||'Modal Window');};/**
   * Returns the description string for this modal. Primarily used for
   * accessibility.
   *
   * @return {string}
   *         The localized or raw description of this modal.
   */ModalDialog.prototype.description=function description(){var desc=this.options_.description||this.localize('This is a modal window.');// Append a universal closeability message if the modal is closeable.
if(this.closeable()){desc+=' '+this.localize('This modal can be closed by pressing the Escape key or activating the close button.');}return desc;};/**
   * Opens the modal.
   *
   * @fires ModalDialog#beforemodalopen
   * @fires ModalDialog#modalopen
   */ModalDialog.prototype.open=function open(){if(!this.opened_){var player=this.player();/**
        * Fired just before a `ModalDialog` is opened.
        *
        * @event ModalDialog#beforemodalopen
        * @type {EventTarget~Event}
        */this.trigger('beforemodalopen');this.opened_=true;// Fill content if the modal has never opened before and
// never been filled.
if(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_){this.fill();}// If the player was playing, pause it and take note of its previously
// playing state.
this.wasPlaying_=!player.paused();if(this.options_.pauseOnOpen&&this.wasPlaying_){player.pause();}if(this.closeable()){this.on(this.el_.ownerDocument,'keydown',bind(this,this.handleKeyPress));}// Hide controls and note if they were enabled.
this.hadControls_=player.controls();player.controls(false);this.show();this.conditionalFocus_();this.el().setAttribute('aria-hidden','false');/**
        * Fired just after a `ModalDialog` is opened.
        *
        * @event ModalDialog#modalopen
        * @type {EventTarget~Event}
        */this.trigger('modalopen');this.hasBeenOpened_=true;}};/**
   * If the `ModalDialog` is currently open or closed.
   *
   * @param  {boolean} [value]
   *         If given, it will open (`true`) or close (`false`) the modal.
   *
   * @return {boolean}
   *         the current open state of the modaldialog
   */ModalDialog.prototype.opened=function opened(value){if(typeof value==='boolean'){this[value?'open':'close']();}return this.opened_;};/**
   * Closes the modal, does nothing if the `ModalDialog` is
   * not open.
   *
   * @fires ModalDialog#beforemodalclose
   * @fires ModalDialog#modalclose
   */ModalDialog.prototype.close=function close(){if(!this.opened_){return;}var player=this.player();/**
      * Fired just before a `ModalDialog` is closed.
      *
      * @event ModalDialog#beforemodalclose
      * @type {EventTarget~Event}
      */this.trigger('beforemodalclose');this.opened_=false;if(this.wasPlaying_&&this.options_.pauseOnOpen){player.play();}if(this.closeable()){this.off(this.el_.ownerDocument,'keydown',bind(this,this.handleKeyPress));}if(this.hadControls_){player.controls(true);}this.hide();this.el().setAttribute('aria-hidden','true');/**
      * Fired just after a `ModalDialog` is closed.
      *
      * @event ModalDialog#modalclose
      * @type {EventTarget~Event}
      */this.trigger('modalclose');this.conditionalBlur_();if(this.options_.temporary){this.dispose();}};/**
   * Check to see if the `ModalDialog` is closeable via the UI.
   *
   * @param  {boolean} [value]
   *         If given as a boolean, it will set the `closeable` option.
   *
   * @return {boolean}
   *         Returns the final value of the closable option.
   */ModalDialog.prototype.closeable=function closeable(value){if(typeof value==='boolean'){var closeable=this.closeable_=!!value;var close=this.getChild('closeButton');// If this is being made closeable and has no close button, add one.
if(closeable&&!close){// The close button should be a child of the modal - not its
// content element, so temporarily change the content element.
var temp=this.contentEl_;this.contentEl_=this.el_;close=this.addChild('closeButton',{controlText:'Close Modal Dialog'});this.contentEl_=temp;this.on(close,'close',this.close);}// If this is being made uncloseable and has a close button, remove it.
if(!closeable&&close){this.off(close,'close',this.close);this.removeChild(close);close.dispose();}}return this.closeable_;};/**
   * Fill the modal's content element with the modal's "content" option.
   * The content element will be emptied before this change takes place.
   */ModalDialog.prototype.fill=function fill(){this.fillWith(this.content());};/**
   * Fill the modal's content element with arbitrary content.
   * The content element will be emptied before this change takes place.
   *
   * @fires ModalDialog#beforemodalfill
   * @fires ModalDialog#modalfill
   *
   * @param {Mixed} [content]
   *        The same rules apply to this as apply to the `content` option.
   */ModalDialog.prototype.fillWith=function fillWith(content){var contentEl=this.contentEl();var parentEl=contentEl.parentNode;var nextSiblingEl=contentEl.nextSibling;/**
     * Fired just before a `ModalDialog` is filled with content.
     *
     * @event ModalDialog#beforemodalfill
     * @type {EventTarget~Event}
     */this.trigger('beforemodalfill');this.hasBeenFilled_=true;// Detach the content element from the DOM before performing
// manipulation to avoid modifying the live DOM multiple times.
parentEl.removeChild(contentEl);this.empty();insertContent(contentEl,content);/**
     * Fired just after a `ModalDialog` is filled with content.
     *
     * @event ModalDialog#modalfill
     * @type {EventTarget~Event}
     */this.trigger('modalfill');// Re-inject the re-filled content element.
if(nextSiblingEl){parentEl.insertBefore(contentEl,nextSiblingEl);}else {parentEl.appendChild(contentEl);}// make sure that the close button is last in the dialog DOM
var closeButton=this.getChild('closeButton');if(closeButton){parentEl.appendChild(closeButton.el_);}};/**
   * Empties the content element. This happens anytime the modal is filled.
   *
   * @fires ModalDialog#beforemodalempty
   * @fires ModalDialog#modalempty
   */ModalDialog.prototype.empty=function empty(){/**
     * Fired just before a `ModalDialog` is emptied.
     *
     * @event ModalDialog#beforemodalempty
     * @type {EventTarget~Event}
     */this.trigger('beforemodalempty');emptyEl(this.contentEl());/**
     * Fired just after a `ModalDialog` is emptied.
     *
     * @event ModalDialog#modalempty
     * @type {EventTarget~Event}
     */this.trigger('modalempty');};/**
   * Gets or sets the modal content, which gets normalized before being
   * rendered into the DOM.
   *
   * This does not update the DOM or fill the modal, but it is called during
   * that process.
   *
   * @param  {Mixed} [value]
   *         If defined, sets the internal content value to be used on the
   *         next call(s) to `fill`. This value is normalized before being
   *         inserted. To "clear" the internal content value, pass `null`.
   *
   * @return {Mixed}
   *         The current content of the modal dialog
   */ModalDialog.prototype.content=function content(value){if(typeof value!=='undefined'){this.content_=value;}return this.content_;};/**
   * conditionally focus the modal dialog if focus was previously on the player.
   *
   * @private
   */ModalDialog.prototype.conditionalFocus_=function conditionalFocus_(){var activeEl=document$1.activeElement;var playerEl=this.player_.el_;this.previouslyActiveEl_=null;if(playerEl.contains(activeEl)||playerEl===activeEl){this.previouslyActiveEl_=activeEl;this.focus();this.on(document$1,'keydown',this.handleKeyDown);}};/**
   * conditionally blur the element and refocus the last focused element
   *
   * @private
   */ModalDialog.prototype.conditionalBlur_=function conditionalBlur_(){if(this.previouslyActiveEl_){this.previouslyActiveEl_.focus();this.previouslyActiveEl_=null;}this.off(document$1,'keydown',this.handleKeyDown);};/**
   * Keydown handler. Attached when modal is focused.
   *
   * @listens keydown
   */ModalDialog.prototype.handleKeyDown=function handleKeyDown(event){// exit early if it isn't a tab key
if(event.which!==9){return;}var focusableEls=this.focusableEls_();var activeEl=this.el_.querySelector(':focus');var focusIndex=void 0;for(var i=0;i<focusableEls.length;i++){if(activeEl===focusableEls[i]){focusIndex=i;break;}}if(document$1.activeElement===this.el_){focusIndex=0;}if(event.shiftKey&&focusIndex===0){focusableEls[focusableEls.length-1].focus();event.preventDefault();}else if(!event.shiftKey&&focusIndex===focusableEls.length-1){focusableEls[0].focus();event.preventDefault();}};/**
   * get all focusable elements
   *
   * @private
   */ModalDialog.prototype.focusableEls_=function focusableEls_(){var allChildren=this.el_.querySelectorAll('*');return Array.prototype.filter.call(allChildren,function(child){return (child instanceof window$1.HTMLAnchorElement||child instanceof window$1.HTMLAreaElement)&&child.hasAttribute('href')||(child instanceof window$1.HTMLInputElement||child instanceof window$1.HTMLSelectElement||child instanceof window$1.HTMLTextAreaElement||child instanceof window$1.HTMLButtonElement)&&!child.hasAttribute('disabled')||child instanceof window$1.HTMLIFrameElement||child instanceof window$1.HTMLObjectElement||child instanceof window$1.HTMLEmbedElement||child.hasAttribute('tabindex')&&child.getAttribute('tabindex')!==-1||child.hasAttribute('contenteditable');});};return ModalDialog;}(Component);/**
 * Default options for `ModalDialog` default options.
 *
 * @type {Object}
 * @private
 */ModalDialog.prototype.options_={pauseOnOpen:true,temporary:true};Component.registerComponent('ModalDialog',ModalDialog);/**
 * @file track-list.js
 */ /**
 * Common functionaliy between {@link TextTrackList}, {@link AudioTrackList}, and
 * {@link VideoTrackList}
 *
 * @extends EventTarget
 */var TrackList=function(_EventTarget){inherits(TrackList,_EventTarget);/**
   * Create an instance of this class
   *
   * @param {Track[]} tracks
   *        A list of tracks to initialize the list with.
   *
   * @param {Object} [list]
   *        The child object with inheritance done manually for ie8.
   *
   * @abstract
   */function TrackList(){var tracks=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var _ret;var list=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;classCallCheck(this,TrackList);var _this=possibleConstructorReturn(this,_EventTarget.call(this));if(!list){list=_this;// eslint-disable-line
if(IS_IE8){list=document$1.createElement('custom');for(var prop in TrackList.prototype){if(prop!=='constructor'){list[prop]=TrackList.prototype[prop];}}}}list.tracks_=[];/**
     * @memberof TrackList
     * @member {number} length
     *         The current number of `Track`s in the this Trackist.
     * @instance
     */Object.defineProperty(list,'length',{get:function get$$1(){return this.tracks_.length;}});for(var i=0;i<tracks.length;i++){list.addTrack(tracks[i]);}// must return the object, as for ie8 it will not be this
// but a reference to a document object
return _ret=list,possibleConstructorReturn(_this,_ret);}/**
   * Add a {@link Track} to the `TrackList`
   *
   * @param {Track} track
   *        The audio, video, or text track to add to the list.
   *
   * @fires TrackList#addtrack
   */TrackList.prototype.addTrack=function addTrack(track){var index=this.tracks_.length;if(!(''+index in this)){Object.defineProperty(this,index,{get:function get$$1(){return this.tracks_[index];}});}// Do not add duplicate tracks
if(this.tracks_.indexOf(track)===-1){this.tracks_.push(track);/**
       * Triggered when a track is added to a track list.
       *
       * @event TrackList#addtrack
       * @type {EventTarget~Event}
       * @property {Track} track
       *           A reference to track that was added.
       */this.trigger({track:track,type:'addtrack'});}};/**
   * Remove a {@link Track} from the `TrackList`
   *
   * @param {Track} rtrack
   *        The audio, video, or text track to remove from the list.
   *
   * @fires TrackList#removetrack
   */TrackList.prototype.removeTrack=function removeTrack(rtrack){var track=void 0;for(var i=0,l=this.length;i<l;i++){if(this[i]===rtrack){track=this[i];if(track.off){track.off();}this.tracks_.splice(i,1);break;}}if(!track){return;}/**
     * Triggered when a track is removed from track list.
     *
     * @event TrackList#removetrack
     * @type {EventTarget~Event}
     * @property {Track} track
     *           A reference to track that was removed.
     */this.trigger({track:track,type:'removetrack'});};/**
   * Get a Track from the TrackList by a tracks id
   *
   * @param {String} id - the id of the track to get
   * @method getTrackById
   * @return {Track}
   * @private
   */TrackList.prototype.getTrackById=function getTrackById(id){var result=null;for(var i=0,l=this.length;i<l;i++){var track=this[i];if(track.id===id){result=track;break;}}return result;};return TrackList;}(EventTarget);/**
 * Triggered when a different track is selected/enabled.
 *
 * @event TrackList#change
 * @type {EventTarget~Event}
 */ /**
 * Events that can be called with on + eventName. See {@link EventHandler}.
 *
 * @property {Object} TrackList#allowedEvents_
 * @private
 */TrackList.prototype.allowedEvents_={change:'change',addtrack:'addtrack',removetrack:'removetrack'};// emulate attribute EventHandler support to allow for feature detection
for(var event in TrackList.prototype.allowedEvents_){TrackList.prototype['on'+event]=null;}/**
 * @file audio-track-list.js
 */ /**
 * Anywhere we call this function we diverge from the spec
 * as we only support one enabled audiotrack at a time
 *
 * @param {AudioTrackList} list
 *        list to work on
 *
 * @param {AudioTrack} track
 *        The track to skip
 *
 * @private
 */var disableOthers=function disableOthers(list,track){for(var i=0;i<list.length;i++){if(!Object.keys(list[i]).length||track.id===list[i].id){continue;}// another audio track is enabled, disable it
list[i].enabled=false;}};/**
 * The current list of {@link AudioTrack} for a media file.
 *
 * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist}
 * @extends TrackList
 */var AudioTrackList=function(_TrackList){inherits(AudioTrackList,_TrackList);/**
   * Create an instance of this class.
   *
   * @param {AudioTrack[]} [tracks=[]]
   *        A list of `AudioTrack` to instantiate the list with.
   */function AudioTrackList(){var _this,_ret;var tracks=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];classCallCheck(this,AudioTrackList);var list=void 0;// make sure only 1 track is enabled
// sorted from last index to first index
for(var i=tracks.length-1;i>=0;i--){if(tracks[i].enabled){disableOthers(tracks,tracks[i]);break;}}// IE8 forces us to implement inheritance ourselves
// as it does not support Object.defineProperty properly
if(IS_IE8){list=document$1.createElement('custom');for(var prop in TrackList.prototype){if(prop!=='constructor'){list[prop]=TrackList.prototype[prop];}}for(var _prop in AudioTrackList.prototype){if(_prop!=='constructor'){list[_prop]=AudioTrackList.prototype[_prop];}}}list=(_this=possibleConstructorReturn(this,_TrackList.call(this,tracks,list)),_this);list.changing_=false;return _ret=list,possibleConstructorReturn(_this,_ret);}/**
   * Add an {@link AudioTrack} to the `AudioTrackList`.
   *
   * @param {AudioTrack} track
   *        The AudioTrack to add to the list
   *
   * @fires TrackList#addtrack
   */AudioTrackList.prototype.addTrack=function addTrack(track){var _this2=this;if(track.enabled){disableOthers(this,track);}_TrackList.prototype.addTrack.call(this,track);// native tracks don't have this
if(!track.addEventListener){return;}/**
     * @listens AudioTrack#enabledchange
     * @fires TrackList#change
     */track.addEventListener('enabledchange',function(){// when we are disabling other tracks (since we don't support
// more than one track at a time) we will set changing_
// to true so that we don't trigger additional change events
if(_this2.changing_){return;}_this2.changing_=true;disableOthers(_this2,track);_this2.changing_=false;_this2.trigger('change');});};return AudioTrackList;}(TrackList);/**
 * @file video-track-list.js
 */ /**
 * Un-select all other {@link VideoTrack}s that are selected.
 *
 * @param {VideoTrackList} list
 *        list to work on
 *
 * @param {VideoTrack} track
 *        The track to skip
 *
 * @private
 */var disableOthers$1=function disableOthers(list,track){for(var i=0;i<list.length;i++){if(!Object.keys(list[i]).length||track.id===list[i].id){continue;}// another video track is enabled, disable it
list[i].selected=false;}};/**
 * The current list of {@link VideoTrack} for a video.
 *
 * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist}
 * @extends TrackList
 */var VideoTrackList=function(_TrackList){inherits(VideoTrackList,_TrackList);/**
   * Create an instance of this class.
   *
   * @param {VideoTrack[]} [tracks=[]]
   *        A list of `VideoTrack` to instantiate the list with.
   */function VideoTrackList(){var _this,_ret;var tracks=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];classCallCheck(this,VideoTrackList);var list=void 0;// make sure only 1 track is enabled
// sorted from last index to first index
for(var i=tracks.length-1;i>=0;i--){if(tracks[i].selected){disableOthers$1(tracks,tracks[i]);break;}}// IE8 forces us to implement inheritance ourselves
// as it does not support Object.defineProperty properly
if(IS_IE8){list=document$1.createElement('custom');for(var prop in TrackList.prototype){if(prop!=='constructor'){list[prop]=TrackList.prototype[prop];}}for(var _prop in VideoTrackList.prototype){if(_prop!=='constructor'){list[_prop]=VideoTrackList.prototype[_prop];}}}list=(_this=possibleConstructorReturn(this,_TrackList.call(this,tracks,list)),_this);list.changing_=false;/**
     * @member {number} VideoTrackList#selectedIndex
     *         The current index of the selected {@link VideoTrack`}.
     */Object.defineProperty(list,'selectedIndex',{get:function get$$1(){for(var _i=0;_i<this.length;_i++){if(this[_i].selected){return _i;}}return -1;},set:function set$$1(){}});return _ret=list,possibleConstructorReturn(_this,_ret);}/**
   * Add a {@link VideoTrack} to the `VideoTrackList`.
   *
   * @param {VideoTrack} track
   *        The VideoTrack to add to the list
   *
   * @fires TrackList#addtrack
   */VideoTrackList.prototype.addTrack=function addTrack(track){var _this2=this;if(track.selected){disableOthers$1(this,track);}_TrackList.prototype.addTrack.call(this,track);// native tracks don't have this
if(!track.addEventListener){return;}/**
     * @listens VideoTrack#selectedchange
     * @fires TrackList#change
     */track.addEventListener('selectedchange',function(){if(_this2.changing_){return;}_this2.changing_=true;disableOthers$1(_this2,track);_this2.changing_=false;_this2.trigger('change');});};return VideoTrackList;}(TrackList);/**
 * @file text-track-list.js
 */ /**
 * The current list of {@link TextTrack} for a media file.
 *
 * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttracklist}
 * @extends TrackList
 */var TextTrackList=function(_TrackList){inherits(TextTrackList,_TrackList);/**
   * Create an instance of this class.
   *
   * @param {TextTrack[]} [tracks=[]]
   *        A list of `TextTrack` to instantiate the list with.
   */function TextTrackList(){var _this,_ret;var tracks=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];classCallCheck(this,TextTrackList);var list=void 0;// IE8 forces us to implement inheritance ourselves
// as it does not support Object.defineProperty properly
if(IS_IE8){list=document$1.createElement('custom');for(var prop in TrackList.prototype){if(prop!=='constructor'){list[prop]=TrackList.prototype[prop];}}for(var _prop in TextTrackList.prototype){if(_prop!=='constructor'){list[_prop]=TextTrackList.prototype[_prop];}}}list=(_this=possibleConstructorReturn(this,_TrackList.call(this,tracks,list)),_this);return _ret=list,possibleConstructorReturn(_this,_ret);}/**
   * Add a {@link TextTrack} to the `TextTrackList`
   *
   * @param {TextTrack} track
   *        The text track to add to the list.
   *
   * @fires TrackList#addtrack
   */TextTrackList.prototype.addTrack=function addTrack(track){_TrackList.prototype.addTrack.call(this,track);/**
     * @listens TextTrack#modechange
     * @fires TrackList#change
     */track.addEventListener('modechange',bind(this,function(){this.trigger('change');}));var nonLanguageTextTrackKind=['metadata','chapters'];if(nonLanguageTextTrackKind.indexOf(track.kind)===-1){track.addEventListener('modechange',bind(this,function(){this.trigger('selectedlanguagechange');}));}};return TextTrackList;}(TrackList);/**
 * @file html-track-element-list.js
 */ /**
 * The current list of {@link HtmlTrackElement}s.
 */var HtmlTrackElementList=function(){/**
   * Create an instance of this class.
   *
   * @param {HtmlTrackElement[]} [tracks=[]]
   *        A list of `HtmlTrackElement` to instantiate the list with.
   */function HtmlTrackElementList(){var trackElements=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];classCallCheck(this,HtmlTrackElementList);var list=this;// eslint-disable-line
if(IS_IE8){list=document$1.createElement('custom');for(var prop in HtmlTrackElementList.prototype){if(prop!=='constructor'){list[prop]=HtmlTrackElementList.prototype[prop];}}}list.trackElements_=[];/**
     * @memberof HtmlTrackElementList
     * @member {number} length
     *         The current number of `Track`s in the this Trackist.
     * @instance
     */Object.defineProperty(list,'length',{get:function get$$1(){return this.trackElements_.length;}});for(var i=0,length=trackElements.length;i<length;i++){list.addTrackElement_(trackElements[i]);}if(IS_IE8){return list;}}/**
   * Add an {@link HtmlTrackElement} to the `HtmlTrackElementList`
   *
   * @param {HtmlTrackElement} trackElement
   *        The track element to add to the list.
   *
   * @private
   */HtmlTrackElementList.prototype.addTrackElement_=function addTrackElement_(trackElement){var index=this.trackElements_.length;if(!(''+index in this)){Object.defineProperty(this,index,{get:function get$$1(){return this.trackElements_[index];}});}// Do not add duplicate elements
if(this.trackElements_.indexOf(trackElement)===-1){this.trackElements_.push(trackElement);}};/**
   * Get an {@link HtmlTrackElement} from the `HtmlTrackElementList` given an
   * {@link TextTrack}.
   *
   * @param {TextTrack} track
   *        The track associated with a track element.
   *
   * @return {HtmlTrackElement|undefined}
   *         The track element that was found or undefined.
   *
   * @private
   */HtmlTrackElementList.prototype.getTrackElementByTrack_=function getTrackElementByTrack_(track){var trackElement_=void 0;for(var i=0,length=this.trackElements_.length;i<length;i++){if(track===this.trackElements_[i].track){trackElement_=this.trackElements_[i];break;}}return trackElement_;};/**
   * Remove a {@link HtmlTrackElement} from the `HtmlTrackElementList`
   *
   * @param {HtmlTrackElement} trackElement
   *        The track element to remove from the list.
   *
   * @private
   */HtmlTrackElementList.prototype.removeTrackElement_=function removeTrackElement_(trackElement){for(var i=0,length=this.trackElements_.length;i<length;i++){if(trackElement===this.trackElements_[i]){this.trackElements_.splice(i,1);break;}}};return HtmlTrackElementList;}();/**
 * @file text-track-cue-list.js
 */ /**
 * @typedef {Object} TextTrackCueList~TextTrackCue
 *
 * @property {string} id
 *           The unique id for this text track cue
 *
 * @property {number} startTime
 *           The start time for this text track cue
 *
 * @property {number} endTime
 *           The end time for this text track cue
 *
 * @property {boolean} pauseOnExit
 *           Pause when the end time is reached if true.
 *
 * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcue}
 */ /**
 * A List of TextTrackCues.
 *
 * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcuelist}
 */var TextTrackCueList=function(){/**
   * Create an instance of this class..
   *
   * @param {Array} cues
   *        A list of cues to be initialized with
   */function TextTrackCueList(cues){classCallCheck(this,TextTrackCueList);var list=this;// eslint-disable-line
if(IS_IE8){list=document$1.createElement('custom');for(var prop in TextTrackCueList.prototype){if(prop!=='constructor'){list[prop]=TextTrackCueList.prototype[prop];}}}TextTrackCueList.prototype.setCues_.call(list,cues);/**
     * @memberof TextTrackCueList
     * @member {number} length
     *         The current number of `TextTrackCue`s in the TextTrackCueList.
     * @instance
     */Object.defineProperty(list,'length',{get:function get$$1(){return this.length_;}});if(IS_IE8){return list;}}/**
   * A setter for cues in this list. Creates getters
   * an an index for the cues.
   *
   * @param {Array} cues
   *        An array of cues to set
   *
   * @private
   */TextTrackCueList.prototype.setCues_=function setCues_(cues){var oldLength=this.length||0;var i=0;var l=cues.length;this.cues_=cues;this.length_=cues.length;var defineProp=function defineProp(index){if(!(''+index in this)){Object.defineProperty(this,''+index,{get:function get$$1(){return this.cues_[index];}});}};if(oldLength<l){i=oldLength;for(;i<l;i++){defineProp.call(this,i);}}};/**
   * Get a `TextTrackCue` that is currently in the `TextTrackCueList` by id.
   *
   * @param {string} id
   *        The id of the cue that should be searched for.
   *
   * @return {TextTrackCueList~TextTrackCue|null}
   *         A single cue or null if none was found.
   */TextTrackCueList.prototype.getCueById=function getCueById(id){var result=null;for(var i=0,l=this.length;i<l;i++){var cue=this[i];if(cue.id===id){result=cue;break;}}return result;};return TextTrackCueList;}();/**
 * @file track-kinds.js
 */ /**
 * All possible `VideoTrackKind`s
 *
 * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-videotrack-kind
 * @typedef VideoTrack~Kind
 * @enum
 */var VideoTrackKind={alternative:'alternative',captions:'captions',main:'main',sign:'sign',subtitles:'subtitles',commentary:'commentary'};/**
 * All possible `AudioTrackKind`s
 *
 * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-audiotrack-kind
 * @typedef AudioTrack~Kind
 * @enum
 */var AudioTrackKind={'alternative':'alternative','descriptions':'descriptions','main':'main','main-desc':'main-desc','translation':'translation','commentary':'commentary'};/**
 * All possible `TextTrackKind`s
 *
 * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-texttrack-kind
 * @typedef TextTrack~Kind
 * @enum
 */var TextTrackKind={subtitles:'subtitles',captions:'captions',descriptions:'descriptions',chapters:'chapters',metadata:'metadata'};/**
 * All possible `TextTrackMode`s
 *
 * @see https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackmode
 * @typedef TextTrack~Mode
 * @enum
 */var TextTrackMode={disabled:'disabled',hidden:'hidden',showing:'showing'};/**
 * @file track.js
 */ /**
 * A Track class that contains all of the common functionality for {@link AudioTrack},
 * {@link VideoTrack}, and {@link TextTrack}.
 *
 * > Note: This class should not be used directly
 *
 * @see {@link https://html.spec.whatwg.org/multipage/embedded-content.html}
 * @extends EventTarget
 * @abstract
 */var Track=function(_EventTarget){inherits(Track,_EventTarget);/**
   * Create an instance of this class.
   *
   * @param {Object} [options={}]
   *        Object of option names and values
   *
   * @param {string} [options.kind='']
   *        A valid kind for the track type you are creating.
   *
   * @param {string} [options.id='vjs_track_' + Guid.newGUID()]
   *        A unique id for this AudioTrack.
   *
   * @param {string} [options.label='']
   *        The menu label for this track.
   *
   * @param {string} [options.language='']
   *        A valid two character language code.
   *
   * @abstract
   */function Track(){var _ret;var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};classCallCheck(this,Track);var _this=possibleConstructorReturn(this,_EventTarget.call(this));var track=_this;// eslint-disable-line
if(IS_IE8){track=document$1.createElement('custom');for(var prop in Track.prototype){if(prop!=='constructor'){track[prop]=Track.prototype[prop];}}}var trackProps={id:options.id||'vjs_track_'+newGUID(),kind:options.kind||'',label:options.label||'',language:options.language||''};/**
     * @memberof Track
     * @member {string} id
     *         The id of this track. Cannot be changed after creation.
     * @instance
     *
     * @readonly
     */ /**
     * @memberof Track
     * @member {string} kind
     *         The kind of track that this is. Cannot be changed after creation.
     * @instance
     *
     * @readonly
     */ /**
     * @memberof Track
     * @member {string} label
     *         The label of this track. Cannot be changed after creation.
     * @instance
     *
     * @readonly
     */ /**
     * @memberof Track
     * @member {string} language
     *         The two letter language code for this track. Cannot be changed after
     *         creation.
     * @instance
     *
     * @readonly
     */var _loop=function _loop(key){Object.defineProperty(track,key,{get:function get$$1(){return trackProps[key];},set:function set$$1(){}});};for(var key in trackProps){_loop(key);}return _ret=track,possibleConstructorReturn(_this,_ret);}return Track;}(EventTarget);/**
 * @file url.js
 * @module url
 */ /**
 * @typedef {Object} url:URLObject
 *
 * @property {string} protocol
 *           The protocol of the url that was parsed.
 *
 * @property {string} hostname
 *           The hostname of the url that was parsed.
 *
 * @property {string} port
 *           The port of the url that was parsed.
 *
 * @property {string} pathname
 *           The pathname of the url that was parsed.
 *
 * @property {string} search
 *           The search query of the url that was parsed.
 *
 * @property {string} hash
 *           The hash of the url that was parsed.
 *
 * @property {string} host
 *           The host of the url that was parsed.
 */ /**
 * Resolve and parse the elements of a URL.
 *
 * @param  {String} url
 *         The url to parse
 *
 * @return {url:URLObject}
 *         An object of url details
 */var parseUrl=function parseUrl(url){var props=['protocol','hostname','port','pathname','search','hash','host'];// add the url to an anchor and let the browser parse the URL
var a=document$1.createElement('a');a.href=url;// IE8 (and 9?) Fix
// ie8 doesn't parse the URL correctly until the anchor is actually
// added to the body, and an innerHTML is needed to trigger the parsing
var addToBody=a.host===''&&a.protocol!=='file:';var div=void 0;if(addToBody){div=document$1.createElement('div');div.innerHTML='<a href="'+url+'"></a>';a=div.firstChild;// prevent the div from affecting layout
div.setAttribute('style','display:none; position:absolute;');document$1.body.appendChild(div);}// Copy the specific URL properties to a new object
// This is also needed for IE8 because the anchor loses its
// properties when it's removed from the dom
var details={};for(var i=0;i<props.length;i++){details[props[i]]=a[props[i]];}// IE9 adds the port to the host property unlike everyone else. If
// a port identifier is added for standard ports, strip it.
if(details.protocol==='http:'){details.host=details.host.replace(/:80$/,'');}if(details.protocol==='https:'){details.host=details.host.replace(/:443$/,'');}if(!details.protocol){details.protocol=window$1.location.protocol;}if(addToBody){document$1.body.removeChild(div);}return details;};/**
 * Get absolute version of relative URL. Used to tell flash correct URL.
 *
 *
 * @param  {string} url
 *         URL to make absolute
 *
 * @return {string}
 *         Absolute URL
 *
 * @see http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue
 */var getAbsoluteURL=function getAbsoluteURL(url){// Check if absolute URL
if(!url.match(/^https?:\/\//)){// Convert to absolute URL. Flash hosted off-site needs an absolute URL.
var div=document$1.createElement('div');div.innerHTML='<a href="'+url+'">x</a>';url=div.firstChild.href;}return url;};/**
 * Returns the extension of the passed file name. It will return an empty string
 * if passed an invalid path.
 *
 * @param {string} path
 *        The fileName path like '/path/to/file.mp4'
 *
 * @returns {string}
 *          The extension in lower case or an empty string if no
 *          extension could be found.
 */var getFileExtension=function getFileExtension(path){if(typeof path==='string'){var splitPathRe=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i;var pathParts=splitPathRe.exec(path);if(pathParts){return pathParts.pop().toLowerCase();}}return '';};/**
 * Returns whether the url passed is a cross domain request or not.
 *
 * @param {string} url
 *        The url to check.
 *
 * @return {boolean}
 *         Whether it is a cross domain request or not.
 */var isCrossOrigin=function isCrossOrigin(url){var winLoc=window$1.location;var urlInfo=parseUrl(url);// IE8 protocol relative urls will return ':' for protocol
var srcProtocol=urlInfo.protocol===':'?winLoc.protocol:urlInfo.protocol;// Check if url is for another domain/origin
// IE8 doesn't know location.origin, so we won't rely on it here
var crossOrigin=srcProtocol+urlInfo.host!==winLoc.protocol+winLoc.host;return crossOrigin;};var Url=(Object.freeze||Object)({parseUrl:parseUrl,getAbsoluteURL:getAbsoluteURL,getFileExtension:getFileExtension,isCrossOrigin:isCrossOrigin});/**
 * @file text-track.js
 */ /**
 * Takes a webvtt file contents and parses it into cues
 *
 * @param {string} srcContent
 *        webVTT file contents
 *
 * @param {TextTrack} track
 *        TextTrack to add cues to. Cues come from the srcContent.
 *
 * @private
 */var parseCues=function parseCues(srcContent,track){var parser=new window$1.WebVTT.Parser(window$1,window$1.vttjs,window$1.WebVTT.StringDecoder());var errors=[];parser.oncue=function(cue){track.addCue(cue);};parser.onparsingerror=function(error){errors.push(error);};parser.onflush=function(){track.trigger({type:'loadeddata',target:track});};parser.parse(srcContent);if(errors.length>0){if(window$1.console&&window$1.console.groupCollapsed){window$1.console.groupCollapsed('Text Track parsing errors for '+track.src);}errors.forEach(function(error){return log.error(error);});if(window$1.console&&window$1.console.groupEnd){window$1.console.groupEnd();}}parser.flush();};/**
 * Load a `TextTrack` from a specifed url.
 *
 * @param {string} src
 *        Url to load track from.
 *
 * @param {TextTrack} track
 *        Track to add cues to. Comes from the content at the end of `url`.
 *
 * @private
 */var loadTrack=function loadTrack(src,track){var opts={uri:src};var crossOrigin=isCrossOrigin(src);if(crossOrigin){opts.cors=crossOrigin;}xhr(opts,bind(this,function(err,response,responseBody){if(err){return log.error(err,response);}track.loaded_=true;// Make sure that vttjs has loaded, otherwise, wait till it finished loading
// NOTE: this is only used for the alt/video.novtt.js build
if(typeof window$1.WebVTT!=='function'){if(track.tech_){var loadHandler=function loadHandler(){return parseCues(responseBody,track);};track.tech_.on('vttjsloaded',loadHandler);track.tech_.on('vttjserror',function(){log.error('vttjs failed to load, stopping trying to process '+track.src);track.tech_.off('vttjsloaded',loadHandler);});}}else {parseCues(responseBody,track);}}));};/**
 * A representation of a single `TextTrack`.
 *
 * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrack}
 * @extends Track
 */var TextTrack=function(_Track){inherits(TextTrack,_Track);/**
   * Create an instance of this class.
   *
   * @param {Object} options={}
   *        Object of option names and values
   *
   * @param {Tech} options.tech
   *        A reference to the tech that owns this TextTrack.
   *
   * @param {TextTrack~Kind} [options.kind='subtitles']
   *        A valid text track kind.
   *
   * @param {TextTrack~Mode} [options.mode='disabled']
   *        A valid text track mode.
   *
   * @param {string} [options.id='vjs_track_' + Guid.newGUID()]
   *        A unique id for this TextTrack.
   *
   * @param {string} [options.label='']
   *        The menu label for this track.
   *
   * @param {string} [options.language='']
   *        A valid two character language code.
   *
   * @param {string} [options.srclang='']
   *        A valid two character language code. An alternative, but deprioritized
   *        vesion of `options.language`
   *
   * @param {string} [options.src]
   *        A url to TextTrack cues.
   *
   * @param {boolean} [options.default]
   *        If this track should default to on or off.
   */function TextTrack(){var _this,_ret;var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};classCallCheck(this,TextTrack);if(!options.tech){throw new Error('A tech was not provided.');}var settings=mergeOptions(options,{kind:TextTrackKind[options.kind]||'subtitles',language:options.language||options.srclang||''});var mode=TextTrackMode[settings.mode]||'disabled';var default_=settings['default'];if(settings.kind==='metadata'||settings.kind==='chapters'){mode='hidden';}// on IE8 this will be a document element
// for every other browser this will be a normal object
var tt=(_this=possibleConstructorReturn(this,_Track.call(this,settings)),_this);tt.tech_=settings.tech;if(IS_IE8){for(var prop in TextTrack.prototype){if(prop!=='constructor'){tt[prop]=TextTrack.prototype[prop];}}}tt.cues_=[];tt.activeCues_=[];var cues=new TextTrackCueList(tt.cues_);var activeCues=new TextTrackCueList(tt.activeCues_);var changed=false;var timeupdateHandler=bind(tt,function(){// Accessing this.activeCues for the side-effects of updating itself
// due to it's nature as a getter function. Do not remove or cues will
// stop updating!
// Use the setter to prevent deletion from uglify (pure_getters rule)
this.activeCues=this.activeCues;if(changed){this.trigger('cuechange');changed=false;}});if(mode!=='disabled'){tt.tech_.ready(function(){tt.tech_.on('timeupdate',timeupdateHandler);},true);}/**
     * @memberof TextTrack
     * @member {boolean} default
     *         If this track was set to be on or off by default. Cannot be changed after
     *         creation.
     * @instance
     *
     * @readonly
     */Object.defineProperty(tt,'default',{get:function get$$1(){return default_;},set:function set$$1(){}});/**
     * @memberof TextTrack
     * @member {string} mode
     *         Set the mode of this TextTrack to a valid {@link TextTrack~Mode}. Will
     *         not be set if setting to an invalid mode.
     * @instance
     *
     * @fires TextTrack#modechange
     */Object.defineProperty(tt,'mode',{get:function get$$1(){return mode;},set:function set$$1(newMode){var _this2=this;if(!TextTrackMode[newMode]){return;}mode=newMode;if(mode!=='disabled'){this.tech_.ready(function(){_this2.tech_.on('timeupdate',timeupdateHandler);},true);}else {this.tech_.off('timeupdate',timeupdateHandler);}/**
         * An event that fires when mode changes on this track. This allows
         * the TextTrackList that holds this track to act accordingly.
         *
         * > Note: This is not part of the spec!
         *
         * @event TextTrack#modechange
         * @type {EventTarget~Event}
         */this.trigger('modechange');}});/**
     * @memberof TextTrack
     * @member {TextTrackCueList} cues
     *         The text track cue list for this TextTrack.
     * @instance
     */Object.defineProperty(tt,'cues',{get:function get$$1(){if(!this.loaded_){return null;}return cues;},set:function set$$1(){}});/**
     * @memberof TextTrack
     * @member {TextTrackCueList} activeCues
     *         The list text track cues that are currently active for this TextTrack.
     * @instance
     */Object.defineProperty(tt,'activeCues',{get:function get$$1(){if(!this.loaded_){return null;}// nothing to do
if(this.cues.length===0){return activeCues;}var ct=this.tech_.currentTime();var active=[];for(var i=0,l=this.cues.length;i<l;i++){var cue=this.cues[i];if(cue.startTime<=ct&&cue.endTime>=ct){active.push(cue);}else if(cue.startTime===cue.endTime&&cue.startTime<=ct&&cue.startTime+0.5>=ct){active.push(cue);}}changed=false;if(active.length!==this.activeCues_.length){changed=true;}else {for(var _i=0;_i<active.length;_i++){if(this.activeCues_.indexOf(active[_i])===-1){changed=true;}}}this.activeCues_=active;activeCues.setCues_(this.activeCues_);return activeCues;},// /!\ Keep this setter empty (see the timeupdate handler above)
set:function set$$1(){}});if(settings.src){tt.src=settings.src;loadTrack(settings.src,tt);}else {tt.loaded_=true;}return _ret=tt,possibleConstructorReturn(_this,_ret);}/**
   * Add a cue to the internal list of cues.
   *
   * @param {TextTrack~Cue} cue
   *        The cue to add to our internal list
   */TextTrack.prototype.addCue=function addCue(originalCue){var cue=originalCue;if(window$1.vttjs&&!(originalCue instanceof window$1.vttjs.VTTCue)){cue=new window$1.vttjs.VTTCue(originalCue.startTime,originalCue.endTime,originalCue.text);for(var prop in originalCue){if(!(prop in cue)){cue[prop]=originalCue[prop];}}// make sure that `id` is copied over
cue.id=originalCue.id;cue.originalCue_=originalCue;}var tracks=this.tech_.textTracks();for(var i=0;i<tracks.length;i++){if(tracks[i]!==this){tracks[i].removeCue(cue);}}this.cues_.push(cue);this.cues.setCues_(this.cues_);};/**
   * Remove a cue from our internal list
   *
   * @param {TextTrack~Cue} removeCue
   *        The cue to remove from our internal list
   */TextTrack.prototype.removeCue=function removeCue(_removeCue){var i=this.cues_.length;while(i--){var cue=this.cues_[i];if(cue===_removeCue||cue.originalCue_&&cue.originalCue_===_removeCue){this.cues_.splice(i,1);this.cues.setCues_(this.cues_);break;}}};return TextTrack;}(Track);/**
 * cuechange - One or more cues in the track have become active or stopped being active.
 */TextTrack.prototype.allowedEvents_={cuechange:'cuechange'};/**
 * A representation of a single `AudioTrack`. If it is part of an {@link AudioTrackList}
 * only one `AudioTrack` in the list will be enabled at a time.
 *
 * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotrack}
 * @extends Track
 */var AudioTrack=function(_Track){inherits(AudioTrack,_Track);/**
   * Create an instance of this class.
   *
   * @param {Object} [options={}]
   *        Object of option names and values
   *
   * @param {AudioTrack~Kind} [options.kind='']
   *        A valid audio track kind
   *
   * @param {string} [options.id='vjs_track_' + Guid.newGUID()]
   *        A unique id for this AudioTrack.
   *
   * @param {string} [options.label='']
   *        The menu label for this track.
   *
   * @param {string} [options.language='']
   *        A valid two character language code.
   *
   * @param {boolean} [options.enabled]
   *        If this track is the one that is currently playing. If this track is part of
   *        an {@link AudioTrackList}, only one {@link AudioTrack} will be enabled.
   */function AudioTrack(){var _this,_ret;var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};classCallCheck(this,AudioTrack);var settings=mergeOptions(options,{kind:AudioTrackKind[options.kind]||''});// on IE8 this will be a document element
// for every other browser this will be a normal object
var track=(_this=possibleConstructorReturn(this,_Track.call(this,settings)),_this);var enabled=false;if(IS_IE8){for(var prop in AudioTrack.prototype){if(prop!=='constructor'){track[prop]=AudioTrack.prototype[prop];}}}/**
     * @memberof AudioTrack
     * @member {boolean} enabled
     *         If this `AudioTrack` is enabled or not. When setting this will
     *         fire {@link AudioTrack#enabledchange} if the state of enabled is changed.
     * @instance
     *
     * @fires VideoTrack#selectedchange
     */Object.defineProperty(track,'enabled',{get:function get$$1(){return enabled;},set:function set$$1(newEnabled){// an invalid or unchanged value
if(typeof newEnabled!=='boolean'||newEnabled===enabled){return;}enabled=newEnabled;/**
         * An event that fires when enabled changes on this track. This allows
         * the AudioTrackList that holds this track to act accordingly.
         *
         * > Note: This is not part of the spec! Native tracks will do
         *         this internally without an event.
         *
         * @event AudioTrack#enabledchange
         * @type {EventTarget~Event}
         */this.trigger('enabledchange');}});// if the user sets this track to selected then
// set selected to that true value otherwise
// we keep it false
if(settings.enabled){track.enabled=settings.enabled;}track.loaded_=true;return _ret=track,possibleConstructorReturn(_this,_ret);}return AudioTrack;}(Track);/**
 * A representation of a single `VideoTrack`.
 *
 * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotrack}
 * @extends Track
 */var VideoTrack=function(_Track){inherits(VideoTrack,_Track);/**
   * Create an instance of this class.
   *
   * @param {Object} [options={}]
   *        Object of option names and values
   *
   * @param {string} [options.kind='']
   *        A valid {@link VideoTrack~Kind}
   *
   * @param {string} [options.id='vjs_track_' + Guid.newGUID()]
   *        A unique id for this AudioTrack.
   *
   * @param {string} [options.label='']
   *        The menu label for this track.
   *
   * @param {string} [options.language='']
   *        A valid two character language code.
   *
   * @param {boolean} [options.selected]
   *        If this track is the one that is currently playing.
   */function VideoTrack(){var _this,_ret;var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};classCallCheck(this,VideoTrack);var settings=mergeOptions(options,{kind:VideoTrackKind[options.kind]||''});// on IE8 this will be a document element
// for every other browser this will be a normal object
var track=(_this=possibleConstructorReturn(this,_Track.call(this,settings)),_this);var selected=false;if(IS_IE8){for(var prop in VideoTrack.prototype){if(prop!=='constructor'){track[prop]=VideoTrack.prototype[prop];}}}/**
     * @memberof VideoTrack
     * @member {boolean} selected
     *         If this `VideoTrack` is selected or not. When setting this will
     *         fire {@link VideoTrack#selectedchange} if the state of selected changed.
     * @instance
     *
     * @fires VideoTrack#selectedchange
     */Object.defineProperty(track,'selected',{get:function get$$1(){return selected;},set:function set$$1(newSelected){// an invalid or unchanged value
if(typeof newSelected!=='boolean'||newSelected===selected){return;}selected=newSelected;/**
         * An event that fires when selected changes on this track. This allows
         * the VideoTrackList that holds this track to act accordingly.
         *
         * > Note: This is not part of the spec! Native tracks will do
         *         this internally without an event.
         *
         * @event VideoTrack#selectedchange
         * @type {EventTarget~Event}
         */this.trigger('selectedchange');}});// if the user sets this track to selected then
// set selected to that true value otherwise
// we keep it false
if(settings.selected){track.selected=settings.selected;}return _ret=track,possibleConstructorReturn(_this,_ret);}return VideoTrack;}(Track);/**
 * @file html-track-element.js
 */ /**
 * @memberof HTMLTrackElement
 * @typedef {HTMLTrackElement~ReadyState}
 * @enum {number}
 */var NONE=0;var LOADING=1;var LOADED=2;var ERROR=3;/**
 * A single track represented in the DOM.
 *
 * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#htmltrackelement}
 * @extends EventTarget
 */var HTMLTrackElement=function(_EventTarget){inherits(HTMLTrackElement,_EventTarget);/**
   * Create an instance of this class.
   *
   * @param {Object} options={}
   *        Object of option names and values
   *
   * @param {Tech} options.tech
   *        A reference to the tech that owns this HTMLTrackElement.
   *
   * @param {TextTrack~Kind} [options.kind='subtitles']
   *        A valid text track kind.
   *
   * @param {TextTrack~Mode} [options.mode='disabled']
   *        A valid text track mode.
   *
   * @param {string} [options.id='vjs_track_' + Guid.newGUID()]
   *        A unique id for this TextTrack.
   *
   * @param {string} [options.label='']
   *        The menu label for this track.
   *
   * @param {string} [options.language='']
   *        A valid two character language code.
   *
   * @param {string} [options.srclang='']
   *        A valid two character language code. An alternative, but deprioritized
   *        vesion of `options.language`
   *
   * @param {string} [options.src]
   *        A url to TextTrack cues.
   *
   * @param {boolean} [options.default]
   *        If this track should default to on or off.
   */function HTMLTrackElement(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};classCallCheck(this,HTMLTrackElement);var _this=possibleConstructorReturn(this,_EventTarget.call(this));var readyState=void 0;var trackElement=_this;// eslint-disable-line
if(IS_IE8){trackElement=document$1.createElement('custom');for(var prop in HTMLTrackElement.prototype){if(prop!=='constructor'){trackElement[prop]=HTMLTrackElement.prototype[prop];}}}var track=new TextTrack(options);trackElement.kind=track.kind;trackElement.src=track.src;trackElement.srclang=track.language;trackElement.label=track.label;trackElement['default']=track['default'];/**
     * @memberof HTMLTrackElement
     * @member {HTMLTrackElement~ReadyState} readyState
     *         The current ready state of the track element.
     * @instance
     */Object.defineProperty(trackElement,'readyState',{get:function get$$1(){return readyState;}});/**
     * @memberof HTMLTrackElement
     * @member {TextTrack} track
     *         The underlying TextTrack object.
     * @instance
     *
     */Object.defineProperty(trackElement,'track',{get:function get$$1(){return track;}});readyState=NONE;/**
     * @listens TextTrack#loadeddata
     * @fires HTMLTrackElement#load
     */track.addEventListener('loadeddata',function(){readyState=LOADED;trackElement.trigger({type:'load',target:trackElement});});if(IS_IE8){var _ret;return _ret=trackElement,possibleConstructorReturn(_this,_ret);}return _this;}return HTMLTrackElement;}(EventTarget);HTMLTrackElement.prototype.allowedEvents_={load:'load'};HTMLTrackElement.NONE=NONE;HTMLTrackElement.LOADING=LOADING;HTMLTrackElement.LOADED=LOADED;HTMLTrackElement.ERROR=ERROR;/*
 * This file contains all track properties that are used in
 * player.js, tech.js, html5.js and possibly other techs in the future.
 */var NORMAL={audio:{ListClass:AudioTrackList,TrackClass:AudioTrack,capitalName:'Audio'},video:{ListClass:VideoTrackList,TrackClass:VideoTrack,capitalName:'Video'},text:{ListClass:TextTrackList,TrackClass:TextTrack,capitalName:'Text'}};Object.keys(NORMAL).forEach(function(type){NORMAL[type].getterName=type+'Tracks';NORMAL[type].privateName=type+'Tracks_';});var REMOTE={remoteText:{ListClass:TextTrackList,TrackClass:TextTrack,capitalName:'RemoteText',getterName:'remoteTextTracks',privateName:'remoteTextTracks_'},remoteTextEl:{ListClass:HtmlTrackElementList,TrackClass:HTMLTrackElement,capitalName:'RemoteTextTrackEls',getterName:'remoteTextTrackEls',privateName:'remoteTextTrackEls_'}};var ALL=mergeOptions(NORMAL,REMOTE);REMOTE.names=Object.keys(REMOTE);NORMAL.names=Object.keys(NORMAL);ALL.names=[].concat(REMOTE.names).concat(NORMAL.names);/**
 * @file tech.js
 */ /**
 * An Object containing a structure like: `{src: 'url', type: 'mimetype'}` or string
 * that just contains the src url alone.
 * * `var SourceObject = {src: 'http://ex.com/video.mp4', type: 'video/mp4'};`
   * `var SourceString = 'http://example.com/some-video.mp4';`
 *
 * @typedef {Object|string} Tech~SourceObject
 *
 * @property {string} src
 *           The url to the source
 *
 * @property {string} type
 *           The mime type of the source
 */ /**
 * A function used by {@link Tech} to create a new {@link TextTrack}.
 *
 * @private
 *
 * @param {Tech} self
 *        An instance of the Tech class.
 *
 * @param {string} kind
 *        `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)
 *
 * @param {string} [label]
 *        Label to identify the text track
 *
 * @param {string} [language]
 *        Two letter language abbreviation
 *
 * @param {Object} [options={}]
 *        An object with additional text track options
 *
 * @return {TextTrack}
 *          The text track that was created.
 */function createTrackHelper(self,kind,label,language){var options=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{};var tracks=self.textTracks();options.kind=kind;if(label){options.label=label;}if(language){options.language=language;}options.tech=self;var track=new ALL.text.TrackClass(options);tracks.addTrack(track);return track;}/**
 * This is the base class for media playback technology controllers, such as
 * {@link Flash} and {@link HTML5}
 *
 * @extends Component
 */var Tech=function(_Component){inherits(Tech,_Component);/**
   * Create an instance of this Tech.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   *
   * @param {Component~ReadyCallback} ready
   *        Callback function to call when the `HTML5` Tech is ready.
   */function Tech(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var ready=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(){};classCallCheck(this,Tech);// we don't want the tech to report user activity automatically.
// This is done manually in addControlsListeners
options.reportTouchActivity=false;// keep track of whether the current source has played at all to
// implement a very limited played()
var _this=possibleConstructorReturn(this,_Component.call(this,null,options,ready));_this.hasStarted_=false;_this.on('playing',function(){this.hasStarted_=true;});_this.on('loadstart',function(){this.hasStarted_=false;});ALL.names.forEach(function(name){var props=ALL[name];if(options&&options[props.getterName]){_this[props.privateName]=options[props.getterName];}});// Manually track progress in cases where the browser/flash player doesn't report it.
if(!_this.featuresProgressEvents){_this.manualProgressOn();}// Manually track timeupdates in cases where the browser/flash player doesn't report it.
if(!_this.featuresTimeupdateEvents){_this.manualTimeUpdatesOn();}['Text','Audio','Video'].forEach(function(track){if(options['native'+track+'Tracks']===false){_this['featuresNative'+track+'Tracks']=false;}});if(options.nativeCaptions===false||options.nativeTextTracks===false){_this.featuresNativeTextTracks=false;}else if(options.nativeCaptions===true||options.nativeTextTracks===true){_this.featuresNativeTextTracks=true;}if(!_this.featuresNativeTextTracks){_this.emulateTextTracks();}_this.autoRemoteTextTracks_=new ALL.text.ListClass();_this.initTrackListeners();// Turn on component tap events only if not using native controls
if(!options.nativeControlsForTouch){_this.emitTapEvents();}if(_this.constructor){_this.name_=_this.constructor.name||'Unknown Tech';}return _this;}/**
   * A special function to trigger source set in a way that will allow player
   * to re-trigger if the player or tech are not ready yet.
   *
   * @fires Tech#sourceset
   * @param {string} src The source string at the time of the source changing.
   */Tech.prototype.triggerSourceset=function triggerSourceset(src){var _this2=this;if(!this.isReady_){// on initial ready we have to trigger source set
// 1ms after ready so that player can watch for it.
this.one('ready',function(){return _this2.setTimeout(function(){return _this2.triggerSourceset(src);},1);});}/**
     * Fired when the source is set on the tech causing the media element
     * to reload.
     *
     * @see {@link Player#event:sourceset}
     * @event Tech#sourceset
     * @type {EventTarget~Event}
     */this.trigger({src:src,type:'sourceset'});};/* Fallbacks for unsupported event types
  ================================================================================ */ /**
   * Polyfill the `progress` event for browsers that don't support it natively.
   *
   * @see {@link Tech#trackProgress}
   */Tech.prototype.manualProgressOn=function manualProgressOn(){this.on('durationchange',this.onDurationChange);this.manualProgress=true;// Trigger progress watching when a source begins loading
this.one('ready',this.trackProgress);};/**
   * Turn off the polyfill for `progress` events that was created in
   * {@link Tech#manualProgressOn}
   */Tech.prototype.manualProgressOff=function manualProgressOff(){this.manualProgress=false;this.stopTrackingProgress();this.off('durationchange',this.onDurationChange);};/**
   * This is used to trigger a `progress` event when the buffered percent changes. It
   * sets an interval function that will be called every 500 milliseconds to check if the
   * buffer end percent has changed.
   *
   * > This function is called by {@link Tech#manualProgressOn}
   *
   * @param {EventTarget~Event} event
   *        The `ready` event that caused this to run.
   *
   * @listens Tech#ready
   * @fires Tech#progress
   */Tech.prototype.trackProgress=function trackProgress(event){this.stopTrackingProgress();this.progressInterval=this.setInterval(bind(this,function(){// Don't trigger unless buffered amount is greater than last time
var numBufferedPercent=this.bufferedPercent();if(this.bufferedPercent_!==numBufferedPercent){/**
         * See {@link Player#progress}
         *
         * @event Tech#progress
         * @type {EventTarget~Event}
         */this.trigger('progress');}this.bufferedPercent_=numBufferedPercent;if(numBufferedPercent===1){this.stopTrackingProgress();}}),500);};/**
   * Update our internal duration on a `durationchange` event by calling
   * {@link Tech#duration}.
   *
   * @param {EventTarget~Event} event
   *        The `durationchange` event that caused this to run.
   *
   * @listens Tech#durationchange
   */Tech.prototype.onDurationChange=function onDurationChange(event){this.duration_=this.duration();};/**
   * Get and create a `TimeRange` object for buffering.
   *
   * @return {TimeRange}
   *         The time range object that was created.
   */Tech.prototype.buffered=function buffered(){return createTimeRanges(0,0);};/**
   * Get the percentage of the current video that is currently buffered.
   *
   * @return {number}
   *         A number from 0 to 1 that represents the decimal percentage of the
   *         video that is buffered.
   *
   */Tech.prototype.bufferedPercent=function bufferedPercent$$1(){return bufferedPercent(this.buffered(),this.duration_);};/**
   * Turn off the polyfill for `progress` events that was created in
   * {@link Tech#manualProgressOn}
   * Stop manually tracking progress events by clearing the interval that was set in
   * {@link Tech#trackProgress}.
   */Tech.prototype.stopTrackingProgress=function stopTrackingProgress(){this.clearInterval(this.progressInterval);};/**
   * Polyfill the `timeupdate` event for browsers that don't support it.
   *
   * @see {@link Tech#trackCurrentTime}
   */Tech.prototype.manualTimeUpdatesOn=function manualTimeUpdatesOn(){this.manualTimeUpdates=true;this.on('play',this.trackCurrentTime);this.on('pause',this.stopTrackingCurrentTime);};/**
   * Turn off the polyfill for `timeupdate` events that was created in
   * {@link Tech#manualTimeUpdatesOn}
   */Tech.prototype.manualTimeUpdatesOff=function manualTimeUpdatesOff(){this.manualTimeUpdates=false;this.stopTrackingCurrentTime();this.off('play',this.trackCurrentTime);this.off('pause',this.stopTrackingCurrentTime);};/**
   * Sets up an interval function to track current time and trigger `timeupdate` every
   * 250 milliseconds.
   *
   * @listens Tech#play
   * @triggers Tech#timeupdate
   */Tech.prototype.trackCurrentTime=function trackCurrentTime(){if(this.currentTimeInterval){this.stopTrackingCurrentTime();}this.currentTimeInterval=this.setInterval(function(){/**
       * Triggered at an interval of 250ms to indicated that time is passing in the video.
       *
       * @event Tech#timeupdate
       * @type {EventTarget~Event}
       */this.trigger({type:'timeupdate',target:this,manuallyTriggered:true});// 42 = 24 fps // 250 is what Webkit uses // FF uses 15
},250);};/**
   * Stop the interval function created in {@link Tech#trackCurrentTime} so that the
   * `timeupdate` event is no longer triggered.
   *
   * @listens {Tech#pause}
   */Tech.prototype.stopTrackingCurrentTime=function stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval);// #1002 - if the video ends right before the next timeupdate would happen,
// the progress bar won't make it all the way to the end
this.trigger({type:'timeupdate',target:this,manuallyTriggered:true});};/**
   * Turn off all event polyfills, clear the `Tech`s {@link AudioTrackList},
   * {@link VideoTrackList}, and {@link TextTrackList}, and dispose of this Tech.
   *
   * @fires Component#dispose
   */Tech.prototype.dispose=function dispose(){// clear out all tracks because we can't reuse them between techs
this.clearTracks(NORMAL.names);// Turn off any manual progress or timeupdate tracking
if(this.manualProgress){this.manualProgressOff();}if(this.manualTimeUpdates){this.manualTimeUpdatesOff();}_Component.prototype.dispose.call(this);};/**
   * Clear out a single `TrackList` or an array of `TrackLists` given their names.
   *
   * > Note: Techs without source handlers should call this between sources for `video`
   *         & `audio` tracks. You don't want to use them between tracks!
   *
   * @param {string[]|string} types
   *        TrackList names to clear, valid names are `video`, `audio`, and
   *        `text`.
   */Tech.prototype.clearTracks=function clearTracks(types){var _this3=this;types=[].concat(types);// clear out all tracks because we can't reuse them between techs
types.forEach(function(type){var list=_this3[type+'Tracks']()||[];var i=list.length;while(i--){var track=list[i];if(type==='text'){_this3.removeRemoteTextTrack(track);}list.removeTrack(track);}});};/**
   * Remove any TextTracks added via addRemoteTextTrack that are
   * flagged for automatic garbage collection
   */Tech.prototype.cleanupAutoTextTracks=function cleanupAutoTextTracks(){var list=this.autoRemoteTextTracks_||[];var i=list.length;while(i--){var track=list[i];this.removeRemoteTextTrack(track);}};/**
   * Reset the tech, which will removes all sources and reset the internal readyState.
   *
   * @abstract
   */Tech.prototype.reset=function reset(){};/**
   * Get or set an error on the Tech.
   *
   * @param {MediaError} [err]
   *        Error to set on the Tech
   *
   * @return {MediaError|null}
   *         The current error object on the tech, or null if there isn't one.
   */Tech.prototype.error=function error(err){if(err!==undefined){this.error_=new MediaError(err);this.trigger('error');}return this.error_;};/**
   * Returns the `TimeRange`s that have been played through for the current source.
   *
   * > NOTE: This implementation is incomplete. It does not track the played `TimeRange`.
   *         It only checks wether the source has played at all or not.
   *
   * @return {TimeRange}
   *         - A single time range if this video has played
   *         - An empty set of ranges if not.
   */Tech.prototype.played=function played(){if(this.hasStarted_){return createTimeRanges(0,0);}return createTimeRanges();};/**
   * Causes a manual time update to occur if {@link Tech#manualTimeUpdatesOn} was
   * previously called.
   *
   * @fires Tech#timeupdate
   */Tech.prototype.setCurrentTime=function setCurrentTime(){// improve the accuracy of manual timeupdates
if(this.manualTimeUpdates){/**
       * A manual `timeupdate` event.
       *
       * @event Tech#timeupdate
       * @type {EventTarget~Event}
       */this.trigger({type:'timeupdate',target:this,manuallyTriggered:true});}};/**
   * Turn on listeners for {@link VideoTrackList}, {@link {AudioTrackList}, and
   * {@link TextTrackList} events.
   *
   * This adds {@link EventTarget~EventListeners} for `addtrack`, and  `removetrack`.
   *
   * @fires Tech#audiotrackchange
   * @fires Tech#videotrackchange
   * @fires Tech#texttrackchange
   */Tech.prototype.initTrackListeners=function initTrackListeners(){var _this4=this;/**
     * Triggered when tracks are added or removed on the Tech {@link AudioTrackList}
     *
     * @event Tech#audiotrackchange
     * @type {EventTarget~Event}
     */ /**
     * Triggered when tracks are added or removed on the Tech {@link VideoTrackList}
     *
     * @event Tech#videotrackchange
     * @type {EventTarget~Event}
     */ /**
     * Triggered when tracks are added or removed on the Tech {@link TextTrackList}
     *
     * @event Tech#texttrackchange
     * @type {EventTarget~Event}
     */NORMAL.names.forEach(function(name){var props=NORMAL[name];var trackListChanges=function trackListChanges(){_this4.trigger(name+'trackchange');};var tracks=_this4[props.getterName]();tracks.addEventListener('removetrack',trackListChanges);tracks.addEventListener('addtrack',trackListChanges);_this4.on('dispose',function(){tracks.removeEventListener('removetrack',trackListChanges);tracks.removeEventListener('addtrack',trackListChanges);});});};/**
   * Emulate TextTracks using vtt.js if necessary
   *
   * @fires Tech#vttjsloaded
   * @fires Tech#vttjserror
   */Tech.prototype.addWebVttScript_=function addWebVttScript_(){var _this5=this;if(window$1.WebVTT){return;}// Initially, Tech.el_ is a child of a dummy-div wait until the Component system
// signals that the Tech is ready at which point Tech.el_ is part of the DOM
// before inserting the WebVTT script
if(document$1.body.contains(this.el())){// load via require if available and vtt.js script location was not passed in
// as an option. novtt builds will turn the above require call into an empty object
// which will cause this if check to always fail.
if(!this.options_['vtt.js']&&isPlain(vtt)&&Object.keys(vtt).length>0){this.trigger('vttjsloaded');return;}// load vtt.js via the script location option or the cdn of no location was
// passed in
var script=document$1.createElement('script');script.src=this.options_['vtt.js']||'https://vjs.zencdn.net/vttjs/0.12.4/vtt.min.js';script.onload=function(){/**
         * Fired when vtt.js is loaded.
         *
         * @event Tech#vttjsloaded
         * @type {EventTarget~Event}
         */_this5.trigger('vttjsloaded');};script.onerror=function(){/**
         * Fired when vtt.js was not loaded due to an error
         *
         * @event Tech#vttjsloaded
         * @type {EventTarget~Event}
         */_this5.trigger('vttjserror');};this.on('dispose',function(){script.onload=null;script.onerror=null;});// but have not loaded yet and we set it to true before the inject so that
// we don't overwrite the injected window.WebVTT if it loads right away
window$1.WebVTT=true;this.el().parentNode.appendChild(script);}else {this.ready(this.addWebVttScript_);}};/**
   * Emulate texttracks
   *
   */Tech.prototype.emulateTextTracks=function emulateTextTracks(){var _this6=this;var tracks=this.textTracks();var remoteTracks=this.remoteTextTracks();var handleAddTrack=function handleAddTrack(e){return tracks.addTrack(e.track);};var handleRemoveTrack=function handleRemoveTrack(e){return tracks.removeTrack(e.track);};remoteTracks.on('addtrack',handleAddTrack);remoteTracks.on('removetrack',handleRemoveTrack);this.addWebVttScript_();var updateDisplay=function updateDisplay(){return _this6.trigger('texttrackchange');};var textTracksChanges=function textTracksChanges(){updateDisplay();for(var i=0;i<tracks.length;i++){var track=tracks[i];track.removeEventListener('cuechange',updateDisplay);if(track.mode==='showing'){track.addEventListener('cuechange',updateDisplay);}}};textTracksChanges();tracks.addEventListener('change',textTracksChanges);tracks.addEventListener('addtrack',textTracksChanges);tracks.addEventListener('removetrack',textTracksChanges);this.on('dispose',function(){remoteTracks.off('addtrack',handleAddTrack);remoteTracks.off('removetrack',handleRemoveTrack);tracks.removeEventListener('change',textTracksChanges);tracks.removeEventListener('addtrack',textTracksChanges);tracks.removeEventListener('removetrack',textTracksChanges);for(var i=0;i<tracks.length;i++){var track=tracks[i];track.removeEventListener('cuechange',updateDisplay);}});};/**
   * Create and returns a remote {@link TextTrack} object.
   *
   * @param {string} kind
   *        `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)
   *
   * @param {string} [label]
   *        Label to identify the text track
   *
   * @param {string} [language]
   *        Two letter language abbreviation
   *
   * @return {TextTrack}
   *         The TextTrack that gets created.
   */Tech.prototype.addTextTrack=function addTextTrack(kind,label,language){if(!kind){throw new Error('TextTrack kind is required but was not provided');}return createTrackHelper(this,kind,label,language);};/**
   * Create an emulated TextTrack for use by addRemoteTextTrack
   *
   * This is intended to be overridden by classes that inherit from
   * Tech in order to create native or custom TextTracks.
   *
   * @param {Object} options
   *        The object should contain the options to initialize the TextTrack with.
   *
   * @param {string} [options.kind]
   *        `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata).
   *
   * @param {string} [options.label].
   *        Label to identify the text track
   *
   * @param {string} [options.language]
   *        Two letter language abbreviation.
   *
   * @return {HTMLTrackElement}
   *         The track element that gets created.
   */Tech.prototype.createRemoteTextTrack=function createRemoteTextTrack(options){var track=mergeOptions(options,{tech:this});return new REMOTE.remoteTextEl.TrackClass(track);};/**
   * Creates a remote text track object and returns an html track element.
   *
   * > Note: This can be an emulated {@link HTMLTrackElement} or a native one.
   *
   * @param {Object} options
   *        See {@link Tech#createRemoteTextTrack} for more detailed properties.
   *
   * @param {boolean} [manualCleanup=true]
   *        - When false: the TextTrack will be automatically removed from the video
   *          element whenever the source changes
   *        - When True: The TextTrack will have to be cleaned up manually
   *
   * @return {HTMLTrackElement}
   *         An Html Track Element.
   *
   * @deprecated The default functionality for this function will be equivalent
   *             to "manualCleanup=false" in the future. The manualCleanup parameter will
   *             also be removed.
   */Tech.prototype.addRemoteTextTrack=function addRemoteTextTrack(){var _this7=this;var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var manualCleanup=arguments[1];var htmlTrackElement=this.createRemoteTextTrack(options);if(manualCleanup!==true&&manualCleanup!==false){// deprecation warning
log.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js');manualCleanup=true;}// store HTMLTrackElement and TextTrack to remote list
this.remoteTextTrackEls().addTrackElement_(htmlTrackElement);this.remoteTextTracks().addTrack(htmlTrackElement.track);if(manualCleanup!==true){// create the TextTrackList if it doesn't exist
this.ready(function(){return _this7.autoRemoteTextTracks_.addTrack(htmlTrackElement.track);});}return htmlTrackElement;};/**
   * Remove a remote text track from the remote `TextTrackList`.
   *
   * @param {TextTrack} track
   *        `TextTrack` to remove from the `TextTrackList`
   */Tech.prototype.removeRemoteTextTrack=function removeRemoteTextTrack(track){var trackElement=this.remoteTextTrackEls().getTrackElementByTrack_(track);// remove HTMLTrackElement and TextTrack from remote list
this.remoteTextTrackEls().removeTrackElement_(trackElement);this.remoteTextTracks().removeTrack(track);this.autoRemoteTextTracks_.removeTrack(track);};/**
   * Gets available media playback quality metrics as specified by the W3C's Media
   * Playback Quality API.
   *
   * @see [Spec]{@link https://wicg.github.io/media-playback-quality}
   *
   * @return {Object}
   *         An object with supported media playback quality metrics
   *
   * @abstract
   */Tech.prototype.getVideoPlaybackQuality=function getVideoPlaybackQuality(){return {};};/**
   * A method to set a poster from a `Tech`.
   *
   * @abstract
   */Tech.prototype.setPoster=function setPoster(){};/**
   * A method to check for the presence of the 'playsinine' <video> attribute.
   *
   * @abstract
   */Tech.prototype.playsinline=function playsinline(){};/**
   * A method to set or unset the 'playsinine' <video> attribute.
   *
   * @abstract
   */Tech.prototype.setPlaysinline=function setPlaysinline(){};/*
   * Check if the tech can support the given mime-type.
   *
   * The base tech does not support any type, but source handlers might
   * overwrite this.
   *
   * @param  {string} type
   *         The mimetype to check for support
   *
   * @return {string}
   *         'probably', 'maybe', or empty string
   *
   * @see [Spec]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType}
   *
   * @abstract
   */Tech.prototype.canPlayType=function canPlayType(){return '';};/**
   * Check if the type is supported by this tech.
   *
   * The base tech does not support any type, but source handlers might
   * overwrite this.
   *
   * @param {string} type
   *        The media type to check
   * @return {string} Returns the native video element's response
   */Tech.canPlayType=function canPlayType(){return '';};/**
   * Check if the tech can support the given source
   * @param {Object} srcObj
   *        The source object
   * @param {Object} options
   *        The options passed to the tech
   * @return {string} 'probably', 'maybe', or '' (empty string)
   */Tech.canPlaySource=function canPlaySource(srcObj,options){return Tech.canPlayType(srcObj.type);};/*
   * Return whether the argument is a Tech or not.
   * Can be passed either a Class like `Html5` or a instance like `player.tech_`
   *
   * @param {Object} component
   *        The item to check
   *
   * @return {boolean}
   *         Whether it is a tech or not
   *         - True if it is a tech
   *         - False if it is not
   */Tech.isTech=function isTech(component){return component.prototype instanceof Tech||component instanceof Tech||component===Tech;};/**
   * Registers a `Tech` into a shared list for videojs.
   *
   * @param {string} name
   *        Name of the `Tech` to register.
   *
   * @param {Object} tech
   *        The `Tech` class to register.
   */Tech.registerTech=function registerTech(name,tech){if(!Tech.techs_){Tech.techs_={};}if(!Tech.isTech(tech)){throw new Error('Tech '+name+' must be a Tech');}if(!Tech.canPlayType){throw new Error('Techs must have a static canPlayType method on them');}if(!Tech.canPlaySource){throw new Error('Techs must have a static canPlaySource method on them');}name=toTitleCase(name);Tech.techs_[name]=tech;if(name!=='Tech'){// camel case the techName for use in techOrder
Tech.defaultTechOrder_.push(name);}return tech;};/**
   * Get a `Tech` from the shared list by name.
   *
   * @param {string} name
   *        `camelCase` or `TitleCase` name of the Tech to get
   *
   * @return {Tech|undefined}
   *         The `Tech` or undefined if there was no tech with the name requsted.
   */Tech.getTech=function getTech(name){if(!name){return;}name=toTitleCase(name);if(Tech.techs_&&Tech.techs_[name]){return Tech.techs_[name];}if(window$1&&window$1.videojs&&window$1.videojs[name]){log.warn('The '+name+' tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)');return window$1.videojs[name];}};return Tech;}(Component);/**
 * Get the {@link VideoTrackList}
 *
 * @returns {VideoTrackList}
 * @method Tech.prototype.videoTracks
 */ /**
 * Get the {@link AudioTrackList}
 *
 * @returns {AudioTrackList}
 * @method Tech.prototype.audioTracks
 */ /**
 * Get the {@link TextTrackList}
 *
 * @returns {TextTrackList}
 * @method Tech.prototype.textTracks
 */ /**
 * Get the remote element {@link TextTrackList}
 *
 * @returns {TextTrackList}
 * @method Tech.prototype.remoteTextTracks
 */ /**
 * Get the remote element {@link HtmlTrackElementList}
 *
 * @returns {HtmlTrackElementList}
 * @method Tech.prototype.remoteTextTrackEls
 */ALL.names.forEach(function(name){var props=ALL[name];Tech.prototype[props.getterName]=function(){this[props.privateName]=this[props.privateName]||new props.ListClass();return this[props.privateName];};});/**
 * List of associated text tracks
 *
 * @type {TextTrackList}
 * @private
 * @property Tech#textTracks_
 */ /**
 * List of associated audio tracks.
 *
 * @type {AudioTrackList}
 * @private
 * @property Tech#audioTracks_
 */ /**
 * List of associated video tracks.
 *
 * @type {VideoTrackList}
 * @private
 * @property Tech#videoTracks_
 */ /**
 * Boolean indicating wether the `Tech` supports volume control.
 *
 * @type {boolean}
 * @default
 */Tech.prototype.featuresVolumeControl=true;/**
 * Boolean indicating whether the `Tech` supports muting volume.
 *
 * @type {bolean}
 * @default
 */Tech.prototype.featuresMuteControl=true;/**
 * Boolean indicating whether the `Tech` supports fullscreen resize control.
 * Resizing plugins using request fullscreen reloads the plugin
 *
 * @type {boolean}
 * @default
 */Tech.prototype.featuresFullscreenResize=false;/**
 * Boolean indicating wether the `Tech` supports changing the speed at which the video
 * plays. Examples:
 *   - Set player to play 2x (twice) as fast
 *   - Set player to play 0.5x (half) as fast
 *
 * @type {boolean}
 * @default
 */Tech.prototype.featuresPlaybackRate=false;/**
 * Boolean indicating wether the `Tech` supports the `progress` event. This is currently
 * not triggered by video-js-swf. This will be used to determine if
 * {@link Tech#manualProgressOn} should be called.
 *
 * @type {boolean}
 * @default
 */Tech.prototype.featuresProgressEvents=false;/**
 * Boolean indicating wether the `Tech` supports the `sourceset` event.
 *
 * A tech should set this to `true` and then use {@link Tech#triggerSourceset}
 * to trigger a {@link Tech#event:sourceset} at the earliest time after getting
 * a new source.
 *
 * @type {boolean}
 * @default
 */Tech.prototype.featuresSourceset=false;/**
 * Boolean indicating wether the `Tech` supports the `timeupdate` event. This is currently
 * not triggered by video-js-swf. This will be used to determine if
 * {@link Tech#manualTimeUpdates} should be called.
 *
 * @type {boolean}
 * @default
 */Tech.prototype.featuresTimeupdateEvents=false;/**
 * Boolean indicating wether the `Tech` supports the native `TextTrack`s.
 * This will help us integrate with native `TextTrack`s if the browser supports them.
 *
 * @type {boolean}
 * @default
 */Tech.prototype.featuresNativeTextTracks=false;/**
 * A functional mixin for techs that want to use the Source Handler pattern.
 * Source handlers are scripts for handling specific formats.
 * The source handler pattern is used for adaptive formats (HLS, DASH) that
 * manually load video data and feed it into a Source Buffer (Media Source Extensions)
 * Example: `Tech.withSourceHandlers.call(MyTech);`
 *
 * @param {Tech} _Tech
 *        The tech to add source handler functions to.
 *
 * @mixes Tech~SourceHandlerAdditions
 */Tech.withSourceHandlers=function(_Tech){/**
   * Register a source handler
   *
   * @param {Function} handler
   *        The source handler class
   *
   * @param {number} [index]
   *        Register it at the following index
   */_Tech.registerSourceHandler=function(handler,index){var handlers=_Tech.sourceHandlers;if(!handlers){handlers=_Tech.sourceHandlers=[];}if(index===undefined){// add to the end of the list
index=handlers.length;}handlers.splice(index,0,handler);};/**
   * Check if the tech can support the given type. Also checks the
   * Techs sourceHandlers.
   *
   * @param {string} type
   *         The mimetype to check.
   *
   * @return {string}
   *         'probably', 'maybe', or '' (empty string)
   */_Tech.canPlayType=function(type){var handlers=_Tech.sourceHandlers||[];var can=void 0;for(var i=0;i<handlers.length;i++){can=handlers[i].canPlayType(type);if(can){return can;}}return '';};/**
   * Returns the first source handler that supports the source.
   *
   * TODO: Answer question: should 'probably' be prioritized over 'maybe'
   *
   * @param {Tech~SourceObject} source
   *        The source object
   *
   * @param {Object} options
   *        The options passed to the tech
   *
   * @return {SourceHandler|null}
   *          The first source handler that supports the source or null if
   *          no SourceHandler supports the source
   */_Tech.selectSourceHandler=function(source,options){var handlers=_Tech.sourceHandlers||[];var can=void 0;for(var i=0;i<handlers.length;i++){can=handlers[i].canHandleSource(source,options);if(can){return handlers[i];}}return null;};/**
   * Check if the tech can support the given source.
   *
   * @param {Tech~SourceObject} srcObj
   *        The source object
   *
   * @param {Object} options
   *        The options passed to the tech
   *
   * @return {string}
   *         'probably', 'maybe', or '' (empty string)
   */_Tech.canPlaySource=function(srcObj,options){var sh=_Tech.selectSourceHandler(srcObj,options);if(sh){return sh.canHandleSource(srcObj,options);}return '';};/**
   * When using a source handler, prefer its implementation of
   * any function normally provided by the tech.
   */var deferrable=['seekable','seeking','duration'];/**
   * A wrapper around {@link Tech#seekable} that will call a `SourceHandler`s seekable
   * function if it exists, with a fallback to the Techs seekable function.
   *
   * @method _Tech.seekable
   */ /**
   * A wrapper around {@link Tech#duration} that will call a `SourceHandler`s duration
   * function if it exists, otherwise it will fallback to the techs duration function.
   *
   * @method _Tech.duration
   */deferrable.forEach(function(fnName){var originalFn=this[fnName];if(typeof originalFn!=='function'){return;}this[fnName]=function(){if(this.sourceHandler_&&this.sourceHandler_[fnName]){return this.sourceHandler_[fnName].apply(this.sourceHandler_,arguments);}return originalFn.apply(this,arguments);};},_Tech.prototype);/**
   * Create a function for setting the source using a source object
   * and source handlers.
   * Should never be called unless a source handler was found.
   *
   * @param {Tech~SourceObject} source
   *        A source object with src and type keys
   */_Tech.prototype.setSource=function(source){var sh=_Tech.selectSourceHandler(source,this.options_);if(!sh){// Fall back to a native source hander when unsupported sources are
// deliberately set
if(_Tech.nativeSourceHandler){sh=_Tech.nativeSourceHandler;}else {log.error('No source hander found for the current source.');}}// Dispose any existing source handler
this.disposeSourceHandler();this.off('dispose',this.disposeSourceHandler);if(sh!==_Tech.nativeSourceHandler){this.currentSource_=source;}this.sourceHandler_=sh.handleSource(source,this,this.options_);this.on('dispose',this.disposeSourceHandler);};/**
   * Clean up any existing SourceHandlers and listeners when the Tech is disposed.
   *
   * @listens Tech#dispose
   */_Tech.prototype.disposeSourceHandler=function(){// if we have a source and get another one
// then we are loading something new
// than clear all of our current tracks
if(this.currentSource_){this.clearTracks(['audio','video']);this.currentSource_=null;}// always clean up auto-text tracks
this.cleanupAutoTextTracks();if(this.sourceHandler_){if(this.sourceHandler_.dispose){this.sourceHandler_.dispose();}this.sourceHandler_=null;}};};// The base Tech class needs to be registered as a Component. It is the only
// Tech that can be registered as a Component.
Component.registerComponent('Tech',Tech);Tech.registerTech('Tech',Tech);/**
 * A list of techs that should be added to techOrder on Players
 *
 * @private
 */Tech.defaultTechOrder_=[];var middlewares={};var middlewareInstances={};var TERMINATOR={};function use(type,middleware){middlewares[type]=middlewares[type]||[];middlewares[type].push(middleware);}function setSource(player,src,next){player.setTimeout(function(){return setSourceHelper(src,middlewares[src.type],next,player);},1);}function setTech(middleware,tech){middleware.forEach(function(mw){return mw.setTech&&mw.setTech(tech);});}/**
 * Calls a getter on the tech first, through each middleware
 * from right to left to the player.
 */function get$1(middleware,tech,method){return middleware.reduceRight(middlewareIterator(method),tech[method]());}/**
 * Takes the argument given to the player and calls the setter method on each
 * middlware from left to right to the tech.
 */function set$1(middleware,tech,method,arg){return tech[method](middleware.reduce(middlewareIterator(method),arg));}/**
 * Takes the argument given to the player and calls the `call` version of the method
 * on each middleware from left to right.
 * Then, call the passed in method on the tech and return the result unchanged
 * back to the player, through middleware, this time from right to left.
 */function mediate(middleware,tech,method){var arg=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var callMethod='call'+toTitleCase(method);var middlewareValue=middleware.reduce(middlewareIterator(callMethod),arg);var terminated=middlewareValue===TERMINATOR;var returnValue=terminated?null:tech[method](middlewareValue);executeRight(middleware,method,returnValue,terminated);return returnValue;}var allowedGetters={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1};var allowedSetters={setCurrentTime:1};var allowedMediators={play:1,pause:1};function middlewareIterator(method){return function(value,mw){// if the previous middleware terminated, pass along the termination
if(value===TERMINATOR){return TERMINATOR;}if(mw[method]){return mw[method](value);}return value;};}function executeRight(mws,method,value,terminated){for(var i=mws.length-1;i>=0;i--){var mw=mws[i];if(mw[method]){mw[method](terminated,value);}}}function clearCacheForPlayer(player){middlewareInstances[player.id()]=null;}/**
 * {
 *  [playerId]: [[mwFactory, mwInstance], ...]
 * }
 */function getOrCreateFactory(player,mwFactory){var mws=middlewareInstances[player.id()];var mw=null;if(mws===undefined||mws===null){mw=mwFactory(player);middlewareInstances[player.id()]=[[mwFactory,mw]];return mw;}for(var i=0;i<mws.length;i++){var _mws$i=mws[i],mwf=_mws$i[0],mwi=_mws$i[1];if(mwf!==mwFactory){continue;}mw=mwi;}if(mw===null){mw=mwFactory(player);mws.push([mwFactory,mw]);}return mw;}function setSourceHelper(){var src=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var middleware=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var next=arguments[2];var player=arguments[3];var acc=arguments.length>4&&arguments[4]!==undefined?arguments[4]:[];var lastRun=arguments.length>5&&arguments[5]!==undefined?arguments[5]:false;var mwFactory=middleware[0],mwrest=middleware.slice(1);// if mwFactory is a string, then we're at a fork in the road
if(typeof mwFactory==='string'){setSourceHelper(src,middlewares[mwFactory],next,player,acc,lastRun);// if we have an mwFactory, call it with the player to get the mw,
// then call the mw's setSource method
}else if(mwFactory){var mw=getOrCreateFactory(player,mwFactory);// if setSource isn't present, implicitly select this middleware
if(!mw.setSource){acc.push(mw);return setSourceHelper(src,mwrest,next,player,acc,lastRun);}mw.setSource(assign({},src),function(err,_src){// something happened, try the next middleware on the current level
// make sure to use the old src
if(err){return setSourceHelper(src,mwrest,next,player,acc,lastRun);}// we've succeeded, now we need to go deeper
acc.push(mw);// if it's the same type, continue down the current chain
// otherwise, we want to go down the new chain
setSourceHelper(_src,src.type===_src.type?mwrest:middlewares[_src.type],next,player,acc,lastRun);});}else if(mwrest.length){setSourceHelper(src,mwrest,next,player,acc,lastRun);}else if(lastRun){next(src,acc);}else {setSourceHelper(src,middlewares['*'],next,player,acc,true);}}/**
 * Mimetypes
 *
 * @see http://hul.harvard.edu/ois/////systems/wax/wax-public-help/mimetypes.htm
 * @typedef Mimetypes~Kind
 * @enum
 */var MimetypesKind={opus:'video/ogg',ogv:'video/ogg',mp4:'video/mp4',mov:'video/mp4',m4v:'video/mp4',mkv:'video/x-matroska',mp3:'audio/mpeg',aac:'audio/aac',oga:'audio/ogg',m3u8:'application/x-mpegURL'};/**
 * Get the mimetype of a given src url if possible
 *
 * @param {string} src
 *        The url to the src
 *
 * @return {string}
 *         return the mimetype if it was known or empty string otherwise
 */var getMimetype=function getMimetype(){var src=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';var ext=getFileExtension(src);var mimetype=MimetypesKind[ext.toLowerCase()];return mimetype||'';};/**
 * Find the mime type of a given source string if possible. Uses the player
 * source cache.
 *
 * @param {Player} player
 *        The player object
 *
 * @param {string} src
 *        The source string
 *
 * @return {string}
 *         The type that was found
 */var findMimetype=function findMimetype(player,src){if(!src){return '';}// 1. check for the type in the `source` cache
if(player.cache_.source.src===src&&player.cache_.source.type){return player.cache_.source.type;}// 2. see if we have this source in our `currentSources` cache
var matchingSources=player.cache_.sources.filter(function(s){return s.src===src;});if(matchingSources.length){return matchingSources[0].type;}// 3. look for the src url in source elements and use the type there
var sources=player.$$('source');for(var i=0;i<sources.length;i++){var s=sources[i];if(s.type&&s.src&&s.src===src){return s.type;}}// 4. finally fallback to our list of mime types based on src url extension
return getMimetype(src);};/**
 * @module filter-source
 */ /**
 * Filter out single bad source objects or multiple source objects in an
 * array. Also flattens nested source object arrays into a 1 dimensional
 * array of source objects.
 *
 * @param {Tech~SourceObject|Tech~SourceObject[]} src
 *        The src object to filter
 *
 * @return {Tech~SourceObject[]}
 *         An array of sourceobjects containing only valid sources
 *
 * @private
 */var filterSource=function filterSource(src){// traverse array
if(Array.isArray(src)){var newsrc=[];src.forEach(function(srcobj){srcobj=filterSource(srcobj);if(Array.isArray(srcobj)){newsrc=newsrc.concat(srcobj);}else if(isObject(srcobj)){newsrc.push(srcobj);}});src=newsrc;}else if(typeof src==='string'&&src.trim()){// convert string into object
src=[fixSource({src:src})];}else if(isObject(src)&&typeof src.src==='string'&&src.src&&src.src.trim()){// src is already valid
src=[fixSource(src)];}else {// invalid source, turn it into an empty array
src=[];}return src;};/**
 * Checks src mimetype, adding it when possible
 *
 * @param {Tech~SourceObject} src
 *        The src object to check
 * @return {Tech~SourceObject}
 *        src Object with known type
 */function fixSource(src){var mimetype=getMimetype(src.src);if(!src.type&&mimetype){src.type=mimetype;}return src;}/**
 * @file loader.js
 */ /**
 * The `MediaLoader` is the `Component` that decides which playback technology to load
 * when a player is initialized.
 *
 * @extends Component
 */var MediaLoader=function(_Component){inherits(MediaLoader,_Component);/**
   * Create an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should attach to.
   *
   * @param {Object} [options]
   *        The key/value stroe of player options.
   *
   * @param {Component~ReadyCallback} [ready]
   *        The function that is run when this component is ready.
   */function MediaLoader(player,options,ready){classCallCheck(this,MediaLoader);// MediaLoader has no element
var options_=mergeOptions({createEl:false},options);// If there are no sources when the player is initialized,
// load the first supported playback technology.
var _this=possibleConstructorReturn(this,_Component.call(this,player,options_,ready));if(!options.playerOptions.sources||options.playerOptions.sources.length===0){for(var i=0,j=options.playerOptions.techOrder;i<j.length;i++){var techName=toTitleCase(j[i]);var tech=Tech.getTech(techName);// Support old behavior of techs being registered as components.
// Remove once that deprecated behavior is removed.
if(!techName){tech=Component.getComponent(techName);}// Check if the browser supports this technology
if(tech&&tech.isSupported()){player.loadTech_(techName);break;}}}else {// Loop through playback technologies (HTML5, Flash) and check for support.
// Then load the best source.
// A few assumptions here:
//   All playback technologies respect preload false.
player.src(options.playerOptions.sources);}return _this;}return MediaLoader;}(Component);Component.registerComponent('MediaLoader',MediaLoader);/**
 * @file button.js
 */ /**
 * Clickable Component which is clickable or keyboard actionable,
 * but is not a native HTML button.
 *
 * @extends Component
 */var ClickableComponent=function(_Component){inherits(ClickableComponent,_Component);/**
   * Creates an instance of this class.
   *
   * @param  {Player} player
   *         The `Player` that this class should be attached to.
   *
   * @param  {Object} [options]
   *         The key/value store of player options.
   */function ClickableComponent(player,options){classCallCheck(this,ClickableComponent);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.emitTapEvents();_this.enable();return _this;}/**
   * Create the `Component`s DOM element.
   *
   * @param {string} [tag=div]
   *        The element's node type.
   *
   * @param {Object} [props={}]
   *        An object of properties that should be set on the element.
   *
   * @param {Object} [attributes={}]
   *        An object of attributes that should be set on the element.
   *
   * @return {Element}
   *         The element that gets created.
   */ClickableComponent.prototype.createEl=function createEl$$1(){var tag=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'div';var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var attributes=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};props=assign({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},props);if(tag==='button'){log.error('Creating a ClickableComponent with an HTML element of '+tag+' is not supported; use a Button instead.');}// Add ARIA attributes for clickable element which is not a native HTML button
attributes=assign({role:'button'},attributes);this.tabIndex_=props.tabIndex;var el=_Component.prototype.createEl.call(this,tag,props,attributes);this.createControlTextEl(el);return el;};ClickableComponent.prototype.dispose=function dispose(){// remove controlTextEl_ on dipose
this.controlTextEl_=null;_Component.prototype.dispose.call(this);};/**
   * Create a control text element on this `Component`
   *
   * @param {Element} [el]
   *        Parent element for the control text.
   *
   * @return {Element}
   *         The control text element that gets created.
   */ClickableComponent.prototype.createControlTextEl=function createControlTextEl(el){this.controlTextEl_=createEl('span',{className:'vjs-control-text'},{// let the screen reader user know that the text of the element may change
'aria-live':'polite'});if(el){el.appendChild(this.controlTextEl_);}this.controlText(this.controlText_,el);return this.controlTextEl_;};/**
   * Get or set the localize text to use for the controls on the `Component`.
   *
   * @param {string} [text]
   *        Control text for element.
   *
   * @param {Element} [el=this.el()]
   *        Element to set the title on.
   *
   * @return {string}
   *         - The control text when getting
   */ClickableComponent.prototype.controlText=function controlText(text){var el=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.el();if(text===undefined){return this.controlText_||'Need Text';}var localizedText=this.localize(text);this.controlText_=text;textContent(this.controlTextEl_,localizedText);if(!this.nonIconControl){// Set title attribute if only an icon is shown
el.setAttribute('title',localizedText);}};/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */ClickableComponent.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-control vjs-button '+_Component.prototype.buildCSSClass.call(this);};/**
   * Enable this `Component`s element.
   */ClickableComponent.prototype.enable=function enable(){if(!this.enabled_){this.enabled_=true;this.removeClass('vjs-disabled');this.el_.setAttribute('aria-disabled','false');if(typeof this.tabIndex_!=='undefined'){this.el_.setAttribute('tabIndex',this.tabIndex_);}this.on(['tap','click'],this.handleClick);this.on('focus',this.handleFocus);this.on('blur',this.handleBlur);}};/**
   * Disable this `Component`s element.
   */ClickableComponent.prototype.disable=function disable(){this.enabled_=false;this.addClass('vjs-disabled');this.el_.setAttribute('aria-disabled','true');if(typeof this.tabIndex_!=='undefined'){this.el_.removeAttribute('tabIndex');}this.off(['tap','click'],this.handleClick);this.off('focus',this.handleFocus);this.off('blur',this.handleBlur);};/**
   * This gets called when a `ClickableComponent` gets:
   * - Clicked (via the `click` event, listening starts in the constructor)
   * - Tapped (via the `tap` event, listening starts in the constructor)
   * - The following things happen in order:
   *   1. {@link ClickableComponent#handleFocus} is called via a `focus` event on the
   *      `ClickableComponent`.
   *   2. {@link ClickableComponent#handleFocus} adds a listener for `keydown` on using
   *      {@link ClickableComponent#handleKeyPress}.
   *   3. `ClickableComponent` has not had a `blur` event (`blur` means that focus was lost). The user presses
   *      the space or enter key.
   *   4. {@link ClickableComponent#handleKeyPress} calls this function with the `keydown`
   *      event as a parameter.
   *
   * @param {EventTarget~Event} event
   *        The `keydown`, `tap`, or `click` event that caused this function to be
   *        called.
   *
   * @listens tap
   * @listens click
   * @abstract
   */ClickableComponent.prototype.handleClick=function handleClick(event){};/**
   * This gets called when a `ClickableComponent` gains focus via a `focus` event.
   * Turns on listening for `keydown` events. When they happen it
   * calls `this.handleKeyPress`.
   *
   * @param {EventTarget~Event} event
   *        The `focus` event that caused this function to be called.
   *
   * @listens focus
   */ClickableComponent.prototype.handleFocus=function handleFocus(event){on(document$1,'keydown',bind(this,this.handleKeyPress));};/**
   * Called when this ClickableComponent has focus and a key gets pressed down. By
   * default it will call `this.handleClick` when the key is space or enter.
   *
   * @param {EventTarget~Event} event
   *        The `keydown` event that caused this function to be called.
   *
   * @listens keydown
   */ClickableComponent.prototype.handleKeyPress=function handleKeyPress(event){// Support Space (32) or Enter (13) key operation to fire a click event
if(event.which===32||event.which===13){event.preventDefault();this.trigger('click');}else if(_Component.prototype.handleKeyPress){// Pass keypress handling up for unsupported keys
_Component.prototype.handleKeyPress.call(this,event);}};/**
   * Called when a `ClickableComponent` loses focus. Turns off the listener for
   * `keydown` events. Which Stops `this.handleKeyPress` from getting called.
   *
   * @param {EventTarget~Event} event
   *        The `blur` event that caused this function to be called.
   *
   * @listens blur
   */ClickableComponent.prototype.handleBlur=function handleBlur(event){off(document$1,'keydown',bind(this,this.handleKeyPress));};return ClickableComponent;}(Component);Component.registerComponent('ClickableComponent',ClickableComponent);/**
 * @file poster-image.js
 */ /**
 * A `ClickableComponent` that handles showing the poster image for the player.
 *
 * @extends ClickableComponent
 */var PosterImage=function(_ClickableComponent){inherits(PosterImage,_ClickableComponent);/**
   * Create an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should attach to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function PosterImage(player,options){classCallCheck(this,PosterImage);var _this=possibleConstructorReturn(this,_ClickableComponent.call(this,player,options));_this.update();player.on('posterchange',bind(_this,_this.update));return _this;}/**
   * Clean up and dispose of the `PosterImage`.
   */PosterImage.prototype.dispose=function dispose(){this.player().off('posterchange',this.update);_ClickableComponent.prototype.dispose.call(this);};/**
   * Create the `PosterImage`s DOM element.
   *
   * @return {Element}
   *         The element that gets created.
   */PosterImage.prototype.createEl=function createEl$$1(){var el=createEl('div',{className:'vjs-poster',// Don't want poster to be tabbable.
tabIndex:-1});// To ensure the poster image resizes while maintaining its original aspect
// ratio, use a div with `background-size` when available. For browsers that
// do not support `background-size` (e.g. IE8), fall back on using a regular
// img element.
if(!BACKGROUND_SIZE_SUPPORTED){this.fallbackImg_=createEl('img');el.appendChild(this.fallbackImg_);}return el;};/**
   * An {@link EventTarget~EventListener} for {@link Player#posterchange} events.
   *
   * @listens Player#posterchange
   *
   * @param {EventTarget~Event} [event]
   *        The `Player#posterchange` event that triggered this function.
   */PosterImage.prototype.update=function update(event){var url=this.player().poster();this.setSrc(url);// If there's no poster source we should display:none on this component
// so it's not still clickable or right-clickable
if(url){this.show();}else {this.hide();}};/**
   * Set the source of the `PosterImage` depending on the display method.
   *
   * @param {string} url
   *        The URL to the source for the `PosterImage`.
   */PosterImage.prototype.setSrc=function setSrc(url){if(this.fallbackImg_){this.fallbackImg_.src=url;}else {var backgroundImage='';// Any falsey values should stay as an empty string, otherwise
// this will throw an extra error
if(url){backgroundImage='url("'+url+'")';}this.el_.style.backgroundImage=backgroundImage;}};/**
   * An {@link EventTarget~EventListener} for clicks on the `PosterImage`. See
   * {@link ClickableComponent#handleClick} for instances where this will be triggered.
   *
   * @listens tap
   * @listens click
   * @listens keydown
   *
   * @param {EventTarget~Event} event
   +        The `click`, `tap` or `keydown` event that caused this function to be called.
   */PosterImage.prototype.handleClick=function handleClick(event){// We don't want a click to trigger playback when controls are disabled
if(!this.player_.controls()){return;}if(this.player_.paused()){silencePromise(this.player_.play());}else {this.player_.pause();}};return PosterImage;}(ClickableComponent);Component.registerComponent('PosterImage',PosterImage);/**
 * @file text-track-display.js
 */var darkGray='#222';var lightGray='#ccc';var fontMap={monospace:'monospace',sansSerif:'sans-serif',serif:'serif',monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:'sans-serif',proportionalSerif:'serif',casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};/**
 * Construct an rgba color from a given hex color code.
 *
 * @param {number} color
 *        Hex number for color, like #f0e or #f604e2.
 *
 * @param {number} opacity
 *        Value for opacity, 0.0 - 1.0.
 *
 * @return {string}
 *         The rgba color that was created, like 'rgba(255, 0, 0, 0.3)'.
 */function constructColor(color,opacity){var hex=void 0;if(color.length===4){// color looks like "#f0e"
hex=color[1]+color[1]+color[2]+color[2]+color[3]+color[3];}else if(color.length===7){// color looks like "#f604e2"
hex=color.slice(1);}else {throw new Error('Invalid color code provided, '+color+'; must be formatted as e.g. #f0e or #f604e2.');}return 'rgba('+parseInt(hex.slice(0,2),16)+','+parseInt(hex.slice(2,4),16)+','+parseInt(hex.slice(4,6),16)+','+opacity+')';}/**
 * Try to update the style of a DOM element. Some style changes will throw an error,
 * particularly in IE8. Those should be noops.
 *
 * @param {Element} el
 *        The DOM element to be styled.
 *
 * @param {string} style
 *        The CSS property on the element that should be styled.
 *
 * @param {string} rule
 *        The style rule that should be applied to the property.
 *
 * @private
 */function tryUpdateStyle(el,style,rule){try{el.style[style]=rule;}catch(e){// Satisfies linter.
return;}}/**
 * The component for displaying text track cues.
 *
 * @extends Component
 */var TextTrackDisplay=function(_Component){inherits(TextTrackDisplay,_Component);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   *
   * @param {Component~ReadyCallback} [ready]
   *        The function to call when `TextTrackDisplay` is ready.
   */function TextTrackDisplay(player,options,ready){classCallCheck(this,TextTrackDisplay);var _this=possibleConstructorReturn(this,_Component.call(this,player,options,ready));var updateDisplayHandler=bind(_this,_this.updateDisplay);player.on('loadstart',bind(_this,_this.toggleDisplay));player.on('texttrackchange',updateDisplayHandler);player.on('loadstart',bind(_this,_this.preselectTrack));// This used to be called during player init, but was causing an error
// if a track should show by default and the display hadn't loaded yet.
// Should probably be moved to an external track loader when we support
// tracks that don't need a display.
player.ready(bind(_this,function(){if(player.tech_&&player.tech_.featuresNativeTextTracks){this.hide();return;}player.on('fullscreenchange',updateDisplayHandler);player.on('playerresize',updateDisplayHandler);if(window$1.addEventListener){window$1.addEventListener('orientationchange',updateDisplayHandler);}player.on('dispose',function(){return window$1.removeEventListener('orientationchange',updateDisplayHandler);});var tracks=this.options_.playerOptions.tracks||[];for(var i=0;i<tracks.length;i++){this.player_.addRemoteTextTrack(tracks[i],true);}this.preselectTrack();}));return _this;}/**
  * Preselect a track following this precedence:
  * - matches the previously selected {@link TextTrack}'s language and kind
  * - matches the previously selected {@link TextTrack}'s language only
  * - is the first default captions track
  * - is the first default descriptions track
  *
  * @listens Player#loadstart
  */TextTrackDisplay.prototype.preselectTrack=function preselectTrack(){var modes={captions:1,subtitles:1};var trackList=this.player_.textTracks();var userPref=this.player_.cache_.selectedLanguage;var firstDesc=void 0;var firstCaptions=void 0;var preferredTrack=void 0;for(var i=0;i<trackList.length;i++){var track=trackList[i];if(userPref&&userPref.enabled&&userPref.language===track.language){// Always choose the track that matches both language and kind
if(track.kind===userPref.kind){preferredTrack=track;// or choose the first track that matches language
}else if(!preferredTrack){preferredTrack=track;}// clear everything if offTextTrackMenuItem was clicked
}else if(userPref&&!userPref.enabled){preferredTrack=null;firstDesc=null;firstCaptions=null;}else if(track['default']){if(track.kind==='descriptions'&&!firstDesc){firstDesc=track;}else if(track.kind in modes&&!firstCaptions){firstCaptions=track;}}}// The preferredTrack matches the user preference and takes
// precendence over all the other tracks.
// So, display the preferredTrack before the first default track
// and the subtitles/captions track before the descriptions track
if(preferredTrack){preferredTrack.mode='showing';}else if(firstCaptions){firstCaptions.mode='showing';}else if(firstDesc){firstDesc.mode='showing';}};/**
   * Turn display of {@link TextTrack}'s from the current state into the other state.
   * There are only two states:
   * - 'shown'
   * - 'hidden'
   *
   * @listens Player#loadstart
   */TextTrackDisplay.prototype.toggleDisplay=function toggleDisplay(){if(this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks){this.hide();}else {this.show();}};/**
   * Create the {@link Component}'s DOM element.
   *
   * @return {Element}
   *         The element that was created.
   */TextTrackDisplay.prototype.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-text-track-display'},{'aria-live':'off','aria-atomic':'true'});};/**
   * Clear all displayed {@link TextTrack}s.
   */TextTrackDisplay.prototype.clearDisplay=function clearDisplay(){if(typeof window$1.WebVTT==='function'){window$1.WebVTT.processCues(window$1,[],this.el_);}};/**
   * Update the displayed TextTrack when a either a {@link Player#texttrackchange} or
   * a {@link Player#fullscreenchange} is fired.
   *
   * @listens Player#texttrackchange
   * @listens Player#fullscreenchange
   */TextTrackDisplay.prototype.updateDisplay=function updateDisplay(){var tracks=this.player_.textTracks();this.clearDisplay();// Track display prioritization model: if multiple tracks are 'showing',
//  display the first 'subtitles' or 'captions' track which is 'showing',
//  otherwise display the first 'descriptions' track which is 'showing'
var descriptionsTrack=null;var captionsSubtitlesTrack=null;var i=tracks.length;while(i--){var track=tracks[i];if(track.mode==='showing'){if(track.kind==='descriptions'){descriptionsTrack=track;}else {captionsSubtitlesTrack=track;}}}if(captionsSubtitlesTrack){if(this.getAttribute('aria-live')!=='off'){this.setAttribute('aria-live','off');}this.updateForTrack(captionsSubtitlesTrack);}else if(descriptionsTrack){if(this.getAttribute('aria-live')!=='assertive'){this.setAttribute('aria-live','assertive');}this.updateForTrack(descriptionsTrack);}};/**
   * Add an {@link Texttrack} to to the {@link Tech}s {@link TextTrackList}.
   *
   * @param {TextTrack} track
   *        Text track object to be added to the list.
   */TextTrackDisplay.prototype.updateForTrack=function updateForTrack(track){if(typeof window$1.WebVTT!=='function'||!track.activeCues){return;}var cues=[];for(var _i=0;_i<track.activeCues.length;_i++){cues.push(track.activeCues[_i]);}window$1.WebVTT.processCues(window$1,cues,this.el_);if(!this.player_.textTrackSettings){return;}var overrides=this.player_.textTrackSettings.getValues();var i=cues.length;while(i--){var cue=cues[i];if(!cue){continue;}var cueDiv=cue.displayState;if(overrides.color){cueDiv.firstChild.style.color=overrides.color;}if(overrides.textOpacity){tryUpdateStyle(cueDiv.firstChild,'color',constructColor(overrides.color||'#fff',overrides.textOpacity));}if(overrides.backgroundColor){cueDiv.firstChild.style.backgroundColor=overrides.backgroundColor;}if(overrides.backgroundOpacity){tryUpdateStyle(cueDiv.firstChild,'backgroundColor',constructColor(overrides.backgroundColor||'#000',overrides.backgroundOpacity));}if(overrides.windowColor){if(overrides.windowOpacity){tryUpdateStyle(cueDiv,'backgroundColor',constructColor(overrides.windowColor,overrides.windowOpacity));}else {cueDiv.style.backgroundColor=overrides.windowColor;}}if(overrides.edgeStyle){if(overrides.edgeStyle==='dropshadow'){cueDiv.firstChild.style.textShadow='2px 2px 3px '+darkGray+', 2px 2px 4px '+darkGray+', 2px 2px 5px '+darkGray;}else if(overrides.edgeStyle==='raised'){cueDiv.firstChild.style.textShadow='1px 1px '+darkGray+', 2px 2px '+darkGray+', 3px 3px '+darkGray;}else if(overrides.edgeStyle==='depressed'){cueDiv.firstChild.style.textShadow='1px 1px '+lightGray+', 0 1px '+lightGray+', -1px -1px '+darkGray+', 0 -1px '+darkGray;}else if(overrides.edgeStyle==='uniform'){cueDiv.firstChild.style.textShadow='0 0 4px '+darkGray+', 0 0 4px '+darkGray+', 0 0 4px '+darkGray+', 0 0 4px '+darkGray;}}if(overrides.fontPercent&&overrides.fontPercent!==1){var fontSize=window$1.parseFloat(cueDiv.style.fontSize);cueDiv.style.fontSize=fontSize*overrides.fontPercent+'px';cueDiv.style.height='auto';cueDiv.style.top='auto';cueDiv.style.bottom='2px';}if(overrides.fontFamily&&overrides.fontFamily!=='default'){if(overrides.fontFamily==='small-caps'){cueDiv.firstChild.style.fontVariant='small-caps';}else {cueDiv.firstChild.style.fontFamily=fontMap[overrides.fontFamily];}}}};return TextTrackDisplay;}(Component);Component.registerComponent('TextTrackDisplay',TextTrackDisplay);/**
 * @file loading-spinner.js
 */ /**
 * A loading spinner for use during waiting/loading events.
 *
 * @extends Component
 */var LoadingSpinner=function(_Component){inherits(LoadingSpinner,_Component);function LoadingSpinner(){classCallCheck(this,LoadingSpinner);return possibleConstructorReturn(this,_Component.apply(this,arguments));}/**
   * Create the `LoadingSpinner`s DOM element.
   *
   * @return {Element}
   *         The dom element that gets created.
   */LoadingSpinner.prototype.createEl=function createEl$$1(){var isAudio=this.player_.isAudio();var playerType=this.localize(isAudio?'Audio Player':'Video Player');var controlText=createEl('span',{className:'vjs-control-text',innerHTML:this.localize('{1} is loading.',[playerType])});var el=_Component.prototype.createEl.call(this,'div',{className:'vjs-loading-spinner',dir:'ltr'});el.appendChild(controlText);return el;};return LoadingSpinner;}(Component);Component.registerComponent('LoadingSpinner',LoadingSpinner);/**
 * @file button.js
 */ /**
 * Base class for all buttons.
 *
 * @extends ClickableComponent
 */var Button=function(_ClickableComponent){inherits(Button,_ClickableComponent);function Button(){classCallCheck(this,Button);return possibleConstructorReturn(this,_ClickableComponent.apply(this,arguments));}/**
   * Create the `Button`s DOM element.
   *
   * @param {string} [tag="button"]
   *        The element's node type. This argument is IGNORED: no matter what
   *        is passed, it will always create a `button` element.
   *
   * @param {Object} [props={}]
   *        An object of properties that should be set on the element.
   *
   * @param {Object} [attributes={}]
   *        An object of attributes that should be set on the element.
   *
   * @return {Element}
   *         The element that gets created.
   */Button.prototype.createEl=function createEl(tag){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var attributes=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};tag='button';props=assign({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},props);// Add attributes for button element
attributes=assign({// Necessary since the default button type is "submit"
type:'button'},attributes);var el=Component.prototype.createEl.call(this,tag,props,attributes);this.createControlTextEl(el);return el;};/**
   * Add a child `Component` inside of this `Button`.
   *
   * @param {string|Component} child
   *        The name or instance of a child to add.
   *
   * @param {Object} [options={}]
   *        The key/value store of options that will get passed to children of
   *        the child.
   *
   * @return {Component}
   *         The `Component` that gets added as a child. When using a string the
   *         `Component` will get created by this process.
   *
   * @deprecated since version 5
   */Button.prototype.addChild=function addChild(child){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var className=this.constructor.name;log.warn('Adding an actionable (user controllable) child to a Button ('+className+') is not supported; use a ClickableComponent instead.');// Avoid the error message generated by ClickableComponent's addChild method
return Component.prototype.addChild.call(this,child,options);};/**
   * Enable the `Button` element so that it can be activated or clicked. Use this with
   * {@link Button#disable}.
   */Button.prototype.enable=function enable(){_ClickableComponent.prototype.enable.call(this);this.el_.removeAttribute('disabled');};/**
   * Disable the `Button` element so that it cannot be activated or clicked. Use this with
   * {@link Button#enable}.
   */Button.prototype.disable=function disable(){_ClickableComponent.prototype.disable.call(this);this.el_.setAttribute('disabled','disabled');};/**
   * This gets called when a `Button` has focus and `keydown` is triggered via a key
   * press.
   *
   * @param {EventTarget~Event} event
   *        The event that caused this function to get called.
   *
   * @listens keydown
   */Button.prototype.handleKeyPress=function handleKeyPress(event){// Ignore Space (32) or Enter (13) key operation, which is handled by the browser for a button.
if(event.which===32||event.which===13){return;}// Pass keypress handling up for unsupported keys
_ClickableComponent.prototype.handleKeyPress.call(this,event);};return Button;}(ClickableComponent);Component.registerComponent('Button',Button);/**
 * @file big-play-button.js
 */ /**
 * The initial play button that shows before the video has played. The hiding of the
 * `BigPlayButton` get done via CSS and `Player` states.
 *
 * @extends Button
 */var BigPlayButton=function(_Button){inherits(BigPlayButton,_Button);function BigPlayButton(player,options){classCallCheck(this,BigPlayButton);var _this=possibleConstructorReturn(this,_Button.call(this,player,options));_this.mouseused_=false;_this.on('mousedown',_this.handleMouseDown);return _this;}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object. Always returns 'vjs-big-play-button'.
   */BigPlayButton.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-big-play-button';};/**
   * This gets called when a `BigPlayButton` "clicked". See {@link ClickableComponent}
   * for more detailed information on what a click can be.
   *
   * @param {EventTarget~Event} event
   *        The `keydown`, `tap`, or `click` event that caused this function to be
   *        called.
   *
   * @listens tap
   * @listens click
   */BigPlayButton.prototype.handleClick=function handleClick(event){var playPromise=this.player_.play();// exit early if clicked via the mouse
if(this.mouseused_&&event.clientX&&event.clientY){silencePromise(playPromise);return;}var cb=this.player_.getChild('controlBar');var playToggle=cb&&cb.getChild('playToggle');if(!playToggle){this.player_.focus();return;}var playFocus=function playFocus(){return playToggle.focus();};if(isPromise(playPromise)){playPromise.then(playFocus,function(){});}else {this.setTimeout(playFocus,1);}};BigPlayButton.prototype.handleKeyPress=function handleKeyPress(event){this.mouseused_=false;_Button.prototype.handleKeyPress.call(this,event);};BigPlayButton.prototype.handleMouseDown=function handleMouseDown(event){this.mouseused_=true;};return BigPlayButton;}(Button);/**
 * The text that should display over the `BigPlayButton`s controls. Added to for localization.
 *
 * @type {string}
 * @private
 */BigPlayButton.prototype.controlText_='Play Video';Component.registerComponent('BigPlayButton',BigPlayButton);/**
 * @file close-button.js
 */ /**
 * The `CloseButton` is a `{@link Button}` that fires a `close` event when
 * it gets clicked.
 *
 * @extends Button
 */var CloseButton=function(_Button){inherits(CloseButton,_Button);/**
   * Creates an instance of the this class.
   *
   * @param  {Player} player
   *         The `Player` that this class should be attached to.
   *
   * @param  {Object} [options]
   *         The key/value store of player options.
   */function CloseButton(player,options){classCallCheck(this,CloseButton);var _this=possibleConstructorReturn(this,_Button.call(this,player,options));_this.controlText(options&&options.controlText||_this.localize('Close'));return _this;}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */CloseButton.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-close-button '+_Button.prototype.buildCSSClass.call(this);};/**
   * This gets called when a `CloseButton` gets clicked. See
   * {@link ClickableComponent#handleClick} for more information on when this will be
   * triggered
   *
   * @param {EventTarget~Event} event
   *        The `keydown`, `tap`, or `click` event that caused this function to be
   *        called.
   *
   * @listens tap
   * @listens click
   * @fires CloseButton#close
   */CloseButton.prototype.handleClick=function handleClick(event){/**
     * Triggered when the a `CloseButton` is clicked.
     *
     * @event CloseButton#close
     * @type {EventTarget~Event}
     *
     * @property {boolean} [bubbles=false]
     *           set to false so that the close event does not
     *           bubble up to parents if there is no listener
     */this.trigger({type:'close',bubbles:false});};return CloseButton;}(Button);Component.registerComponent('CloseButton',CloseButton);/**
 * @file play-toggle.js
 */ /**
 * Button to toggle between play and pause.
 *
 * @extends Button
 */var PlayToggle=function(_Button){inherits(PlayToggle,_Button);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function PlayToggle(player,options){classCallCheck(this,PlayToggle);var _this=possibleConstructorReturn(this,_Button.call(this,player,options));_this.on(player,'play',_this.handlePlay);_this.on(player,'pause',_this.handlePause);_this.on(player,'ended',_this.handleEnded);return _this;}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */PlayToggle.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-play-control '+_Button.prototype.buildCSSClass.call(this);};/**
   * This gets called when an `PlayToggle` is "clicked". See
   * {@link ClickableComponent} for more detailed information on what a click can be.
   *
   * @param {EventTarget~Event} [event]
   *        The `keydown`, `tap`, or `click` event that caused this function to be
   *        called.
   *
   * @listens tap
   * @listens click
   */PlayToggle.prototype.handleClick=function handleClick(event){if(this.player_.paused()){this.player_.play();}else {this.player_.pause();}};/**
   * This gets called once after the video has ended and the user seeks so that
   * we can change the replay button back to a play button.
   *
   * @param {EventTarget~Event} [event]
   *        The event that caused this function to run.
   *
   * @listens Player#seeked
   */PlayToggle.prototype.handleSeeked=function handleSeeked(event){this.removeClass('vjs-ended');if(this.player_.paused()){this.handlePause(event);}else {this.handlePlay(event);}};/**
   * Add the vjs-playing class to the element so it can change appearance.
   *
   * @param {EventTarget~Event} [event]
   *        The event that caused this function to run.
   *
   * @listens Player#play
   */PlayToggle.prototype.handlePlay=function handlePlay(event){this.removeClass('vjs-ended');this.removeClass('vjs-paused');this.addClass('vjs-playing');// change the button text to "Pause"
this.controlText('Pause');};/**
   * Add the vjs-paused class to the element so it can change appearance.
   *
   * @param {EventTarget~Event} [event]
   *        The event that caused this function to run.
   *
   * @listens Player#pause
   */PlayToggle.prototype.handlePause=function handlePause(event){this.removeClass('vjs-playing');this.addClass('vjs-paused');// change the button text to "Play"
this.controlText('Play');};/**
   * Add the vjs-ended class to the element so it can change appearance
   *
   * @param {EventTarget~Event} [event]
   *        The event that caused this function to run.
   *
   * @listens Player#ended
   */PlayToggle.prototype.handleEnded=function handleEnded(event){this.removeClass('vjs-playing');this.addClass('vjs-ended');// change the button text to "Replay"
this.controlText('Replay');// on the next seek remove the replay button
this.one(this.player_,'seeked',this.handleSeeked);};return PlayToggle;}(Button);/**
 * The text that should display over the `PlayToggle`s controls. Added for localization.
 *
 * @type {string}
 * @private
 */PlayToggle.prototype.controlText_='Play';Component.registerComponent('PlayToggle',PlayToggle);/**
 * @file format-time.js
 * @module format-time
 */ /**
* Format seconds as a time string, H:MM:SS or M:SS. Supplying a guide (in seconds)
* will force a number of leading zeros to cover the length of the guide.
*
* @param {number} seconds
*        Number of seconds to be turned into a string
*
* @param {number} guide
*        Number (in seconds) to model the string after
*
* @return {string}
*         Time formatted as H:MM:SS or M:SS
*/var defaultImplementation=function defaultImplementation(seconds,guide){seconds=seconds<0?0:seconds;var s=Math.floor(seconds%60);var m=Math.floor(seconds/60%60);var h=Math.floor(seconds/3600);var gm=Math.floor(guide/60%60);var gh=Math.floor(guide/3600);// handle invalid times
if(isNaN(seconds)||seconds===Infinity){// '-' is false for all relational operators (e.g. <, >=) so this setting
// will add the minimum number of fields specified by the guide
h=m=s='-';}// Check if we need to show hours
h=h>0||gh>0?h+':':'';// If hours are showing, we may need to add a leading zero.
// Always show at least one digit of minutes.
m=((h||gm>=10)&&m<10?'0'+m:m)+':';// Check if leading zero is need for seconds
s=s<10?'0'+s:s;return h+m+s;};var implementation=defaultImplementation;/**
 * Replaces the default formatTime implementation with a custom implementation.
 *
 * @param {Function} customImplementation
 *        A function which will be used in place of the default formatTime implementation.
 *        Will receive the current time in seconds and the guide (in seconds) as arguments.
 */function setFormatTime(customImplementation){implementation=customImplementation;}/**
 * Resets formatTime to the default implementation.
 */function resetFormatTime(){implementation=defaultImplementation;}var formatTime=function(seconds){var guide=arguments.length>1&&arguments[1]!==undefined?arguments[1]:seconds;return implementation(seconds,guide);};/**
 * @file time-display.js
 */ /**
 * Displays the time left in the video
 *
 * @extends Component
 */var TimeDisplay=function(_Component){inherits(TimeDisplay,_Component);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function TimeDisplay(player,options){classCallCheck(this,TimeDisplay);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.throttledUpdateContent=throttle(bind(_this,_this.updateContent),25);_this.on(player,'timeupdate',_this.throttledUpdateContent);return _this;}/**
   * Create the `Component`'s DOM element
   *
   * @return {Element}
   *         The element that was created.
   */TimeDisplay.prototype.createEl=function createEl$$1(plainName){var className=this.buildCSSClass();var el=_Component.prototype.createEl.call(this,'div',{className:className+' vjs-time-control vjs-control',innerHTML:'<span class="vjs-control-text">'+this.localize(this.labelText_)+'\xA0</span>'});this.contentEl_=createEl('span',{className:className+'-display'},{// tell screen readers not to automatically read the time as it changes
'aria-live':'off'});this.updateTextNode_();el.appendChild(this.contentEl_);return el;};TimeDisplay.prototype.dispose=function dispose(){this.contentEl_=null;this.textNode_=null;_Component.prototype.dispose.call(this);};/**
   * Updates the "remaining time" text node with new content using the
   * contents of the `formattedTime_` property.
   *
   * @private
   */TimeDisplay.prototype.updateTextNode_=function updateTextNode_(){if(!this.contentEl_){return;}while(this.contentEl_.firstChild){this.contentEl_.removeChild(this.contentEl_.firstChild);}this.textNode_=document$1.createTextNode(this.formattedTime_||this.formatTime_(0));this.contentEl_.appendChild(this.textNode_);};/**
   * Generates a formatted time for this component to use in display.
   *
   * @param  {number} time
   *         A numeric time, in seconds.
   *
   * @return {string}
   *         A formatted time
   *
   * @private
   */TimeDisplay.prototype.formatTime_=function formatTime_(time){return formatTime(time);};/**
   * Updates the time display text node if it has what was passed in changed
   * the formatted time.
   *
   * @param {number} time
   *        The time to update to
   *
   * @private
   */TimeDisplay.prototype.updateFormattedTime_=function updateFormattedTime_(time){var formattedTime=this.formatTime_(time);if(formattedTime===this.formattedTime_){return;}this.formattedTime_=formattedTime;this.requestAnimationFrame(this.updateTextNode_);};/**
   * To be filled out in the child class, should update the displayed time
   * in accordance with the fact that the current time has changed.
   *
   * @param {EventTarget~Event} [event]
   *        The `timeupdate`  event that caused this to run.
   *
   * @listens Player#timeupdate
   */TimeDisplay.prototype.updateContent=function updateContent(event){};return TimeDisplay;}(Component);/**
 * The text that is added to the `TimeDisplay` for screen reader users.
 *
 * @type {string}
 * @private
 */TimeDisplay.prototype.labelText_='Time';/**
 * The text that should display over the `TimeDisplay`s controls. Added to for localization.
 *
 * @type {string}
 * @private
 *
 * @deprecated in v7; controlText_ is not used in non-active display Components
 */TimeDisplay.prototype.controlText_='Time';Component.registerComponent('TimeDisplay',TimeDisplay);/**
 * @file current-time-display.js
 */ /**
 * Displays the current time
 *
 * @extends Component
 */var CurrentTimeDisplay=function(_TimeDisplay){inherits(CurrentTimeDisplay,_TimeDisplay);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function CurrentTimeDisplay(player,options){classCallCheck(this,CurrentTimeDisplay);var _this=possibleConstructorReturn(this,_TimeDisplay.call(this,player,options));_this.on(player,'ended',_this.handleEnded);return _this;}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */CurrentTimeDisplay.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-current-time';};/**
   * Update current time display
   *
   * @param {EventTarget~Event} [event]
   *        The `timeupdate` event that caused this function to run.
   *
   * @listens Player#timeupdate
   */CurrentTimeDisplay.prototype.updateContent=function updateContent(event){// Allows for smooth scrubbing, when player can't keep up.
var time=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(time);};/**
   * When the player fires ended there should be no time left. Sadly
   * this is not always the case, lets make it seem like that is the case
   * for users.
   *
   * @param {EventTarget~Event} [event]
   *        The `ended` event that caused this to run.
   *
   * @listens Player#ended
   */CurrentTimeDisplay.prototype.handleEnded=function handleEnded(event){if(!this.player_.duration()){return;}this.updateFormattedTime_(this.player_.duration());};return CurrentTimeDisplay;}(TimeDisplay);/**
 * The text that is added to the `CurrentTimeDisplay` for screen reader users.
 *
 * @type {string}
 * @private
 */CurrentTimeDisplay.prototype.labelText_='Current Time';/**
 * The text that should display over the `CurrentTimeDisplay`s controls. Added to for localization.
 *
 * @type {string}
 * @private
 *
 * @deprecated in v7; controlText_ is not used in non-active display Components
 */CurrentTimeDisplay.prototype.controlText_='Current Time';Component.registerComponent('CurrentTimeDisplay',CurrentTimeDisplay);/**
 * @file duration-display.js
 */ /**
 * Displays the duration
 *
 * @extends Component
 */var DurationDisplay=function(_TimeDisplay){inherits(DurationDisplay,_TimeDisplay);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function DurationDisplay(player,options){classCallCheck(this,DurationDisplay);// we do not want to/need to throttle duration changes,
// as they should always display the changed duration as
// it has changed
var _this=possibleConstructorReturn(this,_TimeDisplay.call(this,player,options));_this.on(player,'durationchange',_this.updateContent);// Also listen for timeupdate (in the parent) and loadedmetadata because removing those
// listeners could have broken dependent applications/libraries. These
// can likely be removed for 7.0.
_this.on(player,'loadedmetadata',_this.throttledUpdateContent);return _this;}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */DurationDisplay.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-duration';};/**
   * Update duration time display.
   *
   * @param {EventTarget~Event} [event]
   *        The `durationchange`, `timeupdate`, or `loadedmetadata` event that caused
   *        this function to be called.
   *
   * @listens Player#durationchange
   * @listens Player#timeupdate
   * @listens Player#loadedmetadata
   */DurationDisplay.prototype.updateContent=function updateContent(event){var duration=this.player_.duration();if(duration&&this.duration_!==duration){this.duration_=duration;this.updateFormattedTime_(duration);}};return DurationDisplay;}(TimeDisplay);/**
 * The text that is added to the `DurationDisplay` for screen reader users.
 *
 * @type {string}
 * @private
 */DurationDisplay.prototype.labelText_='Duration';/**
 * The text that should display over the `DurationDisplay`s controls. Added to for localization.
 *
 * @type {string}
 * @private
 *
 * @deprecated in v7; controlText_ is not used in non-active display Components
 */DurationDisplay.prototype.controlText_='Duration';Component.registerComponent('DurationDisplay',DurationDisplay);/**
 * @file time-divider.js
 */ /**
 * The separator between the current time and duration.
 * Can be hidden if it's not needed in the design.
 *
 * @extends Component
 */var TimeDivider=function(_Component){inherits(TimeDivider,_Component);function TimeDivider(){classCallCheck(this,TimeDivider);return possibleConstructorReturn(this,_Component.apply(this,arguments));}/**
   * Create the component's DOM element
   *
   * @return {Element}
   *         The element that was created.
   */TimeDivider.prototype.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-time-control vjs-time-divider',innerHTML:'<div><span>/</span></div>'});};return TimeDivider;}(Component);Component.registerComponent('TimeDivider',TimeDivider);/**
 * @file remaining-time-display.js
 */ /**
 * Displays the time left in the video
 *
 * @extends Component
 */var RemainingTimeDisplay=function(_TimeDisplay){inherits(RemainingTimeDisplay,_TimeDisplay);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function RemainingTimeDisplay(player,options){classCallCheck(this,RemainingTimeDisplay);var _this=possibleConstructorReturn(this,_TimeDisplay.call(this,player,options));_this.on(player,'durationchange',_this.throttledUpdateContent);_this.on(player,'ended',_this.handleEnded);return _this;}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */RemainingTimeDisplay.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-remaining-time';};/**
   * The remaining time display prefixes numbers with a "minus" character.
   *
   * @param  {number} time
   *         A numeric time, in seconds.
   *
   * @return {string}
   *         A formatted time
   *
   * @private
   */RemainingTimeDisplay.prototype.formatTime_=function formatTime_(time){// TODO: The "-" should be decorative, and not announced by a screen reader
return '-'+_TimeDisplay.prototype.formatTime_.call(this,time);};/**
   * Update remaining time display.
   *
   * @param {EventTarget~Event} [event]
   *        The `timeupdate` or `durationchange` event that caused this to run.
   *
   * @listens Player#timeupdate
   * @listens Player#durationchange
   */RemainingTimeDisplay.prototype.updateContent=function updateContent(event){if(!this.player_.duration()){return;}// @deprecated We should only use remainingTimeDisplay
// as of video.js 7
if(this.player_.remainingTimeDisplay){this.updateFormattedTime_(this.player_.remainingTimeDisplay());}else {this.updateFormattedTime_(this.player_.remainingTime());}};/**
   * When the player fires ended there should be no time left. Sadly
   * this is not always the case, lets make it seem like that is the case
   * for users.
   *
   * @param {EventTarget~Event} [event]
   *        The `ended` event that caused this to run.
   *
   * @listens Player#ended
   */RemainingTimeDisplay.prototype.handleEnded=function handleEnded(event){if(!this.player_.duration()){return;}this.updateFormattedTime_(0);};return RemainingTimeDisplay;}(TimeDisplay);/**
 * The text that is added to the `RemainingTimeDisplay` for screen reader users.
 *
 * @type {string}
 * @private
 */RemainingTimeDisplay.prototype.labelText_='Remaining Time';/**
 * The text that should display over the `RemainingTimeDisplay`s controls. Added to for localization.
 *
 * @type {string}
 * @private
 *
 * @deprecated in v7; controlText_ is not used in non-active display Components
 */RemainingTimeDisplay.prototype.controlText_='Remaining Time';Component.registerComponent('RemainingTimeDisplay',RemainingTimeDisplay);/**
 * @file live-display.js
 */ // TODO - Future make it click to snap to live
/**
 * Displays the live indicator when duration is Infinity.
 *
 * @extends Component
 */var LiveDisplay=function(_Component){inherits(LiveDisplay,_Component);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function LiveDisplay(player,options){classCallCheck(this,LiveDisplay);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.updateShowing();_this.on(_this.player(),'durationchange',_this.updateShowing);return _this;}/**
   * Create the `Component`'s DOM element
   *
   * @return {Element}
   *         The element that was created.
   */LiveDisplay.prototype.createEl=function createEl$$1(){var el=_Component.prototype.createEl.call(this,'div',{className:'vjs-live-control vjs-control'});this.contentEl_=createEl('div',{className:'vjs-live-display',innerHTML:'<span class="vjs-control-text">'+this.localize('Stream Type')+'\xA0</span>'+this.localize('LIVE')},{'aria-live':'off'});el.appendChild(this.contentEl_);return el;};LiveDisplay.prototype.dispose=function dispose(){this.contentEl_=null;_Component.prototype.dispose.call(this);};/**
   * Check the duration to see if the LiveDisplay should be showing or not. Then show/hide
   * it accordingly
   *
   * @param {EventTarget~Event} [event]
   *        The {@link Player#durationchange} event that caused this function to run.
   *
   * @listens Player#durationchange
   */LiveDisplay.prototype.updateShowing=function updateShowing(event){if(this.player().duration()===Infinity){this.show();}else {this.hide();}};return LiveDisplay;}(Component);Component.registerComponent('LiveDisplay',LiveDisplay);/**
 * @file slider.js
 */ /**
 * The base functionality for a slider. Can be vertical or horizontal.
 * For instance the volume bar or the seek bar on a video is a slider.
 *
 * @extends Component
 */var Slider=function(_Component){inherits(Slider,_Component);/**
   * Create an instance of this class
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function Slider(player,options){classCallCheck(this,Slider);// Set property names to bar to match with the child Slider class is looking for
var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.bar=_this.getChild(_this.options_.barName);// Set a horizontal or vertical class on the slider depending on the slider type
_this.vertical(!!_this.options_.vertical);_this.enable();return _this;}/**
   * Are controls are currently enabled for this slider or not.
   *
   * @return {boolean}
   *         true if controls are enabled, false otherwise
   */Slider.prototype.enabled=function enabled(){return this.enabled_;};/**
   * Enable controls for this slider if they are disabled
   */Slider.prototype.enable=function enable(){if(this.enabled()){return;}this.on('mousedown',this.handleMouseDown);this.on('touchstart',this.handleMouseDown);this.on('focus',this.handleFocus);this.on('blur',this.handleBlur);this.on('click',this.handleClick);this.on(this.player_,'controlsvisible',this.update);if(this.playerEvent){this.on(this.player_,this.playerEvent,this.update);}this.removeClass('disabled');this.setAttribute('tabindex',0);this.enabled_=true;};/**
   * Disable controls for this slider if they are enabled
   */Slider.prototype.disable=function disable(){if(!this.enabled()){return;}var doc=this.bar.el_.ownerDocument;this.off('mousedown',this.handleMouseDown);this.off('touchstart',this.handleMouseDown);this.off('focus',this.handleFocus);this.off('blur',this.handleBlur);this.off('click',this.handleClick);this.off(this.player_,'controlsvisible',this.update);this.off(doc,'mousemove',this.handleMouseMove);this.off(doc,'mouseup',this.handleMouseUp);this.off(doc,'touchmove',this.handleMouseMove);this.off(doc,'touchend',this.handleMouseUp);this.removeAttribute('tabindex');this.addClass('disabled');if(this.playerEvent){this.off(this.player_,this.playerEvent,this.update);}this.enabled_=false;};/**
   * Create the `Button`s DOM element.
   *
   * @param {string} type
   *        Type of element to create.
   *
   * @param {Object} [props={}]
   *        List of properties in Object form.
   *
   * @param {Object} [attributes={}]
   *        list of attributes in Object form.
   *
   * @return {Element}
   *         The element that gets created.
   */Slider.prototype.createEl=function createEl$$1(type){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var attributes=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};// Add the slider element class to all sub classes
props.className=props.className+' vjs-slider';props=assign({tabIndex:0},props);attributes=assign({'role':'slider','aria-valuenow':0,'aria-valuemin':0,'aria-valuemax':100,'tabIndex':0},attributes);return _Component.prototype.createEl.call(this,type,props,attributes);};/**
   * Handle `mousedown` or `touchstart` events on the `Slider`.
   *
   * @param {EventTarget~Event} event
   *        `mousedown` or `touchstart` event that triggered this function
   *
   * @listens mousedown
   * @listens touchstart
   * @fires Slider#slideractive
   */Slider.prototype.handleMouseDown=function handleMouseDown(event){var doc=this.bar.el_.ownerDocument;if(event.type==='mousedown'){event.preventDefault();}// Do not call preventDefault() on touchstart in Chrome
// to avoid console warnings. Use a 'touch-action: none' style
// instead to prevent unintented scrolling.
// https://developers.google.com/web/updates/2017/01/scrolling-intervention
if(event.type==='touchstart'&&!IS_CHROME){event.preventDefault();}blockTextSelection();this.addClass('vjs-sliding');/**
     * Triggered when the slider is in an active state
     *
     * @event Slider#slideractive
     * @type {EventTarget~Event}
     */this.trigger('slideractive');this.on(doc,'mousemove',this.handleMouseMove);this.on(doc,'mouseup',this.handleMouseUp);this.on(doc,'touchmove',this.handleMouseMove);this.on(doc,'touchend',this.handleMouseUp);this.handleMouseMove(event);};/**
   * Handle the `mousemove`, `touchmove`, and `mousedown` events on this `Slider`.
   * The `mousemove` and `touchmove` events will only only trigger this function during
   * `mousedown` and `touchstart`. This is due to {@link Slider#handleMouseDown} and
   * {@link Slider#handleMouseUp}.
   *
   * @param {EventTarget~Event} event
   *        `mousedown`, `mousemove`, `touchstart`, or `touchmove` event that triggered
   *        this function
   *
   * @listens mousemove
   * @listens touchmove
   */Slider.prototype.handleMouseMove=function handleMouseMove(event){};/**
   * Handle `mouseup` or `touchend` events on the `Slider`.
   *
   * @param {EventTarget~Event} event
   *        `mouseup` or `touchend` event that triggered this function.
   *
   * @listens touchend
   * @listens mouseup
   * @fires Slider#sliderinactive
   */Slider.prototype.handleMouseUp=function handleMouseUp(){var doc=this.bar.el_.ownerDocument;unblockTextSelection();this.removeClass('vjs-sliding');/**
     * Triggered when the slider is no longer in an active state.
     *
     * @event Slider#sliderinactive
     * @type {EventTarget~Event}
     */this.trigger('sliderinactive');this.off(doc,'mousemove',this.handleMouseMove);this.off(doc,'mouseup',this.handleMouseUp);this.off(doc,'touchmove',this.handleMouseMove);this.off(doc,'touchend',this.handleMouseUp);this.update();};/**
   * Update the progress bar of the `Slider`.
   *
   * @returns {number}
   *          The percentage of progress the progress bar represents as a
   *          number from 0 to 1.
   */Slider.prototype.update=function update(){// In VolumeBar init we have a setTimeout for update that pops and update
// to the end of the execution stack. The player is destroyed before then
// update will cause an error
if(!this.el_){return;}// If scrubbing, we could use a cached value to make the handle keep up
// with the user's mouse. On HTML5 browsers scrubbing is really smooth, but
// some flash players are slow, so we might want to utilize this later.
// var progress =  (this.player_.scrubbing()) ? this.player_.getCache().currentTime / this.player_.duration() : this.player_.currentTime() / this.player_.duration();
var progress=this.getPercent();var bar=this.bar;// If there's no bar...
if(!bar){return;}// Protect against no duration and other division issues
if(typeof progress!=='number'||progress!==progress||progress<0||progress===Infinity){progress=0;}// Convert to a percentage for setting
var percentage=(progress*100).toFixed(2)+'%';var style=bar.el().style;// Set the new bar width or height
if(this.vertical()){style.height=percentage;}else {style.width=percentage;}return progress;};/**
   * Calculate distance for slider
   *
   * @param {EventTarget~Event} event
   *        The event that caused this function to run.
   *
   * @return {number}
   *         The current position of the Slider.
   *         - postition.x for vertical `Slider`s
   *         - postition.y for horizontal `Slider`s
   */Slider.prototype.calculateDistance=function calculateDistance(event){var position=getPointerPosition(this.el_,event);if(this.vertical()){return position.y;}return position.x;};/**
   * Handle a `focus` event on this `Slider`.
   *
   * @param {EventTarget~Event} event
   *        The `focus` event that caused this function to run.
   *
   * @listens focus
   */Slider.prototype.handleFocus=function handleFocus(){this.on(this.bar.el_.ownerDocument,'keydown',this.handleKeyPress);};/**
   * Handle a `keydown` event on the `Slider`. Watches for left, rigth, up, and down
   * arrow keys. This function will only be called when the slider has focus. See
   * {@link Slider#handleFocus} and {@link Slider#handleBlur}.
   *
   * @param {EventTarget~Event} event
   *        the `keydown` event that caused this function to run.
   *
   * @listens keydown
   */Slider.prototype.handleKeyPress=function handleKeyPress(event){// Left and Down Arrows
if(event.which===37||event.which===40){event.preventDefault();this.stepBack();// Up and Right Arrows
}else if(event.which===38||event.which===39){event.preventDefault();this.stepForward();}};/**
   * Handle a `blur` event on this `Slider`.
   *
   * @param {EventTarget~Event} event
   *        The `blur` event that caused this function to run.
   *
   * @listens blur
   */Slider.prototype.handleBlur=function handleBlur(){this.off(this.bar.el_.ownerDocument,'keydown',this.handleKeyPress);};/**
   * Listener for click events on slider, used to prevent clicks
   *   from bubbling up to parent elements like button menus.
   *
   * @param {Object} event
   *        Event that caused this object to run
   */Slider.prototype.handleClick=function handleClick(event){event.stopImmediatePropagation();event.preventDefault();};/**
   * Get/set if slider is horizontal for vertical
   *
   * @param {boolean} [bool]
   *        - true if slider is vertical,
   *        - false is horizontal
   *
   * @return {boolean}
   *         - true if slider is vertical, and getting
   *         - false if the slider is horizontal, and getting
   */Slider.prototype.vertical=function vertical(bool){if(bool===undefined){return this.vertical_||false;}this.vertical_=!!bool;if(this.vertical_){this.addClass('vjs-slider-vertical');}else {this.addClass('vjs-slider-horizontal');}};return Slider;}(Component);Component.registerComponent('Slider',Slider);/**
 * @file load-progress-bar.js
 */ /**
 * Shows loading progress
 *
 * @extends Component
 */var LoadProgressBar=function(_Component){inherits(LoadProgressBar,_Component);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function LoadProgressBar(player,options){classCallCheck(this,LoadProgressBar);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.partEls_=[];_this.on(player,'progress',_this.update);return _this;}/**
   * Create the `Component`'s DOM element
   *
   * @return {Element}
   *         The element that was created.
   */LoadProgressBar.prototype.createEl=function createEl$$1(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-load-progress',innerHTML:'<span class="vjs-control-text"><span>'+this.localize('Loaded')+'</span>: 0%</span>'});};LoadProgressBar.prototype.dispose=function dispose(){this.partEls_=null;_Component.prototype.dispose.call(this);};/**
   * Update progress bar
   *
   * @param {EventTarget~Event} [event]
   *        The `progress` event that caused this function to run.
   *
   * @listens Player#progress
   */LoadProgressBar.prototype.update=function update(event){var buffered=this.player_.buffered();var duration=this.player_.duration();var bufferedEnd=this.player_.bufferedEnd();var children=this.partEls_;// get the percent width of a time compared to the total end
var percentify=function percentify(time,end){// no NaN
var percent=time/end||0;return (percent>=1?1:percent)*100+'%';};// update the width of the progress bar
this.el_.style.width=percentify(bufferedEnd,duration);// add child elements to represent the individual buffered time ranges
for(var i=0;i<buffered.length;i++){var start=buffered.start(i);var end=buffered.end(i);var part=children[i];if(!part){part=this.el_.appendChild(createEl());children[i]=part;}// set the percent based on the width of the progress bar (bufferedEnd)
part.style.left=percentify(start,bufferedEnd);part.style.width=percentify(end-start,bufferedEnd);}// remove unused buffered range elements
for(var _i=children.length;_i>buffered.length;_i--){this.el_.removeChild(children[_i-1]);}children.length=buffered.length;};return LoadProgressBar;}(Component);Component.registerComponent('LoadProgressBar',LoadProgressBar);/**
 * @file time-tooltip.js
 */ /**
 * Time tooltips display a time above the progress bar.
 *
 * @extends Component
 */var TimeTooltip=function(_Component){inherits(TimeTooltip,_Component);function TimeTooltip(){classCallCheck(this,TimeTooltip);return possibleConstructorReturn(this,_Component.apply(this,arguments));}/**
   * Create the time tooltip DOM element
   *
   * @return {Element}
   *         The element that was created.
   */TimeTooltip.prototype.createEl=function createEl$$1(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-time-tooltip'});};/**
   * Updates the position of the time tooltip relative to the `SeekBar`.
   *
   * @param {Object} seekBarRect
   *        The `ClientRect` for the {@link SeekBar} element.
   *
   * @param {number} seekBarPoint
   *        A number from 0 to 1, representing a horizontal reference point
   *        from the left edge of the {@link SeekBar}
   */TimeTooltip.prototype.update=function update(seekBarRect,seekBarPoint,content){var tooltipRect=getBoundingClientRect(this.el_);var playerRect=getBoundingClientRect(this.player_.el());var seekBarPointPx=seekBarRect.width*seekBarPoint;// do nothing if either rect isn't available
// for example, if the player isn't in the DOM for testing
if(!playerRect||!tooltipRect){return;}// This is the space left of the `seekBarPoint` available within the bounds
// of the player. We calculate any gap between the left edge of the player
// and the left edge of the `SeekBar` and add the number of pixels in the
// `SeekBar` before hitting the `seekBarPoint`
var spaceLeftOfPoint=seekBarRect.left-playerRect.left+seekBarPointPx;// This is the space right of the `seekBarPoint` available within the bounds
// of the player. We calculate the number of pixels from the `seekBarPoint`
// to the right edge of the `SeekBar` and add to that any gap between the
// right edge of the `SeekBar` and the player.
var spaceRightOfPoint=seekBarRect.width-seekBarPointPx+(playerRect.right-seekBarRect.right);// This is the number of pixels by which the tooltip will need to be pulled
// further to the right to center it over the `seekBarPoint`.
var pullTooltipBy=tooltipRect.width/2;// Adjust the `pullTooltipBy` distance to the left or right depending on
// the results of the space calculations above.
if(spaceLeftOfPoint<pullTooltipBy){pullTooltipBy+=pullTooltipBy-spaceLeftOfPoint;}else if(spaceRightOfPoint<pullTooltipBy){pullTooltipBy=spaceRightOfPoint;}// Due to the imprecision of decimal/ratio based calculations and varying
// rounding behaviors, there are cases where the spacing adjustment is off
// by a pixel or two. This adds insurance to these calculations.
if(pullTooltipBy<0){pullTooltipBy=0;}else if(pullTooltipBy>tooltipRect.width){pullTooltipBy=tooltipRect.width;}this.el_.style.right='-'+pullTooltipBy+'px';textContent(this.el_,content);};return TimeTooltip;}(Component);Component.registerComponent('TimeTooltip',TimeTooltip);/**
 * @file play-progress-bar.js
 */ /**
 * Used by {@link SeekBar} to display media playback progress as part of the
 * {@link ProgressControl}.
 *
 * @extends Component
 */var PlayProgressBar=function(_Component){inherits(PlayProgressBar,_Component);function PlayProgressBar(){classCallCheck(this,PlayProgressBar);return possibleConstructorReturn(this,_Component.apply(this,arguments));}/**
   * Create the the DOM element for this class.
   *
   * @return {Element}
   *         The element that was created.
   */PlayProgressBar.prototype.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-play-progress vjs-slider-bar',innerHTML:'<span class="vjs-control-text"><span>'+this.localize('Progress')+'</span>: 0%</span>'});};/**
   * Enqueues updates to its own DOM as well as the DOM of its
   * {@link TimeTooltip} child.
   *
   * @param {Object} seekBarRect
   *        The `ClientRect` for the {@link SeekBar} element.
   *
   * @param {number} seekBarPoint
   *        A number from 0 to 1, representing a horizontal reference point
   *        from the left edge of the {@link SeekBar}
   */PlayProgressBar.prototype.update=function update(seekBarRect,seekBarPoint){var _this2=this;// If there is an existing rAF ID, cancel it so we don't over-queue.
if(this.rafId_){this.cancelAnimationFrame(this.rafId_);}this.rafId_=this.requestAnimationFrame(function(){var time=_this2.player_.scrubbing()?_this2.player_.getCache().currentTime:_this2.player_.currentTime();var content=formatTime(time,_this2.player_.duration());var timeTooltip=_this2.getChild('timeTooltip');if(timeTooltip){timeTooltip.update(seekBarRect,seekBarPoint,content);}});};return PlayProgressBar;}(Component);/**
 * Default options for {@link PlayProgressBar}.
 *
 * @type {Object}
 * @private
 */PlayProgressBar.prototype.options_={children:[]};// Time tooltips should not be added to a player on mobile devices or IE8
if((!IE_VERSION||IE_VERSION>8)&&!IS_IOS&&!IS_ANDROID){PlayProgressBar.prototype.options_.children.push('timeTooltip');}Component.registerComponent('PlayProgressBar',PlayProgressBar);/**
 * @file mouse-time-display.js
 */ /**
 * The {@link MouseTimeDisplay} component tracks mouse movement over the
 * {@link ProgressControl}. It displays an indicator and a {@link TimeTooltip}
 * indicating the time which is represented by a given point in the
 * {@link ProgressControl}.
 *
 * @extends Component
 */var MouseTimeDisplay=function(_Component){inherits(MouseTimeDisplay,_Component);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The {@link Player} that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function MouseTimeDisplay(player,options){classCallCheck(this,MouseTimeDisplay);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.update=throttle(bind(_this,_this.update),25);return _this;}/**
   * Create the DOM element for this class.
   *
   * @return {Element}
   *         The element that was created.
   */MouseTimeDisplay.prototype.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-mouse-display'});};/**
   * Enqueues updates to its own DOM as well as the DOM of its
   * {@link TimeTooltip} child.
   *
   * @param {Object} seekBarRect
   *        The `ClientRect` for the {@link SeekBar} element.
   *
   * @param {number} seekBarPoint
   *        A number from 0 to 1, representing a horizontal reference point
   *        from the left edge of the {@link SeekBar}
   */MouseTimeDisplay.prototype.update=function update(seekBarRect,seekBarPoint){var _this2=this;// If there is an existing rAF ID, cancel it so we don't over-queue.
if(this.rafId_){this.cancelAnimationFrame(this.rafId_);}this.rafId_=this.requestAnimationFrame(function(){var duration=_this2.player_.duration();var content=formatTime(seekBarPoint*duration,duration);_this2.el_.style.left=seekBarRect.width*seekBarPoint+'px';_this2.getChild('timeTooltip').update(seekBarRect,seekBarPoint,content);});};return MouseTimeDisplay;}(Component);/**
 * Default options for `MouseTimeDisplay`
 *
 * @type {Object}
 * @private
 */MouseTimeDisplay.prototype.options_={children:['timeTooltip']};Component.registerComponent('MouseTimeDisplay',MouseTimeDisplay);/**
 * @file seek-bar.js
 */ // The number of seconds the `step*` functions move the timeline.
var STEP_SECONDS=5;// The interval at which the bar should update as it progresses.
var UPDATE_REFRESH_INTERVAL=30;/**
 * Seek bar and container for the progress bars. Uses {@link PlayProgressBar}
 * as its `bar`.
 *
 * @extends Slider
 */var SeekBar=function(_Slider){inherits(SeekBar,_Slider);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function SeekBar(player,options){classCallCheck(this,SeekBar);var _this=possibleConstructorReturn(this,_Slider.call(this,player,options));_this.setEventHandlers_();return _this;}/**
   * Sets the event handlers
   *
   * @private
   */SeekBar.prototype.setEventHandlers_=function setEventHandlers_(){var _this2=this;this.update=throttle(bind(this,this.update),UPDATE_REFRESH_INTERVAL);this.on(this.player_,'timeupdate',this.update);this.on(this.player_,'ended',this.handleEnded);// when playing, let's ensure we smoothly update the play progress bar
// via an interval
this.updateInterval=null;this.on(this.player_,['playing'],function(){_this2.clearInterval(_this2.updateInterval);_this2.updateInterval=_this2.setInterval(function(){_this2.requestAnimationFrame(function(){_this2.update();});},UPDATE_REFRESH_INTERVAL);});this.on(this.player_,['ended','pause','waiting'],function(){_this2.clearInterval(_this2.updateInterval);});this.on(this.player_,['timeupdate','ended'],this.update);};/**
   * Create the `Component`'s DOM element
   *
   * @return {Element}
   *         The element that was created.
   */SeekBar.prototype.createEl=function createEl$$1(){return _Slider.prototype.createEl.call(this,'div',{className:'vjs-progress-holder'},{'aria-label':this.localize('Progress Bar')});};/**
   * This function updates the play progress bar and accessiblity
   * attributes to whatever is passed in.
   *
   * @param {number} currentTime
   *        The currentTime value that should be used for accessiblity
   *
   * @param {number} percent
   *        The percentage as a decimal that the bar should be filled from 0-1.
   *
   * @private
   */SeekBar.prototype.update_=function update_(currentTime,percent){var duration=this.player_.duration();// machine readable value of progress bar (percentage complete)
this.el_.setAttribute('aria-valuenow',(percent*100).toFixed(2));// human readable value of progress bar (time complete)
this.el_.setAttribute('aria-valuetext',this.localize('progress bar timing: currentTime={1} duration={2}',[formatTime(currentTime,duration),formatTime(duration,duration)],'{1} of {2}'));// Update the `PlayProgressBar`.
this.bar.update(getBoundingClientRect(this.el_),percent);};/**
   * Update the seek bar's UI.
   *
   * @param {EventTarget~Event} [event]
   *        The `timeupdate` or `ended` event that caused this to run.
   *
   * @listens Player#timeupdate
   *
   * @returns {number}
   *          The current percent at a number from 0-1
   */SeekBar.prototype.update=function update(event){var percent=_Slider.prototype.update.call(this);this.update_(this.getCurrentTime_(),percent);return percent;};/**
   * Get the value of current time but allows for smooth scrubbing,
   * when player can't keep up.
   *
   * @return {number}
   *         The current time value to display
   *
   * @private
   */SeekBar.prototype.getCurrentTime_=function getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();};/**
   * We want the seek bar to be full on ended
   * no matter what the actual internal values are. so we force it.
   *
   * @param {EventTarget~Event} [event]
   *        The `timeupdate` or `ended` event that caused this to run.
   *
   * @listens Player#ended
   */SeekBar.prototype.handleEnded=function handleEnded(event){this.update_(this.player_.duration(),1);};/**
   * Get the percentage of media played so far.
   *
   * @return {number}
   *         The percentage of media played so far (0 to 1).
   */SeekBar.prototype.getPercent=function getPercent(){var percent=this.getCurrentTime_()/this.player_.duration();return percent>=1?1:percent;};/**
   * Handle mouse down on seek bar
   *
   * @param {EventTarget~Event} event
   *        The `mousedown` event that caused this to run.
   *
   * @listens mousedown
   */SeekBar.prototype.handleMouseDown=function handleMouseDown(event){if(!isSingleLeftClick(event)){return;}// Stop event propagation to prevent double fire in progress-control.js
event.stopPropagation();this.player_.scrubbing(true);this.videoWasPlaying=!this.player_.paused();this.player_.pause();_Slider.prototype.handleMouseDown.call(this,event);};/**
   * Handle mouse move on seek bar
   *
   * @param {EventTarget~Event} event
   *        The `mousemove` event that caused this to run.
   *
   * @listens mousemove
   */SeekBar.prototype.handleMouseMove=function handleMouseMove(event){if(!isSingleLeftClick(event)){return;}var newTime=this.calculateDistance(event)*this.player_.duration();// Don't let video end while scrubbing.
if(newTime===this.player_.duration()){newTime=newTime-0.1;}// Set new time (tell player to seek to new time)
this.player_.currentTime(newTime);};SeekBar.prototype.enable=function enable(){_Slider.prototype.enable.call(this);var mouseTimeDisplay=this.getChild('mouseTimeDisplay');if(!mouseTimeDisplay){return;}mouseTimeDisplay.show();};SeekBar.prototype.disable=function disable(){_Slider.prototype.disable.call(this);var mouseTimeDisplay=this.getChild('mouseTimeDisplay');if(!mouseTimeDisplay){return;}mouseTimeDisplay.hide();};/**
   * Handle mouse up on seek bar
   *
   * @param {EventTarget~Event} event
   *        The `mouseup` event that caused this to run.
   *
   * @listens mouseup
   */SeekBar.prototype.handleMouseUp=function handleMouseUp(event){_Slider.prototype.handleMouseUp.call(this,event);// Stop event propagation to prevent double fire in progress-control.js
if(event){event.stopPropagation();}this.player_.scrubbing(false);/**
     * Trigger timeupdate because we're done seeking and the time has changed.
     * This is particularly useful for if the player is paused to time the time displays.
     *
     * @event Tech#timeupdate
     * @type {EventTarget~Event}
     */this.player_.trigger({type:'timeupdate',target:this,manuallyTriggered:true});if(this.videoWasPlaying){silencePromise(this.player_.play());}};/**
   * Move more quickly fast forward for keyboard-only users
   */SeekBar.prototype.stepForward=function stepForward(){this.player_.currentTime(this.player_.currentTime()+STEP_SECONDS);};/**
   * Move more quickly rewind for keyboard-only users
   */SeekBar.prototype.stepBack=function stepBack(){this.player_.currentTime(this.player_.currentTime()-STEP_SECONDS);};/**
   * Toggles the playback state of the player
   * This gets called when enter or space is used on the seekbar
   *
   * @param {EventTarget~Event} event
   *        The `keydown` event that caused this function to be called
   *
   */SeekBar.prototype.handleAction=function handleAction(event){if(this.player_.paused()){this.player_.play();}else {this.player_.pause();}};/**
   * Called when this SeekBar has focus and a key gets pressed down. By
   * default it will call `this.handleAction` when the key is space or enter.
   *
   * @param {EventTarget~Event} event
   *        The `keydown` event that caused this function to be called.
   *
   * @listens keydown
   */SeekBar.prototype.handleKeyPress=function handleKeyPress(event){// Support Space (32) or Enter (13) key operation to fire a click event
if(event.which===32||event.which===13){event.preventDefault();this.handleAction(event);}else if(_Slider.prototype.handleKeyPress){// Pass keypress handling up for unsupported keys
_Slider.prototype.handleKeyPress.call(this,event);}};return SeekBar;}(Slider);/**
 * Default options for the `SeekBar`
 *
 * @type {Object}
 * @private
 */SeekBar.prototype.options_={children:['loadProgressBar','playProgressBar'],barName:'playProgressBar'};// MouseTimeDisplay tooltips should not be added to a player on mobile devices or IE8
if((!IE_VERSION||IE_VERSION>8)&&!IS_IOS&&!IS_ANDROID){SeekBar.prototype.options_.children.splice(1,0,'mouseTimeDisplay');}/**
 * Call the update event for this Slider when this event happens on the player.
 *
 * @type {string}
 */SeekBar.prototype.playerEvent='timeupdate';Component.registerComponent('SeekBar',SeekBar);/**
 * @file progress-control.js
 */ /**
 * The Progress Control component contains the seek bar, load progress,
 * and play progress.
 *
 * @extends Component
 */var ProgressControl=function(_Component){inherits(ProgressControl,_Component);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function ProgressControl(player,options){classCallCheck(this,ProgressControl);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.handleMouseMove=throttle(bind(_this,_this.handleMouseMove),25);_this.throttledHandleMouseSeek=throttle(bind(_this,_this.handleMouseSeek),25);_this.enable();return _this;}/**
   * Create the `Component`'s DOM element
   *
   * @return {Element}
   *         The element that was created.
   */ProgressControl.prototype.createEl=function createEl$$1(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-progress-control vjs-control'});};/**
   * When the mouse moves over the `ProgressControl`, the pointer position
   * gets passed down to the `MouseTimeDisplay` component.
   *
   * @param {EventTarget~Event} event
   *        The `mousemove` event that caused this function to run.
   *
   * @listen mousemove
   */ProgressControl.prototype.handleMouseMove=function handleMouseMove(event){var seekBar=this.getChild('seekBar');if(seekBar){var mouseTimeDisplay=seekBar.getChild('mouseTimeDisplay');var seekBarEl=seekBar.el();var seekBarRect=getBoundingClientRect(seekBarEl);var seekBarPoint=getPointerPosition(seekBarEl,event).x;// The default skin has a gap on either side of the `SeekBar`. This means
// that it's possible to trigger this behavior outside the boundaries of
// the `SeekBar`. This ensures we stay within it at all times.
if(seekBarPoint>1){seekBarPoint=1;}else if(seekBarPoint<0){seekBarPoint=0;}if(mouseTimeDisplay){mouseTimeDisplay.update(seekBarRect,seekBarPoint);}}};/**
   * A throttled version of the {@link ProgressControl#handleMouseSeek} listener.
   *
   * @method ProgressControl#throttledHandleMouseSeek
   * @param {EventTarget~Event} event
   *        The `mousemove` event that caused this function to run.
   *
   * @listen mousemove
   * @listen touchmove
   */ /**
   * Handle `mousemove` or `touchmove` events on the `ProgressControl`.
   *
   * @param {EventTarget~Event} event
   *        `mousedown` or `touchstart` event that triggered this function
   *
   * @listens mousemove
   * @listens touchmove
   */ProgressControl.prototype.handleMouseSeek=function handleMouseSeek(event){var seekBar=this.getChild('seekBar');if(seekBar){seekBar.handleMouseMove(event);}};/**
   * Are controls are currently enabled for this progress control.
   *
   * @return {boolean}
   *         true if controls are enabled, false otherwise
   */ProgressControl.prototype.enabled=function enabled(){return this.enabled_;};/**
   * Disable all controls on the progress control and its children
   */ProgressControl.prototype.disable=function disable(){this.children().forEach(function(child){return child.disable&&child.disable();});if(!this.enabled()){return;}this.off(['mousedown','touchstart'],this.handleMouseDown);this.off(this.el_,'mousemove',this.handleMouseMove);this.handleMouseUp();this.addClass('disabled');this.enabled_=false;};/**
   * Enable all controls on the progress control and its children
   */ProgressControl.prototype.enable=function enable(){this.children().forEach(function(child){return child.enable&&child.enable();});if(this.enabled()){return;}this.on(['mousedown','touchstart'],this.handleMouseDown);this.on(this.el_,'mousemove',this.handleMouseMove);this.removeClass('disabled');this.enabled_=true;};/**
   * Handle `mousedown` or `touchstart` events on the `ProgressControl`.
   *
   * @param {EventTarget~Event} event
   *        `mousedown` or `touchstart` event that triggered this function
   *
   * @listens mousedown
   * @listens touchstart
   */ProgressControl.prototype.handleMouseDown=function handleMouseDown(event){var doc=this.el_.ownerDocument;var seekBar=this.getChild('seekBar');if(seekBar){seekBar.handleMouseDown(event);}this.on(doc,'mousemove',this.throttledHandleMouseSeek);this.on(doc,'touchmove',this.throttledHandleMouseSeek);this.on(doc,'mouseup',this.handleMouseUp);this.on(doc,'touchend',this.handleMouseUp);};/**
   * Handle `mouseup` or `touchend` events on the `ProgressControl`.
   *
   * @param {EventTarget~Event} event
   *        `mouseup` or `touchend` event that triggered this function.
   *
   * @listens touchend
   * @listens mouseup
   */ProgressControl.prototype.handleMouseUp=function handleMouseUp(event){var doc=this.el_.ownerDocument;var seekBar=this.getChild('seekBar');if(seekBar){seekBar.handleMouseUp(event);}this.off(doc,'mousemove',this.throttledHandleMouseSeek);this.off(doc,'touchmove',this.throttledHandleMouseSeek);this.off(doc,'mouseup',this.handleMouseUp);this.off(doc,'touchend',this.handleMouseUp);};return ProgressControl;}(Component);/**
 * Default options for `ProgressControl`
 *
 * @type {Object}
 * @private
 */ProgressControl.prototype.options_={children:['seekBar']};Component.registerComponent('ProgressControl',ProgressControl);/**
 * @file fullscreen-toggle.js
 */ /**
 * Toggle fullscreen video
 *
 * @extends Button
 */var FullscreenToggle=function(_Button){inherits(FullscreenToggle,_Button);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function FullscreenToggle(player,options){classCallCheck(this,FullscreenToggle);var _this=possibleConstructorReturn(this,_Button.call(this,player,options));_this.on(player,'fullscreenchange',_this.handleFullscreenChange);if(document$1[FullscreenApi.fullscreenEnabled]===false){_this.disable();}return _this;}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */FullscreenToggle.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-fullscreen-control '+_Button.prototype.buildCSSClass.call(this);};/**
   * Handles fullscreenchange on the player and change control text accordingly.
   *
   * @param {EventTarget~Event} [event]
   *        The {@link Player#fullscreenchange} event that caused this function to be
   *        called.
   *
   * @listens Player#fullscreenchange
   */FullscreenToggle.prototype.handleFullscreenChange=function handleFullscreenChange(event){if(this.player_.isFullscreen()){this.controlText('Non-Fullscreen');}else {this.controlText('Fullscreen');}};/**
   * This gets called when an `FullscreenToggle` is "clicked". See
   * {@link ClickableComponent} for more detailed information on what a click can be.
   *
   * @param {EventTarget~Event} [event]
   *        The `keydown`, `tap`, or `click` event that caused this function to be
   *        called.
   *
   * @listens tap
   * @listens click
   */FullscreenToggle.prototype.handleClick=function handleClick(event){if(!this.player_.isFullscreen()){this.player_.requestFullscreen();}else {this.player_.exitFullscreen();}};return FullscreenToggle;}(Button);/**
 * The text that should display over the `FullscreenToggle`s controls. Added for localization.
 *
 * @type {string}
 * @private
 */FullscreenToggle.prototype.controlText_='Fullscreen';Component.registerComponent('FullscreenToggle',FullscreenToggle);/**
 * Check if volume control is supported and if it isn't hide the
 * `Component` that was passed  using the `vjs-hidden` class.
 *
 * @param {Component} self
 *        The component that should be hidden if volume is unsupported
 *
 * @param {Player} player
 *        A reference to the player
 *
 * @private
 */var checkVolumeSupport=function checkVolumeSupport(self,player){// hide volume controls when they're not supported by the current tech
if(player.tech_&&!player.tech_.featuresVolumeControl){self.addClass('vjs-hidden');}self.on(player,'loadstart',function(){if(!player.tech_.featuresVolumeControl){self.addClass('vjs-hidden');}else {self.removeClass('vjs-hidden');}});};/**
 * @file volume-level.js
 */ /**
 * Shows volume level
 *
 * @extends Component
 */var VolumeLevel=function(_Component){inherits(VolumeLevel,_Component);function VolumeLevel(){classCallCheck(this,VolumeLevel);return possibleConstructorReturn(this,_Component.apply(this,arguments));}/**
   * Create the `Component`'s DOM element
   *
   * @return {Element}
   *         The element that was created.
   */VolumeLevel.prototype.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-volume-level',innerHTML:'<span class="vjs-control-text"></span>'});};return VolumeLevel;}(Component);Component.registerComponent('VolumeLevel',VolumeLevel);/**
 * @file volume-bar.js
 */ // Required children
/**
 * The bar that contains the volume level and can be clicked on to adjust the level
 *
 * @extends Slider
 */var VolumeBar=function(_Slider){inherits(VolumeBar,_Slider);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function VolumeBar(player,options){classCallCheck(this,VolumeBar);var _this=possibleConstructorReturn(this,_Slider.call(this,player,options));_this.on('slideractive',_this.updateLastVolume_);_this.on(player,'volumechange',_this.updateARIAAttributes);player.ready(function(){return _this.updateARIAAttributes();});return _this;}/**
   * Create the `Component`'s DOM element
   *
   * @return {Element}
   *         The element that was created.
   */VolumeBar.prototype.createEl=function createEl$$1(){return _Slider.prototype.createEl.call(this,'div',{className:'vjs-volume-bar vjs-slider-bar'},{'aria-label':this.localize('Volume Level'),'aria-live':'polite'});};/**
   * Handle mouse down on volume bar
   *
   * @param {EventTarget~Event} event
   *        The `mousedown` event that caused this to run.
   *
   * @listens mousedown
   */VolumeBar.prototype.handleMouseDown=function handleMouseDown(event){if(!isSingleLeftClick(event)){return;}_Slider.prototype.handleMouseDown.call(this,event);};/**
   * Handle movement events on the {@link VolumeMenuButton}.
   *
   * @param {EventTarget~Event} event
   *        The event that caused this function to run.
   *
   * @listens mousemove
   */VolumeBar.prototype.handleMouseMove=function handleMouseMove(event){if(!isSingleLeftClick(event)){return;}this.checkMuted();this.player_.volume(this.calculateDistance(event));};/**
   * If the player is muted unmute it.
   */VolumeBar.prototype.checkMuted=function checkMuted(){if(this.player_.muted()){this.player_.muted(false);}};/**
   * Get percent of volume level
   *
   * @return {number}
   *         Volume level percent as a decimal number.
   */VolumeBar.prototype.getPercent=function getPercent(){if(this.player_.muted()){return 0;}return this.player_.volume();};/**
   * Increase volume level for keyboard users
   */VolumeBar.prototype.stepForward=function stepForward(){this.checkMuted();this.player_.volume(this.player_.volume()+0.1);};/**
   * Decrease volume level for keyboard users
   */VolumeBar.prototype.stepBack=function stepBack(){this.checkMuted();this.player_.volume(this.player_.volume()-0.1);};/**
   * Update ARIA accessibility attributes
   *
   * @param {EventTarget~Event} [event]
   *        The `volumechange` event that caused this function to run.
   *
   * @listens Player#volumechange
   */VolumeBar.prototype.updateARIAAttributes=function updateARIAAttributes(event){var ariaValue=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute('aria-valuenow',ariaValue);this.el_.setAttribute('aria-valuetext',ariaValue+'%');};/**
   * Returns the current value of the player volume as a percentage
   *
   * @private
   */VolumeBar.prototype.volumeAsPercentage_=function volumeAsPercentage_(){return Math.round(this.player_.volume()*100);};/**
   * When user starts dragging the VolumeBar, store the volume and listen for
   * the end of the drag. When the drag ends, if the volume was set to zero,
   * set lastVolume to the stored volume.
   *
   * @listens slideractive
   * @private
   */VolumeBar.prototype.updateLastVolume_=function updateLastVolume_(){var _this2=this;var volumeBeforeDrag=this.player_.volume();this.one('sliderinactive',function(){if(_this2.player_.volume()===0){_this2.player_.lastVolume_(volumeBeforeDrag);}});};return VolumeBar;}(Slider);/**
 * Default options for the `VolumeBar`
 *
 * @type {Object}
 * @private
 */VolumeBar.prototype.options_={children:['volumeLevel'],barName:'volumeLevel'};/**
 * Call the update event for this Slider when this event happens on the player.
 *
 * @type {string}
 */VolumeBar.prototype.playerEvent='volumechange';Component.registerComponent('VolumeBar',VolumeBar);/**
 * @file volume-control.js
 */ // Required children
/**
 * The component for controlling the volume level
 *
 * @extends Component
 */var VolumeControl=function(_Component){inherits(VolumeControl,_Component);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options={}]
   *        The key/value store of player options.
   */function VolumeControl(player){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};classCallCheck(this,VolumeControl);options.vertical=options.vertical||false;// Pass the vertical option down to the VolumeBar if
// the VolumeBar is turned on.
if(typeof options.volumeBar==='undefined'||isPlain(options.volumeBar)){options.volumeBar=options.volumeBar||{};options.volumeBar.vertical=options.vertical;}// hide this control if volume support is missing
var _this=possibleConstructorReturn(this,_Component.call(this,player,options));checkVolumeSupport(_this,player);_this.throttledHandleMouseMove=throttle(bind(_this,_this.handleMouseMove),25);_this.on('mousedown',_this.handleMouseDown);_this.on('touchstart',_this.handleMouseDown);// while the slider is active (the mouse has been pressed down and
// is dragging) or in focus we do not want to hide the VolumeBar
_this.on(_this.volumeBar,['focus','slideractive'],function(){_this.volumeBar.addClass('vjs-slider-active');_this.addClass('vjs-slider-active');_this.trigger('slideractive');});_this.on(_this.volumeBar,['blur','sliderinactive'],function(){_this.volumeBar.removeClass('vjs-slider-active');_this.removeClass('vjs-slider-active');_this.trigger('sliderinactive');});return _this;}/**
   * Create the `Component`'s DOM element
   *
   * @return {Element}
   *         The element that was created.
   */VolumeControl.prototype.createEl=function createEl(){var orientationClass='vjs-volume-horizontal';if(this.options_.vertical){orientationClass='vjs-volume-vertical';}return _Component.prototype.createEl.call(this,'div',{className:'vjs-volume-control vjs-control '+orientationClass});};/**
   * Handle `mousedown` or `touchstart` events on the `VolumeControl`.
   *
   * @param {EventTarget~Event} event
   *        `mousedown` or `touchstart` event that triggered this function
   *
   * @listens mousedown
   * @listens touchstart
   */VolumeControl.prototype.handleMouseDown=function handleMouseDown(event){var doc=this.el_.ownerDocument;this.on(doc,'mousemove',this.throttledHandleMouseMove);this.on(doc,'touchmove',this.throttledHandleMouseMove);this.on(doc,'mouseup',this.handleMouseUp);this.on(doc,'touchend',this.handleMouseUp);};/**
   * Handle `mouseup` or `touchend` events on the `VolumeControl`.
   *
   * @param {EventTarget~Event} event
   *        `mouseup` or `touchend` event that triggered this function.
   *
   * @listens touchend
   * @listens mouseup
   */VolumeControl.prototype.handleMouseUp=function handleMouseUp(event){var doc=this.el_.ownerDocument;this.off(doc,'mousemove',this.throttledHandleMouseMove);this.off(doc,'touchmove',this.throttledHandleMouseMove);this.off(doc,'mouseup',this.handleMouseUp);this.off(doc,'touchend',this.handleMouseUp);};/**
   * Handle `mousedown` or `touchstart` events on the `VolumeControl`.
   *
   * @param {EventTarget~Event} event
   *        `mousedown` or `touchstart` event that triggered this function
   *
   * @listens mousedown
   * @listens touchstart
   */VolumeControl.prototype.handleMouseMove=function handleMouseMove(event){this.volumeBar.handleMouseMove(event);};return VolumeControl;}(Component);/**
 * Default options for the `VolumeControl`
 *
 * @type {Object}
 * @private
 */VolumeControl.prototype.options_={children:['volumeBar']};Component.registerComponent('VolumeControl',VolumeControl);/**
 * Check if muting volume is supported and if it isn't hide the mute toggle
 * button.
 *
 * @param {Component} self
 *        A reference to the mute toggle button
 *
 * @param {Player} player
 *        A reference to the player
 *
 * @private
 */var checkMuteSupport=function checkMuteSupport(self,player){// hide mute toggle button if it's not supported by the current tech
if(player.tech_&&!player.tech_.featuresMuteControl){self.addClass('vjs-hidden');}self.on(player,'loadstart',function(){if(!player.tech_.featuresMuteControl){self.addClass('vjs-hidden');}else {self.removeClass('vjs-hidden');}});};/**
 * @file mute-toggle.js
 */ /**
 * A button component for muting the audio.
 *
 * @extends Button
 */var MuteToggle=function(_Button){inherits(MuteToggle,_Button);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function MuteToggle(player,options){classCallCheck(this,MuteToggle);// hide this control if volume support is missing
var _this=possibleConstructorReturn(this,_Button.call(this,player,options));checkMuteSupport(_this,player);_this.on(player,['loadstart','volumechange'],_this.update);return _this;}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */MuteToggle.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-mute-control '+_Button.prototype.buildCSSClass.call(this);};/**
   * This gets called when an `MuteToggle` is "clicked". See
   * {@link ClickableComponent} for more detailed information on what a click can be.
   *
   * @param {EventTarget~Event} [event]
   *        The `keydown`, `tap`, or `click` event that caused this function to be
   *        called.
   *
   * @listens tap
   * @listens click
   */MuteToggle.prototype.handleClick=function handleClick(event){var vol=this.player_.volume();var lastVolume=this.player_.lastVolume_();if(vol===0){var volumeToSet=lastVolume<0.1?0.1:lastVolume;this.player_.volume(volumeToSet);this.player_.muted(false);}else {this.player_.muted(this.player_.muted()?false:true);}};/**
   * Update the `MuteToggle` button based on the state of `volume` and `muted`
   * on the player.
   *
   * @param {EventTarget~Event} [event]
   *        The {@link Player#loadstart} event if this function was called
   *        through an event.
   *
   * @listens Player#loadstart
   * @listens Player#volumechange
   */MuteToggle.prototype.update=function update(event){this.updateIcon_();this.updateControlText_();};/**
   * Update the appearance of the `MuteToggle` icon.
   *
   * Possible states (given `level` variable below):
   * - 0: crossed out
   * - 1: zero bars of volume
   * - 2: one bar of volume
   * - 3: two bars of volume
   *
   * @private
   */MuteToggle.prototype.updateIcon_=function updateIcon_(){var vol=this.player_.volume();var level=3;// in iOS when a player is loaded with muted attribute
// and volume is changed with a native mute button
// we want to make sure muted state is updated
if(IS_IOS){this.player_.muted(this.player_.tech_.el_.muted);}if(vol===0||this.player_.muted()){level=0;}else if(vol<0.33){level=1;}else if(vol<0.67){level=2;}// TODO improve muted icon classes
for(var i=0;i<4;i++){removeClass(this.el_,'vjs-vol-'+i);}addClass(this.el_,'vjs-vol-'+level);};/**
   * If `muted` has changed on the player, update the control text
   * (`title` attribute on `vjs-mute-control` element and content of
   * `vjs-control-text` element).
   *
   * @private
   */MuteToggle.prototype.updateControlText_=function updateControlText_(){var soundOff=this.player_.muted()||this.player_.volume()===0;var text=soundOff?'Unmute':'Mute';if(this.controlText()!==text){this.controlText(text);}};return MuteToggle;}(Button);/**
 * The text that should display over the `MuteToggle`s controls. Added for localization.
 *
 * @type {string}
 * @private
 */MuteToggle.prototype.controlText_='Mute';Component.registerComponent('MuteToggle',MuteToggle);/**
 * @file volume-control.js
 */ // Required children
/**
 * A Component to contain the MuteToggle and VolumeControl so that
 * they can work together.
 *
 * @extends Component
 */var VolumePanel=function(_Component){inherits(VolumePanel,_Component);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options={}]
   *        The key/value store of player options.
   */function VolumePanel(player){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};classCallCheck(this,VolumePanel);if(typeof options.inline!=='undefined'){options.inline=options.inline;}else {options.inline=true;}// pass the inline option down to the VolumeControl as vertical if
// the VolumeControl is on.
if(typeof options.volumeControl==='undefined'||isPlain(options.volumeControl)){options.volumeControl=options.volumeControl||{};options.volumeControl.vertical=!options.inline;}var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.on(player,['loadstart'],_this.volumePanelState_);// while the slider is active (the mouse has been pressed down and
// is dragging) we do not want to hide the VolumeBar
_this.on(_this.volumeControl,['slideractive'],_this.sliderActive_);_this.on(_this.volumeControl,['sliderinactive'],_this.sliderInactive_);return _this;}/**
   * Add vjs-slider-active class to the VolumePanel
   *
   * @listens VolumeControl#slideractive
   * @private
   */VolumePanel.prototype.sliderActive_=function sliderActive_(){this.addClass('vjs-slider-active');};/**
   * Removes vjs-slider-active class to the VolumePanel
   *
   * @listens VolumeControl#sliderinactive
   * @private
   */VolumePanel.prototype.sliderInactive_=function sliderInactive_(){this.removeClass('vjs-slider-active');};/**
   * Adds vjs-hidden or vjs-mute-toggle-only to the VolumePanel
   * depending on MuteToggle and VolumeControl state
   *
   * @listens Player#loadstart
   * @private
   */VolumePanel.prototype.volumePanelState_=function volumePanelState_(){// hide volume panel if neither volume control or mute toggle
// are displayed
if(this.volumeControl.hasClass('vjs-hidden')&&this.muteToggle.hasClass('vjs-hidden')){this.addClass('vjs-hidden');}// if only mute toggle is visible we don't want
// volume panel expanding when hovered or active
if(this.volumeControl.hasClass('vjs-hidden')&&!this.muteToggle.hasClass('vjs-hidden')){this.addClass('vjs-mute-toggle-only');}};/**
   * Create the `Component`'s DOM element
   *
   * @return {Element}
   *         The element that was created.
   */VolumePanel.prototype.createEl=function createEl(){var orientationClass='vjs-volume-panel-horizontal';if(!this.options_.inline){orientationClass='vjs-volume-panel-vertical';}return _Component.prototype.createEl.call(this,'div',{className:'vjs-volume-panel vjs-control '+orientationClass});};return VolumePanel;}(Component);/**
 * Default options for the `VolumeControl`
 *
 * @type {Object}
 * @private
 */VolumePanel.prototype.options_={children:['muteToggle','volumeControl']};Component.registerComponent('VolumePanel',VolumePanel);/**
 * @file menu.js
 */ /**
 * The Menu component is used to build popup menus, including subtitle and
 * captions selection menus.
 *
 * @extends Component
 */var Menu=function(_Component){inherits(Menu,_Component);/**
   * Create an instance of this class.
   *
   * @param {Player} player
   *        the player that this component should attach to
   *
   * @param {Object} [options]
   *        Object of option names and values
   *
   */function Menu(player,options){classCallCheck(this,Menu);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));if(options){_this.menuButton_=options.menuButton;}_this.focusedChild_=-1;_this.on('keydown',_this.handleKeyPress);return _this;}/**
   * Add a {@link MenuItem} to the menu.
   *
   * @param {Object|string} component
   *        The name or instance of the `MenuItem` to add.
   *
   */Menu.prototype.addItem=function addItem(component){this.addChild(component);component.on('click',bind(this,function(event){// Unpress the associated MenuButton, and move focus back to it
if(this.menuButton_){this.menuButton_.unpressButton();// don't focus menu button if item is a caption settings item
// because focus will move elsewhere and it logs an error on IE8
if(component.name()!=='CaptionSettingsMenuItem'){this.menuButton_.focus();}}}));};/**
   * Create the `Menu`s DOM element.
   *
   * @return {Element}
   *         the element that was created
   */Menu.prototype.createEl=function createEl$$1(){var contentElType=this.options_.contentElType||'ul';this.contentEl_=createEl(contentElType,{className:'vjs-menu-content'});this.contentEl_.setAttribute('role','menu');var el=_Component.prototype.createEl.call(this,'div',{append:this.contentEl_,className:'vjs-menu'});el.appendChild(this.contentEl_);// Prevent clicks from bubbling up. Needed for Menu Buttons,
// where a click on the parent is significant
on(el,'click',function(event){event.preventDefault();event.stopImmediatePropagation();});return el;};Menu.prototype.dispose=function dispose(){this.contentEl_=null;_Component.prototype.dispose.call(this);};/**
   * Handle a `keydown` event on this menu. This listener is added in the constructor.
   *
   * @param {EventTarget~Event} event
   *        A `keydown` event that happened on the menu.
   *
   * @listens keydown
   */Menu.prototype.handleKeyPress=function handleKeyPress(event){// Left and Down Arrows
if(event.which===37||event.which===40){event.preventDefault();this.stepForward();// Up and Right Arrows
}else if(event.which===38||event.which===39){event.preventDefault();this.stepBack();}};/**
   * Move to next (lower) menu item for keyboard users.
   */Menu.prototype.stepForward=function stepForward(){var stepChild=0;if(this.focusedChild_!==undefined){stepChild=this.focusedChild_+1;}this.focus(stepChild);};/**
   * Move to previous (higher) menu item for keyboard users.
   */Menu.prototype.stepBack=function stepBack(){var stepChild=0;if(this.focusedChild_!==undefined){stepChild=this.focusedChild_-1;}this.focus(stepChild);};/**
   * Set focus on a {@link MenuItem} in the `Menu`.
   *
   * @param {Object|string} [item=0]
   *        Index of child item set focus on.
   */Menu.prototype.focus=function focus(){var item=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var children=this.children().slice();var haveTitle=children.length&&children[0].className&&/vjs-menu-title/.test(children[0].className);if(haveTitle){children.shift();}if(children.length>0){if(item<0){item=0;}else if(item>=children.length){item=children.length-1;}this.focusedChild_=item;children[item].el_.focus();}};return Menu;}(Component);Component.registerComponent('Menu',Menu);/**
 * @file menu-button.js
 */ /**
 * A `MenuButton` class for any popup {@link Menu}.
 *
 * @extends Component
 */var MenuButton=function(_Component){inherits(MenuButton,_Component);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options={}]
   *        The key/value store of player options.
   */function MenuButton(player){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};classCallCheck(this,MenuButton);var _this=possibleConstructorReturn(this,_Component.call(this,player,options));_this.menuButton_=new Button(player,options);_this.menuButton_.controlText(_this.controlText_);_this.menuButton_.el_.setAttribute('aria-haspopup','true');// Add buildCSSClass values to the button, not the wrapper
var buttonClass=Button.prototype.buildCSSClass();_this.menuButton_.el_.className=_this.buildCSSClass()+' '+buttonClass;_this.menuButton_.removeClass('vjs-control');_this.addChild(_this.menuButton_);_this.update();_this.enabled_=true;_this.on(_this.menuButton_,'tap',_this.handleClick);_this.on(_this.menuButton_,'click',_this.handleClick);_this.on(_this.menuButton_,'focus',_this.handleFocus);_this.on(_this.menuButton_,'blur',_this.handleBlur);_this.on('keydown',_this.handleSubmenuKeyPress);return _this;}/**
   * Update the menu based on the current state of its items.
   */MenuButton.prototype.update=function update(){var menu=this.createMenu();if(this.menu){this.menu.dispose();this.removeChild(this.menu);}this.menu=menu;this.addChild(menu);/**
     * Track the state of the menu button
     *
     * @type {Boolean}
     * @private
     */this.buttonPressed_=false;this.menuButton_.el_.setAttribute('aria-expanded','false');if(this.items&&this.items.length<=this.hideThreshold_){this.hide();}else {this.show();}};/**
   * Create the menu and add all items to it.
   *
   * @return {Menu}
   *         The constructed menu
   */MenuButton.prototype.createMenu=function createMenu(){var menu=new Menu(this.player_,{menuButton:this});/**
     * Hide the menu if the number of items is less than or equal to this threshold. This defaults
     * to 0 and whenever we add items which can be hidden to the menu we'll increment it. We list
     * it here because every time we run `createMenu` we need to reset the value.
     *
     * @protected
     * @type {Number}
     */this.hideThreshold_=0;// Add a title list item to the top
if(this.options_.title){var title=createEl('li',{className:'vjs-menu-title',innerHTML:toTitleCase(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;menu.children_.unshift(title);prependTo(title,menu.contentEl());}this.items=this.createItems();if(this.items){// Add menu items to the menu
for(var i=0;i<this.items.length;i++){menu.addItem(this.items[i]);}}return menu;};/**
   * Create the list of menu items. Specific to each subclass.
   *
   * @abstract
   */MenuButton.prototype.createItems=function createItems(){};/**
   * Create the `MenuButtons`s DOM element.
   *
   * @return {Element}
   *         The element that gets created.
   */MenuButton.prototype.createEl=function createEl$$1(){return _Component.prototype.createEl.call(this,'div',{className:this.buildWrapperCSSClass()},{});};/**
   * Allow sub components to stack CSS class names for the wrapper element
   *
   * @return {string}
   *         The constructed wrapper DOM `className`
   */MenuButton.prototype.buildWrapperCSSClass=function buildWrapperCSSClass(){var menuButtonClass='vjs-menu-button';// If the inline option is passed, we want to use different styles altogether.
if(this.options_.inline===true){menuButtonClass+='-inline';}else {menuButtonClass+='-popup';}// TODO: Fix the CSS so that this isn't necessary
var buttonClass=Button.prototype.buildCSSClass();return 'vjs-menu-button '+menuButtonClass+' '+buttonClass+' '+_Component.prototype.buildCSSClass.call(this);};/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */MenuButton.prototype.buildCSSClass=function buildCSSClass(){var menuButtonClass='vjs-menu-button';// If the inline option is passed, we want to use different styles altogether.
if(this.options_.inline===true){menuButtonClass+='-inline';}else {menuButtonClass+='-popup';}return 'vjs-menu-button '+menuButtonClass+' '+_Component.prototype.buildCSSClass.call(this);};/**
   * Get or set the localized control text that will be used for accessibility.
   *
   * > NOTE: This will come from the internal `menuButton_` element.
   *
   * @param {string} [text]
   *        Control text for element.
   *
   * @param {Element} [el=this.menuButton_.el()]
   *        Element to set the title on.
   *
   * @return {string}
   *         - The control text when getting
   */MenuButton.prototype.controlText=function controlText(text){var el=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(text,el);};/**
   * Handle a click on a `MenuButton`.
   * See {@link ClickableComponent#handleClick} for instances where this is called.
   *
   * @param {EventTarget~Event} event
   *        The `keydown`, `tap`, or `click` event that caused this function to be
   *        called.
   *
   * @listens tap
   * @listens click
   */MenuButton.prototype.handleClick=function handleClick(event){// When you click the button it adds focus, which will show the menu.
// So we'll remove focus when the mouse leaves the button. Focus is needed
// for tab navigation.
this.one(this.menu.contentEl(),'mouseleave',bind(this,function(e){this.unpressButton();this.el_.blur();}));if(this.buttonPressed_){this.unpressButton();}else {this.pressButton();}};/**
   * Set the focus to the actual button, not to this element
   */MenuButton.prototype.focus=function focus(){this.menuButton_.focus();};/**
   * Remove the focus from the actual button, not this element
   */MenuButton.prototype.blur=function blur(){this.menuButton_.blur();};/**
   * This gets called when a `MenuButton` gains focus via a `focus` event.
   * Turns on listening for `keydown` events. When they happen it
   * calls `this.handleKeyPress`.
   *
   * @param {EventTarget~Event} event
   *        The `focus` event that caused this function to be called.
   *
   * @listens focus
   */MenuButton.prototype.handleFocus=function handleFocus(){on(document$1,'keydown',bind(this,this.handleKeyPress));};/**
   * Called when a `MenuButton` loses focus. Turns off the listener for
   * `keydown` events. Which Stops `this.handleKeyPress` from getting called.
   *
   * @param {EventTarget~Event} event
   *        The `blur` event that caused this function to be called.
   *
   * @listens blur
   */MenuButton.prototype.handleBlur=function handleBlur(){off(document$1,'keydown',bind(this,this.handleKeyPress));};/**
   * Handle tab, escape, down arrow, and up arrow keys for `MenuButton`. See
   * {@link ClickableComponent#handleKeyPress} for instances where this is called.
   *
   * @param {EventTarget~Event} event
   *        The `keydown` event that caused this function to be called.
   *
   * @listens keydown
   */MenuButton.prototype.handleKeyPress=function handleKeyPress(event){// Escape (27) key or Tab (9) key unpress the 'button'
if(event.which===27||event.which===9){if(this.buttonPressed_){this.unpressButton();}// Don't preventDefault for Tab key - we still want to lose focus
if(event.which!==9){event.preventDefault();// Set focus back to the menu button's button
this.menuButton_.el_.focus();}// Up (38) key or Down (40) key press the 'button'
}else if(event.which===38||event.which===40){if(!this.buttonPressed_){this.pressButton();event.preventDefault();}}};/**
   * Handle a `keydown` event on a sub-menu. The listener for this is added in
   * the constructor.
   *
   * @param {EventTarget~Event} event
   *        Key press event
   *
   * @listens keydown
   */MenuButton.prototype.handleSubmenuKeyPress=function handleSubmenuKeyPress(event){// Escape (27) key or Tab (9) key unpress the 'button'
if(event.which===27||event.which===9){if(this.buttonPressed_){this.unpressButton();}// Don't preventDefault for Tab key - we still want to lose focus
if(event.which!==9){event.preventDefault();// Set focus back to the menu button's button
this.menuButton_.el_.focus();}}};/**
   * Put the current `MenuButton` into a pressed state.
   */MenuButton.prototype.pressButton=function pressButton(){if(this.enabled_){this.buttonPressed_=true;this.menu.lockShowing();this.menuButton_.el_.setAttribute('aria-expanded','true');// set the focus into the submenu, except on iOS where it is resulting in
// undesired scrolling behavior when the player is in an iframe
if(IS_IOS&&isInFrame()){// Return early so that the menu isn't focused
return;}this.menu.focus();}};/**
   * Take the current `MenuButton` out of a pressed state.
   */MenuButton.prototype.unpressButton=function unpressButton(){if(this.enabled_){this.buttonPressed_=false;this.menu.unlockShowing();this.menuButton_.el_.setAttribute('aria-expanded','false');}};/**
   * Disable the `MenuButton`. Don't allow it to be clicked.
   */MenuButton.prototype.disable=function disable(){this.unpressButton();this.enabled_=false;this.addClass('vjs-disabled');this.menuButton_.disable();};/**
   * Enable the `MenuButton`. Allow it to be clicked.
   */MenuButton.prototype.enable=function enable(){this.enabled_=true;this.removeClass('vjs-disabled');this.menuButton_.enable();};return MenuButton;}(Component);Component.registerComponent('MenuButton',MenuButton);/**
 * @file track-button.js
 */ /**
 * The base class for buttons that toggle specific  track types (e.g. subtitles).
 *
 * @extends MenuButton
 */var TrackButton=function(_MenuButton){inherits(TrackButton,_MenuButton);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function TrackButton(player,options){classCallCheck(this,TrackButton);var tracks=options.tracks;var _this=possibleConstructorReturn(this,_MenuButton.call(this,player,options));if(_this.items.length<=1){_this.hide();}if(!tracks){return possibleConstructorReturn(_this);}var updateHandler=bind(_this,_this.update);tracks.addEventListener('removetrack',updateHandler);tracks.addEventListener('addtrack',updateHandler);_this.player_.on('ready',updateHandler);_this.player_.on('dispose',function(){tracks.removeEventListener('removetrack',updateHandler);tracks.removeEventListener('addtrack',updateHandler);});return _this;}return TrackButton;}(MenuButton);Component.registerComponent('TrackButton',TrackButton);/**
 * @file menu-item.js
 */ /**
 * The component for a menu item. `<li>`
 *
 * @extends ClickableComponent
 */var MenuItem=function(_ClickableComponent){inherits(MenuItem,_ClickableComponent);/**
   * Creates an instance of the this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options={}]
   *        The key/value store of player options.
   *
   */function MenuItem(player,options){classCallCheck(this,MenuItem);var _this=possibleConstructorReturn(this,_ClickableComponent.call(this,player,options));_this.selectable=options.selectable;_this.isSelected_=options.selected||false;_this.multiSelectable=options.multiSelectable;_this.selected(_this.isSelected_);if(_this.selectable){if(_this.multiSelectable){_this.el_.setAttribute('role','menuitemcheckbox');}else {_this.el_.setAttribute('role','menuitemradio');}}else {_this.el_.setAttribute('role','menuitem');}return _this;}/**
   * Create the `MenuItem's DOM element
   *
   * @param {string} [type=li]
   *        Element's node type, not actually used, always set to `li`.
   *
   * @param {Object} [props={}]
   *        An object of properties that should be set on the element
   *
   * @param {Object} [attrs={}]
   *        An object of attributes that should be set on the element
   *
   * @return {Element}
   *         The element that gets created.
   */MenuItem.prototype.createEl=function createEl(type,props,attrs){// The control is textual, not just an icon
this.nonIconControl=true;return _ClickableComponent.prototype.createEl.call(this,'li',assign({className:'vjs-menu-item',innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+'</span>',tabIndex:-1},props),attrs);};/**
   * Any click on a `MenuItem` puts it into the selected state.
   * See {@link ClickableComponent#handleClick} for instances where this is called.
   *
   * @param {EventTarget~Event} event
   *        The `keydown`, `tap`, or `click` event that caused this function to be
   *        called.
   *
   * @listens tap
   * @listens click
   */MenuItem.prototype.handleClick=function handleClick(event){this.selected(true);};/**
   * Set the state for this menu item as selected or not.
   *
   * @param {boolean} selected
   *        if the menu item is selected or not
   */MenuItem.prototype.selected=function selected(_selected){if(this.selectable){if(_selected){this.addClass('vjs-selected');this.el_.setAttribute('aria-checked','true');// aria-checked isn't fully supported by browsers/screen readers,
// so indicate selected state to screen reader in the control text.
this.controlText(', selected');this.isSelected_=true;}else {this.removeClass('vjs-selected');this.el_.setAttribute('aria-checked','false');// Indicate un-selected state to screen reader
this.controlText('');this.isSelected_=false;}}};return MenuItem;}(ClickableComponent);Component.registerComponent('MenuItem',MenuItem);/**
 * @file text-track-menu-item.js
 */ /**
 * The specific menu item type for selecting a language within a text track kind
 *
 * @extends MenuItem
 */var TextTrackMenuItem=function(_MenuItem){inherits(TextTrackMenuItem,_MenuItem);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function TextTrackMenuItem(player,options){classCallCheck(this,TextTrackMenuItem);var track=options.track;var tracks=player.textTracks();// Modify options for parent MenuItem class's init.
options.label=track.label||track.language||'Unknown';options.selected=track.mode==='showing';var _this=possibleConstructorReturn(this,_MenuItem.call(this,player,options));_this.track=track;var changeHandler=function changeHandler(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this.handleTracksChange.apply(_this,args);};var selectedLanguageChangeHandler=function selectedLanguageChangeHandler(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}_this.handleSelectedLanguageChange.apply(_this,args);};player.on(['loadstart','texttrackchange'],changeHandler);tracks.addEventListener('change',changeHandler);tracks.addEventListener('selectedlanguagechange',selectedLanguageChangeHandler);_this.on('dispose',function(){player.off(['loadstart','texttrackchange'],changeHandler);tracks.removeEventListener('change',changeHandler);tracks.removeEventListener('selectedlanguagechange',selectedLanguageChangeHandler);});// iOS7 doesn't dispatch change events to TextTrackLists when an
// associated track's mode changes. Without something like
// Object.observe() (also not present on iOS7), it's not
// possible to detect changes to the mode attribute and polyfill
// the change event. As a poor substitute, we manually dispatch
// change events whenever the controls modify the mode.
if(tracks.onchange===undefined){var event=void 0;_this.on(['tap','click'],function(){if(_typeof$2(window$1.Event)!=='object'){// Android 2.3 throws an Illegal Constructor error for window.Event
try{event=new window$1.Event('change');}catch(err){// continue regardless of error
}}if(!event){event=document$1.createEvent('Event');event.initEvent('change',true,true);}tracks.dispatchEvent(event);});}// set the default state based on current tracks
_this.handleTracksChange();return _this;}/**
   * This gets called when an `TextTrackMenuItem` is "clicked". See
   * {@link ClickableComponent} for more detailed information on what a click can be.
   *
   * @param {EventTarget~Event} event
   *        The `keydown`, `tap`, or `click` event that caused this function to be
   *        called.
   *
   * @listens tap
   * @listens click
   */TextTrackMenuItem.prototype.handleClick=function handleClick(event){var kind=this.track.kind;var kinds=this.track.kinds;var tracks=this.player_.textTracks();if(!kinds){kinds=[kind];}_MenuItem.prototype.handleClick.call(this,event);if(!tracks){return;}for(var i=0;i<tracks.length;i++){var track=tracks[i];if(track===this.track&&kinds.indexOf(track.kind)>-1){if(track.mode!=='showing'){track.mode='showing';}}else if(track.mode!=='disabled'){track.mode='disabled';}}};/**
   * Handle text track list change
   *
   * @param {EventTarget~Event} event
   *        The `change` event that caused this function to be called.
   *
   * @listens TextTrackList#change
   */TextTrackMenuItem.prototype.handleTracksChange=function handleTracksChange(event){var shouldBeSelected=this.track.mode==='showing';// Prevent redundant selected() calls because they may cause
// screen readers to read the appended control text unnecessarily
if(shouldBeSelected!==this.isSelected_){this.selected(shouldBeSelected);}};TextTrackMenuItem.prototype.handleSelectedLanguageChange=function handleSelectedLanguageChange(event){if(this.track.mode==='showing'){var selectedLanguage=this.player_.cache_.selectedLanguage;// Don't replace the kind of track across the same language
if(selectedLanguage&&selectedLanguage.enabled&&selectedLanguage.language===this.track.language&&selectedLanguage.kind!==this.track.kind){return;}this.player_.cache_.selectedLanguage={enabled:true,language:this.track.language,kind:this.track.kind};}};TextTrackMenuItem.prototype.dispose=function dispose(){// remove reference to track object on dispose
this.track=null;_MenuItem.prototype.dispose.call(this);};return TextTrackMenuItem;}(MenuItem);Component.registerComponent('TextTrackMenuItem',TextTrackMenuItem);/**
 * @file off-text-track-menu-item.js
 */ /**
 * A special menu item for turning of a specific type of text track
 *
 * @extends TextTrackMenuItem
 */var OffTextTrackMenuItem=function(_TextTrackMenuItem){inherits(OffTextTrackMenuItem,_TextTrackMenuItem);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function OffTextTrackMenuItem(player,options){classCallCheck(this,OffTextTrackMenuItem);// Create pseudo track info
// Requires options['kind']
options.track={player:player,kind:options.kind,kinds:options.kinds,'default':false,mode:'disabled'};if(!options.kinds){options.kinds=[options.kind];}if(options.label){options.track.label=options.label;}else {options.track.label=options.kinds.join(' and ')+' off';}// MenuItem is selectable
options.selectable=true;// MenuItem is NOT multiSelectable (i.e. only one can be marked "selected" at a time)
options.multiSelectable=false;return possibleConstructorReturn(this,_TextTrackMenuItem.call(this,player,options));}/**
   * Handle text track change
   *
   * @param {EventTarget~Event} event
   *        The event that caused this function to run
   */OffTextTrackMenuItem.prototype.handleTracksChange=function handleTracksChange(event){var tracks=this.player().textTracks();var shouldBeSelected=true;for(var i=0,l=tracks.length;i<l;i++){var track=tracks[i];if(this.options_.kinds.indexOf(track.kind)>-1&&track.mode==='showing'){shouldBeSelected=false;break;}}// Prevent redundant selected() calls because they may cause
// screen readers to read the appended control text unnecessarily
if(shouldBeSelected!==this.isSelected_){this.selected(shouldBeSelected);}};OffTextTrackMenuItem.prototype.handleSelectedLanguageChange=function handleSelectedLanguageChange(event){var tracks=this.player().textTracks();var allHidden=true;for(var i=0,l=tracks.length;i<l;i++){var track=tracks[i];if(['captions','descriptions','subtitles'].indexOf(track.kind)>-1&&track.mode==='showing'){allHidden=false;break;}}if(allHidden){this.player_.cache_.selectedLanguage={enabled:false};}};return OffTextTrackMenuItem;}(TextTrackMenuItem);Component.registerComponent('OffTextTrackMenuItem',OffTextTrackMenuItem);/**
 * @file text-track-button.js
 */ /**
 * The base class for buttons that toggle specific text track types (e.g. subtitles)
 *
 * @extends MenuButton
 */var TextTrackButton=function(_TrackButton){inherits(TextTrackButton,_TrackButton);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options={}]
   *        The key/value store of player options.
   */function TextTrackButton(player){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};classCallCheck(this,TextTrackButton);options.tracks=player.textTracks();return possibleConstructorReturn(this,_TrackButton.call(this,player,options));}/**
   * Create a menu item for each text track
   *
   * @param {TextTrackMenuItem[]} [items=[]]
   *        Existing array of items to use during creation
   *
   * @return {TextTrackMenuItem[]}
   *         Array of menu items that were created
   */TextTrackButton.prototype.createItems=function createItems(){var items=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var TrackMenuItem=arguments.length>1&&arguments[1]!==undefined?arguments[1]:TextTrackMenuItem;// Label is an overide for the [track] off label
// USed to localise captions/subtitles
var label=void 0;if(this.label_){label=this.label_+' off';}// Add an OFF menu item to turn all tracks off
items.push(new OffTextTrackMenuItem(this.player_,{kinds:this.kinds_,kind:this.kind_,label:label}));this.hideThreshold_+=1;var tracks=this.player_.textTracks();if(!Array.isArray(this.kinds_)){this.kinds_=[this.kind_];}for(var i=0;i<tracks.length;i++){var track=tracks[i];// only add tracks that are of an appropriate kind and have a label
if(this.kinds_.indexOf(track.kind)>-1){var item=new TrackMenuItem(this.player_,{track:track,// MenuItem is selectable
selectable:true,// MenuItem is NOT multiSelectable (i.e. only one can be marked "selected" at a time)
multiSelectable:false});item.addClass('vjs-'+track.kind+'-menu-item');items.push(item);}}return items;};return TextTrackButton;}(TrackButton);Component.registerComponent('TextTrackButton',TextTrackButton);/**
 * @file chapters-track-menu-item.js
 */ /**
 * The chapter track menu item
 *
 * @extends MenuItem
 */var ChaptersTrackMenuItem=function(_MenuItem){inherits(ChaptersTrackMenuItem,_MenuItem);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function ChaptersTrackMenuItem(player,options){classCallCheck(this,ChaptersTrackMenuItem);var track=options.track;var cue=options.cue;var currentTime=player.currentTime();// Modify options for parent MenuItem class's init.
options.selectable=true;options.multiSelectable=false;options.label=cue.text;options.selected=cue.startTime<=currentTime&&currentTime<cue.endTime;var _this=possibleConstructorReturn(this,_MenuItem.call(this,player,options));_this.track=track;_this.cue=cue;track.addEventListener('cuechange',bind(_this,_this.update));return _this;}/**
   * This gets called when an `ChaptersTrackMenuItem` is "clicked". See
   * {@link ClickableComponent} for more detailed information on what a click can be.
   *
   * @param {EventTarget~Event} [event]
   *        The `keydown`, `tap`, or `click` event that caused this function to be
   *        called.
   *
   * @listens tap
   * @listens click
   */ChaptersTrackMenuItem.prototype.handleClick=function handleClick(event){_MenuItem.prototype.handleClick.call(this);this.player_.currentTime(this.cue.startTime);this.update(this.cue.startTime);};/**
   * Update chapter menu item
   *
   * @param {EventTarget~Event} [event]
   *        The `cuechange` event that caused this function to run.
   *
   * @listens TextTrack#cuechange
   */ChaptersTrackMenuItem.prototype.update=function update(event){var cue=this.cue;var currentTime=this.player_.currentTime();// vjs.log(currentTime, cue.startTime);
this.selected(cue.startTime<=currentTime&&currentTime<cue.endTime);};return ChaptersTrackMenuItem;}(MenuItem);Component.registerComponent('ChaptersTrackMenuItem',ChaptersTrackMenuItem);/**
 * @file chapters-button.js
 */ /**
 * The button component for toggling and selecting chapters
 * Chapters act much differently than other text tracks
 * Cues are navigation vs. other tracks of alternative languages
 *
 * @extends TextTrackButton
 */var ChaptersButton=function(_TextTrackButton){inherits(ChaptersButton,_TextTrackButton);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   *
   * @param {Component~ReadyCallback} [ready]
   *        The function to call when this function is ready.
   */function ChaptersButton(player,options,ready){classCallCheck(this,ChaptersButton);return possibleConstructorReturn(this,_TextTrackButton.call(this,player,options,ready));}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */ChaptersButton.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-chapters-button '+_TextTrackButton.prototype.buildCSSClass.call(this);};ChaptersButton.prototype.buildWrapperCSSClass=function buildWrapperCSSClass(){return 'vjs-chapters-button '+_TextTrackButton.prototype.buildWrapperCSSClass.call(this);};/**
   * Update the menu based on the current state of its items.
   *
   * @param {EventTarget~Event} [event]
   *        An event that triggered this function to run.
   *
   * @listens TextTrackList#addtrack
   * @listens TextTrackList#removetrack
   * @listens TextTrackList#change
   */ChaptersButton.prototype.update=function update(event){if(!this.track_||event&&(event.type==='addtrack'||event.type==='removetrack')){this.setTrack(this.findChaptersTrack());}_TextTrackButton.prototype.update.call(this);};/**
   * Set the currently selected track for the chapters button.
   *
   * @param {TextTrack} track
   *        The new track to select. Nothing will change if this is the currently selected
   *        track.
   */ChaptersButton.prototype.setTrack=function setTrack(track){if(this.track_===track){return;}if(!this.updateHandler_){this.updateHandler_=this.update.bind(this);}// here this.track_ refers to the old track instance
if(this.track_){var remoteTextTrackEl=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(remoteTextTrackEl){remoteTextTrackEl.removeEventListener('load',this.updateHandler_);}this.track_=null;}this.track_=track;// here this.track_ refers to the new track instance
if(this.track_){this.track_.mode='hidden';var _remoteTextTrackEl=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(_remoteTextTrackEl){_remoteTextTrackEl.addEventListener('load',this.updateHandler_);}}};/**
   * Find the track object that is currently in use by this ChaptersButton
   *
   * @return {TextTrack|undefined}
   *         The current track or undefined if none was found.
   */ChaptersButton.prototype.findChaptersTrack=function findChaptersTrack(){var tracks=this.player_.textTracks()||[];for(var i=tracks.length-1;i>=0;i--){// We will always choose the last track as our chaptersTrack
var track=tracks[i];if(track.kind===this.kind_){return track;}}};/**
   * Get the caption for the ChaptersButton based on the track label. This will also
   * use the current tracks localized kind as a fallback if a label does not exist.
   *
   * @return {string}
   *         The tracks current label or the localized track kind.
   */ChaptersButton.prototype.getMenuCaption=function getMenuCaption(){if(this.track_&&this.track_.label){return this.track_.label;}return this.localize(toTitleCase(this.kind_));};/**
   * Create menu from chapter track
   *
   * @return {Menu}
   *         New menu for the chapter buttons
   */ChaptersButton.prototype.createMenu=function createMenu(){this.options_.title=this.getMenuCaption();return _TextTrackButton.prototype.createMenu.call(this);};/**
   * Create a menu item for each text track
   *
   * @return {TextTrackMenuItem[]}
   *         Array of menu items
   */ChaptersButton.prototype.createItems=function createItems(){var items=[];if(!this.track_){return items;}var cues=this.track_.cues;if(!cues){return items;}for(var i=0,l=cues.length;i<l;i++){var cue=cues[i];var mi=new ChaptersTrackMenuItem(this.player_,{track:this.track_,cue:cue});items.push(mi);}return items;};return ChaptersButton;}(TextTrackButton);/**
 * `kind` of TextTrack to look for to associate it with this menu.
 *
 * @type {string}
 * @private
 */ChaptersButton.prototype.kind_='chapters';/**
 * The text that should display over the `ChaptersButton`s controls. Added for localization.
 *
 * @type {string}
 * @private
 */ChaptersButton.prototype.controlText_='Chapters';Component.registerComponent('ChaptersButton',ChaptersButton);/**
 * @file descriptions-button.js
 */ /**
 * The button component for toggling and selecting descriptions
 *
 * @extends TextTrackButton
 */var DescriptionsButton=function(_TextTrackButton){inherits(DescriptionsButton,_TextTrackButton);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   *
   * @param {Component~ReadyCallback} [ready]
   *        The function to call when this component is ready.
   */function DescriptionsButton(player,options,ready){classCallCheck(this,DescriptionsButton);var _this=possibleConstructorReturn(this,_TextTrackButton.call(this,player,options,ready));var tracks=player.textTracks();var changeHandler=bind(_this,_this.handleTracksChange);tracks.addEventListener('change',changeHandler);_this.on('dispose',function(){tracks.removeEventListener('change',changeHandler);});return _this;}/**
   * Handle text track change
   *
   * @param {EventTarget~Event} event
   *        The event that caused this function to run
   *
   * @listens TextTrackList#change
   */DescriptionsButton.prototype.handleTracksChange=function handleTracksChange(event){var tracks=this.player().textTracks();var disabled=false;// Check whether a track of a different kind is showing
for(var i=0,l=tracks.length;i<l;i++){var track=tracks[i];if(track.kind!==this.kind_&&track.mode==='showing'){disabled=true;break;}}// If another track is showing, disable this menu button
if(disabled){this.disable();}else {this.enable();}};/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */DescriptionsButton.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-descriptions-button '+_TextTrackButton.prototype.buildCSSClass.call(this);};DescriptionsButton.prototype.buildWrapperCSSClass=function buildWrapperCSSClass(){return 'vjs-descriptions-button '+_TextTrackButton.prototype.buildWrapperCSSClass.call(this);};return DescriptionsButton;}(TextTrackButton);/**
 * `kind` of TextTrack to look for to associate it with this menu.
 *
 * @type {string}
 * @private
 */DescriptionsButton.prototype.kind_='descriptions';/**
 * The text that should display over the `DescriptionsButton`s controls. Added for localization.
 *
 * @type {string}
 * @private
 */DescriptionsButton.prototype.controlText_='Descriptions';Component.registerComponent('DescriptionsButton',DescriptionsButton);/**
 * @file subtitles-button.js
 */ /**
 * The button component for toggling and selecting subtitles
 *
 * @extends TextTrackButton
 */var SubtitlesButton=function(_TextTrackButton){inherits(SubtitlesButton,_TextTrackButton);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   *
   * @param {Component~ReadyCallback} [ready]
   *        The function to call when this component is ready.
   */function SubtitlesButton(player,options,ready){classCallCheck(this,SubtitlesButton);return possibleConstructorReturn(this,_TextTrackButton.call(this,player,options,ready));}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */SubtitlesButton.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-subtitles-button '+_TextTrackButton.prototype.buildCSSClass.call(this);};SubtitlesButton.prototype.buildWrapperCSSClass=function buildWrapperCSSClass(){return 'vjs-subtitles-button '+_TextTrackButton.prototype.buildWrapperCSSClass.call(this);};return SubtitlesButton;}(TextTrackButton);/**
 * `kind` of TextTrack to look for to associate it with this menu.
 *
 * @type {string}
 * @private
 */SubtitlesButton.prototype.kind_='subtitles';/**
 * The text that should display over the `SubtitlesButton`s controls. Added for localization.
 *
 * @type {string}
 * @private
 */SubtitlesButton.prototype.controlText_='Subtitles';Component.registerComponent('SubtitlesButton',SubtitlesButton);/**
 * @file caption-settings-menu-item.js
 */ /**
 * The menu item for caption track settings menu
 *
 * @extends TextTrackMenuItem
 */var CaptionSettingsMenuItem=function(_TextTrackMenuItem){inherits(CaptionSettingsMenuItem,_TextTrackMenuItem);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function CaptionSettingsMenuItem(player,options){classCallCheck(this,CaptionSettingsMenuItem);options.track={player:player,kind:options.kind,label:options.kind+' settings',selectable:false,'default':false,mode:'disabled'};// CaptionSettingsMenuItem has no concept of 'selected'
options.selectable=false;options.name='CaptionSettingsMenuItem';var _this=possibleConstructorReturn(this,_TextTrackMenuItem.call(this,player,options));_this.addClass('vjs-texttrack-settings');_this.controlText(', opens '+options.kind+' settings dialog');return _this;}/**
   * This gets called when an `CaptionSettingsMenuItem` is "clicked". See
   * {@link ClickableComponent} for more detailed information on what a click can be.
   *
   * @param {EventTarget~Event} [event]
   *        The `keydown`, `tap`, or `click` event that caused this function to be
   *        called.
   *
   * @listens tap
   * @listens click
   */CaptionSettingsMenuItem.prototype.handleClick=function handleClick(event){this.player().getChild('textTrackSettings').open();};return CaptionSettingsMenuItem;}(TextTrackMenuItem);Component.registerComponent('CaptionSettingsMenuItem',CaptionSettingsMenuItem);/**
 * @file captions-button.js
 */ /**
 * The button component for toggling and selecting captions
 *
 * @extends TextTrackButton
 */var CaptionsButton=function(_TextTrackButton){inherits(CaptionsButton,_TextTrackButton);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   *
   * @param {Component~ReadyCallback} [ready]
   *        The function to call when this component is ready.
   */function CaptionsButton(player,options,ready){classCallCheck(this,CaptionsButton);return possibleConstructorReturn(this,_TextTrackButton.call(this,player,options,ready));}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */CaptionsButton.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-captions-button '+_TextTrackButton.prototype.buildCSSClass.call(this);};CaptionsButton.prototype.buildWrapperCSSClass=function buildWrapperCSSClass(){return 'vjs-captions-button '+_TextTrackButton.prototype.buildWrapperCSSClass.call(this);};/**
   * Create caption menu items
   *
   * @return {CaptionSettingsMenuItem[]}
   *         The array of current menu items.
   */CaptionsButton.prototype.createItems=function createItems(){var items=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild('textTrackSettings')){items.push(new CaptionSettingsMenuItem(this.player_,{kind:this.kind_}));this.hideThreshold_+=1;}return _TextTrackButton.prototype.createItems.call(this,items);};return CaptionsButton;}(TextTrackButton);/**
 * `kind` of TextTrack to look for to associate it with this menu.
 *
 * @type {string}
 * @private
 */CaptionsButton.prototype.kind_='captions';/**
 * The text that should display over the `CaptionsButton`s controls. Added for localization.
 *
 * @type {string}
 * @private
 */CaptionsButton.prototype.controlText_='Captions';Component.registerComponent('CaptionsButton',CaptionsButton);/**
 * @file subs-caps-menu-item.js
 */ /**
 * SubsCapsMenuItem has an [cc] icon to distinguish captions from subtitles
 * in the SubsCapsMenu.
 *
 * @extends TextTrackMenuItem
 */var SubsCapsMenuItem=function(_TextTrackMenuItem){inherits(SubsCapsMenuItem,_TextTrackMenuItem);function SubsCapsMenuItem(){classCallCheck(this,SubsCapsMenuItem);return possibleConstructorReturn(this,_TextTrackMenuItem.apply(this,arguments));}SubsCapsMenuItem.prototype.createEl=function createEl(type,props,attrs){var innerHTML='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);if(this.options_.track.kind==='captions'){innerHTML+='\n        <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n        <span class="vjs-control-text"> '+this.localize('Captions')+'</span>\n      ';}innerHTML+='</span>';var el=_TextTrackMenuItem.prototype.createEl.call(this,type,assign({innerHTML:innerHTML},props),attrs);return el;};return SubsCapsMenuItem;}(TextTrackMenuItem);Component.registerComponent('SubsCapsMenuItem',SubsCapsMenuItem);/**
 * @file sub-caps-button.js
 */ /**
 * The button component for toggling and selecting captions and/or subtitles
 *
 * @extends TextTrackButton
 */var SubsCapsButton=function(_TextTrackButton){inherits(SubsCapsButton,_TextTrackButton);function SubsCapsButton(player){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};classCallCheck(this,SubsCapsButton);// Although North America uses "captions" in most cases for
// "captions and subtitles" other locales use "subtitles"
var _this=possibleConstructorReturn(this,_TextTrackButton.call(this,player,options));_this.label_='subtitles';if(['en','en-us','en-ca','fr-ca'].indexOf(_this.player_.language_)>-1){_this.label_='captions';}_this.menuButton_.controlText(toTitleCase(_this.label_));return _this;}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */SubsCapsButton.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-subs-caps-button '+_TextTrackButton.prototype.buildCSSClass.call(this);};SubsCapsButton.prototype.buildWrapperCSSClass=function buildWrapperCSSClass(){return 'vjs-subs-caps-button '+_TextTrackButton.prototype.buildWrapperCSSClass.call(this);};/**
   * Create caption/subtitles menu items
   *
   * @return {CaptionSettingsMenuItem[]}
   *         The array of current menu items.
   */SubsCapsButton.prototype.createItems=function createItems(){var items=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild('textTrackSettings')){items.push(new CaptionSettingsMenuItem(this.player_,{kind:this.label_}));this.hideThreshold_+=1;}items=_TextTrackButton.prototype.createItems.call(this,items,SubsCapsMenuItem);return items;};return SubsCapsButton;}(TextTrackButton);/**
 * `kind`s of TextTrack to look for to associate it with this menu.
 *
 * @type {array}
 * @private
 */SubsCapsButton.prototype.kinds_=['captions','subtitles'];/**
 * The text that should display over the `SubsCapsButton`s controls.
 *
 *
 * @type {string}
 * @private
 */SubsCapsButton.prototype.controlText_='Subtitles';Component.registerComponent('SubsCapsButton',SubsCapsButton);/**
 * @file audio-track-menu-item.js
 */ /**
 * An {@link AudioTrack} {@link MenuItem}
 *
 * @extends MenuItem
 */var AudioTrackMenuItem=function(_MenuItem){inherits(AudioTrackMenuItem,_MenuItem);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function AudioTrackMenuItem(player,options){classCallCheck(this,AudioTrackMenuItem);var track=options.track;var tracks=player.audioTracks();// Modify options for parent MenuItem class's init.
options.label=track.label||track.language||'Unknown';options.selected=track.enabled;var _this=possibleConstructorReturn(this,_MenuItem.call(this,player,options));_this.track=track;_this.addClass('vjs-'+track.kind+'-menu-item');var changeHandler=function changeHandler(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this.handleTracksChange.apply(_this,args);};tracks.addEventListener('change',changeHandler);_this.on('dispose',function(){tracks.removeEventListener('change',changeHandler);});return _this;}AudioTrackMenuItem.prototype.createEl=function createEl(type,props,attrs){var innerHTML='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);if(this.options_.track.kind==='main-desc'){innerHTML+='\n        <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n        <span class="vjs-control-text"> '+this.localize('Descriptions')+'</span>\n      ';}innerHTML+='</span>';var el=_MenuItem.prototype.createEl.call(this,type,assign({innerHTML:innerHTML},props),attrs);return el;};/**
   * This gets called when an `AudioTrackMenuItem is "clicked". See {@link ClickableComponent}
   * for more detailed information on what a click can be.
   *
   * @param {EventTarget~Event} [event]
   *        The `keydown`, `tap`, or `click` event that caused this function to be
   *        called.
   *
   * @listens tap
   * @listens click
   */AudioTrackMenuItem.prototype.handleClick=function handleClick(event){var tracks=this.player_.audioTracks();_MenuItem.prototype.handleClick.call(this,event);for(var i=0;i<tracks.length;i++){var track=tracks[i];track.enabled=track===this.track;}};/**
   * Handle any {@link AudioTrack} change.
   *
   * @param {EventTarget~Event} [event]
   *        The {@link AudioTrackList#change} event that caused this to run.
   *
   * @listens AudioTrackList#change
   */AudioTrackMenuItem.prototype.handleTracksChange=function handleTracksChange(event){this.selected(this.track.enabled);};return AudioTrackMenuItem;}(MenuItem);Component.registerComponent('AudioTrackMenuItem',AudioTrackMenuItem);/**
 * @file audio-track-button.js
 */ /**
 * The base class for buttons that toggle specific {@link AudioTrack} types.
 *
 * @extends TrackButton
 */var AudioTrackButton=function(_TrackButton){inherits(AudioTrackButton,_TrackButton);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options={}]
   *        The key/value store of player options.
   */function AudioTrackButton(player){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};classCallCheck(this,AudioTrackButton);options.tracks=player.audioTracks();return possibleConstructorReturn(this,_TrackButton.call(this,player,options));}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */AudioTrackButton.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-audio-button '+_TrackButton.prototype.buildCSSClass.call(this);};AudioTrackButton.prototype.buildWrapperCSSClass=function buildWrapperCSSClass(){return 'vjs-audio-button '+_TrackButton.prototype.buildWrapperCSSClass.call(this);};/**
   * Create a menu item for each audio track
   *
   * @param {AudioTrackMenuItem[]} [items=[]]
   *        An array of existing menu items to use.
   *
   * @return {AudioTrackMenuItem[]}
   *         An array of menu items
   */AudioTrackButton.prototype.createItems=function createItems(){var items=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];// if there's only one audio track, there no point in showing it
this.hideThreshold_=1;var tracks=this.player_.audioTracks();for(var i=0;i<tracks.length;i++){var track=tracks[i];items.push(new AudioTrackMenuItem(this.player_,{track:track,// MenuItem is selectable
selectable:true,// MenuItem is NOT multiSelectable (i.e. only one can be marked "selected" at a time)
multiSelectable:false}));}return items;};return AudioTrackButton;}(TrackButton);/**
 * The text that should display over the `AudioTrackButton`s controls. Added for localization.
 *
 * @type {string}
 * @private
 */AudioTrackButton.prototype.controlText_='Audio Track';Component.registerComponent('AudioTrackButton',AudioTrackButton);/**
 * @file playback-rate-menu-item.js
 */ /**
 * The specific menu item type for selecting a playback rate.
 *
 * @extends MenuItem
 */var PlaybackRateMenuItem=function(_MenuItem){inherits(PlaybackRateMenuItem,_MenuItem);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function PlaybackRateMenuItem(player,options){classCallCheck(this,PlaybackRateMenuItem);var label=options.rate;var rate=parseFloat(label,10);// Modify options for parent MenuItem class's init.
options.label=label;options.selected=rate===1;options.selectable=true;options.multiSelectable=false;var _this=possibleConstructorReturn(this,_MenuItem.call(this,player,options));_this.label=label;_this.rate=rate;_this.on(player,'ratechange',_this.update);return _this;}/**
   * This gets called when an `PlaybackRateMenuItem` is "clicked". See
   * {@link ClickableComponent} for more detailed information on what a click can be.
   *
   * @param {EventTarget~Event} [event]
   *        The `keydown`, `tap`, or `click` event that caused this function to be
   *        called.
   *
   * @listens tap
   * @listens click
   */PlaybackRateMenuItem.prototype.handleClick=function handleClick(event){_MenuItem.prototype.handleClick.call(this);this.player().playbackRate(this.rate);};/**
   * Update the PlaybackRateMenuItem when the playbackrate changes.
   *
   * @param {EventTarget~Event} [event]
   *        The `ratechange` event that caused this function to run.
   *
   * @listens Player#ratechange
   */PlaybackRateMenuItem.prototype.update=function update(event){this.selected(this.player().playbackRate()===this.rate);};return PlaybackRateMenuItem;}(MenuItem);/**
 * The text that should display over the `PlaybackRateMenuItem`s controls. Added for localization.
 *
 * @type {string}
 * @private
 */PlaybackRateMenuItem.prototype.contentElType='button';Component.registerComponent('PlaybackRateMenuItem',PlaybackRateMenuItem);/**
 * @file playback-rate-menu-button.js
 */ /**
 * The component for controlling the playback rate.
 *
 * @extends MenuButton
 */var PlaybackRateMenuButton=function(_MenuButton){inherits(PlaybackRateMenuButton,_MenuButton);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   */function PlaybackRateMenuButton(player,options){classCallCheck(this,PlaybackRateMenuButton);var _this=possibleConstructorReturn(this,_MenuButton.call(this,player,options));_this.updateVisibility();_this.updateLabel();_this.on(player,'loadstart',_this.updateVisibility);_this.on(player,'ratechange',_this.updateLabel);return _this;}/**
   * Create the `Component`'s DOM element
   *
   * @return {Element}
   *         The element that was created.
   */PlaybackRateMenuButton.prototype.createEl=function createEl$$1(){var el=_MenuButton.prototype.createEl.call(this);this.labelEl_=createEl('div',{className:'vjs-playback-rate-value',innerHTML:'1x'});el.appendChild(this.labelEl_);return el;};PlaybackRateMenuButton.prototype.dispose=function dispose(){this.labelEl_=null;_MenuButton.prototype.dispose.call(this);};/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */PlaybackRateMenuButton.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-playback-rate '+_MenuButton.prototype.buildCSSClass.call(this);};PlaybackRateMenuButton.prototype.buildWrapperCSSClass=function buildWrapperCSSClass(){return 'vjs-playback-rate '+_MenuButton.prototype.buildWrapperCSSClass.call(this);};/**
   * Create the playback rate menu
   *
   * @return {Menu}
   *         Menu object populated with {@link PlaybackRateMenuItem}s
   */PlaybackRateMenuButton.prototype.createMenu=function createMenu(){var menu=new Menu(this.player());var rates=this.playbackRates();if(rates){for(var i=rates.length-1;i>=0;i--){menu.addChild(new PlaybackRateMenuItem(this.player(),{rate:rates[i]+'x'}));}}return menu;};/**
   * Updates ARIA accessibility attributes
   */PlaybackRateMenuButton.prototype.updateARIAAttributes=function updateARIAAttributes(){// Current playback rate
this.el().setAttribute('aria-valuenow',this.player().playbackRate());};/**
   * This gets called when an `PlaybackRateMenuButton` is "clicked". See
   * {@link ClickableComponent} for more detailed information on what a click can be.
   *
   * @param {EventTarget~Event} [event]
   *        The `keydown`, `tap`, or `click` event that caused this function to be
   *        called.
   *
   * @listens tap
   * @listens click
   */PlaybackRateMenuButton.prototype.handleClick=function handleClick(event){// select next rate option
var currentRate=this.player().playbackRate();var rates=this.playbackRates();// this will select first one if the last one currently selected
var newRate=rates[0];for(var i=0;i<rates.length;i++){if(rates[i]>currentRate){newRate=rates[i];break;}}this.player().playbackRate(newRate);};/**
   * Get possible playback rates
   *
   * @return {Array}
   *         All possible playback rates
   */PlaybackRateMenuButton.prototype.playbackRates=function playbackRates(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates;};/**
   * Get whether playback rates is supported by the tech
   * and an array of playback rates exists
   *
   * @return {boolean}
   *         Whether changing playback rate is supported
   */PlaybackRateMenuButton.prototype.playbackRateSupported=function playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0;};/**
   * Hide playback rate controls when they're no playback rate options to select
   *
   * @param {EventTarget~Event} [event]
   *        The event that caused this function to run.
   *
   * @listens Player#loadstart
   */PlaybackRateMenuButton.prototype.updateVisibility=function updateVisibility(event){if(this.playbackRateSupported()){this.removeClass('vjs-hidden');}else {this.addClass('vjs-hidden');}};/**
   * Update button label when rate changed
   *
   * @param {EventTarget~Event} [event]
   *        The event that caused this function to run.
   *
   * @listens Player#ratechange
   */PlaybackRateMenuButton.prototype.updateLabel=function updateLabel(event){if(this.playbackRateSupported()){this.labelEl_.innerHTML=this.player().playbackRate()+'x';}};return PlaybackRateMenuButton;}(MenuButton);/**
 * The text that should display over the `FullscreenToggle`s controls. Added for localization.
 *
 * @type {string}
 * @private
 */PlaybackRateMenuButton.prototype.controlText_='Playback Rate';Component.registerComponent('PlaybackRateMenuButton',PlaybackRateMenuButton);/**
 * @file spacer.js
 */ /**
 * Just an empty spacer element that can be used as an append point for plugins, etc.
 * Also can be used to create space between elements when necessary.
 *
 * @extends Component
 */var Spacer=function(_Component){inherits(Spacer,_Component);function Spacer(){classCallCheck(this,Spacer);return possibleConstructorReturn(this,_Component.apply(this,arguments));}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */Spacer.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-spacer '+_Component.prototype.buildCSSClass.call(this);};/**
   * Create the `Component`'s DOM element
   *
   * @return {Element}
   *         The element that was created.
   */Spacer.prototype.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:this.buildCSSClass()});};return Spacer;}(Component);Component.registerComponent('Spacer',Spacer);/**
 * @file custom-control-spacer.js
 */ /**
 * Spacer specifically meant to be used as an insertion point for new plugins, etc.
 *
 * @extends Spacer
 */var CustomControlSpacer=function(_Spacer){inherits(CustomControlSpacer,_Spacer);function CustomControlSpacer(){classCallCheck(this,CustomControlSpacer);return possibleConstructorReturn(this,_Spacer.apply(this,arguments));}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   */CustomControlSpacer.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-custom-control-spacer '+_Spacer.prototype.buildCSSClass.call(this);};/**
   * Create the `Component`'s DOM element
   *
   * @return {Element}
   *         The element that was created.
   */CustomControlSpacer.prototype.createEl=function createEl(){var el=_Spacer.prototype.createEl.call(this,{className:this.buildCSSClass()});// No-flex/table-cell mode requires there be some content
// in the cell to fill the remaining space of the table.
el.innerHTML='\xA0';return el;};return CustomControlSpacer;}(Spacer);Component.registerComponent('CustomControlSpacer',CustomControlSpacer);/**
 * @file control-bar.js
 */ // Required children
/**
 * Container of main controls.
 *
 * @extends Component
 */var ControlBar=function(_Component){inherits(ControlBar,_Component);function ControlBar(){classCallCheck(this,ControlBar);return possibleConstructorReturn(this,_Component.apply(this,arguments));}/**
   * Create the `Component`'s DOM element
   *
   * @return {Element}
   *         The element that was created.
   */ControlBar.prototype.createEl=function createEl(){return _Component.prototype.createEl.call(this,'div',{className:'vjs-control-bar',dir:'ltr'});};return ControlBar;}(Component);/**
 * Default options for `ControlBar`
 *
 * @type {Object}
 * @private
 */ControlBar.prototype.options_={children:['playToggle','volumePanel','currentTimeDisplay','timeDivider','durationDisplay','progressControl','liveDisplay','remainingTimeDisplay','customControlSpacer','playbackRateMenuButton','chaptersButton','descriptionsButton','subsCapsButton','audioTrackButton','fullscreenToggle']};Component.registerComponent('ControlBar',ControlBar);/**
 * @file error-display.js
 */ /**
 * A display that indicates an error has occurred. This means that the video
 * is unplayable.
 *
 * @extends ModalDialog
 */var ErrorDisplay=function(_ModalDialog){inherits(ErrorDisplay,_ModalDialog);/**
   * Creates an instance of this class.
   *
   * @param  {Player} player
   *         The `Player` that this class should be attached to.
   *
   * @param  {Object} [options]
   *         The key/value store of player options.
   */function ErrorDisplay(player,options){classCallCheck(this,ErrorDisplay);var _this=possibleConstructorReturn(this,_ModalDialog.call(this,player,options));_this.on(player,'error',_this.open);return _this;}/**
   * Builds the default DOM `className`.
   *
   * @return {string}
   *         The DOM `className` for this object.
   *
   * @deprecated Since version 5.
   */ErrorDisplay.prototype.buildCSSClass=function buildCSSClass(){return 'vjs-error-display '+_ModalDialog.prototype.buildCSSClass.call(this);};/**
   * Gets the localized error message based on the `Player`s error.
   *
   * @return {string}
   *         The `Player`s error message localized or an empty string.
   */ErrorDisplay.prototype.content=function content(){var error=this.player().error();return error?this.localize(error.message):'';};return ErrorDisplay;}(ModalDialog);/**
 * The default options for an `ErrorDisplay`.
 *
 * @private
 */ErrorDisplay.prototype.options_=mergeOptions(ModalDialog.prototype.options_,{pauseOnOpen:false,fillAlways:true,temporary:false,uncloseable:true});Component.registerComponent('ErrorDisplay',ErrorDisplay);/**
 * @file text-track-settings.js
 */var LOCAL_STORAGE_KEY='vjs-text-track-settings';var COLOR_BLACK=['#000','Black'];var COLOR_BLUE=['#00F','Blue'];var COLOR_CYAN=['#0FF','Cyan'];var COLOR_GREEN=['#0F0','Green'];var COLOR_MAGENTA=['#F0F','Magenta'];var COLOR_RED=['#F00','Red'];var COLOR_WHITE=['#FFF','White'];var COLOR_YELLOW=['#FF0','Yellow'];var OPACITY_OPAQUE=['1','Opaque'];var OPACITY_SEMI=['0.5','Semi-Transparent'];var OPACITY_TRANS=['0','Transparent'];// Configuration for the various <select> elements in the DOM of this component.
//
// Possible keys include:
//
// `default`:
//   The default option index. Only needs to be provided if not zero.
// `parser`:
//   A function which is used to parse the value from the selected option in
//   a customized way.
// `selector`:
//   The selector used to find the associated <select> element.
var selectConfigs={backgroundColor:{selector:'.vjs-bg-color > select',id:'captions-background-color-%s',label:'Color',options:[COLOR_BLACK,COLOR_WHITE,COLOR_RED,COLOR_GREEN,COLOR_BLUE,COLOR_YELLOW,COLOR_MAGENTA,COLOR_CYAN]},backgroundOpacity:{selector:'.vjs-bg-opacity > select',id:'captions-background-opacity-%s',label:'Transparency',options:[OPACITY_OPAQUE,OPACITY_SEMI,OPACITY_TRANS]},color:{selector:'.vjs-fg-color > select',id:'captions-foreground-color-%s',label:'Color',options:[COLOR_WHITE,COLOR_BLACK,COLOR_RED,COLOR_GREEN,COLOR_BLUE,COLOR_YELLOW,COLOR_MAGENTA,COLOR_CYAN]},edgeStyle:{selector:'.vjs-edge-style > select',id:'%s',label:'Text Edge Style',options:[['none','None'],['raised','Raised'],['depressed','Depressed'],['uniform','Uniform'],['dropshadow','Dropshadow']]},fontFamily:{selector:'.vjs-font-family > select',id:'captions-font-family-%s',label:'Font Family',options:[['proportionalSansSerif','Proportional Sans-Serif'],['monospaceSansSerif','Monospace Sans-Serif'],['proportionalSerif','Proportional Serif'],['monospaceSerif','Monospace Serif'],['casual','Casual'],['script','Script'],['small-caps','Small Caps']]},fontPercent:{selector:'.vjs-font-percent > select',id:'captions-font-size-%s',label:'Font Size',options:[['0.50','50%'],['0.75','75%'],['1.00','100%'],['1.25','125%'],['1.50','150%'],['1.75','175%'],['2.00','200%'],['3.00','300%'],['4.00','400%']],'default':2,parser:function parser(v){return v==='1.00'?null:Number(v);}},textOpacity:{selector:'.vjs-text-opacity > select',id:'captions-foreground-opacity-%s',label:'Transparency',options:[OPACITY_OPAQUE,OPACITY_SEMI]},// Options for this object are defined below.
windowColor:{selector:'.vjs-window-color > select',id:'captions-window-color-%s',label:'Color'},// Options for this object are defined below.
windowOpacity:{selector:'.vjs-window-opacity > select',id:'captions-window-opacity-%s',label:'Transparency',options:[OPACITY_TRANS,OPACITY_SEMI,OPACITY_OPAQUE]}};selectConfigs.windowColor.options=selectConfigs.backgroundColor.options;/**
 * Get the actual value of an option.
 *
 * @param  {string} value
 *         The value to get
 *
 * @param  {Function} [parser]
 *         Optional function to adjust the value.
 *
 * @return {Mixed}
 *         - Will be `undefined` if no value exists
 *         - Will be `undefined` if the given value is "none".
 *         - Will be the actual value otherwise.
 *
 * @private
 */function parseOptionValue(value,parser){if(parser){value=parser(value);}if(value&&value!=='none'){return value;}}/**
 * Gets the value of the selected <option> element within a <select> element.
 *
 * @param  {Element} el
 *         the element to look in
 *
 * @param  {Function} [parser]
 *         Optional function to adjust the value.
 *
 * @return {Mixed}
 *         - Will be `undefined` if no value exists
 *         - Will be `undefined` if the given value is "none".
 *         - Will be the actual value otherwise.
 *
 * @private
 */function getSelectedOptionValue(el,parser){var value=el.options[el.options.selectedIndex].value;return parseOptionValue(value,parser);}/**
 * Sets the selected <option> element within a <select> element based on a
 * given value.
 *
 * @param {Element} el
 *        The element to look in.
 *
 * @param {string} value
 *        the property to look on.
 *
 * @param {Function} [parser]
 *        Optional function to adjust the value before comparing.
 *
 * @private
 */function setSelectedOption(el,value,parser){if(!value){return;}for(var i=0;i<el.options.length;i++){if(parseOptionValue(el.options[i].value,parser)===value){el.selectedIndex=i;break;}}}/**
 * Manipulate Text Tracks settings.
 *
 * @extends ModalDialog
 */var TextTrackSettings=function(_ModalDialog){inherits(TextTrackSettings,_ModalDialog);/**
   * Creates an instance of this class.
   *
   * @param {Player} player
   *         The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *         The key/value store of player options.
   */function TextTrackSettings(player,options){classCallCheck(this,TextTrackSettings);options.temporary=false;var _this=possibleConstructorReturn(this,_ModalDialog.call(this,player,options));_this.updateDisplay=bind(_this,_this.updateDisplay);// fill the modal and pretend we have opened it
_this.fill();_this.hasBeenOpened_=_this.hasBeenFilled_=true;_this.endDialog=createEl('p',{className:'vjs-control-text',textContent:_this.localize('End of dialog window.')});_this.el().appendChild(_this.endDialog);_this.setDefaults();// Grab `persistTextTrackSettings` from the player options if not passed in child options
if(options.persistTextTrackSettings===undefined){_this.options_.persistTextTrackSettings=_this.options_.playerOptions.persistTextTrackSettings;}_this.on(_this.$('.vjs-done-button'),'click',function(){_this.saveSettings();_this.close();});_this.on(_this.$('.vjs-default-button'),'click',function(){_this.setDefaults();_this.updateDisplay();});each(selectConfigs,function(config){_this.on(_this.$(config.selector),'change',_this.updateDisplay);});if(_this.options_.persistTextTrackSettings){_this.restoreSettings();}return _this;}TextTrackSettings.prototype.dispose=function dispose(){this.endDialog=null;_ModalDialog.prototype.dispose.call(this);};/**
   * Create a <select> element with configured options.
   *
   * @param {string} key
   *        Configuration key to use during creation.
   *
   * @return {string}
   *         An HTML string.
   *
   * @private
   */TextTrackSettings.prototype.createElSelect_=function createElSelect_(key){var _this2=this;var legendId=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'';var type=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'label';var config=selectConfigs[key];var id=config.id.replace('%s',this.id_);var selectLabelledbyIds=[legendId,id].join(' ').trim();return ['<'+type+' id="'+id+'" class="'+(type==='label'?'vjs-label':'')+'">',this.localize(config.label),'</'+type+'>','<select aria-labelledby="'+selectLabelledbyIds+'">'].concat(config.options.map(function(o){var optionId=id+'-'+o[1].replace(/\W+/g,'');return ['<option id="'+optionId+'" value="'+o[0]+'" ','aria-labelledby="'+selectLabelledbyIds+' '+optionId+'">',_this2.localize(o[1]),'</option>'].join('');})).concat('</select>').join('');};/**
   * Create foreground color element for the component
   *
   * @return {string}
   *         An HTML string.
   *
   * @private
   */TextTrackSettings.prototype.createElFgColor_=function createElFgColor_(){var legendId='captions-text-legend-'+this.id_;return ['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+legendId+'">',this.localize('Text'),'</legend>',this.createElSelect_('color',legendId),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_('textOpacity',legendId),'</span>','</fieldset>'].join('');};/**
   * Create background color element for the component
   *
   * @return {string}
   *         An HTML string.
   *
   * @private
   */TextTrackSettings.prototype.createElBgColor_=function createElBgColor_(){var legendId='captions-background-'+this.id_;return ['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+legendId+'">',this.localize('Background'),'</legend>',this.createElSelect_('backgroundColor',legendId),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_('backgroundOpacity',legendId),'</span>','</fieldset>'].join('');};/**
   * Create window color element for the component
   *
   * @return {string}
   *         An HTML string.
   *
   * @private
   */TextTrackSettings.prototype.createElWinColor_=function createElWinColor_(){var legendId='captions-window-'+this.id_;return ['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+legendId+'">',this.localize('Window'),'</legend>',this.createElSelect_('windowColor',legendId),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_('windowOpacity',legendId),'</span>','</fieldset>'].join('');};/**
   * Create color elements for the component
   *
   * @return {Element}
   *         The element that was created
   *
   * @private
   */TextTrackSettings.prototype.createElColors_=function createElColors_(){return createEl('div',{className:'vjs-track-settings-colors',innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join('')});};/**
   * Create font elements for the component
   *
   * @return {Element}
   *         The element that was created.
   *
   * @private
   */TextTrackSettings.prototype.createElFont_=function createElFont_(){return createEl('div',{className:'vjs-track-settings-font',innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_('fontPercent','','legend'),'</fieldset>','<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_('edgeStyle','','legend'),'</fieldset>','<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_('fontFamily','','legend'),'</fieldset>'].join('')});};/**
   * Create controls for the component
   *
   * @return {Element}
   *         The element that was created.
   *
   * @private
   */TextTrackSettings.prototype.createElControls_=function createElControls_(){var defaultsDescription=this.localize('restore all settings to the default values');return createEl('div',{className:'vjs-track-settings-controls',innerHTML:['<button type="button" class="vjs-default-button" title="'+defaultsDescription+'">',this.localize('Reset'),'<span class="vjs-control-text"> '+defaultsDescription+'</span>','</button>','<button type="button" class="vjs-done-button">'+this.localize('Done')+'</button>'].join('')});};TextTrackSettings.prototype.content=function content(){return [this.createElColors_(),this.createElFont_(),this.createElControls_()];};TextTrackSettings.prototype.label=function label(){return this.localize('Caption Settings Dialog');};TextTrackSettings.prototype.description=function description(){return this.localize('Beginning of dialog window. Escape will cancel and close the window.');};TextTrackSettings.prototype.buildCSSClass=function buildCSSClass(){return _ModalDialog.prototype.buildCSSClass.call(this)+' vjs-text-track-settings';};/**
   * Gets an object of text track settings (or null).
   *
   * @return {Object}
   *         An object with config values parsed from the DOM or localStorage.
   */TextTrackSettings.prototype.getValues=function getValues(){var _this3=this;return reduce(selectConfigs,function(accum,config,key){var value=getSelectedOptionValue(_this3.$(config.selector),config.parser);if(value!==undefined){accum[key]=value;}return accum;},{});};/**
   * Sets text track settings from an object of values.
   *
   * @param {Object} values
   *        An object with config values parsed from the DOM or localStorage.
   */TextTrackSettings.prototype.setValues=function setValues(values){var _this4=this;each(selectConfigs,function(config,key){setSelectedOption(_this4.$(config.selector),values[key],config.parser);});};/**
   * Sets all `<select>` elements to their default values.
   */TextTrackSettings.prototype.setDefaults=function setDefaults(){var _this5=this;each(selectConfigs,function(config){var index=config.hasOwnProperty('default')?config['default']:0;_this5.$(config.selector).selectedIndex=index;});};/**
   * Restore texttrack settings from localStorage
   */TextTrackSettings.prototype.restoreSettings=function restoreSettings(){var values=void 0;try{values=JSON.parse(window$1.localStorage.getItem(LOCAL_STORAGE_KEY));}catch(err){log.warn(err);}if(values){this.setValues(values);}};/**
   * Save text track settings to localStorage
   */TextTrackSettings.prototype.saveSettings=function saveSettings(){if(!this.options_.persistTextTrackSettings){return;}var values=this.getValues();try{if(Object.keys(values).length){window$1.localStorage.setItem(LOCAL_STORAGE_KEY,JSON.stringify(values));}else {window$1.localStorage.removeItem(LOCAL_STORAGE_KEY);}}catch(err){log.warn(err);}};/**
   * Update display of text track settings
   */TextTrackSettings.prototype.updateDisplay=function updateDisplay(){var ttDisplay=this.player_.getChild('textTrackDisplay');if(ttDisplay){ttDisplay.updateDisplay();}};/**
   * conditionally blur the element and refocus the captions button
   *
   * @private
   */TextTrackSettings.prototype.conditionalBlur_=function conditionalBlur_(){this.previouslyActiveEl_=null;this.off(document$1,'keydown',this.handleKeyDown);var cb=this.player_.controlBar;var subsCapsBtn=cb&&cb.subsCapsButton;var ccBtn=cb&&cb.captionsButton;if(subsCapsBtn){subsCapsBtn.focus();}else if(ccBtn){ccBtn.focus();}};return TextTrackSettings;}(ModalDialog);Component.registerComponent('TextTrackSettings',TextTrackSettings);/**
 * @file resize-manager.js
 */ /**
 * A Resize Manager. It is in charge of triggering `playerresize` on the player in the right conditions.
 *
 * It'll either create an iframe and use a debounced resize handler on it or use the new {@link https://wicg.github.io/ResizeObserver/|ResizeObserver}.
 *
 * If the ResizeObserver is available natively, it will be used. A polyfill can be passed in as an option.
 * If a `playerresize` event is not needed, the ResizeManager component can be removed from the player, see the example below.
 * @example <caption>How to disable the resize manager</caption>
 * const player = videojs('#vid', {
 *   resizeManager: false
 * });
 *
 * @see {@link https://wicg.github.io/ResizeObserver/|ResizeObserver specification}
 *
 * @extends Component
 */var ResizeManager=function(_Component){inherits(ResizeManager,_Component);/**
   * Create the ResizeManager.
   *
   * @param {Object} player
   *        The `Player` that this class should be attached to.
   *
   * @param {Object} [options]
   *        The key/value store of ResizeManager options.
   *
   * @param {Object} [options.ResizeObserver]
   *        A polyfill for ResizeObserver can be passed in here.
   *        If this is set to null it will ignore the native ResizeObserver and fall back to the iframe fallback.
   */function ResizeManager(player,options){classCallCheck(this,ResizeManager);var RESIZE_OBSERVER_AVAILABLE=options.ResizeObserver||window$1.ResizeObserver;// if `null` was passed, we want to disable the ResizeObserver
if(options.ResizeObserver===null){RESIZE_OBSERVER_AVAILABLE=false;}// Only create an element when ResizeObserver isn't available
var options_=mergeOptions({createEl:!RESIZE_OBSERVER_AVAILABLE},options);var _this=possibleConstructorReturn(this,_Component.call(this,player,options_));_this.ResizeObserver=options.ResizeObserver||window$1.ResizeObserver;_this.loadListener_=null;_this.resizeObserver_=null;_this.debouncedHandler_=debounce(function(){_this.resizeHandler();},100,false,_this);if(RESIZE_OBSERVER_AVAILABLE){_this.resizeObserver_=new _this.ResizeObserver(_this.debouncedHandler_);_this.resizeObserver_.observe(player.el());}else {_this.loadListener_=function(){if(!_this.el_||!_this.el_.contentWindow){return;}on(_this.el_.contentWindow,'resize',_this.debouncedHandler_);};_this.one('load',_this.loadListener_);}return _this;}ResizeManager.prototype.createEl=function createEl(){return _Component.prototype.createEl.call(this,'iframe',{className:'vjs-resize-manager'});};/**
   * Called when a resize is triggered on the iframe or a resize is observed via the ResizeObserver
   *
   * @fires Player#playerresize
   */ResizeManager.prototype.resizeHandler=function resizeHandler(){/**
     * Called when the player size has changed
     *
     * @event Player#playerresize
     * @type {EventTarget~Event}
     */ // make sure player is still around to trigger
// prevents this from causing an error after dispose
if(!this.player_||!this.player_.trigger){return;}this.player_.trigger('playerresize');};ResizeManager.prototype.dispose=function dispose(){if(this.debouncedHandler_){this.debouncedHandler_.cancel();}if(this.resizeObserver_){if(this.player_.el()){this.resizeObserver_.unobserve(this.player_.el());}this.resizeObserver_.disconnect();}if(this.el_&&this.el_.contentWindow){off(this.el_.contentWindow,'resize',this.debouncedHandler_);}if(this.loadListener_){this.off('load',this.loadListener_);}this.ResizeObserver=null;this.resizeObserver=null;this.debouncedHandler_=null;this.loadListener_=null;};return ResizeManager;}(Component);Component.registerComponent('ResizeManager',ResizeManager);/**
 * This function is used to fire a sourceset when there is something
 * similar to `mediaEl.load()` being called. It will try to find the source via
 * the `src` attribute and then the `<source>` elements. It will then fire `sourceset`
 * with the source that was found or empty string if we cannot know. If it cannot
 * find a source then `sourceset` will not be fired.
 *
 * @param {Html5} tech
 *        The tech object that sourceset was setup on
 *
 * @return {boolean}
 *         returns false if the sourceset was not fired and true otherwise.
 */var sourcesetLoad=function sourcesetLoad(tech){var el=tech.el();// if `el.src` is set, that source will be loaded.
if(el.hasAttribute('src')){tech.triggerSourceset(el.src);return true;}/**
   * Since there isn't a src property on the media element, source elements will be used for
   * implementing the source selection algorithm. This happens asynchronously and
   * for most cases were there is more than one source we cannot tell what source will
   * be loaded, without re-implementing the source selection algorithm. At this time we are not
   * going to do that. There are three special cases that we do handle here though:
   *
   * 1. If there are no sources, do not fire `sourceset`.
   * 2. If there is only one `<source>` with a `src` property/attribute that is our `src`
   * 3. If there is more than one `<source>` but all of them have the same `src` url.
   *    That will be our src.
   */var sources=tech.$$('source');var srcUrls=[];var src='';// if there are no sources, do not fire sourceset
if(!sources.length){return false;}// only count valid/non-duplicate source elements
for(var i=0;i<sources.length;i++){var url=sources[i].src;if(url&&srcUrls.indexOf(url)===-1){srcUrls.push(url);}}// there were no valid sources
if(!srcUrls.length){return false;}// there is only one valid source element url
// use that
if(srcUrls.length===1){src=srcUrls[0];}tech.triggerSourceset(src);return true;};/**
 * our implementation of an `innerHTML` descriptor for browsers
 * that do not have one.
 */var innerHTMLDescriptorPolyfill={};if(!IS_IE8){innerHTMLDescriptorPolyfill=Object.defineProperty({},'innerHTML',{get:function get(){return this.cloneNode(true).innerHTML;},set:function set(v){// make a dummy node to use innerHTML on
var dummy=document$1.createElement(this.nodeName.toLowerCase());// set innerHTML to the value provided
dummy.innerHTML=v;// make a document fragment to hold the nodes from dummy
var docFrag=document$1.createDocumentFragment();// copy all of the nodes created by the innerHTML on dummy
// to the document fragment
while(dummy.childNodes.length){docFrag.appendChild(dummy.childNodes[0]);}// remove content
this.innerText='';// now we add all of that html in one by appending the
// document fragment. This is how innerHTML does it.
window$1.Element.prototype.appendChild.call(this,docFrag);// then return the result that innerHTML's setter would
return this.innerHTML;}});}/**
 * Get a property descriptor given a list of priorities and the
 * property to get.
 */var getDescriptor=function getDescriptor(priority,prop){var descriptor={};for(var i=0;i<priority.length;i++){descriptor=Object.getOwnPropertyDescriptor(priority[i],prop);if(descriptor&&descriptor.set&&descriptor.get){break;}}descriptor.enumerable=true;descriptor.configurable=true;return descriptor;};var getInnerHTMLDescriptor=function getInnerHTMLDescriptor(tech){return getDescriptor([tech.el(),window$1.HTMLMediaElement.prototype,window$1.Element.prototype,innerHTMLDescriptorPolyfill],'innerHTML');};/**
 * Patches browser internal functions so that we can tell syncronously
 * if a `<source>` was appended to the media element. For some reason this
 * causes a `sourceset` if the the media element is ready and has no source.
 * This happens when:
 * - The page has just loaded and the media element does not have a source.
 * - The media element was emptied of all sources, then `load()` was called.
 *
 * It does this by patching the following functions/properties when they are supported:
 *
 * - `append()` - can be used to add a `<source>` element to the media element
 * - `appendChild()` - can be used to add a `<source>` element to the media element
 * - `insertAdjacentHTML()` -  can be used to add a `<source>` element to the media element
 * - `innerHTML` -  can be used to add a `<source>` element to the media element
 *
 * @param {Html5} tech
 *        The tech object that sourceset is being setup on.
 */var firstSourceWatch=function firstSourceWatch(tech){var el=tech.el();// make sure firstSourceWatch isn't setup twice.
if(el.resetSourceWatch_){return;}var old={};var innerDescriptor=getInnerHTMLDescriptor(tech);var appendWrapper=function appendWrapper(appendFn){return function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}var retval=appendFn.apply(el,args);sourcesetLoad(tech);return retval;};};['append','appendChild','insertAdjacentHTML'].forEach(function(k){if(!el[k]){return;}// store the old function
old[k]=el[k];// call the old function with a sourceset if a source
// was loaded
el[k]=appendWrapper(old[k]);});Object.defineProperty(el,'innerHTML',mergeOptions(innerDescriptor,{set:appendWrapper(innerDescriptor.set)}));el.resetSourceWatch_=function(){el.resetSourceWatch_=null;Object.keys(old).forEach(function(k){el[k]=old[k];});Object.defineProperty(el,'innerHTML',innerDescriptor);};// on the first sourceset, we need to revert our changes
tech.one('sourceset',el.resetSourceWatch_);};/**
 * our implementation of a `src` descriptor for browsers
 * that do not have one.
 */var srcDescriptorPolyfill={};if(!IS_IE8){srcDescriptorPolyfill=Object.defineProperty({},'src',{get:function get(){if(this.hasAttribute('src')){return getAbsoluteURL(window$1.Element.prototype.getAttribute.call(this,'src'));}return '';},set:function set(v){window$1.Element.prototype.setAttribute.call(this,'src',v);return v;}});}var getSrcDescriptor=function getSrcDescriptor(tech){return getDescriptor([tech.el(),window$1.HTMLMediaElement.prototype,srcDescriptorPolyfill],'src');};/**
 * setup `sourceset` handling on the `Html5` tech. This function
 * patches the following element properties/functions:
 *
 * - `src` - to determine when `src` is set
 * - `setAttribute()` - to determine when `src` is set
 * - `load()` - this re-triggers the source selection algorithm, and can
 *              cause a sourceset.
 *
 * If there is no source when we are adding `sourceset` support or during a `load()`
 * we also patch the functions listed in `firstSourceWatch`.
 *
 * @param {Html5} tech
 *        The tech to patch
 */var setupSourceset=function setupSourceset(tech){if(!tech.featuresSourceset){return;}var el=tech.el();// make sure sourceset isn't setup twice.
if(el.resetSourceset_){return;}var srcDescriptor=getSrcDescriptor(tech);var oldSetAttribute=el.setAttribute;var oldLoad=el.load;Object.defineProperty(el,'src',mergeOptions(srcDescriptor,{set:function set(v){var retval=srcDescriptor.set.call(el,v);// we use the getter here to get the actual value set on src
tech.triggerSourceset(el.src);return retval;}}));el.setAttribute=function(n,v){var retval=oldSetAttribute.call(el,n,v);if(/src/i.test(n)){tech.triggerSourceset(el.src);}return retval;};el.load=function(){var retval=oldLoad.call(el);// if load was called, but there was no source to fire
// sourceset on. We have to watch for a source append
// as that can trigger a `sourceset` when the media element
// has no source
if(!sourcesetLoad(tech)){tech.triggerSourceset('');firstSourceWatch(tech);}return retval;};if(el.currentSrc){tech.triggerSourceset(el.currentSrc);}else if(!sourcesetLoad(tech)){firstSourceWatch(tech);}el.resetSourceset_=function(){el.resetSourceset_=null;el.load=oldLoad;el.setAttribute=oldSetAttribute;Object.defineProperty(el,'src',srcDescriptor);if(el.resetSourceWatch_){el.resetSourceWatch_();}};};var _templateObject$2=taggedTemplateLiteralLoose(['Text Tracks are being loaded from another origin but the crossorigin attribute isn\'t used.\n            This may prevent text tracks from loading.'],['Text Tracks are being loaded from another origin but the crossorigin attribute isn\'t used.\n            This may prevent text tracks from loading.']);/**
 * @file html5.js
 */ /**
 * HTML5 Media Controller - Wrapper for HTML5 Media API
 *
 * @mixes Tech~SouceHandlerAdditions
 * @extends Tech
 */var Html5=function(_Tech){inherits(Html5,_Tech);/**
   * Create an instance of this Tech.
   *
   * @param {Object} [options]
   *        The key/value store of player options.
   *
   * @param {Component~ReadyCallback} ready
   *        Callback function to call when the `HTML5` Tech is ready.
   */function Html5(options,ready){classCallCheck(this,Html5);var _this=possibleConstructorReturn(this,_Tech.call(this,options,ready));var source=options.source;var crossoriginTracks=false;// Set the source if one is provided
// 1) Check if the source is new (if not, we want to keep the original so playback isn't interrupted)
// 2) Check to see if the network state of the tag was failed at init, and if so, reset the source
// anyway so the error gets fired.
if(source&&(_this.el_.currentSrc!==source.src||options.tag&&options.tag.initNetworkState_===3)){_this.setSource(source);}else {_this.handleLateInit_(_this.el_);}// setup sourceset after late sourceset/init
if(options.enableSourceset){_this.setupSourcesetHandling_();}if(_this.el_.hasChildNodes()){var nodes=_this.el_.childNodes;var nodesLength=nodes.length;var removeNodes=[];while(nodesLength--){var node=nodes[nodesLength];var nodeName=node.nodeName.toLowerCase();if(nodeName==='track'){if(!_this.featuresNativeTextTracks){// Empty video tag tracks so the built-in player doesn't use them also.
// This may not be fast enough to stop HTML5 browsers from reading the tags
// so we'll need to turn off any default tracks if we're manually doing
// captions and subtitles. videoElement.textTracks
removeNodes.push(node);}else {// store HTMLTrackElement and TextTrack to remote list
_this.remoteTextTrackEls().addTrackElement_(node);_this.remoteTextTracks().addTrack(node.track);_this.textTracks().addTrack(node.track);if(!crossoriginTracks&&!_this.el_.hasAttribute('crossorigin')&&isCrossOrigin(node.src)){crossoriginTracks=true;}}}}for(var i=0;i<removeNodes.length;i++){_this.el_.removeChild(removeNodes[i]);}}_this.proxyNativeTracks_();if(_this.featuresNativeTextTracks&&crossoriginTracks){log.warn(tsml(_templateObject$2));}// prevent iOS Safari from disabling metadata text tracks during native playback
_this.restoreMetadataTracksInIOSNativePlayer_();// Determine if native controls should be used
// Our goal should be to get the custom controls on mobile solid everywhere
// so we can remove this all together. Right now this will block custom
// controls on touch enabled laptops like the Chrome Pixel
if((TOUCH_ENABLED||IS_IPHONE||IS_NATIVE_ANDROID)&&options.nativeControlsForTouch===true){_this.setControls(true);}// on iOS, we want to proxy `webkitbeginfullscreen` and `webkitendfullscreen`
// into a `fullscreenchange` event
_this.proxyWebkitFullscreen_();_this.triggerReady();return _this;}/**
   * Dispose of `HTML5` media element and remove all tracks.
   */Html5.prototype.dispose=function dispose(){if(this.el_&&this.el_.resetSourceset_){this.el_.resetSourceset_();}Html5.disposeMediaElement(this.el_);this.options_=null;// tech will handle clearing of the emulated track list
_Tech.prototype.dispose.call(this);};/**
   * Modify the media element so that we can detect when
   * the source is changed. Fires `sourceset` just after the source has changed
   */Html5.prototype.setupSourcesetHandling_=function setupSourcesetHandling_(){setupSourceset(this);};/**
   * When a captions track is enabled in the iOS Safari native player, all other
   * tracks are disabled (including metadata tracks), which nulls all of their
   * associated cue points. This will restore metadata tracks to their pre-fullscreen
   * state in those cases so that cue points are not needlessly lost.
   *
   * @private
   */Html5.prototype.restoreMetadataTracksInIOSNativePlayer_=function restoreMetadataTracksInIOSNativePlayer_(){var textTracks=this.textTracks();var metadataTracksPreFullscreenState=void 0;// captures a snapshot of every metadata track's current state
var takeMetadataTrackSnapshot=function takeMetadataTrackSnapshot(){metadataTracksPreFullscreenState=[];for(var i=0;i<textTracks.length;i++){var track=textTracks[i];if(track.kind==='metadata'){metadataTracksPreFullscreenState.push({track:track,storedMode:track.mode});}}};// snapshot each metadata track's initial state, and update the snapshot
// each time there is a track 'change' event
takeMetadataTrackSnapshot();textTracks.addEventListener('change',takeMetadataTrackSnapshot);this.on('dispose',function(){return textTracks.removeEventListener('change',takeMetadataTrackSnapshot);});var restoreTrackMode=function restoreTrackMode(){for(var i=0;i<metadataTracksPreFullscreenState.length;i++){var storedTrack=metadataTracksPreFullscreenState[i];if(storedTrack.track.mode==='disabled'&&storedTrack.track.mode!==storedTrack.storedMode){storedTrack.track.mode=storedTrack.storedMode;}}// we only want this handler to be executed on the first 'change' event
textTracks.removeEventListener('change',restoreTrackMode);};// when we enter fullscreen playback, stop updating the snapshot and
// restore all track modes to their pre-fullscreen state
this.on('webkitbeginfullscreen',function(){textTracks.removeEventListener('change',takeMetadataTrackSnapshot);// remove the listener before adding it just in case it wasn't previously removed
textTracks.removeEventListener('change',restoreTrackMode);textTracks.addEventListener('change',restoreTrackMode);});// start updating the snapshot again after leaving fullscreen
this.on('webkitendfullscreen',function(){// remove the listener before adding it just in case it wasn't previously removed
textTracks.removeEventListener('change',takeMetadataTrackSnapshot);textTracks.addEventListener('change',takeMetadataTrackSnapshot);// remove the restoreTrackMode handler in case it wasn't triggered during fullscreen playback
textTracks.removeEventListener('change',restoreTrackMode);});};/**
   * Proxy all native track list events to our track lists if the browser we are playing
   * in supports that type of track list.
   *
   * @private
   */Html5.prototype.proxyNativeTracks_=function proxyNativeTracks_(){var _this2=this;NORMAL.names.forEach(function(name){var props=NORMAL[name];var elTracks=_this2.el()[props.getterName];var techTracks=_this2[props.getterName]();if(!_this2['featuresNative'+props.capitalName+'Tracks']||!elTracks||!elTracks.addEventListener){return;}var listeners={change:function change(e){techTracks.trigger({type:'change',target:techTracks,currentTarget:techTracks,srcElement:techTracks});},addtrack:function addtrack(e){techTracks.addTrack(e.track);},removetrack:function removetrack(e){techTracks.removeTrack(e.track);}};var removeOldTracks=function removeOldTracks(){var removeTracks=[];for(var i=0;i<techTracks.length;i++){var found=false;for(var j=0;j<elTracks.length;j++){if(elTracks[j]===techTracks[i]){found=true;break;}}if(!found){removeTracks.push(techTracks[i]);}}while(removeTracks.length){techTracks.removeTrack(removeTracks.shift());}};Object.keys(listeners).forEach(function(eventName){var listener=listeners[eventName];elTracks.addEventListener(eventName,listener);_this2.on('dispose',function(e){return elTracks.removeEventListener(eventName,listener);});});// Remove (native) tracks that are not used anymore
_this2.on('loadstart',removeOldTracks);_this2.on('dispose',function(e){return _this2.off('loadstart',removeOldTracks);});});};/**
   * Create the `Html5` Tech's DOM element.
   *
   * @return {Element}
   *         The element that gets created.
   */Html5.prototype.createEl=function createEl$$1(){var el=this.options_.tag;// Check if this browser supports moving the element into the box.
// On the iPhone video will break if you move the element,
// So we have to create a brand new element.
// If we ingested the player div, we do not need to move the media element.
if(!el||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){// If the original tag is still there, clone and remove it.
if(el){var clone=el.cloneNode(true);if(el.parentNode){el.parentNode.insertBefore(clone,el);}Html5.disposeMediaElement(el);el=clone;}else {el=document$1.createElement('video');// determine if native controls should be used
var tagAttributes=this.options_.tag&&getAttributes(this.options_.tag);var attributes=mergeOptions({},tagAttributes);if(!TOUCH_ENABLED||this.options_.nativeControlsForTouch!==true){delete attributes.controls;}setAttributes(el,assign(attributes,{id:this.options_.techId,'class':'vjs-tech'}));}el.playerId=this.options_.playerId;}if(typeof this.options_.preload!=='undefined'){setAttribute(el,'preload',this.options_.preload);}// Update specific tag settings, in case they were overridden
// `autoplay` has to be *last* so that `muted` and `playsinline` are present
// when iOS/Safari or other browsers attempt to autoplay.
var settingsAttrs=['loop','muted','playsinline','autoplay'];for(var i=0;i<settingsAttrs.length;i++){var attr=settingsAttrs[i];var value=this.options_[attr];if(typeof value!=='undefined'){if(value){setAttribute(el,attr,attr);}else {removeAttribute(el,attr);}el[attr]=value;}}return el;};/**
   * This will be triggered if the loadstart event has already fired, before videojs was
   * ready. Two known examples of when this can happen are:
   * 1. If we're loading the playback object after it has started loading
   * 2. The media is already playing the (often with autoplay on) then
   *
   * This function will fire another loadstart so that videojs can catchup.
   *
   * @fires Tech#loadstart
   *
   * @return {undefined}
   *         returns nothing.
   */Html5.prototype.handleLateInit_=function handleLateInit_(el){if(el.networkState===0||el.networkState===3){// The video element hasn't started loading the source yet
// or didn't find a source
return;}if(el.readyState===0){// NetworkState is set synchronously BUT loadstart is fired at the
// end of the current stack, usually before setInterval(fn, 0).
// So at this point we know loadstart may have already fired or is
// about to fire, and either way the player hasn't seen it yet.
// We don't want to fire loadstart prematurely here and cause a
// double loadstart so we'll wait and see if it happens between now
// and the next loop, and fire it if not.
// HOWEVER, we also want to make sure it fires before loadedmetadata
// which could also happen between now and the next loop, so we'll
// watch for that also.
var loadstartFired=false;var setLoadstartFired=function setLoadstartFired(){loadstartFired=true;};this.on('loadstart',setLoadstartFired);var triggerLoadstart=function triggerLoadstart(){// We did miss the original loadstart. Make sure the player
// sees loadstart before loadedmetadata
if(!loadstartFired){this.trigger('loadstart');}};this.on('loadedmetadata',triggerLoadstart);this.ready(function(){this.off('loadstart',setLoadstartFired);this.off('loadedmetadata',triggerLoadstart);if(!loadstartFired){// We did miss the original native loadstart. Fire it now.
this.trigger('loadstart');}});return;}// From here on we know that loadstart already fired and we missed it.
// The other readyState events aren't as much of a problem if we double
// them, so not going to go to as much trouble as loadstart to prevent
// that unless we find reason to.
var eventsToTrigger=['loadstart'];// loadedmetadata: newly equal to HAVE_METADATA (1) or greater
eventsToTrigger.push('loadedmetadata');// loadeddata: newly increased to HAVE_CURRENT_DATA (2) or greater
if(el.readyState>=2){eventsToTrigger.push('loadeddata');}// canplay: newly increased to HAVE_FUTURE_DATA (3) or greater
if(el.readyState>=3){eventsToTrigger.push('canplay');}// canplaythrough: newly equal to HAVE_ENOUGH_DATA (4)
if(el.readyState>=4){eventsToTrigger.push('canplaythrough');}// We still need to give the player time to add event listeners
this.ready(function(){eventsToTrigger.forEach(function(type){this.trigger(type);},this);});};/**
   * Set current time for the `HTML5` tech.
   *
   * @param {number} seconds
   *        Set the current time of the media to this.
   */Html5.prototype.setCurrentTime=function setCurrentTime(seconds){try{this.el_.currentTime=seconds;}catch(e){log(e,'Video is not ready. (Video.js)');// this.warning(VideoJS.warnings.videoNotReady);
}};/**
   * Get the current duration of the HTML5 media element.
   *
   * @return {number}
   *         The duration of the media or 0 if there is no duration.
   */Html5.prototype.duration=function duration(){var _this3=this;// Android Chrome will report duration as Infinity for VOD HLS until after
// playback has started, which triggers the live display erroneously.
// Return NaN if playback has not started and trigger a durationupdate once
// the duration can be reliably known.
if(this.el_.duration===Infinity&&IS_ANDROID&&IS_CHROME&&this.el_.currentTime===0){// Wait for the first `timeupdate` with currentTime > 0 - there may be
// several with 0
var checkProgress=function checkProgress(){if(_this3.el_.currentTime>0){// Trigger durationchange for genuinely live video
if(_this3.el_.duration===Infinity){_this3.trigger('durationchange');}_this3.off('timeupdate',checkProgress);}};this.on('timeupdate',checkProgress);return NaN;}return this.el_.duration||NaN;};/**
   * Get the current width of the HTML5 media element.
   *
   * @return {number}
   *         The width of the HTML5 media element.
   */Html5.prototype.width=function width(){return this.el_.offsetWidth;};/**
   * Get the current height of the HTML5 media element.
   *
   * @return {number}
   *         The heigth of the HTML5 media element.
   */Html5.prototype.height=function height(){return this.el_.offsetHeight;};/**
   * Proxy iOS `webkitbeginfullscreen` and `webkitendfullscreen` into
   * `fullscreenchange` event.
   *
   * @private
   * @fires fullscreenchange
   * @listens webkitendfullscreen
   * @listens webkitbeginfullscreen
   * @listens webkitbeginfullscreen
   */Html5.prototype.proxyWebkitFullscreen_=function proxyWebkitFullscreen_(){var _this4=this;if(!('webkitDisplayingFullscreen'in this.el_)){return;}var endFn=function endFn(){this.trigger('fullscreenchange',{isFullscreen:false});};var beginFn=function beginFn(){if('webkitPresentationMode'in this.el_&&this.el_.webkitPresentationMode!=='picture-in-picture'){this.one('webkitendfullscreen',endFn);this.trigger('fullscreenchange',{isFullscreen:true});}};this.on('webkitbeginfullscreen',beginFn);this.on('dispose',function(){_this4.off('webkitbeginfullscreen',beginFn);_this4.off('webkitendfullscreen',endFn);});};/**
   * Check if fullscreen is supported on the current playback device.
   *
   * @return {boolean}
   *         - True if fullscreen is supported.
   *         - False if fullscreen is not supported.
   */Html5.prototype.supportsFullScreen=function supportsFullScreen(){if(typeof this.el_.webkitEnterFullScreen==='function'){var userAgent=window$1.navigator&&window$1.navigator.userAgent||'';// Seems to be broken in Chromium/Chrome && Safari in Leopard
if(/Android/.test(userAgent)||!/Chrome|Mac OS X 10.5/.test(userAgent)){return true;}}return false;};/**
   * Request that the `HTML5` Tech enter fullscreen.
   */Html5.prototype.enterFullScreen=function enterFullScreen(){var video=this.el_;if(video.paused&&video.networkState<=video.HAVE_METADATA){// attempt to prime the video element for programmatic access
// this isn't necessary on the desktop but shouldn't hurt
this.el_.play();// playing and pausing synchronously during the transition to fullscreen
// can get iOS ~6.1 devices into a play/pause loop
this.setTimeout(function(){video.pause();video.webkitEnterFullScreen();},0);}else {video.webkitEnterFullScreen();}};/**
   * Request that the `HTML5` Tech exit fullscreen.
   */Html5.prototype.exitFullScreen=function exitFullScreen(){this.el_.webkitExitFullScreen();};/**
   * A getter/setter for the `Html5` Tech's source object.
   * > Note: Please use {@link Html5#setSource}
   *
   * @param {Tech~SourceObject} [src]
   *        The source object you want to set on the `HTML5` techs element.
   *
   * @return {Tech~SourceObject|undefined}
   *         - The current source object when a source is not passed in.
   *         - undefined when setting
   *
   * @deprecated Since version 5.
   */Html5.prototype.src=function src(_src){if(_src===undefined){return this.el_.src;}// Setting src through `src` instead of `setSrc` will be deprecated
this.setSrc(_src);};/**
   * Reset the tech by removing all sources and then calling
   * {@link Html5.resetMediaElement}.
   */Html5.prototype.reset=function reset(){Html5.resetMediaElement(this.el_);};/**
   * Get the current source on the `HTML5` Tech. Falls back to returning the source from
   * the HTML5 media element.
   *
   * @return {Tech~SourceObject}
   *         The current source object from the HTML5 tech. With a fallback to the
   *         elements source.
   */Html5.prototype.currentSrc=function currentSrc(){if(this.currentSource_){return this.currentSource_.src;}return this.el_.currentSrc;};/**
   * Set controls attribute for the HTML5 media Element.
   *
   * @param {string} val
   *        Value to set the controls attribute to
   */Html5.prototype.setControls=function setControls(val){this.el_.controls=!!val;};/**
   * Create and returns a remote {@link TextTrack} object.
   *
   * @param {string} kind
   *        `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)
   *
   * @param {string} [label]
   *        Label to identify the text track
   *
   * @param {string} [language]
   *        Two letter language abbreviation
   *
   * @return {TextTrack}
   *         The TextTrack that gets created.
   */Html5.prototype.addTextTrack=function addTextTrack(kind,label,language){if(!this.featuresNativeTextTracks){return _Tech.prototype.addTextTrack.call(this,kind,label,language);}return this.el_.addTextTrack(kind,label,language);};/**
   * Creates either native TextTrack or an emulated TextTrack depending
   * on the value of `featuresNativeTextTracks`
   *
   * @param {Object} options
   *        The object should contain the options to intialize the TextTrack with.
   *
   * @param {string} [options.kind]
   *        `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata).
   *
   * @param {string} [options.label].
   *        Label to identify the text track
   *
   * @param {string} [options.language]
   *        Two letter language abbreviation.
   *
   * @param {boolean} [options.default]
   *        Default this track to on.
   *
   * @param {string} [options.id]
   *        The internal id to assign this track.
   *
   * @param {string} [options.src]
   *        A source url for the track.
   *
   * @return {HTMLTrackElement}
   *         The track element that gets created.
   */Html5.prototype.createRemoteTextTrack=function createRemoteTextTrack(options){if(!this.featuresNativeTextTracks){return _Tech.prototype.createRemoteTextTrack.call(this,options);}var htmlTrackElement=document$1.createElement('track');if(options.kind){htmlTrackElement.kind=options.kind;}if(options.label){htmlTrackElement.label=options.label;}if(options.language||options.srclang){htmlTrackElement.srclang=options.language||options.srclang;}if(options['default']){htmlTrackElement['default']=options['default'];}if(options.id){htmlTrackElement.id=options.id;}if(options.src){htmlTrackElement.src=options.src;}return htmlTrackElement;};/**
   * Creates a remote text track object and returns an html track element.
   *
   * @param {Object} options The object should contain values for
   * kind, language, label, and src (location of the WebVTT file)
   * @param {Boolean} [manualCleanup=true] if set to false, the TextTrack will be
   * automatically removed from the video element whenever the source changes
   * @return {HTMLTrackElement} An Html Track Element.
   * This can be an emulated {@link HTMLTrackElement} or a native one.
   * @deprecated The default value of the "manualCleanup" parameter will default
   * to "false" in upcoming versions of Video.js
   */Html5.prototype.addRemoteTextTrack=function addRemoteTextTrack(options,manualCleanup){var htmlTrackElement=_Tech.prototype.addRemoteTextTrack.call(this,options,manualCleanup);if(this.featuresNativeTextTracks){this.el().appendChild(htmlTrackElement);}return htmlTrackElement;};/**
   * Remove remote `TextTrack` from `TextTrackList` object
   *
   * @param {TextTrack} track
   *        `TextTrack` object to remove
   */Html5.prototype.removeRemoteTextTrack=function removeRemoteTextTrack(track){_Tech.prototype.removeRemoteTextTrack.call(this,track);if(this.featuresNativeTextTracks){var tracks=this.$$('track');var i=tracks.length;while(i--){if(track===tracks[i]||track===tracks[i].track){this.el().removeChild(tracks[i]);}}}};/**
   * Gets available media playback quality metrics as specified by the W3C's Media
   * Playback Quality API.
   *
   * @see [Spec]{@link https://wicg.github.io/media-playback-quality}
   *
   * @return {Object}
   *         An object with supported media playback quality metrics
   */Html5.prototype.getVideoPlaybackQuality=function getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality==='function'){return this.el().getVideoPlaybackQuality();}var videoPlaybackQuality={};if(typeof this.el().webkitDroppedFrameCount!=='undefined'&&typeof this.el().webkitDecodedFrameCount!=='undefined'){videoPlaybackQuality.droppedVideoFrames=this.el().webkitDroppedFrameCount;videoPlaybackQuality.totalVideoFrames=this.el().webkitDecodedFrameCount;}if(window$1.performance&&typeof window$1.performance.now==='function'){videoPlaybackQuality.creationTime=window$1.performance.now();}else if(window$1.performance&&window$1.performance.timing&&typeof window$1.performance.timing.navigationStart==='number'){videoPlaybackQuality.creationTime=window$1.Date.now()-window$1.performance.timing.navigationStart;}return videoPlaybackQuality;};return Html5;}(Tech);/* HTML5 Support Testing ---------------------------------------------------- */if(isReal()){/**
   * Element for testing browser HTML5 media capabilities
   *
   * @type {Element}
   * @constant
   * @private
   */Html5.TEST_VID=document$1.createElement('video');var track=document$1.createElement('track');track.kind='captions';track.srclang='en';track.label='English';Html5.TEST_VID.appendChild(track);}/**
 * Check if HTML5 media is supported by this browser/device.
 *
 * @return {boolean}
 *         - True if HTML5 media is supported.
 *         - False if HTML5 media is not supported.
 */Html5.isSupported=function(){// IE9 with no Media Player is a LIAR! (#984)
try{Html5.TEST_VID.volume=0.5;}catch(e){return false;}return !!(Html5.TEST_VID&&Html5.TEST_VID.canPlayType);};/**
 * Check if the tech can support the given type
 *
 * @param {string} type
 *        The mimetype to check
 * @return {string} 'probably', 'maybe', or '' (empty string)
 */Html5.canPlayType=function(type){return Html5.TEST_VID.canPlayType(type);};/**
 * Check if the tech can support the given source
 * @param {Object} srcObj
 *        The source object
 * @param {Object} options
 *        The options passed to the tech
 * @return {string} 'probably', 'maybe', or '' (empty string)
 */Html5.canPlaySource=function(srcObj,options){return Html5.canPlayType(srcObj.type);};/**
 * Check if the volume can be changed in this browser/device.
 * Volume cannot be changed in a lot of mobile devices.
 * Specifically, it can't be changed from 1 on iOS.
 *
 * @return {boolean}
 *         - True if volume can be controlled
 *         - False otherwise
 */Html5.canControlVolume=function(){// IE will error if Windows Media Player not installed #3315
try{var volume=Html5.TEST_VID.volume;Html5.TEST_VID.volume=volume/2+0.1;return volume!==Html5.TEST_VID.volume;}catch(e){return false;}};/**
 * Check if the volume can be muted in this browser/device.
 * Some devices, e.g. iOS, don't allow changing volume
 * but permits muting/unmuting.
 *
 * @return {bolean}
 *      - True if volume can be muted
 *      - False otherwise
 */Html5.canMuteVolume=function(){try{var muted=Html5.TEST_VID.muted;// in some versions of iOS muted property doesn't always
// work, so we want to set both property and attribute
Html5.TEST_VID.muted=!muted;if(Html5.TEST_VID.muted){setAttribute(Html5.TEST_VID,'muted','muted');}else {removeAttribute(Html5.TEST_VID,'muted','muted');}return muted!==Html5.TEST_VID.muted;}catch(e){return false;}};/**
 * Check if the playback rate can be changed in this browser/device.
 *
 * @return {boolean}
 *         - True if playback rate can be controlled
 *         - False otherwise
 */Html5.canControlPlaybackRate=function(){// Playback rate API is implemented in Android Chrome, but doesn't do anything
// https://github.com/videojs/video.js/issues/3180
if(IS_ANDROID&&IS_CHROME&&CHROME_VERSION<58){return false;}// IE will error if Windows Media Player not installed #3315
try{var playbackRate=Html5.TEST_VID.playbackRate;Html5.TEST_VID.playbackRate=playbackRate/2+0.1;return playbackRate!==Html5.TEST_VID.playbackRate;}catch(e){return false;}};/**
 * Check if we can override a video/audio elements attributes, with
 * Object.defineProperty.
 *
 * @return {boolean}
 *         - True if builtin attributes can be overriden
 *         - False otherwise
 */Html5.canOverrideAttributes=function(){if(IS_IE8){return false;}// if we cannot overwrite the src/innerHTML property, there is no support
// iOS 7 safari for instance cannot do this.
try{var noop=function noop(){};Object.defineProperty(document$1.createElement('video'),'src',{get:noop,set:noop});Object.defineProperty(document$1.createElement('audio'),'src',{get:noop,set:noop});Object.defineProperty(document$1.createElement('video'),'innerHTML',{get:noop,set:noop});Object.defineProperty(document$1.createElement('audio'),'innerHTML',{get:noop,set:noop});}catch(e){return false;}return true;};/**
 * Check to see if native `TextTrack`s are supported by this browser/device.
 *
 * @return {boolean}
 *         - True if native `TextTrack`s are supported.
 *         - False otherwise
 */Html5.supportsNativeTextTracks=function(){return IS_ANY_SAFARI||IS_IOS&&IS_CHROME;};/**
 * Check to see if native `VideoTrack`s are supported by this browser/device
 *
 * @return {boolean}
 *        - True if native `VideoTrack`s are supported.
 *        - False otherwise
 */Html5.supportsNativeVideoTracks=function(){return !!(Html5.TEST_VID&&Html5.TEST_VID.videoTracks);};/**
 * Check to see if native `AudioTrack`s are supported by this browser/device
 *
 * @return {boolean}
 *        - True if native `AudioTrack`s are supported.
 *        - False otherwise
 */Html5.supportsNativeAudioTracks=function(){return !!(Html5.TEST_VID&&Html5.TEST_VID.audioTracks);};/**
 * An array of events available on the Html5 tech.
 *
 * @private
 * @type {Array}
 */Html5.Events=['loadstart','suspend','abort','error','emptied','stalled','loadedmetadata','loadeddata','canplay','canplaythrough','playing','waiting','seeking','seeked','ended','durationchange','timeupdate','progress','play','pause','ratechange','resize','volumechange'];/**
 * Boolean indicating whether the `Tech` supports volume control.
 *
 * @type {boolean}
 * @default {@link Html5.canControlVolume}
 */Html5.prototype.featuresVolumeControl=Html5.canControlVolume();/**
 * Boolean indicating whether the `Tech` supports muting volume.
 *
 * @type {bolean}
 * @default {@link Html5.canMuteVolume}
 */Html5.prototype.featuresMuteControl=Html5.canMuteVolume();/**
 * Boolean indicating whether the `Tech` supports changing the speed at which the media
 * plays. Examples:
 *   - Set player to play 2x (twice) as fast
 *   - Set player to play 0.5x (half) as fast
 *
 * @type {boolean}
 * @default {@link Html5.canControlPlaybackRate}
 */Html5.prototype.featuresPlaybackRate=Html5.canControlPlaybackRate();/**
 * Boolean indicating wether the `Tech` supports the `sourceset` event.
 *
 * @type {boolean}
 * @default
 */Html5.prototype.featuresSourceset=Html5.canOverrideAttributes();/**
 * Boolean indicating whether the `HTML5` tech currently supports the media element
 * moving in the DOM. iOS breaks if you move the media element, so this is set this to
 * false there. Everywhere else this should be true.
 *
 * @type {boolean}
 * @default
 */Html5.prototype.movingMediaElementInDOM=!IS_IOS;// TODO: Previous comment: No longer appears to be used. Can probably be removed.
//       Is this true?
/**
 * Boolean indicating whether the `HTML5` tech currently supports automatic media resize
 * when going into fullscreen.
 *
 * @type {boolean}
 * @default
 */Html5.prototype.featuresFullscreenResize=true;/**
 * Boolean indicating whether the `HTML5` tech currently supports the progress event.
 * If this is false, manual `progress` events will be triggred instead.
 *
 * @type {boolean}
 * @default
 */Html5.prototype.featuresProgressEvents=true;/**
 * Boolean indicating whether the `HTML5` tech currently supports the timeupdate event.
 * If this is false, manual `timeupdate` events will be triggred instead.
 *
 * @default
 */Html5.prototype.featuresTimeupdateEvents=true;/**
 * Boolean indicating whether the `HTML5` tech currently supports native `TextTrack`s.
 *
 * @type {boolean}
 * @default {@link Html5.supportsNativeTextTracks}
 */Html5.prototype.featuresNativeTextTracks=Html5.supportsNativeTextTracks();/**
 * Boolean indicating whether the `HTML5` tech currently supports native `VideoTrack`s.
 *
 * @type {boolean}
 * @default {@link Html5.supportsNativeVideoTracks}
 */Html5.prototype.featuresNativeVideoTracks=Html5.supportsNativeVideoTracks();/**
 * Boolean indicating whether the `HTML5` tech currently supports native `AudioTrack`s.
 *
 * @type {boolean}
 * @default {@link Html5.supportsNativeAudioTracks}
 */Html5.prototype.featuresNativeAudioTracks=Html5.supportsNativeAudioTracks();// HTML5 Feature detection and Device Fixes --------------------------------- //
var canPlayType=Html5.TEST_VID&&Html5.TEST_VID.constructor.prototype.canPlayType;var mpegurlRE=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;var mp4RE=/^video\/mp4/i;Html5.patchCanPlayType=function(){// Android 4.0 and above can play HLS to some extent but it reports being unable to do so
// Firefox and Chrome report correctly
if(ANDROID_VERSION>=4.0&&!IS_FIREFOX&&!IS_CHROME){Html5.TEST_VID.constructor.prototype.canPlayType=function(type){if(type&&mpegurlRE.test(type)){return 'maybe';}return canPlayType.call(this,type);};// Override Android 2.2 and less canPlayType method which is broken
}else if(IS_OLD_ANDROID){Html5.TEST_VID.constructor.prototype.canPlayType=function(type){if(type&&mp4RE.test(type)){return 'maybe';}return canPlayType.call(this,type);};}};Html5.unpatchCanPlayType=function(){var r=Html5.TEST_VID.constructor.prototype.canPlayType;Html5.TEST_VID.constructor.prototype.canPlayType=canPlayType;return r;};// by default, patch the media element
Html5.patchCanPlayType();Html5.disposeMediaElement=function(el){if(!el){return;}if(el.parentNode){el.parentNode.removeChild(el);}// remove any child track or source nodes to prevent their loading
while(el.hasChildNodes()){el.removeChild(el.firstChild);}// remove any src reference. not setting `src=''` because that causes a warning
// in firefox
el.removeAttribute('src');// force the media element to update its loading state by calling load()
// however IE on Windows 7N has a bug that throws an error so need a try/catch (#793)
if(typeof el.load==='function'){// wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473)
(function(){try{el.load();}catch(e){// not supported
}})();}};Html5.resetMediaElement=function(el){if(!el){return;}var sources=el.querySelectorAll('source');var i=sources.length;while(i--){el.removeChild(sources[i]);}// remove any src reference.
// not setting `src=''` because that throws an error
el.removeAttribute('src');if(typeof el.load==='function'){// wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473)
(function(){try{el.load();}catch(e){// satisfy linter
}})();}};/* Native HTML5 element property wrapping ----------------------------------- */ // Wrap native boolean attributes with getters that check both property and attribute
// The list is as followed:
// muted, defaultMuted, autoplay, controls, loop, playsinline
[/**
 * Get the value of `muted` from the media element. `muted` indicates
 * that the volume for the media should be set to silent. This does not actually change
 * the `volume` attribute.
 *
 * @method Html5#muted
 * @return {boolean}
 *         - True if the value of `volume` should be ignored and the audio set to silent.
 *         - False if the value of `volume` should be used.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted}
 */'muted',/**
 * Get the value of `defaultMuted` from the media element. `defaultMuted` indicates
 * whether the media should start muted or not. Only changes the default state of the
 * media. `muted` and `defaultMuted` can have different values. {@link Html5#muted} indicates the
 * current state.
 *
 * @method Html5#defaultMuted
 * @return {boolean}
 *         - The value of `defaultMuted` from the media element.
 *         - True indicates that the media should start muted.
 *         - False indicates that the media should not start muted
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted}
 */'defaultMuted',/**
 * Get the value of `autoplay` from the media element. `autoplay` indicates
 * that the media should start to play as soon as the page is ready.
 *
 * @method Html5#autoplay
 * @return {boolean}
 *         - The value of `autoplay` from the media element.
 *         - True indicates that the media should start as soon as the page loads.
 *         - False indicates that the media should not start as soon as the page loads.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay}
 */'autoplay',/**
 * Get the value of `controls` from the media element. `controls` indicates
 * whether the native media controls should be shown or hidden.
 *
 * @method Html5#controls
 * @return {boolean}
 *         - The value of `controls` from the media element.
 *         - True indicates that native controls should be showing.
 *         - False indicates that native controls should be hidden.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-controls}
 */'controls',/**
 * Get the value of `loop` from the media element. `loop` indicates
 * that the media should return to the start of the media and continue playing once
 * it reaches the end.
 *
 * @method Html5#loop
 * @return {boolean}
 *         - The value of `loop` from the media element.
 *         - True indicates that playback should seek back to start once
 *           the end of a media is reached.
 *         - False indicates that playback should not loop back to the start when the
 *           end of the media is reached.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop}
 */'loop',/**
 * Get the value of `playsinline` from the media element. `playsinline` indicates
 * to the browser that non-fullscreen playback is preferred when fullscreen
 * playback is the native default, such as in iOS Safari.
 *
 * @method Html5#playsinline
 * @return {boolean}
 *         - The value of `playsinline` from the media element.
 *         - True indicates that the media should play inline.
 *         - False indicates that the media should not play inline.
 *
 * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}
 */'playsinline'].forEach(function(prop){Html5.prototype[prop]=function(){return this.el_[prop]||this.el_.hasAttribute(prop);};});// Wrap native boolean attributes with setters that set both property and attribute
// The list is as followed:
// setMuted, setDefaultMuted, setAutoplay, setLoop, setPlaysinline
// setControls is special-cased above
[/**
 * Set the value of `muted` on the media element. `muted` indicates that the current
 * audio level should be silent.
 *
 * @method Html5#setMuted
 * @param {boolean} muted
 *        - True if the audio should be set to silent
 *        - False otherwise
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted}
 */'muted',/**
 * Set the value of `defaultMuted` on the media element. `defaultMuted` indicates that the current
 * audio level should be silent, but will only effect the muted level on intial playback..
 *
 * @method Html5.prototype.setDefaultMuted
 * @param {boolean} defaultMuted
 *        - True if the audio should be set to silent
 *        - False otherwise
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted}
 */'defaultMuted',/**
 * Set the value of `autoplay` on the media element. `autoplay` indicates
 * that the media should start to play as soon as the page is ready.
 *
 * @method Html5#setAutoplay
 * @param {boolean} autoplay
 *         - True indicates that the media should start as soon as the page loads.
 *         - False indicates that the media should not start as soon as the page loads.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay}
 */'autoplay',/**
 * Set the value of `loop` on the media element. `loop` indicates
 * that the media should return to the start of the media and continue playing once
 * it reaches the end.
 *
 * @method Html5#setLoop
 * @param {boolean} loop
 *         - True indicates that playback should seek back to start once
 *           the end of a media is reached.
 *         - False indicates that playback should not loop back to the start when the
 *           end of the media is reached.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop}
 */'loop',/**
 * Set the value of `playsinline` from the media element. `playsinline` indicates
 * to the browser that non-fullscreen playback is preferred when fullscreen
 * playback is the native default, such as in iOS Safari.
 *
 * @method Html5#setPlaysinline
 * @param {boolean} playsinline
 *         - True indicates that the media should play inline.
 *         - False indicates that the media should not play inline.
 *
 * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}
 */'playsinline'].forEach(function(prop){Html5.prototype['set'+toTitleCase(prop)]=function(v){this.el_[prop]=v;if(v){this.el_.setAttribute(prop,prop);}else {this.el_.removeAttribute(prop);}};});// Wrap native properties with a getter
// The list is as followed
// paused, currentTime, buffered, volume, poster, preload, error, seeking
// seekable, ended, playbackRate, defaultPlaybackRate, played, networkState
// readyState, videoWidth, videoHeight
[/**
 * Get the value of `paused` from the media element. `paused` indicates whether the media element
 * is currently paused or not.
 *
 * @method Html5#paused
 * @return {boolean}
 *         The value of `paused` from the media element.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-paused}
 */'paused',/**
 * Get the value of `currentTime` from the media element. `currentTime` indicates
 * the current second that the media is at in playback.
 *
 * @method Html5#currentTime
 * @return {number}
 *         The value of `currentTime` from the media element.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-currenttime}
 */'currentTime',/**
 * Get the value of `buffered` from the media element. `buffered` is a `TimeRange`
 * object that represents the parts of the media that are already downloaded and
 * available for playback.
 *
 * @method Html5#buffered
 * @return {TimeRange}
 *         The value of `buffered` from the media element.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-buffered}
 */'buffered',/**
 * Get the value of `volume` from the media element. `volume` indicates
 * the current playback volume of audio for a media. `volume` will be a value from 0
 * (silent) to 1 (loudest and default).
 *
 * @method Html5#volume
 * @return {number}
 *         The value of `volume` from the media element. Value will be between 0-1.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume}
 */'volume',/**
 * Get the value of `poster` from the media element. `poster` indicates
 * that the url of an image file that can/will be shown when no media data is available.
 *
 * @method Html5#poster
 * @return {string}
 *         The value of `poster` from the media element. Value will be a url to an
 *         image.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-video-poster}
 */'poster',/**
 * Get the value of `preload` from the media element. `preload` indicates
 * what should download before the media is interacted with. It can have the following
 * values:
 * - none: nothing should be downloaded
 * - metadata: poster and the first few frames of the media may be downloaded to get
 *   media dimensions and other metadata
 * - auto: allow the media and metadata for the media to be downloaded before
 *    interaction
 *
 * @method Html5#preload
 * @return {string}
 *         The value of `preload` from the media element. Will be 'none', 'metadata',
 *         or 'auto'.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload}
 */'preload',/**
 * Get the value of the `error` from the media element. `error` indicates any
 * MediaError that may have occured during playback. If error returns null there is no
 * current error.
 *
 * @method Html5#error
 * @return {MediaError|null}
 *         The value of `error` from the media element. Will be `MediaError` if there
 *         is a current error and null otherwise.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-error}
 */'error',/**
 * Get the value of `seeking` from the media element. `seeking` indicates whether the
 * media is currently seeking to a new position or not.
 *
 * @method Html5#seeking
 * @return {boolean}
 *         - The value of `seeking` from the media element.
 *         - True indicates that the media is currently seeking to a new position.
 *         - Flase indicates that the media is not seeking to a new position at this time.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seeking}
 */'seeking',/**
 * Get the value of `seekable` from the media element. `seekable` returns a
 * `TimeRange` object indicating ranges of time that can currently be `seeked` to.
 *
 * @method Html5#seekable
 * @return {TimeRange}
 *         The value of `seekable` from the media element. A `TimeRange` object
 *         indicating the current ranges of time that can be seeked to.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seekable}
 */'seekable',/**
 * Get the value of `ended` from the media element. `ended` indicates whether
 * the media has reached the end or not.
 *
 * @method Html5#ended
 * @return {boolean}
 *         - The value of `ended` from the media element.
 *         - True indicates that the media has ended.
 *         - False indicates that the media has not ended.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-ended}
 */'ended',/**
 * Get the value of `playbackRate` from the media element. `playbackRate` indicates
 * the rate at which the media is currently playing back. Examples:
 *   - if playbackRate is set to 2, media will play twice as fast.
 *   - if playbackRate is set to 0.5, media will play half as fast.
 *
 * @method Html5#playbackRate
 * @return {number}
 *         The value of `playbackRate` from the media element. A number indicating
 *         the current playback speed of the media, where 1 is normal speed.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}
 */'playbackRate',/**
 * Get the value of `defaultPlaybackRate` from the media element. `defaultPlaybackRate` indicates
 * the rate at which the media is currently playing back. This value will not indicate the current
 * `playbackRate` after playback has started, use {@link Html5#playbackRate} for that.
 *
 * Examples:
 *   - if defaultPlaybackRate is set to 2, media will play twice as fast.
 *   - if defaultPlaybackRate is set to 0.5, media will play half as fast.
 *
 * @method Html5.prototype.defaultPlaybackRate
 * @return {number}
 *         The value of `defaultPlaybackRate` from the media element. A number indicating
 *         the current playback speed of the media, where 1 is normal speed.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}
 */'defaultPlaybackRate',/**
 * Get the value of `played` from the media element. `played` returns a `TimeRange`
 * object representing points in the media timeline that have been played.
 *
 * @method Html5#played
 * @return {TimeRange}
 *         The value of `played` from the media element. A `TimeRange` object indicating
 *         the ranges of time that have been played.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-played}
 */'played',/**
 * Get the value of `networkState` from the media element. `networkState` indicates
 * the current network state. It returns an enumeration from the following list:
 * - 0: NETWORK_EMPTY
 * - 1: NEWORK_IDLE
 * - 2: NETWORK_LOADING
 * - 3: NETWORK_NO_SOURCE
 *
 * @method Html5#networkState
 * @return {number}
 *         The value of `networkState` from the media element. This will be a number
 *         from the list in the description.
 *
 * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-networkstate}
 */'networkState',/**
 * Get the value of `readyState` from the media element. `readyState` indicates
 * the current state of the media element. It returns an enumeration from the
 * following list:
 * - 0: HAVE_NOTHING
 * - 1: HAVE_METADATA
 * - 2: HAVE_CURRENT_DATA
 * - 3: HAVE_FUTURE_DATA
 * - 4: HAVE_ENOUGH_DATA
 *
 * @method Html5#readyState
 * @return {number}
 *         The value of `readyState` from the media element. This will be a number
 *         from the list in the description.
 *
 * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#ready-states}
 */'readyState',/**
 * Get the value of `videoWidth` from the video element. `videoWidth` indicates
 * the current width of the video in css pixels.
 *
 * @method Html5#videoWidth
 * @return {number}
 *         The value of `videoWidth` from the video element. This will be a number
 *         in css pixels.
 *
 * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth}
 */'videoWidth',/**
 * Get the value of `videoHeight` from the video element. `videoHeigth` indicates
 * the current height of the video in css pixels.
 *
 * @method Html5#videoHeight
 * @return {number}
 *         The value of `videoHeight` from the video element. This will be a number
 *         in css pixels.
 *
 * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth}
 */'videoHeight'].forEach(function(prop){Html5.prototype[prop]=function(){return this.el_[prop];};});// Wrap native properties with a setter in this format:
// set + toTitleCase(name)
// The list is as follows:
// setVolume, setSrc, setPoster, setPreload, setPlaybackRate, setDefaultPlaybackRate
[/**
 * Set the value of `volume` on the media element. `volume` indicates the current
 * audio level as a percentage in decimal form. This means that 1 is 100%, 0.5 is 50%, and
 * so on.
 *
 * @method Html5#setVolume
 * @param {number} percentAsDecimal
 *        The volume percent as a decimal. Valid range is from 0-1.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume}
 */'volume',/**
 * Set the value of `src` on the media element. `src` indicates the current
 * {@link Tech~SourceObject} for the media.
 *
 * @method Html5#setSrc
 * @param {Tech~SourceObject} src
 *        The source object to set as the current source.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-src}
 */'src',/**
 * Set the value of `poster` on the media element. `poster` is the url to
 * an image file that can/will be shown when no media data is available.
 *
 * @method Html5#setPoster
 * @param {string} poster
 *        The url to an image that should be used as the `poster` for the media
 *        element.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-poster}
 */'poster',/**
 * Set the value of `preload` on the media element. `preload` indicates
 * what should download before the media is interacted with. It can have the following
 * values:
 * - none: nothing should be downloaded
 * - metadata: poster and the first few frames of the media may be downloaded to get
 *   media dimensions and other metadata
 * - auto: allow the media and metadata for the media to be downloaded before
 *    interaction
 *
 * @method Html5#setPreload
 * @param {string} preload
 *         The value of `preload` to set on the media element. Must be 'none', 'metadata',
 *         or 'auto'.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload}
 */'preload',/**
 * Set the value of `playbackRate` on the media element. `playbackRate` indicates
 * the rate at which the media should play back. Examples:
 *   - if playbackRate is set to 2, media will play twice as fast.
 *   - if playbackRate is set to 0.5, media will play half as fast.
 *
 * @method Html5#setPlaybackRate
 * @return {number}
 *         The value of `playbackRate` from the media element. A number indicating
 *         the current playback speed of the media, where 1 is normal speed.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}
 */'playbackRate',/**
 * Set the value of `defaultPlaybackRate` on the media element. `defaultPlaybackRate` indicates
 * the rate at which the media should play back upon initial startup. Changing this value
 * after a video has started will do nothing. Instead you should used {@link Html5#setPlaybackRate}.
 *
 * Example Values:
 *   - if playbackRate is set to 2, media will play twice as fast.
 *   - if playbackRate is set to 0.5, media will play half as fast.
 *
 * @method Html5.prototype.setDefaultPlaybackRate
 * @return {number}
 *         The value of `defaultPlaybackRate` from the media element. A number indicating
 *         the current playback speed of the media, where 1 is normal speed.
 *
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultplaybackrate}
 */'defaultPlaybackRate'].forEach(function(prop){Html5.prototype['set'+toTitleCase(prop)]=function(v){this.el_[prop]=v;};});// wrap native functions with a function
// The list is as follows:
// pause, load play
[/**
 * A wrapper around the media elements `pause` function. This will call the `HTML5`
 * media elements `pause` function.
 *
 * @method Html5#pause
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-pause}
 */'pause',/**
 * A wrapper around the media elements `load` function. This will call the `HTML5`s
 * media element `load` function.
 *
 * @method Html5#load
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-load}
 */'load',/**
 * A wrapper around the media elements `play` function. This will call the `HTML5`s
 * media element `play` function.
 *
 * @method Html5#play
 * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-play}
 */'play'].forEach(function(prop){Html5.prototype[prop]=function(){return this.el_[prop]();};});Tech.withSourceHandlers(Html5);/**
 * Native source handler for Html5, simply passes the source to the media element.
 *
 * @proprety {Tech~SourceObject} source
 *        The source object
 *
 * @proprety {Html5} tech
 *        The instance of the HTML5 tech.
 */Html5.nativeSourceHandler={};/**
 * Check if the media element can play the given mime type.
 *
 * @param {string} type
 *        The mimetype to check
 *
 * @return {string}
 *         'probably', 'maybe', or '' (empty string)
 */Html5.nativeSourceHandler.canPlayType=function(type){// IE9 on Windows 7 without MediaPlayer throws an error here
// https://github.com/videojs/video.js/issues/519
try{return Html5.TEST_VID.canPlayType(type);}catch(e){return '';}};/**
 * Check if the media element can handle a source natively.
 *
 * @param {Tech~SourceObject} source
 *         The source object
 *
 * @param {Object} [options]
 *         Options to be passed to the tech.
 *
 * @return {string}
 *         'probably', 'maybe', or '' (empty string).
 */Html5.nativeSourceHandler.canHandleSource=function(source,options){// If a type was provided we should rely on that
if(source.type){return Html5.nativeSourceHandler.canPlayType(source.type);// If no type, fall back to checking 'video/[EXTENSION]'
}else if(source.src){var ext=getFileExtension(source.src);return Html5.nativeSourceHandler.canPlayType('video/'+ext);}return '';};/**
 * Pass the source to the native media element.
 *
 * @param {Tech~SourceObject} source
 *        The source object
 *
 * @param {Html5} tech
 *        The instance of the Html5 tech
 *
 * @param {Object} [options]
 *        The options to pass to the source
 */Html5.nativeSourceHandler.handleSource=function(source,tech,options){tech.setSrc(source.src);};/**
 * A noop for the native dispose function, as cleanup is not needed.
 */Html5.nativeSourceHandler.dispose=function(){};// Register the native source handler
Html5.registerSourceHandler(Html5.nativeSourceHandler);Tech.registerTech('Html5',Html5);var _templateObject$1=taggedTemplateLiteralLoose(['\n        Using the tech directly can be dangerous. I hope you know what you\'re doing.\n        See https://github.com/videojs/video.js/issues/2617 for more info.\n      '],['\n        Using the tech directly can be dangerous. I hope you know what you\'re doing.\n        See https://github.com/videojs/video.js/issues/2617 for more info.\n      ']);/**
 * @file player.js
 */ // Subclasses Component
// The following imports are used only to ensure that the corresponding modules
// are always included in the video.js package. Importing the modules will
// execute them and they will register themselves with video.js.
// Import Html5 tech, at least for disposing the original video tag.
// The following tech events are simply re-triggered
// on the player when they happen
var TECH_EVENTS_RETRIGGER=[/**
 * Fired while the user agent is downloading media data.
 *
 * @event Player#progress
 * @type {EventTarget~Event}
 */ /**
 * Retrigger the `progress` event that was triggered by the {@link Tech}.
 *
 * @private
 * @method Player#handleTechProgress_
 * @fires Player#progress
 * @listens Tech#progress
 */'progress',/**
 * Fires when the loading of an audio/video is aborted.
 *
 * @event Player#abort
 * @type {EventTarget~Event}
 */ /**
 * Retrigger the `abort` event that was triggered by the {@link Tech}.
 *
 * @private
 * @method Player#handleTechAbort_
 * @fires Player#abort
 * @listens Tech#abort
 */'abort',/**
 * Fires when the browser is intentionally not getting media data.
 *
 * @event Player#suspend
 * @type {EventTarget~Event}
 */ /**
 * Retrigger the `suspend` event that was triggered by the {@link Tech}.
 *
 * @private
 * @method Player#handleTechSuspend_
 * @fires Player#suspend
 * @listens Tech#suspend
 */'suspend',/**
 * Fires when the current playlist is empty.
 *
 * @event Player#emptied
 * @type {EventTarget~Event}
 */ /**
 * Retrigger the `emptied` event that was triggered by the {@link Tech}.
 *
 * @private
 * @method Player#handleTechEmptied_
 * @fires Player#emptied
 * @listens Tech#emptied
 */'emptied',/**
 * Fires when the browser is trying to get media data, but data is not available.
 *
 * @event Player#stalled
 * @type {EventTarget~Event}
 */ /**
 * Retrigger the `stalled` event that was triggered by the {@link Tech}.
 *
 * @private
 * @method Player#handleTechStalled_
 * @fires Player#stalled
 * @listens Tech#stalled
 */'stalled',/**
 * Fires when the browser has loaded meta data for the audio/video.
 *
 * @event Player#loadedmetadata
 * @type {EventTarget~Event}
 */ /**
 * Retrigger the `stalled` event that was triggered by the {@link Tech}.
 *
 * @private
 * @method Player#handleTechLoadedmetadata_
 * @fires Player#loadedmetadata
 * @listens Tech#loadedmetadata
 */'loadedmetadata',/**
 * Fires when the browser has loaded the current frame of the audio/video.
 *
 * @event Player#loadeddata
 * @type {event}
 */ /**
 * Retrigger the `loadeddata` event that was triggered by the {@link Tech}.
 *
 * @private
 * @method Player#handleTechLoaddeddata_
 * @fires Player#loadeddata
 * @listens Tech#loadeddata
 */'loadeddata',/**
 * Fires when the current playback position has changed.
 *
 * @event Player#timeupdate
 * @type {event}
 */ /**
 * Retrigger the `timeupdate` event that was triggered by the {@link Tech}.
 *
 * @private
 * @method Player#handleTechTimeUpdate_
 * @fires Player#timeupdate
 * @listens Tech#timeupdate
 */'timeupdate',/**
 * Fires when the video's intrinsic dimensions change
 *
 * @event Player#resize
 * @type {event}
 */ /**
 * Retrigger the `resize` event that was triggered by the {@link Tech}.
 *
 * @private
 * @method Player#handleTechResize_
 * @fires Player#resize
 * @listens Tech#resize
 */'resize',/**
 * Fires when the volume has been changed
 *
 * @event Player#volumechange
 * @type {event}
 */ /**
 * Retrigger the `volumechange` event that was triggered by the {@link Tech}.
 *
 * @private
 * @method Player#handleTechVolumechange_
 * @fires Player#volumechange
 * @listens Tech#volumechange
 */'volumechange',/**
 * Fires when the text track has been changed
 *
 * @event Player#texttrackchange
 * @type {event}
 */ /**
 * Retrigger the `texttrackchange` event that was triggered by the {@link Tech}.
 *
 * @private
 * @method Player#handleTechTexttrackchange_
 * @fires Player#texttrackchange
 * @listens Tech#texttrackchange
 */'texttrackchange'];// events to queue when playback rate is zero
// this is a hash for the sole purpose of mapping non-camel-cased event names
// to camel-cased function names
var TECH_EVENTS_QUEUE={canplay:'CanPlay',canplaythrough:'CanPlayThrough',playing:'Playing',seeked:'Seeked'};var BREAKPOINT_ORDER=['tiny','xsmall','small','medium','large','xlarge','huge'];var BREAKPOINT_CLASSES={};// grep: vjs-layout-tiny
// grep: vjs-layout-x-small
// grep: vjs-layout-small
// grep: vjs-layout-medium
// grep: vjs-layout-large
// grep: vjs-layout-x-large
// grep: vjs-layout-huge
BREAKPOINT_ORDER.forEach(function(k){var v=k.charAt(0)==='x'?'x-'+k.substring(1):k;BREAKPOINT_CLASSES[k]='vjs-layout-'+v;});var DEFAULT_BREAKPOINTS={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:Infinity};/**
 * An instance of the `Player` class is created when any of the Video.js setup methods
 * are used to initialize a video.
 *
 * After an instance has been created it can be accessed globally in two ways:
 * 1. By calling `videojs('example_video_1');`
 * 2. By using it directly via  `videojs.players.example_video_1;`
 *
 * @extends Component
 */var Player=function(_Component){inherits(Player,_Component);/**
   * Create an instance of this class.
   *
   * @param {Element} tag
   *        The original video DOM element used for configuring options.
   *
   * @param {Object} [options]
   *        Object of option names and values.
   *
   * @param {Component~ReadyCallback} [ready]
   *        Ready callback function.
   */function Player(tag,options,ready){classCallCheck(this,Player);// Make sure tag ID exists
tag.id=tag.id||options.id||'vjs_video_'+newGUID();// Set Options
// The options argument overrides options set in the video tag
// which overrides globally set options.
// This latter part coincides with the load order
// (tag must exist before Player)
options=assign(Player.getTagSettings(tag),options);// Delay the initialization of children because we need to set up
// player properties first, and can't use `this` before `super()`
options.initChildren=false;// Same with creating the element
options.createEl=false;// don't auto mixin the evented mixin
options.evented=false;// we don't want the player to report touch activity on itself
// see enableTouchActivity in Component
options.reportTouchActivity=false;// If language is not set, get the closest lang attribute
if(!options.language){if(typeof tag.closest==='function'){var closest=tag.closest('[lang]');if(closest&&closest.getAttribute){options.language=closest.getAttribute('lang');}}else {var element=tag;while(element&&element.nodeType===1){if(getAttributes(element).hasOwnProperty('lang')){options.language=element.getAttribute('lang');break;}element=element.parentNode;}}}// Run base component initializing with new options
// create logger
var _this=possibleConstructorReturn(this,_Component.call(this,null,options,ready));_this.log=createLogger(_this.id_);// Tracks when a tech changes the poster
_this.isPosterFromTech_=false;// Holds callback info that gets queued when playback rate is zero
// and a seek is happening
_this.queuedCallbacks_=[];// Turn off API access because we're loading a new tech that might load asynchronously
_this.isReady_=false;// Init state hasStarted_
_this.hasStarted_=false;// Init state userActive_
_this.userActive_=false;// if the global option object was accidentally blown away by
// someone, bail early with an informative error
if(!_this.options_||!_this.options_.techOrder||!_this.options_.techOrder.length){throw new Error('No techOrder specified. Did you overwrite '+'videojs.options instead of just changing the '+'properties you want to override?');}// Store the original tag used to set options
_this.tag=tag;// Store the tag attributes used to restore html5 element
_this.tagAttributes=tag&&getAttributes(tag);// Update current language
_this.language(_this.options_.language);// Update Supported Languages
if(options.languages){// Normalise player option languages to lowercase
var languagesToLower={};Object.getOwnPropertyNames(options.languages).forEach(function(name$$1){languagesToLower[name$$1.toLowerCase()]=options.languages[name$$1];});_this.languages_=languagesToLower;}else {_this.languages_=Player.prototype.options_.languages;}// Cache for video property values.
_this.cache_={};// Set poster
_this.poster_=options.poster||'';// Set controls
_this.controls_=!!options.controls;// Set default values for lastVolume
_this.cache_.lastVolume=1;// Original tag settings stored in options
// now remove immediately so native controls don't flash.
// May be turned back on by HTML5 tech if nativeControlsForTouch is true
tag.controls=false;tag.removeAttribute('controls');// the attribute overrides the option
if(tag.hasAttribute('autoplay')){_this.options_.autoplay=true;}else {// otherwise use the setter to validate and
// set the correct value.
_this.autoplay(_this.options_.autoplay);}/*
     * Store the internal state of scrubbing
     *
     * @private
     * @return {Boolean} True if the user is scrubbing
     */_this.scrubbing_=false;_this.el_=_this.createEl();// Set default value for lastPlaybackRate
_this.cache_.lastPlaybackRate=_this.defaultPlaybackRate();// Make this an evented object and use `el_` as its event bus.
evented(_this,{eventBusKey:'el_'});// We also want to pass the original player options to each component and plugin
// as well so they don't need to reach back into the player for options later.
// We also need to do another copy of this.options_ so we don't end up with
// an infinite loop.
var playerOptionsCopy=mergeOptions(_this.options_);// Load plugins
if(options.plugins){var plugins=options.plugins;Object.keys(plugins).forEach(function(name$$1){if(typeof this[name$$1]==='function'){this[name$$1](plugins[name$$1]);}else {throw new Error('plugin "'+name$$1+'" does not exist');}},_this);}_this.options_.playerOptions=playerOptionsCopy;_this.middleware_=[];_this.initChildren();// Set isAudio based on whether or not an audio tag was used
_this.isAudio(tag.nodeName.toLowerCase()==='audio');// Update controls className. Can't do this when the controls are initially
// set because the element doesn't exist yet.
if(_this.controls()){_this.addClass('vjs-controls-enabled');}else {_this.addClass('vjs-controls-disabled');}// Set ARIA label and region role depending on player type
_this.el_.setAttribute('role','region');if(_this.isAudio()){_this.el_.setAttribute('aria-label',_this.localize('Audio Player'));}else {_this.el_.setAttribute('aria-label',_this.localize('Video Player'));}if(_this.isAudio()){_this.addClass('vjs-audio');}if(_this.flexNotSupported_()){_this.addClass('vjs-no-flex');}// TODO: Make this smarter. Toggle user state between touching/mousing
// using events, since devices can have both touch and mouse events.
// if (browser.TOUCH_ENABLED) {
//   this.addClass('vjs-touch-enabled');
// }
// iOS Safari has broken hover handling
if(!IS_IOS){_this.addClass('vjs-workinghover');}// Make player easily findable by ID
Player.players[_this.id_]=_this;// Add a major version class to aid css in plugins
var majorVersion=version.split('.')[0];_this.addClass('vjs-v'+majorVersion);// When the player is first initialized, trigger activity so components
// like the control bar show themselves if needed
_this.userActive(true);_this.reportUserActivity();_this.one('play',_this.listenForUserActivity_);_this.on('fullscreenchange',_this.handleFullscreenChange_);_this.on('stageclick',_this.handleStageClick_);_this.breakpoints(_this.options_.breakpoints);_this.responsive(_this.options_.responsive);_this.changingSrc_=false;_this.playWaitingForReady_=false;_this.playOnLoadstart_=null;return _this;}/**
   * Destroys the video player and does any necessary cleanup.
   *
   * This is especially helpful if you are dynamically adding and removing videos
   * to/from the DOM.
   *
   * @fires Player#dispose
   */Player.prototype.dispose=function dispose(){/**
     * Called when the player is being disposed of.
     *
     * @event Player#dispose
     * @type {EventTarget~Event}
     */this.trigger('dispose');// prevent dispose from being called twice
this.off('dispose');if(this.styleEl_&&this.styleEl_.parentNode){this.styleEl_.parentNode.removeChild(this.styleEl_);this.styleEl_=null;}// Kill reference to this player
Player.players[this.id_]=null;if(this.tag&&this.tag.player){this.tag.player=null;}if(this.el_&&this.el_.player){this.el_.player=null;}if(this.tech_){this.tech_.dispose();this.isPosterFromTech_=false;this.poster_='';}if(this.playerElIngest_){this.playerElIngest_=null;}if(this.tag){this.tag=null;}clearCacheForPlayer(this);// the actual .el_ is removed here
_Component.prototype.dispose.call(this);};/**
   * Create the `Player`'s DOM element.
   *
   * @return {Element}
   *         The DOM element that gets created.
   */Player.prototype.createEl=function createEl$$1(){var tag=this.tag;var el=void 0;var playerElIngest=this.playerElIngest_=tag.parentNode&&tag.parentNode.hasAttribute&&tag.parentNode.hasAttribute('data-vjs-player');var divEmbed=this.tag.tagName.toLowerCase()==='video-js';if(playerElIngest){el=this.el_=tag.parentNode;}else if(!divEmbed){el=this.el_=_Component.prototype.createEl.call(this,'div');}// Copy over all the attributes from the tag, including ID and class
// ID will now reference player box, not the video tag
var attrs=getAttributes(tag);if(divEmbed){el=this.el_=tag;tag=this.tag=document$1.createElement('video');while(el.children.length){tag.appendChild(el.firstChild);}if(!hasClass$1(el,'video-js')){addClass(el,'video-js');}el.appendChild(tag);playerElIngest=this.playerElIngest_=el;// copy over properties from the video-js element
// ie8 doesn't support Object.keys nor hasOwnProperty
// on dom elements so we have to specify properties individually
['autoplay','controls','crossOrigin','defaultMuted','defaultPlaybackRate','loop','muted','playbackRate','src','volume'].forEach(function(prop){if(typeof el[prop]!=='undefined'){tag[prop]=el[prop];}});}// set tabindex to -1 to remove the video element from the focus order
tag.setAttribute('tabindex','-1');attrs.tabindex='-1';// Workaround for #4583 (JAWS+IE doesn't announce BPB or play button)
// See https://github.com/FreedomScientific/VFO-standards-support/issues/78
// Note that we can't detect if JAWS is being used, but this ARIA attribute
//  doesn't change behavior of IE11 if JAWS is not being used
if(IE_VERSION){tag.setAttribute('role','application');attrs.role='application';}// Remove width/height attrs from tag so CSS can make it 100% width/height
tag.removeAttribute('width');tag.removeAttribute('height');if('width'in attrs){delete attrs.width;}if('height'in attrs){delete attrs.height;}Object.getOwnPropertyNames(attrs).forEach(function(attr){// workaround so we don't totally break IE7
// http://stackoverflow.com/questions/3653444/css-styles-not-applied-on-dynamic-elements-in-internet-explorer-7
if(attr==='class'){el.className+=' '+attrs[attr];if(divEmbed){tag.className+=' '+attrs[attr];}}else {el.setAttribute(attr,attrs[attr]);if(divEmbed){tag.setAttribute(attr,attrs[attr]);}}});// Update tag id/class for use as HTML5 playback tech
// Might think we should do this after embedding in container so .vjs-tech class
// doesn't flash 100% width/height, but class only applies with .video-js parent
tag.playerId=tag.id;tag.id+='_html5_api';tag.className='vjs-tech';// Make player findable on elements
tag.player=el.player=this;// Default state of video is paused
this.addClass('vjs-paused');// Add a style element in the player that we'll use to set the width/height
// of the player in a way that's still overrideable by CSS, just like the
// video element
if(window$1.VIDEOJS_NO_DYNAMIC_STYLE!==true){this.styleEl_=createStyleElement('vjs-styles-dimensions');var defaultsStyleEl=$$1('.vjs-styles-defaults');var head=$$1('head');head.insertBefore(this.styleEl_,defaultsStyleEl?defaultsStyleEl.nextSibling:head.firstChild);}this.fill_=false;this.fluid_=false;// Pass in the width/height/aspectRatio options which will update the style el
this.width(this.options_.width);this.height(this.options_.height);this.fill(this.options_.fill);this.fluid(this.options_.fluid);this.aspectRatio(this.options_.aspectRatio);// Hide any links within the video/audio tag, because IE doesn't hide them completely.
var links=tag.getElementsByTagName('a');for(var i=0;i<links.length;i++){var linkEl=links.item(i);addClass(linkEl,'vjs-hidden');linkEl.setAttribute('hidden','hidden');}// insertElFirst seems to cause the networkState to flicker from 3 to 2, so
// keep track of the original for later so we can know if the source originally failed
tag.initNetworkState_=tag.networkState;// Wrap video tag in div (el/box) container
if(tag.parentNode&&!playerElIngest){tag.parentNode.insertBefore(el,tag);}// insert the tag as the first child of the player element
// then manually add it to the children array so that this.addChild
// will work properly for other components
//
// Breaks iPhone, fixed in HTML5 setup.
prependTo(tag,el);this.children_.unshift(tag);// Set lang attr on player to ensure CSS :lang() in consistent with player
// if it's been set to something different to the doc
this.el_.setAttribute('lang',this.language_);this.el_=el;return el;};/**
   * A getter/setter for the `Player`'s width. Returns the player's configured value.
   * To get the current width use `currentWidth()`.
   *
   * @param {number} [value]
   *        The value to set the `Player`'s width to.
   *
   * @return {number}
   *         The current width of the `Player` when getting.
   */Player.prototype.width=function width(value){return this.dimension('width',value);};/**
   * A getter/setter for the `Player`'s height. Returns the player's configured value.
   * To get the current height use `currentheight()`.
   *
   * @param {number} [value]
   *        The value to set the `Player`'s heigth to.
   *
   * @return {number}
   *         The current height of the `Player` when getting.
   */Player.prototype.height=function height(value){return this.dimension('height',value);};/**
   * A getter/setter for the `Player`'s width & height.
   *
   * @param {string} dimension
   *        This string can be:
   *        - 'width'
   *        - 'height'
   *
   * @param {number} [value]
   *        Value for dimension specified in the first argument.
   *
   * @return {number}
   *         The dimension arguments value when getting (width/height).
   */Player.prototype.dimension=function dimension(_dimension,value){var privDimension=_dimension+'_';if(value===undefined){return this[privDimension]||0;}if(value===''){// If an empty string is given, reset the dimension to be automatic
this[privDimension]=undefined;this.updateStyleEl_();return;}var parsedVal=parseFloat(value);if(isNaN(parsedVal)){log.error('Improper value "'+value+'" supplied for for '+_dimension);return;}this[privDimension]=parsedVal;this.updateStyleEl_();};/**
   * A getter/setter/toggler for the vjs-fluid `className` on the `Player`.
   *
   * Turning this on will turn off fill mode.
   *
   * @param {boolean} [bool]
   *        - A value of true adds the class.
   *        - A value of false removes the class.
   *        - No value will be a getter.
   *
   * @return {boolean|undefined}
   *         - The value of fluid when getting.
   *         - `undefined` when setting.
   */Player.prototype.fluid=function fluid(bool){if(bool===undefined){return !!this.fluid_;}this.fluid_=!!bool;if(bool){this.addClass('vjs-fluid');this.fill(false);}else {this.removeClass('vjs-fluid');}this.updateStyleEl_();};/**
   * A getter/setter/toggler for the vjs-fill `className` on the `Player`.
   *
   * Turning this on will turn off fluid mode.
   *
   * @param {boolean} [bool]
   *        - A value of true adds the class.
   *        - A value of false removes the class.
   *        - No value will be a getter.
   *
   * @return {boolean|undefined}
   *         - The value of fluid when getting.
   *         - `undefined` when setting.
   */Player.prototype.fill=function fill(bool){if(bool===undefined){return !!this.fill_;}this.fill_=!!bool;if(bool){this.addClass('vjs-fill');this.fluid(false);}else {this.removeClass('vjs-fill');}};/**
   * Get/Set the aspect ratio
   *
   * @param {string} [ratio]
   *        Aspect ratio for player
   *
   * @return {string|undefined}
   *         returns the current aspect ratio when getting
   */ /**
   * A getter/setter for the `Player`'s aspect ratio.
   *
   * @param {string} [ratio]
   *        The value to set the `Player's aspect ratio to.
   *
   * @return {string|undefined}
   *         - The current aspect ratio of the `Player` when getting.
   *         - undefined when setting
   */Player.prototype.aspectRatio=function aspectRatio(ratio){if(ratio===undefined){return this.aspectRatio_;}// Check for width:height format
if(!/^\d+\:\d+$/.test(ratio)){throw new Error('Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.');}this.aspectRatio_=ratio;// We're assuming if you set an aspect ratio you want fluid mode,
// because in fixed mode you could calculate width and height yourself.
this.fluid(true);this.updateStyleEl_();};/**
   * Update styles of the `Player` element (height, width and aspect ratio).
   *
   * @private
   * @listens Tech#loadedmetadata
   */Player.prototype.updateStyleEl_=function updateStyleEl_(){if(window$1.VIDEOJS_NO_DYNAMIC_STYLE===true){var _width=typeof this.width_==='number'?this.width_:this.options_.width;var _height=typeof this.height_==='number'?this.height_:this.options_.height;var techEl=this.tech_&&this.tech_.el();if(techEl){if(_width>=0){techEl.width=_width;}if(_height>=0){techEl.height=_height;}}return;}var width=void 0;var height=void 0;var aspectRatio=void 0;var idClass=void 0;// The aspect ratio is either used directly or to calculate width and height.
if(this.aspectRatio_!==undefined&&this.aspectRatio_!=='auto'){// Use any aspectRatio that's been specifically set
aspectRatio=this.aspectRatio_;}else if(this.videoWidth()>0){// Otherwise try to get the aspect ratio from the video metadata
aspectRatio=this.videoWidth()+':'+this.videoHeight();}else {// Or use a default. The video element's is 2:1, but 16:9 is more common.
aspectRatio='16:9';}// Get the ratio as a decimal we can use to calculate dimensions
var ratioParts=aspectRatio.split(':');var ratioMultiplier=ratioParts[1]/ratioParts[0];if(this.width_!==undefined){// Use any width that's been specifically set
width=this.width_;}else if(this.height_!==undefined){// Or calulate the width from the aspect ratio if a height has been set
width=this.height_/ratioMultiplier;}else {// Or use the video's metadata, or use the video el's default of 300
width=this.videoWidth()||300;}if(this.height_!==undefined){// Use any height that's been specifically set
height=this.height_;}else {// Otherwise calculate the height from the ratio and the width
height=width*ratioMultiplier;}// Ensure the CSS class is valid by starting with an alpha character
if(/^[^a-zA-Z]/.test(this.id())){idClass='dimensions-'+this.id();}else {idClass=this.id()+'-dimensions';}// Ensure the right class is still on the player for the style element
this.addClass(idClass);setTextContent(this.styleEl_,'\n      .'+idClass+' {\n        width: '+width+'px;\n        height: '+height+'px;\n      }\n\n      .'+idClass+'.vjs-fluid {\n        padding-top: '+ratioMultiplier*100+'%;\n      }\n    ');};/**
   * Load/Create an instance of playback {@link Tech} including element
   * and API methods. Then append the `Tech` element in `Player` as a child.
   *
   * @param {string} techName
   *        name of the playback technology
   *
   * @param {string} source
   *        video source
   *
   * @private
   */Player.prototype.loadTech_=function loadTech_(techName,source){var _this2=this;// Pause and remove current playback technology
if(this.tech_){this.unloadTech_();}var titleTechName=toTitleCase(techName);var camelTechName=techName.charAt(0).toLowerCase()+techName.slice(1);// get rid of the HTML5 video tag as soon as we are using another tech
if(titleTechName!=='Html5'&&this.tag){Tech.getTech('Html5').disposeMediaElement(this.tag);this.tag.player=null;this.tag=null;}this.techName_=titleTechName;// Turn off API access because we're loading a new tech that might load asynchronously
this.isReady_=false;// if autoplay is a string we pass false to the tech
// because the player is going to handle autoplay on `loadstart`
var autoplay=typeof this.autoplay()==='string'?false:this.autoplay();// Grab tech-specific options from player options and add source and parent element to use.
var techOptions={source:source,autoplay:autoplay,'nativeControlsForTouch':this.options_.nativeControlsForTouch,'playerId':this.id(),'techId':this.id()+'_'+camelTechName+'_api','playsinline':this.options_.playsinline,'preload':this.options_.preload,'loop':this.options_.loop,'muted':this.options_.muted,'poster':this.poster(),'language':this.language(),'playerElIngest':this.playerElIngest_||false,'vtt.js':this.options_['vtt.js'],'canOverridePoster':!!this.options_.techCanOverridePoster,'enableSourceset':this.options_.enableSourceset};ALL.names.forEach(function(name$$1){var props=ALL[name$$1];techOptions[props.getterName]=_this2[props.privateName];});assign(techOptions,this.options_[titleTechName]);assign(techOptions,this.options_[camelTechName]);assign(techOptions,this.options_[techName.toLowerCase()]);if(this.tag){techOptions.tag=this.tag;}if(source&&source.src===this.cache_.src&&this.cache_.currentTime>0){techOptions.startTime=this.cache_.currentTime;}// Initialize tech instance
var TechClass=Tech.getTech(techName);if(!TechClass){throw new Error('No Tech named \''+titleTechName+'\' exists! \''+titleTechName+'\' should be registered using videojs.registerTech()\'');}this.tech_=new TechClass(techOptions);// player.triggerReady is always async, so don't need this to be async
this.tech_.ready(bind(this,this.handleTechReady_),true);textTrackConverter.jsonToTextTracks(this.textTracksJson_||[],this.tech_);// Listen to all HTML5-defined events and trigger them on the player
TECH_EVENTS_RETRIGGER.forEach(function(event){_this2.on(_this2.tech_,event,_this2['handleTech'+toTitleCase(event)+'_']);});Object.keys(TECH_EVENTS_QUEUE).forEach(function(event){_this2.on(_this2.tech_,event,function(eventObj){if(_this2.tech_.playbackRate()===0&&_this2.tech_.seeking()){_this2.queuedCallbacks_.push({callback:_this2['handleTech'+TECH_EVENTS_QUEUE[event]+'_'].bind(_this2),event:eventObj});return;}_this2['handleTech'+TECH_EVENTS_QUEUE[event]+'_'](eventObj);});});this.on(this.tech_,'loadstart',this.handleTechLoadStart_);this.on(this.tech_,'sourceset',this.handleTechSourceset_);this.on(this.tech_,'waiting',this.handleTechWaiting_);this.on(this.tech_,'ended',this.handleTechEnded_);this.on(this.tech_,'seeking',this.handleTechSeeking_);this.on(this.tech_,'play',this.handleTechPlay_);this.on(this.tech_,'firstplay',this.handleTechFirstPlay_);this.on(this.tech_,'pause',this.handleTechPause_);this.on(this.tech_,'durationchange',this.handleTechDurationChange_);this.on(this.tech_,'fullscreenchange',this.handleTechFullscreenChange_);this.on(this.tech_,'error',this.handleTechError_);this.on(this.tech_,'loadedmetadata',this.updateStyleEl_);this.on(this.tech_,'posterchange',this.handleTechPosterChange_);this.on(this.tech_,'textdata',this.handleTechTextData_);this.on(this.tech_,'ratechange',this.handleTechRateChange_);this.usingNativeControls(this.techGet_('controls'));if(this.controls()&&!this.usingNativeControls()){this.addTechControlsListeners_();}// Add the tech element in the DOM if it was not already there
// Make sure to not insert the original video element if using Html5
if(this.tech_.el().parentNode!==this.el()&&(titleTechName!=='Html5'||!this.tag)){prependTo(this.tech_.el(),this.el());}// Get rid of the original video tag reference after the first tech is loaded
if(this.tag){this.tag.player=null;this.tag=null;}};/**
   * Unload and dispose of the current playback {@link Tech}.
   *
   * @private
   */Player.prototype.unloadTech_=function unloadTech_(){var _this3=this;// Save the current text tracks so that we can reuse the same text tracks with the next tech
ALL.names.forEach(function(name$$1){var props=ALL[name$$1];_this3[props.privateName]=_this3[props.getterName]();});this.textTracksJson_=textTrackConverter.textTracksToJson(this.tech_);this.isReady_=false;this.tech_.dispose();this.tech_=false;if(this.isPosterFromTech_){this.poster_='';this.trigger('posterchange');}this.isPosterFromTech_=false;};/**
   * Return a reference to the current {@link Tech}.
   * It will print a warning by default about the danger of using the tech directly
   * but any argument that is passed in will silence the warning.
   *
   * @param {*} [safety]
   *        Anything passed in to silence the warning
   *
   * @return {Tech}
   *         The Tech
   */Player.prototype.tech=function tech(safety){if(safety===undefined){log.warn(tsml(_templateObject$1));}return this.tech_;};/**
   * Set up click and touch listeners for the playback element
   *
   * - On desktops: a click on the video itself will toggle playback
   * - On mobile devices: a click on the video toggles controls
   *   which is done by toggling the user state between active and
   *   inactive
   * - A tap can signal that a user has become active or has become inactive
   *   e.g. a quick tap on an iPhone movie should reveal the controls. Another
   *   quick tap should hide them again (signaling the user is in an inactive
   *   viewing state)
   * - In addition to this, we still want the user to be considered inactive after
   *   a few seconds of inactivity.
   *
   * > Note: the only part of iOS interaction we can't mimic with this setup
   * is a touch and hold on the video element counting as activity in order to
   * keep the controls showing, but that shouldn't be an issue. A touch and hold
   * on any controls will still keep the user active
   *
   * @private
   */Player.prototype.addTechControlsListeners_=function addTechControlsListeners_(){// Make sure to remove all the previous listeners in case we are called multiple times.
this.removeTechControlsListeners_();// Some browsers (Chrome & IE) don't trigger a click on a flash swf, but do
// trigger mousedown/up.
// http://stackoverflow.com/questions/1444562/javascript-onclick-event-over-flash-object
// Any touch events are set to block the mousedown event from happening
this.on(this.tech_,'mousedown',this.handleTechClick_);// If the controls were hidden we don't want that to change without a tap event
// so we'll check if the controls were already showing before reporting user
// activity
this.on(this.tech_,'touchstart',this.handleTechTouchStart_);this.on(this.tech_,'touchmove',this.handleTechTouchMove_);this.on(this.tech_,'touchend',this.handleTechTouchEnd_);// The tap listener needs to come after the touchend listener because the tap
// listener cancels out any reportedUserActivity when setting userActive(false)
this.on(this.tech_,'tap',this.handleTechTap_);};/**
   * Remove the listeners used for click and tap controls. This is needed for
   * toggling to controls disabled, where a tap/touch should do nothing.
   *
   * @private
   */Player.prototype.removeTechControlsListeners_=function removeTechControlsListeners_(){// We don't want to just use `this.off()` because there might be other needed
// listeners added by techs that extend this.
this.off(this.tech_,'tap',this.handleTechTap_);this.off(this.tech_,'touchstart',this.handleTechTouchStart_);this.off(this.tech_,'touchmove',this.handleTechTouchMove_);this.off(this.tech_,'touchend',this.handleTechTouchEnd_);this.off(this.tech_,'mousedown',this.handleTechClick_);};/**
   * Player waits for the tech to be ready
   *
   * @private
   */Player.prototype.handleTechReady_=function handleTechReady_(){this.triggerReady();// Keep the same volume as before
if(this.cache_.volume){this.techCall_('setVolume',this.cache_.volume);}// Look if the tech found a higher resolution poster while loading
this.handleTechPosterChange_();// Update the duration if available
this.handleTechDurationChange_();// Chrome and Safari both have issues with autoplay.
// In Safari (5.1.1), when we move the video element into the container div, autoplay doesn't work.
// In Chrome (15), if you have autoplay + a poster + no controls, the video gets hidden (but audio plays)
// This fixes both issues. Need to wait for API, so it updates displays correctly
if((this.src()||this.currentSrc())&&this.tag&&this.options_.autoplay&&this.paused()){try{// Chrome Fix. Fixed in Chrome v16.
delete this.tag.poster;}catch(e){log('deleting tag.poster throws in some browsers',e);}}};/**
   * Retrigger the `loadstart` event that was triggered by the {@link Tech}. This
   * function will also trigger {@link Player#firstplay} if it is the first loadstart
   * for a video.
   *
   * @fires Player#loadstart
   * @fires Player#firstplay
   * @listens Tech#loadstart
   * @private
   */Player.prototype.handleTechLoadStart_=function handleTechLoadStart_(){// TODO: Update to use `emptied` event instead. See #1277.
this.removeClass('vjs-ended');this.removeClass('vjs-seeking');// reset the error state
this.error(null);// If it's already playing we want to trigger a firstplay event now.
// The firstplay event relies on both the play and loadstart events
// which can happen in any order for a new source
if(!this.paused()){/**
       * Fired when the user agent begins looking for media data
       *
       * @event Player#loadstart
       * @type {EventTarget~Event}
       */this.trigger('loadstart');this.trigger('firstplay');}else {// reset the hasStarted state
this.hasStarted(false);this.trigger('loadstart');}// autoplay happens after loadstart for the browser,
// so we mimic that behavior
this.manualAutoplay_(this.autoplay());};/**
   * Handle autoplay string values, rather than the typical boolean
   * values that should be handled by the tech. Note that this is not
   * part of any specification. Valid values and what they do can be
   * found on the autoplay getter at Player#autoplay()
   */Player.prototype.manualAutoplay_=function manualAutoplay_(type){var _this4=this;if(!this.tech_||typeof type!=='string'){return;}var muted=function muted(){var previouslyMuted=_this4.muted();_this4.muted(true);var playPromise=_this4.play();if(!playPromise||!playPromise.then||!playPromise['catch']){return;}return playPromise['catch'](function(e){// restore old value of muted on failure
_this4.muted(previouslyMuted);});};var promise=void 0;if(type==='any'){promise=this.play();if(promise&&promise.then&&promise['catch']){promise['catch'](function(){return muted();});}}else if(type==='muted'){promise=muted();}else {promise=this.play();}if(!promise||!promise.then||!promise['catch']){return;}return promise.then(function(){_this4.trigger({type:'autoplay-success',autoplay:type});})['catch'](function(e){_this4.trigger({type:'autoplay-failure',autoplay:type});});};/**
   * Update the internal source caches so that we return the correct source from
   * `src()`, `currentSource()`, and `currentSources()`.
   *
   * > Note: `currentSources` will not be updated if the source that is passed in exists
   *         in the current `currentSources` cache.
   *
   *
   * @param {Tech~SourceObject} srcObj
   *        A string or object source to update our caches to.
   */Player.prototype.updateSourceCaches_=function updateSourceCaches_(){var srcObj=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';var src=srcObj;var type='';if(typeof src!=='string'){src=srcObj.src;type=srcObj.type;}// make sure all the caches are set to default values
// to prevent null checking
this.cache_.source=this.cache_.source||{};this.cache_.sources=this.cache_.sources||[];// try to get the type of the src that was passed in
if(src&&!type){type=findMimetype(this,src);}// update `currentSource` cache always
this.cache_.source=mergeOptions({},srcObj,{src:src,type:type});var matchingSources=this.cache_.sources.filter(function(s){return s.src&&s.src===src;});var sourceElSources=[];var sourceEls=this.$$('source');var matchingSourceEls=[];for(var i=0;i<sourceEls.length;i++){var sourceObj=getAttributes(sourceEls[i]);sourceElSources.push(sourceObj);if(sourceObj.src&&sourceObj.src===src){matchingSourceEls.push(sourceObj.src);}}// if we have matching source els but not matching sources
// the current source cache is not up to date
if(matchingSourceEls.length&&!matchingSources.length){this.cache_.sources=sourceElSources;// if we don't have matching source or source els set the
// sources cache to the `currentSource` cache
}else if(!matchingSources.length){this.cache_.sources=[this.cache_.source];}// update the tech `src` cache
this.cache_.src=src;};/**
   * *EXPERIMENTAL* Fired when the source is set or changed on the {@link Tech}
   * causing the media element to reload.
   *
   * It will fire for the initial source and each subsequent source.
   * This event is a custom event from Video.js and is triggered by the {@link Tech}.
   *
   * The event object for this event contains a `src` property that will contain the source
   * that was available when the event was triggered. This is generally only necessary if Video.js
   * is switching techs while the source was being changed.
   *
   * It is also fired when `load` is called on the player (or media element)
   * because the {@link https://html.spec.whatwg.org/multipage/media.html#dom-media-load|specification for `load`}
   * says that the resource selection algorithm needs to be aborted and restarted.
   * In this case, it is very likely that the `src` property will be set to the
   * empty string `""` to indicate we do not know what the source will be but
   * that it is changing.
   *
   * *This event is currently still experimental and may change in minor releases.*
   * __To use this, pass `enableSourceset` option to the player.__
   *
   * @event Player#sourceset
   * @type {EventTarget~Event}
   * @prop {string} src
   *                The source url available when the `sourceset` was triggered.
   *                It will be an empty string if we cannot know what the source is
   *                but know that the source will change.
   */ /**
   * Retrigger the `sourceset` event that was triggered by the {@link Tech}.
   *
   * @fires Player#sourceset
   * @listens Tech#sourceset
   * @private
   */Player.prototype.handleTechSourceset_=function handleTechSourceset_(event){var _this5=this;// only update the source cache when the source
// was not updated using the player api
if(!this.changingSrc_){var updateSourceCaches=function updateSourceCaches(src){return _this5.updateSourceCaches_(src);};var playerSrc=this.currentSource().src;var eventSrc=event.src;// if we have a playerSrc that is not a blob, and a tech src that is a blob
if(playerSrc&&!/^blob:/.test(playerSrc)&&/^blob:/.test(eventSrc)){// if both the tech source and the player source were updated we assume
// something like @videojs/http-streaming did the sourceset and skip updating the source cache.
if(!this.lastSource_||this.lastSource_.tech!==eventSrc&&this.lastSource_.player!==playerSrc){updateSourceCaches=function updateSourceCaches(){};}}// update the source to the intial source right away
// in some cases this will be empty string
updateSourceCaches(eventSrc);// if the `sourceset` `src` was an empty string
// wait for a `loadstart` to update the cache to `currentSrc`.
// If a sourceset happens before a `loadstart`, we reset the state
// as this function will be called again.
if(!event.src){var updateCache=function updateCache(e){if(e.type!=='sourceset'){var techSrc=_this5.techGet('currentSrc');_this5.lastSource_.tech=techSrc;_this5.updateSourceCaches_(techSrc);}_this5.tech_.off(['sourceset','loadstart'],updateCache);};this.tech_.one(['sourceset','loadstart'],updateCache);}}this.lastSource_={player:this.currentSource().src,tech:event.src};this.trigger({src:event.src,type:'sourceset'});};/**
   * Add/remove the vjs-has-started class
   *
   * @fires Player#firstplay
   *
   * @param {boolean} request
   *        - true: adds the class
   *        - false: remove the class
   *
   * @return {boolean}
   *         the boolean value of hasStarted_
   */Player.prototype.hasStarted=function hasStarted(request){if(request===undefined){// act as getter, if we have no request to change
return this.hasStarted_;}if(request===this.hasStarted_){return;}this.hasStarted_=request;if(this.hasStarted_){this.addClass('vjs-has-started');this.trigger('firstplay');}else {this.removeClass('vjs-has-started');}};/**
   * Fired whenever the media begins or resumes playback
   *
   * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-play}
   * @fires Player#play
   * @listens Tech#play
   * @private
   */Player.prototype.handleTechPlay_=function handleTechPlay_(){this.removeClass('vjs-ended');this.removeClass('vjs-paused');this.addClass('vjs-playing');// hide the poster when the user hits play
this.hasStarted(true);/**
     * Triggered whenever an {@link Tech#play} event happens. Indicates that
     * playback has started or resumed.
     *
     * @event Player#play
     * @type {EventTarget~Event}
     */this.trigger('play');};/**
   * Retrigger the `ratechange` event that was triggered by the {@link Tech}.
   *
   * If there were any events queued while the playback rate was zero, fire
   * those events now.
   *
   * @private
   * @method Player#handleTechRateChange_
   * @fires Player#ratechange
   * @listens Tech#ratechange
   */Player.prototype.handleTechRateChange_=function handleTechRateChange_(){if(this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0){this.queuedCallbacks_.forEach(function(queued){return queued.callback(queued.event);});this.queuedCallbacks_=[];}this.cache_.lastPlaybackRate=this.tech_.playbackRate();/**
     * Fires when the playing speed of the audio/video is changed
     *
     * @event Player#ratechange
     * @type {event}
     */this.trigger('ratechange');};/**
   * Retrigger the `waiting` event that was triggered by the {@link Tech}.
   *
   * @fires Player#waiting
   * @listens Tech#waiting
   * @private
   */Player.prototype.handleTechWaiting_=function handleTechWaiting_(){var _this6=this;this.addClass('vjs-waiting');/**
     * A readyState change on the DOM element has caused playback to stop.
     *
     * @event Player#waiting
     * @type {EventTarget~Event}
     */this.trigger('waiting');this.one('timeupdate',function(){return _this6.removeClass('vjs-waiting');});};/**
   * Retrigger the `canplay` event that was triggered by the {@link Tech}.
   * > Note: This is not consistent between browsers. See #1351
   *
   * @fires Player#canplay
   * @listens Tech#canplay
   * @private
   */Player.prototype.handleTechCanPlay_=function handleTechCanPlay_(){this.removeClass('vjs-waiting');/**
     * The media has a readyState of HAVE_FUTURE_DATA or greater.
     *
     * @event Player#canplay
     * @type {EventTarget~Event}
     */this.trigger('canplay');};/**
   * Retrigger the `canplaythrough` event that was triggered by the {@link Tech}.
   *
   * @fires Player#canplaythrough
   * @listens Tech#canplaythrough
   * @private
   */Player.prototype.handleTechCanPlayThrough_=function handleTechCanPlayThrough_(){this.removeClass('vjs-waiting');/**
     * The media has a readyState of HAVE_ENOUGH_DATA or greater. This means that the
     * entire media file can be played without buffering.
     *
     * @event Player#canplaythrough
     * @type {EventTarget~Event}
     */this.trigger('canplaythrough');};/**
   * Retrigger the `playing` event that was triggered by the {@link Tech}.
   *
   * @fires Player#playing
   * @listens Tech#playing
   * @private
   */Player.prototype.handleTechPlaying_=function handleTechPlaying_(){this.removeClass('vjs-waiting');/**
     * The media is no longer blocked from playback, and has started playing.
     *
     * @event Player#playing
     * @type {EventTarget~Event}
     */this.trigger('playing');};/**
   * Retrigger the `seeking` event that was triggered by the {@link Tech}.
   *
   * @fires Player#seeking
   * @listens Tech#seeking
   * @private
   */Player.prototype.handleTechSeeking_=function handleTechSeeking_(){this.addClass('vjs-seeking');/**
     * Fired whenever the player is jumping to a new time
     *
     * @event Player#seeking
     * @type {EventTarget~Event}
     */this.trigger('seeking');};/**
   * Retrigger the `seeked` event that was triggered by the {@link Tech}.
   *
   * @fires Player#seeked
   * @listens Tech#seeked
   * @private
   */Player.prototype.handleTechSeeked_=function handleTechSeeked_(){this.removeClass('vjs-seeking');/**
     * Fired when the player has finished jumping to a new time
     *
     * @event Player#seeked
     * @type {EventTarget~Event}
     */this.trigger('seeked');};/**
   * Retrigger the `firstplay` event that was triggered by the {@link Tech}.
   *
   * @fires Player#firstplay
   * @listens Tech#firstplay
   * @deprecated As of 6.0 firstplay event is deprecated.
   *             As of 6.0 passing the `starttime` option to the player and the firstplay event are deprecated.
   * @private
   */Player.prototype.handleTechFirstPlay_=function handleTechFirstPlay_(){// If the first starttime attribute is specified
// then we will start at the given offset in seconds
if(this.options_.starttime){log.warn('Passing the `starttime` option to the player will be deprecated in 6.0');this.currentTime(this.options_.starttime);}this.addClass('vjs-has-started');/**
     * Fired the first time a video is played. Not part of the HLS spec, and this is
     * probably not the best implementation yet, so use sparingly. If you don't have a
     * reason to prevent playback, use `myPlayer.one('play');` instead.
     *
     * @event Player#firstplay
     * @deprecated As of 6.0 firstplay event is deprecated.
     * @type {EventTarget~Event}
     */this.trigger('firstplay');};/**
   * Retrigger the `pause` event that was triggered by the {@link Tech}.
   *
   * @fires Player#pause
   * @listens Tech#pause
   * @private
   */Player.prototype.handleTechPause_=function handleTechPause_(){this.removeClass('vjs-playing');this.addClass('vjs-paused');/**
     * Fired whenever the media has been paused
     *
     * @event Player#pause
     * @type {EventTarget~Event}
     */this.trigger('pause');};/**
   * Retrigger the `ended` event that was triggered by the {@link Tech}.
   *
   * @fires Player#ended
   * @listens Tech#ended
   * @private
   */Player.prototype.handleTechEnded_=function handleTechEnded_(){this.addClass('vjs-ended');if(this.options_.loop){this.currentTime(0);this.play();}else if(!this.paused()){this.pause();}/**
     * Fired when the end of the media resource is reached (currentTime == duration)
     *
     * @event Player#ended
     * @type {EventTarget~Event}
     */this.trigger('ended');};/**
   * Fired when the duration of the media resource is first known or changed
   *
   * @listens Tech#durationchange
   * @private
   */Player.prototype.handleTechDurationChange_=function handleTechDurationChange_(){this.duration(this.techGet_('duration'));};/**
   * Handle a click on the media element to play/pause
   *
   * @param {EventTarget~Event} event
   *        the event that caused this function to trigger
   *
   * @listens Tech#mousedown
   * @private
   */Player.prototype.handleTechClick_=function handleTechClick_(event){if(!isSingleLeftClick(event)){return;}// When controls are disabled a click should not toggle playback because
// the click is considered a control
if(!this.controls_){return;}if(this.paused()){silencePromise(this.play());}else {this.pause();}};/**
   * Handle a tap on the media element. It will toggle the user
   * activity state, which hides and shows the controls.
   *
   * @listens Tech#tap
   * @private
   */Player.prototype.handleTechTap_=function handleTechTap_(){this.userActive(!this.userActive());};/**
   * Handle touch to start
   *
   * @listens Tech#touchstart
   * @private
   */Player.prototype.handleTechTouchStart_=function handleTechTouchStart_(){this.userWasActive=this.userActive();};/**
   * Handle touch to move
   *
   * @listens Tech#touchmove
   * @private
   */Player.prototype.handleTechTouchMove_=function handleTechTouchMove_(){if(this.userWasActive){this.reportUserActivity();}};/**
   * Handle touch to end
   *
   * @param {EventTarget~Event} event
   *        the touchend event that triggered
   *        this function
   *
   * @listens Tech#touchend
   * @private
   */Player.prototype.handleTechTouchEnd_=function handleTechTouchEnd_(event){// Stop the mouse events from also happening
event.preventDefault();};/**
   * Fired when the player switches in or out of fullscreen mode
   *
   * @private
   * @listens Player#fullscreenchange
   */Player.prototype.handleFullscreenChange_=function handleFullscreenChange_(){if(this.isFullscreen()){this.addClass('vjs-fullscreen');}else {this.removeClass('vjs-fullscreen');}};/**
   * native click events on the SWF aren't triggered on IE11, Win8.1RT
   * use stageclick events triggered from inside the SWF instead
   *
   * @private
   * @listens stageclick
   */Player.prototype.handleStageClick_=function handleStageClick_(){this.reportUserActivity();};/**
   * Handle Tech Fullscreen Change
   *
   * @param {EventTarget~Event} event
   *        the fullscreenchange event that triggered this function
   *
   * @param {Object} data
   *        the data that was sent with the event
   *
   * @private
   * @listens Tech#fullscreenchange
   * @fires Player#fullscreenchange
   */Player.prototype.handleTechFullscreenChange_=function handleTechFullscreenChange_(event,data){if(data){this.isFullscreen(data.isFullscreen);}/**
     * Fired when going in and out of fullscreen.
     *
     * @event Player#fullscreenchange
     * @type {EventTarget~Event}
     */this.trigger('fullscreenchange');};/**
   * Fires when an error occurred during the loading of an audio/video.
   *
   * @private
   * @listens Tech#error
   */Player.prototype.handleTechError_=function handleTechError_(){var error=this.tech_.error();this.error(error);};/**
   * Retrigger the `textdata` event that was triggered by the {@link Tech}.
   *
   * @fires Player#textdata
   * @listens Tech#textdata
   * @private
   */Player.prototype.handleTechTextData_=function handleTechTextData_(){var data=null;if(arguments.length>1){data=arguments[1];}/**
     * Fires when we get a textdata event from tech
     *
     * @event Player#textdata
     * @type {EventTarget~Event}
     */this.trigger('textdata',data);};/**
   * Get object for cached values.
   *
   * @return {Object}
   *         get the current object cache
   */Player.prototype.getCache=function getCache(){return this.cache_;};/**
   * Pass values to the playback tech
   *
   * @param {string} [method]
   *        the method to call
   *
   * @param {Object} arg
   *        the argument to pass
   *
   * @private
   */Player.prototype.techCall_=function techCall_(method,arg){// If it's not ready yet, call method when it is
this.ready(function(){if(method in allowedSetters){return set$1(this.middleware_,this.tech_,method,arg);}else if(method in allowedMediators){return mediate(this.middleware_,this.tech_,method,arg);}try{if(this.tech_){this.tech_[method](arg);}}catch(e){log(e);throw e;}},true);};/**
   * Get calls can't wait for the tech, and sometimes don't need to.
   *
   * @param {string} method
   *        Tech method
   *
   * @return {Function|undefined}
   *         the method or undefined
   *
   * @private
   */Player.prototype.techGet_=function techGet_(method){if(!this.tech_||!this.tech_.isReady_){return;}if(method in allowedGetters){return get$1(this.middleware_,this.tech_,method);}else if(method in allowedMediators){return mediate(this.middleware_,this.tech_,method);}// Flash likes to die and reload when you hide or reposition it.
// In these cases the object methods go away and we get errors.
// When that happens we'll catch the errors and inform tech that it's not ready any more.
try{return this.tech_[method]();}catch(e){// When building additional tech libs, an expected method may not be defined yet
if(this.tech_[method]===undefined){log('Video.js: '+method+' method not defined for '+this.techName_+' playback technology.',e);throw e;}// When a method isn't available on the object it throws a TypeError
if(e.name==='TypeError'){log('Video.js: '+method+' unavailable on '+this.techName_+' playback technology element.',e);this.tech_.isReady_=false;throw e;}// If error unknown, just log and throw
log(e);throw e;}};/**
   * Attempt to begin playback at the first opportunity.
   *
   * @return {Promise|undefined}
   *         Returns a promise if the browser supports Promises (or one
   *         was passed in as an option). This promise will be resolved on
   *         the return value of play. If this is undefined it will fulfill the
   *         promise chain otherwise the promise chain will be fulfilled when
   *         the promise from play is fulfilled.
   */Player.prototype.play=function play(){var _this7=this;var PromiseClass=this.options_.Promise||window$1.Promise;if(PromiseClass){return new PromiseClass(function(resolve){_this7.play_(resolve);});}return this.play_();};/**
   * The actual logic for play, takes a callback that will be resolved on the
   * return value of play. This allows us to resolve to the play promise if there
   * is one on modern browsers.
   *
   * @private
   * @param {Function} [callback]
   *        The callback that should be called when the techs play is actually called
   */Player.prototype.play_=function play_(){var _this8=this;var callback=arguments.length>0&&arguments[0]!==undefined?arguments[0]:silencePromise;// If this is called while we have a play queued up on a loadstart, remove
// that listener to avoid getting in a potentially bad state.
if(this.playOnLoadstart_){this.off('loadstart',this.playOnLoadstart_);}// If the player/tech is not ready, queue up another call to `play()` for
// when it is. This will loop back into this method for another attempt at
// playback when the tech is ready.
if(!this.isReady_){// Bail out if we're already waiting for `ready`!
if(this.playWaitingForReady_){return;}this.playWaitingForReady_=true;this.ready(function(){_this8.playWaitingForReady_=false;callback(_this8.play());});// If the player/tech is ready and we have a source, we can attempt playback.
}else if(!this.changingSrc_&&(this.src()||this.currentSrc())){callback(this.techGet_('play'));return;// If the tech is ready, but we do not have a source, we'll need to wait
// for both the `ready` and a `loadstart` when the source is finally
// resolved by middleware and set on the player.
//
// This can happen if `play()` is called while changing sources or before
// one has been set on the player.
}else {this.playOnLoadstart_=function(){_this8.playOnLoadstart_=null;callback(_this8.play());};this.one('loadstart',this.playOnLoadstart_);}};/**
   * Pause the video playback
   *
   * @return {Player}
   *         A reference to the player object this function was called on
   */Player.prototype.pause=function pause(){this.techCall_('pause');};/**
   * Check if the player is paused or has yet to play
   *
   * @return {boolean}
   *         - false: if the media is currently playing
   *         - true: if media is not currently playing
   */Player.prototype.paused=function paused(){// The initial state of paused should be true (in Safari it's actually false)
return this.techGet_('paused')===false?false:true;};/**
   * Get a TimeRange object representing the current ranges of time that the user
   * has played.
   *
   * @return {TimeRange}
   *         A time range object that represents all the increments of time that have
   *         been played.
   */Player.prototype.played=function played(){return this.techGet_('played')||createTimeRanges(0,0);};/**
   * Returns whether or not the user is "scrubbing". Scrubbing is
   * when the user has clicked the progress bar handle and is
   * dragging it along the progress bar.
   *
   * @param {boolean} [isScrubbing]
   *        wether the user is or is not scrubbing
   *
   * @return {boolean}
   *         The value of scrubbing when getting
   */Player.prototype.scrubbing=function scrubbing(isScrubbing){if(typeof isScrubbing==='undefined'){return this.scrubbing_;}this.scrubbing_=!!isScrubbing;if(isScrubbing){this.addClass('vjs-scrubbing');}else {this.removeClass('vjs-scrubbing');}};/**
   * Get or set the current time (in seconds)
   *
   * @param {number|string} [seconds]
   *        The time to seek to in seconds
   *
   * @return {number}
   *         - the current time in seconds when getting
   */Player.prototype.currentTime=function currentTime(seconds){if(typeof seconds!=='undefined'){if(seconds<0){seconds=0;}this.techCall_('setCurrentTime',seconds);return;}// cache last currentTime and return. default to 0 seconds
//
// Caching the currentTime is meant to prevent a massive amount of reads on the tech's
// currentTime when scrubbing, but may not provide much performance benefit afterall.
// Should be tested. Also something has to read the actual current time or the cache will
// never get updated.
this.cache_.currentTime=this.techGet_('currentTime')||0;return this.cache_.currentTime;};/**
   * Normally gets the length in time of the video in seconds;
   * in all but the rarest use cases an argument will NOT be passed to the method
   *
   * > **NOTE**: The video must have started loading before the duration can be
   * known, and in the case of Flash, may not be known until the video starts
   * playing.
   *
   * @fires Player#durationchange
   *
   * @param {number} [seconds]
   *        The duration of the video to set in seconds
   *
   * @return {number}
   *         - The duration of the video in seconds when getting
   */Player.prototype.duration=function duration(seconds){if(seconds===undefined){// return NaN if the duration is not known
return this.cache_.duration!==undefined?this.cache_.duration:NaN;}seconds=parseFloat(seconds);// Standardize on Inifity for signaling video is live
if(seconds<0){seconds=Infinity;}if(seconds!==this.cache_.duration){// Cache the last set value for optimized scrubbing (esp. Flash)
this.cache_.duration=seconds;if(seconds===Infinity){this.addClass('vjs-live');}else {this.removeClass('vjs-live');}/**
       * @event Player#durationchange
       * @type {EventTarget~Event}
       */this.trigger('durationchange');}};/**
   * Calculates how much time is left in the video. Not part
   * of the native video API.
   *
   * @return {number}
   *         The time remaining in seconds
   */Player.prototype.remainingTime=function remainingTime(){return this.duration()-this.currentTime();};/**
   * A remaining time function that is intented to be used when
   * the time is to be displayed directly to the user.
   *
   * @return {number}
   *         The rounded time remaining in seconds
   */Player.prototype.remainingTimeDisplay=function remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime());};//
// Kind of like an array of portions of the video that have been downloaded.
/**
   * Get a TimeRange object with an array of the times of the video
   * that have been downloaded. If you just want the percent of the
   * video that's been downloaded, use bufferedPercent.
   *
   * @see [Buffered Spec]{@link http://dev.w3.org/html5/spec/video.html#dom-media-buffered}
   *
   * @return {TimeRange}
   *         A mock TimeRange object (following HTML spec)
   */Player.prototype.buffered=function buffered(){var buffered=this.techGet_('buffered');if(!buffered||!buffered.length){buffered=createTimeRanges(0,0);}return buffered;};/**
   * Get the percent (as a decimal) of the video that's been downloaded.
   * This method is not a part of the native HTML video API.
   *
   * @return {number}
   *         A decimal between 0 and 1 representing the percent
   *         that is bufferred 0 being 0% and 1 being 100%
   */Player.prototype.bufferedPercent=function bufferedPercent$$1(){return bufferedPercent(this.buffered(),this.duration());};/**
   * Get the ending time of the last buffered time range
   * This is used in the progress bar to encapsulate all time ranges.
   *
   * @return {number}
   *         The end of the last buffered time range
   */Player.prototype.bufferedEnd=function bufferedEnd(){var buffered=this.buffered();var duration=this.duration();var end=buffered.end(buffered.length-1);if(end>duration){end=duration;}return end;};/**
   * Get or set the current volume of the media
   *
   * @param  {number} [percentAsDecimal]
   *         The new volume as a decimal percent:
   *         - 0 is muted/0%/off
   *         - 1.0 is 100%/full
   *         - 0.5 is half volume or 50%
   *
   * @return {number}
   *         The current volume as a percent when getting
   */Player.prototype.volume=function volume(percentAsDecimal){var vol=void 0;if(percentAsDecimal!==undefined){// Force value to between 0 and 1
vol=Math.max(0,Math.min(1,parseFloat(percentAsDecimal)));this.cache_.volume=vol;this.techCall_('setVolume',vol);if(vol>0){this.lastVolume_(vol);}return;}// Default to 1 when returning current volume.
vol=parseFloat(this.techGet_('volume'));return isNaN(vol)?1:vol;};/**
   * Get the current muted state, or turn mute on or off
   *
   * @param {boolean} [muted]
   *        - true to mute
   *        - false to unmute
   *
   * @return {boolean}
   *         - true if mute is on and getting
   *         - false if mute is off and getting
   */Player.prototype.muted=function muted(_muted){if(_muted!==undefined){this.techCall_('setMuted',_muted);return;}return this.techGet_('muted')||false;};/**
   * Get the current defaultMuted state, or turn defaultMuted on or off. defaultMuted
   * indicates the state of muted on intial playback.
   *
   * ```js
   *   var myPlayer = videojs('some-player-id');
   *
   *   myPlayer.src("http://www.example.com/path/to/video.mp4");
   *
   *   // get, should be false
   *   console.log(myPlayer.defaultMuted());
   *   // set to true
   *   myPlayer.defaultMuted(true);
   *   // get should be true
   *   console.log(myPlayer.defaultMuted());
   * ```
   *
   * @param {boolean} [defaultMuted]
   *        - true to mute
   *        - false to unmute
   *
   * @return {boolean|Player}
   *         - true if defaultMuted is on and getting
   *         - false if defaultMuted is off and getting
   *         - A reference to the current player when setting
   */Player.prototype.defaultMuted=function defaultMuted(_defaultMuted){if(_defaultMuted!==undefined){return this.techCall_('setDefaultMuted',_defaultMuted);}return this.techGet_('defaultMuted')||false;};/**
   * Get the last volume, or set it
   *
   * @param  {number} [percentAsDecimal]
   *         The new last volume as a decimal percent:
   *         - 0 is muted/0%/off
   *         - 1.0 is 100%/full
   *         - 0.5 is half volume or 50%
   *
   * @return {number}
   *         the current value of lastVolume as a percent when getting
   *
   * @private
   */Player.prototype.lastVolume_=function lastVolume_(percentAsDecimal){if(percentAsDecimal!==undefined&&percentAsDecimal!==0){this.cache_.lastVolume=percentAsDecimal;return;}return this.cache_.lastVolume;};/**
   * Check if current tech can support native fullscreen
   * (e.g. with built in controls like iOS, so not our flash swf)
   *
   * @return {boolean}
   *         if native fullscreen is supported
   */Player.prototype.supportsFullScreen=function supportsFullScreen(){return this.techGet_('supportsFullScreen')||false;};/**
   * Check if the player is in fullscreen mode or tell the player that it
   * is or is not in fullscreen mode.
   *
   * > NOTE: As of the latest HTML5 spec, isFullscreen is no longer an official
   * property and instead document.fullscreenElement is used. But isFullscreen is
   * still a valuable property for internal player workings.
   *
   * @param  {boolean} [isFS]
   *         Set the players current fullscreen state
   *
   * @return {boolean}
   *         - true if fullscreen is on and getting
   *         - false if fullscreen is off and getting
   */Player.prototype.isFullscreen=function isFullscreen(isFS){if(isFS!==undefined){this.isFullscreen_=!!isFS;return;}return !!this.isFullscreen_;};/**
   * Increase the size of the video to full screen
   * In some browsers, full screen is not supported natively, so it enters
   * "full window mode", where the video fills the browser window.
   * In browsers and devices that support native full screen, sometimes the
   * browser's default controls will be shown, and not the Video.js custom skin.
   * This includes most mobile devices (iOS, Android) and older versions of
   * Safari.
   *
   * @fires Player#fullscreenchange
   */Player.prototype.requestFullscreen=function requestFullscreen(){var fsApi=FullscreenApi;this.isFullscreen(true);if(fsApi.requestFullscreen){// the browser supports going fullscreen at the element level so we can
// take the controls fullscreen as well as the video
// Trigger fullscreenchange event after change
// We have to specifically add this each time, and remove
// when canceling fullscreen. Otherwise if there's multiple
// players on a page, they would all be reacting to the same fullscreen
// events
on(document$1,fsApi.fullscreenchange,bind(this,function documentFullscreenChange(e){this.isFullscreen(document$1[fsApi.fullscreenElement]);// If cancelling fullscreen, remove event listener.
if(this.isFullscreen()===false){off(document$1,fsApi.fullscreenchange,documentFullscreenChange);}/**
         * @event Player#fullscreenchange
         * @type {EventTarget~Event}
         */this.trigger('fullscreenchange');}));this.el_[fsApi.requestFullscreen]();}else if(this.tech_.supportsFullScreen()){// we can't take the video.js controls fullscreen but we can go fullscreen
// with native controls
this.techCall_('enterFullScreen');}else {// fullscreen isn't supported so we'll just stretch the video element to
// fill the viewport
this.enterFullWindow();/**
       * @event Player#fullscreenchange
       * @type {EventTarget~Event}
       */this.trigger('fullscreenchange');}};/**
   * Return the video to its normal size after having been in full screen mode
   *
   * @fires Player#fullscreenchange
   */Player.prototype.exitFullscreen=function exitFullscreen(){var fsApi=FullscreenApi;this.isFullscreen(false);// Check for browser element fullscreen support
if(fsApi.requestFullscreen){document$1[fsApi.exitFullscreen]();}else if(this.tech_.supportsFullScreen()){this.techCall_('exitFullScreen');}else {this.exitFullWindow();/**
       * @event Player#fullscreenchange
       * @type {EventTarget~Event}
       */this.trigger('fullscreenchange');}};/**
   * When fullscreen isn't supported we can stretch the
   * video container to as wide as the browser will let us.
   *
   * @fires Player#enterFullWindow
   */Player.prototype.enterFullWindow=function enterFullWindow(){this.isFullWindow=true;// Storing original doc overflow value to return to when fullscreen is off
this.docOrigOverflow=document$1.documentElement.style.overflow;// Add listener for esc key to exit fullscreen
on(document$1,'keydown',bind(this,this.fullWindowOnEscKey));// Hide any scroll bars
document$1.documentElement.style.overflow='hidden';// Apply fullscreen styles
addClass(document$1.body,'vjs-full-window');/**
     * @event Player#enterFullWindow
     * @type {EventTarget~Event}
     */this.trigger('enterFullWindow');};/**
   * Check for call to either exit full window or
   * full screen on ESC key
   *
   * @param {string} event
   *        Event to check for key press
   */Player.prototype.fullWindowOnEscKey=function fullWindowOnEscKey(event){if(event.keyCode===27){if(this.isFullscreen()===true){this.exitFullscreen();}else {this.exitFullWindow();}}};/**
   * Exit full window
   *
   * @fires Player#exitFullWindow
   */Player.prototype.exitFullWindow=function exitFullWindow(){this.isFullWindow=false;off(document$1,'keydown',this.fullWindowOnEscKey);// Unhide scroll bars.
document$1.documentElement.style.overflow=this.docOrigOverflow;// Remove fullscreen styles
removeClass(document$1.body,'vjs-full-window');// Resize the box, controller, and poster to original sizes
// this.positionAll();
/**
     * @event Player#exitFullWindow
     * @type {EventTarget~Event}
     */this.trigger('exitFullWindow');};/**
   * Check whether the player can play a given mimetype
   *
   * @see https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype
   *
   * @param {string} type
   *        The mimetype to check
   *
   * @return {string}
   *         'probably', 'maybe', or '' (empty string)
   */Player.prototype.canPlayType=function canPlayType(type){var can=void 0;// Loop through each playback technology in the options order
for(var i=0,j=this.options_.techOrder;i<j.length;i++){var techName=j[i];var tech=Tech.getTech(techName);// Support old behavior of techs being registered as components.
// Remove once that deprecated behavior is removed.
if(!tech){tech=Component.getComponent(techName);}// Check if the current tech is defined before continuing
if(!tech){log.error('The "'+techName+'" tech is undefined. Skipped browser support check for that tech.');continue;}// Check if the browser supports this technology
if(tech.isSupported()){can=tech.canPlayType(type);if(can){return can;}}}return '';};/**
   * Select source based on tech-order or source-order
   * Uses source-order selection if `options.sourceOrder` is truthy. Otherwise,
   * defaults to tech-order selection
   *
   * @param {Array} sources
   *        The sources for a media asset
   *
   * @return {Object|boolean}
   *         Object of source and tech order or false
   */Player.prototype.selectSource=function selectSource(sources){var _this9=this;// Get only the techs specified in `techOrder` that exist and are supported by the
// current platform
var techs=this.options_.techOrder.map(function(techName){return [techName,Tech.getTech(techName)];}).filter(function(_ref){var techName=_ref[0],tech=_ref[1];// Check if the current tech is defined before continuing
if(tech){// Check if the browser supports this technology
return tech.isSupported();}log.error('The "'+techName+'" tech is undefined. Skipped browser support check for that tech.');return false;});// Iterate over each `innerArray` element once per `outerArray` element and execute
// `tester` with both. If `tester` returns a non-falsy value, exit early and return
// that value.
var findFirstPassingTechSourcePair=function findFirstPassingTechSourcePair(outerArray,innerArray,tester){var found=void 0;outerArray.some(function(outerChoice){return innerArray.some(function(innerChoice){found=tester(outerChoice,innerChoice);if(found){return true;}});});return found;};var foundSourceAndTech=void 0;var flip=function flip(fn){return function(a,b){return fn(b,a);};};var finder=function finder(_ref2,source){var techName=_ref2[0],tech=_ref2[1];if(tech.canPlaySource(source,_this9.options_[techName.toLowerCase()])){return {source:source,tech:techName};}};// Depending on the truthiness of `options.sourceOrder`, we swap the order of techs and sources
// to select from them based on their priority.
if(this.options_.sourceOrder){// Source-first ordering
foundSourceAndTech=findFirstPassingTechSourcePair(sources,techs,flip(finder));}else {// Tech-first ordering
foundSourceAndTech=findFirstPassingTechSourcePair(techs,sources,finder);}return foundSourceAndTech||false;};/**
   * Get or set the video source.
   *
   * @param {Tech~SourceObject|Tech~SourceObject[]|string} [source]
   *        A SourceObject, an array of SourceObjects, or a string referencing
   *        a URL to a media source. It is _highly recommended_ that an object
   *        or array of objects is used here, so that source selection
   *        algorithms can take the `type` into account.
   *
   *        If not provided, this method acts as a getter.
   *
   * @return {string|undefined}
   *         If the `source` argument is missing, returns the current source
   *         URL. Otherwise, returns nothing/undefined.
   */Player.prototype.src=function src(source){var _this10=this;// getter usage
if(typeof source==='undefined'){return this.cache_.src||'';}// filter out invalid sources and turn our source into
// an array of source objects
var sources=filterSource(source);// if a source was passed in then it is invalid because
// it was filtered to a zero length Array. So we have to
// show an error
if(!sources.length){this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)});},0);return;}// intial sources
this.changingSrc_=true;this.cache_.sources=sources;this.updateSourceCaches_(sources[0]);// middlewareSource is the source after it has been changed by middleware
setSource(this,sources[0],function(middlewareSource,mws){_this10.middleware_=mws;// since sourceSet is async we have to update the cache again after we select a source since
// the source that is selected could be out of order from the cache update above this callback.
_this10.cache_.sources=sources;_this10.updateSourceCaches_(middlewareSource);var err=_this10.src_(middlewareSource);if(err){if(sources.length>1){return _this10.src(sources.slice(1));}_this10.changingSrc_=false;// We need to wrap this in a timeout to give folks a chance to add error event handlers
_this10.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)});},0);// we could not find an appropriate tech, but let's still notify the delegate that this is it
// this needs a better comment about why this is needed
_this10.triggerReady();return;}setTech(mws,_this10.tech_);});};/**
   * Set the source object on the tech, returns a boolean that indicates wether
   * there is a tech that can play the source or not
   *
   * @param {Tech~SourceObject} source
   *        The source object to set on the Tech
   *
   * @return {Boolean}
   *         - True if there is no Tech to playback this source
   *         - False otherwise
   *
   * @private
   */Player.prototype.src_=function src_(source){var _this11=this;var sourceTech=this.selectSource([source]);if(!sourceTech){return true;}if(!titleCaseEquals(sourceTech.tech,this.techName_)){this.changingSrc_=true;// load this technology with the chosen source
this.loadTech_(sourceTech.tech,sourceTech.source);this.tech_.ready(function(){_this11.changingSrc_=false;});return false;}// wait until the tech is ready to set the source
// and set it synchronously if possible (#2326)
this.ready(function(){// The setSource tech method was added with source handlers
// so older techs won't support it
// We need to check the direct prototype for the case where subclasses
// of the tech do not support source handlers
if(this.tech_.constructor.prototype.hasOwnProperty('setSource')){this.techCall_('setSource',source);}else {this.techCall_('src',source.src);}this.changingSrc_=false;},true);return false;};/**
   * Begin loading the src data.
   */Player.prototype.load=function load(){this.techCall_('load');};/**
   * Reset the player. Loads the first tech in the techOrder,
   * removes all the text tracks in the existing `tech`,
   * and calls `reset` on the `tech`.
   */Player.prototype.reset=function reset(){if(this.tech_){this.tech_.clearTracks('text');}this.loadTech_(this.options_.techOrder[0],null);this.techCall_('reset');};/**
   * Returns all of the current source objects.
   *
   * @return {Tech~SourceObject[]}
   *         The current source objects
   */Player.prototype.currentSources=function currentSources(){var source=this.currentSource();var sources=[];// assume `{}` or `{ src }`
if(Object.keys(source).length!==0){sources.push(source);}return this.cache_.sources||sources;};/**
   * Returns the current source object.
   *
   * @return {Tech~SourceObject}
   *         The current source object
   */Player.prototype.currentSource=function currentSource(){return this.cache_.source||{};};/**
   * Returns the fully qualified URL of the current source value e.g. http://mysite.com/video.mp4
   * Can be used in conjuction with `currentType` to assist in rebuilding the current source object.
   *
   * @return {string}
   *         The current source
   */Player.prototype.currentSrc=function currentSrc(){return this.currentSource()&&this.currentSource().src||'';};/**
   * Get the current source type e.g. video/mp4
   * This can allow you rebuild the current source object so that you could load the same
   * source and tech later
   *
   * @return {string}
   *         The source MIME type
   */Player.prototype.currentType=function currentType(){return this.currentSource()&&this.currentSource().type||'';};/**
   * Get or set the preload attribute
   *
   * @param {boolean} [value]
   *        - true means that we should preload
   *        - false maens that we should not preload
   *
   * @return {string}
   *         The preload attribute value when getting
   */Player.prototype.preload=function preload(value){if(value!==undefined){this.techCall_('setPreload',value);this.options_.preload=value;return;}return this.techGet_('preload');};/**
   * Get or set the autoplay option. When this is a boolean it will
   * modify the attribute on the tech. When this is a string the attribute on
   * the tech will be removed and `Player` will handle autoplay on loadstarts.
   *
   * @param {boolean|string} [value]
   *        - true: autoplay using the browser behavior
   *        - false: do not autoplay
   *        - 'play': call play() on every loadstart
   *        - 'muted': call muted() then play() on every loadstart
   *        - 'any': call play() on every loadstart. if that fails call muted() then play().
   *        - *: values other than those listed here will be set `autoplay` to true
   *
   * @return {boolean|string}
   *         The current value of autoplay when getting
   */Player.prototype.autoplay=function autoplay(value){// getter usage
if(value===undefined){return this.options_.autoplay||false;}var techAutoplay=void 0;// if the value is a valid string set it to that
if(typeof value==='string'&&/(any|play|muted)/.test(value)){this.options_.autoplay=value;this.manualAutoplay_(value);techAutoplay=false;// any falsy value sets autoplay to false in the browser,
// lets do the same
}else if(!value){this.options_.autoplay=false;// any other value (ie truthy) sets autoplay to true
}else {this.options_.autoplay=true;}techAutoplay=techAutoplay||this.options_.autoplay;// if we don't have a tech then we do not queue up
// a setAutoplay call on tech ready. We do this because the
// autoplay option will be passed in the constructor and we
// do not need to set it twice
if(this.tech_){this.techCall_('setAutoplay',techAutoplay);}};/**
   * Set or unset the playsinline attribute.
   * Playsinline tells the browser that non-fullscreen playback is preferred.
   *
   * @param {boolean} [value]
   *        - true means that we should try to play inline by default
   *        - false means that we should use the browser's default playback mode,
   *          which in most cases is inline. iOS Safari is a notable exception
   *          and plays fullscreen by default.
   *
   * @return {string|Player}
   *         - the current value of playsinline
   *         - the player when setting
   *
   * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}
   */Player.prototype.playsinline=function playsinline(value){if(value!==undefined){this.techCall_('setPlaysinline',value);this.options_.playsinline=value;return this;}return this.techGet_('playsinline');};/**
   * Get or set the loop attribute on the video element.
   *
   * @param {boolean} [value]
   *        - true means that we should loop the video
   *        - false means that we should not loop the video
   *
   * @return {string}
   *         The current value of loop when getting
   */Player.prototype.loop=function loop(value){if(value!==undefined){this.techCall_('setLoop',value);this.options_.loop=value;return;}return this.techGet_('loop');};/**
   * Get or set the poster image source url
   *
   * @fires Player#posterchange
   *
   * @param {string} [src]
   *        Poster image source URL
   *
   * @return {string}
   *         The current value of poster when getting
   */Player.prototype.poster=function poster(src){if(src===undefined){return this.poster_;}// The correct way to remove a poster is to set as an empty string
// other falsey values will throw errors
if(!src){src='';}if(src===this.poster_){return;}// update the internal poster variable
this.poster_=src;// update the tech's poster
this.techCall_('setPoster',src);this.isPosterFromTech_=false;// alert components that the poster has been set
/**
     * This event fires when the poster image is changed on the player.
     *
     * @event Player#posterchange
     * @type {EventTarget~Event}
     */this.trigger('posterchange');};/**
   * Some techs (e.g. YouTube) can provide a poster source in an
   * asynchronous way. We want the poster component to use this
   * poster source so that it covers up the tech's controls.
   * (YouTube's play button). However we only want to use this
   * source if the player user hasn't set a poster through
   * the normal APIs.
   *
   * @fires Player#posterchange
   * @listens Tech#posterchange
   * @private
   */Player.prototype.handleTechPosterChange_=function handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var newPoster=this.tech_.poster()||'';if(newPoster!==this.poster_){this.poster_=newPoster;this.isPosterFromTech_=true;// Let components know the poster has changed
this.trigger('posterchange');}}};/**
   * Get or set whether or not the controls are showing.
   *
   * @fires Player#controlsenabled
   *
   * @param {boolean} [bool]
   *        - true to turn controls on
   *        - false to turn controls off
   *
   * @return {boolean}
   *         The current value of controls when getting
   */Player.prototype.controls=function controls(bool){if(bool===undefined){return !!this.controls_;}bool=!!bool;// Don't trigger a change event unless it actually changed
if(this.controls_===bool){return;}this.controls_=bool;if(this.usingNativeControls()){this.techCall_('setControls',bool);}if(this.controls_){this.removeClass('vjs-controls-disabled');this.addClass('vjs-controls-enabled');/**
       * @event Player#controlsenabled
       * @type {EventTarget~Event}
       */this.trigger('controlsenabled');if(!this.usingNativeControls()){this.addTechControlsListeners_();}}else {this.removeClass('vjs-controls-enabled');this.addClass('vjs-controls-disabled');/**
       * @event Player#controlsdisabled
       * @type {EventTarget~Event}
       */this.trigger('controlsdisabled');if(!this.usingNativeControls()){this.removeTechControlsListeners_();}}};/**
   * Toggle native controls on/off. Native controls are the controls built into
   * devices (e.g. default iPhone controls), Flash, or other techs
   * (e.g. Vimeo Controls)
   * **This should only be set by the current tech, because only the tech knows
   * if it can support native controls**
   *
   * @fires Player#usingnativecontrols
   * @fires Player#usingcustomcontrols
   *
   * @param {boolean} [bool]
   *        - true to turn native controls on
   *        - false to turn native controls off
   *
   * @return {boolean}
   *         The current value of native controls when getting
   */Player.prototype.usingNativeControls=function usingNativeControls(bool){if(bool===undefined){return !!this.usingNativeControls_;}bool=!!bool;// Don't trigger a change event unless it actually changed
if(this.usingNativeControls_===bool){return;}this.usingNativeControls_=bool;if(this.usingNativeControls_){this.addClass('vjs-using-native-controls');/**
       * player is using the native device controls
       *
       * @event Player#usingnativecontrols
       * @type {EventTarget~Event}
       */this.trigger('usingnativecontrols');}else {this.removeClass('vjs-using-native-controls');/**
       * player is using the custom HTML controls
       *
       * @event Player#usingcustomcontrols
       * @type {EventTarget~Event}
       */this.trigger('usingcustomcontrols');}};/**
   * Set or get the current MediaError
   *
   * @fires Player#error
   *
   * @param  {MediaError|string|number} [err]
   *         A MediaError or a string/number to be turned
   *         into a MediaError
   *
   * @return {MediaError|null}
   *         The current MediaError when getting (or null)
   */Player.prototype.error=function error(err){if(err===undefined){return this.error_||null;}// restoring to default
if(err===null){this.error_=err;this.removeClass('vjs-error');if(this.errorDisplay){this.errorDisplay.close();}return;}this.error_=new MediaError(err);// add the vjs-error classname to the player
this.addClass('vjs-error');// log the name of the error type and any message
// ie8 just logs "[object object]" if you just log the error object
log.error('(CODE:'+this.error_.code+' '+MediaError.errorTypes[this.error_.code]+')',this.error_.message,this.error_);/**
     * @event Player#error
     * @type {EventTarget~Event}
     */this.trigger('error');return;};/**
   * Report user activity
   *
   * @param {Object} event
   *        Event object
   */Player.prototype.reportUserActivity=function reportUserActivity(event){this.userActivity_=true;};/**
   * Get/set if user is active
   *
   * @fires Player#useractive
   * @fires Player#userinactive
   *
   * @param {boolean} [bool]
   *        - true if the user is active
   *        - false if the user is inactive
   *
   * @return {boolean}
   *         The current value of userActive when getting
   */Player.prototype.userActive=function userActive(bool){if(bool===undefined){return this.userActive_;}bool=!!bool;if(bool===this.userActive_){return;}this.userActive_=bool;if(this.userActive_){this.userActivity_=true;this.removeClass('vjs-user-inactive');this.addClass('vjs-user-active');/**
       * @event Player#useractive
       * @type {EventTarget~Event}
       */this.trigger('useractive');return;}// Chrome/Safari/IE have bugs where when you change the cursor it can
// trigger a mousemove event. This causes an issue when you're hiding
// the cursor when the user is inactive, and a mousemove signals user
// activity. Making it impossible to go into inactive mode. Specifically
// this happens in fullscreen when we really need to hide the cursor.
//
// When this gets resolved in ALL browsers it can be removed
// https://code.google.com/p/chromium/issues/detail?id=103041
if(this.tech_){this.tech_.one('mousemove',function(e){e.stopPropagation();e.preventDefault();});}this.userActivity_=false;this.removeClass('vjs-user-active');this.addClass('vjs-user-inactive');/**
     * @event Player#userinactive
     * @type {EventTarget~Event}
     */this.trigger('userinactive');};/**
   * Listen for user activity based on timeout value
   *
   * @private
   */Player.prototype.listenForUserActivity_=function listenForUserActivity_(){var mouseInProgress=void 0;var lastMoveX=void 0;var lastMoveY=void 0;var handleActivity=bind(this,this.reportUserActivity);var handleMouseMove=function handleMouseMove(e){// #1068 - Prevent mousemove spamming
// Chrome Bug: https://code.google.com/p/chromium/issues/detail?id=366970
if(e.screenX!==lastMoveX||e.screenY!==lastMoveY){lastMoveX=e.screenX;lastMoveY=e.screenY;handleActivity();}};var handleMouseDown=function handleMouseDown(){handleActivity();// For as long as the they are touching the device or have their mouse down,
// we consider them active even if they're not moving their finger or mouse.
// So we want to continue to update that they are active
this.clearInterval(mouseInProgress);// Setting userActivity=true now and setting the interval to the same time
// as the activityCheck interval (250) should ensure we never miss the
// next activityCheck
mouseInProgress=this.setInterval(handleActivity,250);};var handleMouseUp=function handleMouseUp(event){handleActivity();// Stop the interval that maintains activity if the mouse/touch is down
this.clearInterval(mouseInProgress);};// Any mouse movement will be considered user activity
this.on('mousedown',handleMouseDown);this.on('mousemove',handleMouseMove);this.on('mouseup',handleMouseUp);// Listen for keyboard navigation
// Shouldn't need to use inProgress interval because of key repeat
this.on('keydown',handleActivity);this.on('keyup',handleActivity);// Run an interval every 250 milliseconds instead of stuffing everything into
// the mousemove/touchmove function itself, to prevent performance degradation.
// `this.reportUserActivity` simply sets this.userActivity_ to true, which
// then gets picked up by this loop
// http://ejohn.org/blog/learning-from-twitter/
var inactivityTimeout=void 0;this.setInterval(function(){// Check to see if mouse/touch activity has happened
if(!this.userActivity_){return;}// Reset the activity tracker
this.userActivity_=false;// If the user state was inactive, set the state to active
this.userActive(true);// Clear any existing inactivity timeout to start the timer over
this.clearTimeout(inactivityTimeout);var timeout=this.options_.inactivityTimeout;if(timeout<=0){return;}// In <timeout> milliseconds, if no more activity has occurred the
// user will be considered inactive
inactivityTimeout=this.setTimeout(function(){// Protect against the case where the inactivityTimeout can trigger just
// before the next user activity is picked up by the activity check loop
// causing a flicker
if(!this.userActivity_){this.userActive(false);}},timeout);},250);};/**
   * Gets or sets the current playback rate. A playback rate of
   * 1.0 represents normal speed and 0.5 would indicate half-speed
   * playback, for instance.
   *
   * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-playbackrate
   *
   * @param {number} [rate]
   *       New playback rate to set.
   *
   * @return {number}
   *         The current playback rate when getting or 1.0
   */Player.prototype.playbackRate=function playbackRate(rate){if(rate!==undefined){// NOTE: this.cache_.lastPlaybackRate is set from the tech handler
// that is registered above
this.techCall_('setPlaybackRate',rate);return;}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.cache_.lastPlaybackRate||this.techGet_('playbackRate');}return 1.0;};/**
   * Gets or sets the current default playback rate. A default playback rate of
   * 1.0 represents normal speed and 0.5 would indicate half-speed playback, for instance.
   * defaultPlaybackRate will only represent what the intial playbackRate of a video was, not
   * not the current playbackRate.
   *
   * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-defaultplaybackrate
   *
   * @param {number} [rate]
   *       New default playback rate to set.
   *
   * @return {number|Player}
   *         - The default playback rate when getting or 1.0
   *         - the player when setting
   */Player.prototype.defaultPlaybackRate=function defaultPlaybackRate(rate){if(rate!==undefined){return this.techCall_('setDefaultPlaybackRate',rate);}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.techGet_('defaultPlaybackRate');}return 1.0;};/**
   * Gets or sets the audio flag
   *
   * @param {boolean} bool
   *        - true signals that this is an audio player
   *        - false signals that this is not an audio player
   *
   * @return {boolean}
   *         The current value of isAudio when getting
   */Player.prototype.isAudio=function isAudio(bool){if(bool!==undefined){this.isAudio_=!!bool;return;}return !!this.isAudio_;};/**
   * A helper method for adding a {@link TextTrack} to our
   * {@link TextTrackList}.
   *
   * In addition to the W3C settings we allow adding additional info through options.
   *
   * @see http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack
   *
   * @param {string} [kind]
   *        the kind of TextTrack you are adding
   *
   * @param {string} [label]
   *        the label to give the TextTrack label
   *
   * @param {string} [language]
   *        the language to set on the TextTrack
   *
   * @return {TextTrack|undefined}
   *         the TextTrack that was added or undefined
   *         if there is no tech
   */Player.prototype.addTextTrack=function addTextTrack(kind,label,language){if(this.tech_){return this.tech_.addTextTrack(kind,label,language);}};/**
   * Create a remote {@link TextTrack} and an {@link HTMLTrackElement}. It will
   * automatically removed from the video element whenever the source changes, unless
   * manualCleanup is set to false.
   *
   * @param {Object} options
   *        Options to pass to {@link HTMLTrackElement} during creation. See
   *        {@link HTMLTrackElement} for object properties that you should use.
   *
   * @param {boolean} [manualCleanup=true] if set to false, the TextTrack will be
   *
   * @return {HtmlTrackElement}
   *         the HTMLTrackElement that was created and added
   *         to the HtmlTrackElementList and the remote
   *         TextTrackList
   *
   * @deprecated The default value of the "manualCleanup" parameter will default
   *             to "false" in upcoming versions of Video.js
   */Player.prototype.addRemoteTextTrack=function addRemoteTextTrack(options,manualCleanup){if(this.tech_){return this.tech_.addRemoteTextTrack(options,manualCleanup);}};/**
   * Remove a remote {@link TextTrack} from the respective
   * {@link TextTrackList} and {@link HtmlTrackElementList}.
   *
   * @param {Object} track
   *        Remote {@link TextTrack} to remove
   *
   * @return {undefined}
   *         does not return anything
   */Player.prototype.removeRemoteTextTrack=function removeRemoteTextTrack(){var _ref3=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref3$track=_ref3.track,track=_ref3$track===undefined?arguments[0]:_ref3$track;// destructure the input into an object with a track argument, defaulting to arguments[0]
// default the whole argument to an empty object if nothing was passed in
if(this.tech_){return this.tech_.removeRemoteTextTrack(track);}};/**
   * Gets available media playback quality metrics as specified by the W3C's Media
   * Playback Quality API.
   *
   * @see [Spec]{@link https://wicg.github.io/media-playback-quality}
   *
   * @return {Object|undefined}
   *         An object with supported media playback quality metrics or undefined if there
   *         is no tech or the tech does not support it.
   */Player.prototype.getVideoPlaybackQuality=function getVideoPlaybackQuality(){return this.techGet_('getVideoPlaybackQuality');};/**
   * Get video width
   *
   * @return {number}
   *         current video width
   */Player.prototype.videoWidth=function videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0;};/**
   * Get video height
   *
   * @return {number}
   *         current video height
   */Player.prototype.videoHeight=function videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0;};/**
   * The player's language code
   * NOTE: The language should be set in the player options if you want the
   * the controls to be built with a specific language. Changing the lanugage
   * later will not update controls text.
   *
   * @param {string} [code]
   *        the language code to set the player to
   *
   * @return {string}
   *         The current language code when getting
   */Player.prototype.language=function language(code){if(code===undefined){return this.language_;}this.language_=String(code).toLowerCase();};/**
   * Get the player's language dictionary
   * Merge every time, because a newly added plugin might call videojs.addLanguage() at any time
   * Languages specified directly in the player options have precedence
   *
   * @return {Array}
   *         An array of of supported languages
   */Player.prototype.languages=function languages(){return mergeOptions(Player.prototype.options_.languages,this.languages_);};/**
   * returns a JavaScript object reperesenting the current track
   * information. **DOES not return it as JSON**
   *
   * @return {Object}
   *         Object representing the current of track info
   */Player.prototype.toJSON=function toJSON(){var options=mergeOptions(this.options_);var tracks=options.tracks;options.tracks=[];for(var i=0;i<tracks.length;i++){var track=tracks[i];// deep merge tracks and null out player so no circular references
track=mergeOptions(track);track.player=undefined;options.tracks[i]=track;}return options;};/**
   * Creates a simple modal dialog (an instance of the {@link ModalDialog}
   * component) that immediately overlays the player with arbitrary
   * content and removes itself when closed.
   *
   * @param {string|Function|Element|Array|null} content
   *        Same as {@link ModalDialog#content}'s param of the same name.
   *        The most straight-forward usage is to provide a string or DOM
   *        element.
   *
   * @param {Object} [options]
   *        Extra options which will be passed on to the {@link ModalDialog}.
   *
   * @return {ModalDialog}
   *         the {@link ModalDialog} that was created
   */Player.prototype.createModal=function createModal(content,options){var _this12=this;options=options||{};options.content=content||'';var modal=new ModalDialog(this,options);this.addChild(modal);modal.on('dispose',function(){_this12.removeChild(modal);});modal.open();return modal;};/**
   * Change breakpoint classes when the player resizes.
   *
   * @private
   */Player.prototype.updateCurrentBreakpoint_=function updateCurrentBreakpoint_(){if(!this.responsive()){return;}var currentBreakpoint=this.currentBreakpoint();var currentWidth=this.currentWidth();for(var i=0;i<BREAKPOINT_ORDER.length;i++){var candidateBreakpoint=BREAKPOINT_ORDER[i];var maxWidth=this.breakpoints_[candidateBreakpoint];if(currentWidth<=maxWidth){// The current breakpoint did not change, nothing to do.
if(currentBreakpoint===candidateBreakpoint){return;}// Only remove a class if there is a current breakpoint.
if(currentBreakpoint){this.removeClass(BREAKPOINT_CLASSES[currentBreakpoint]);}this.addClass(BREAKPOINT_CLASSES[candidateBreakpoint]);this.breakpoint_=candidateBreakpoint;break;}}};/**
   * Removes the current breakpoint.
   *
   * @private
   */Player.prototype.removeCurrentBreakpoint_=function removeCurrentBreakpoint_(){var className=this.currentBreakpointClass();this.breakpoint_='';if(className){this.removeClass(className);}};/**
   * Get or set breakpoints on the player.
   *
   * Calling this method with an object or `true` will remove any previous
   * custom breakpoints and start from the defaults again.
   *
   * @param  {Object|boolean} [breakpoints]
   *         If an object is given, it can be used to provide custom
   *         breakpoints. If `true` is given, will set default breakpoints.
   *         If this argument is not given, will simply return the current
   *         breakpoints.
   *
   * @param  {number} [breakpoints.tiny]
   *         The maximum width for the "vjs-layout-tiny" class.
   *
   * @param  {number} [breakpoints.xsmall]
   *         The maximum width for the "vjs-layout-x-small" class.
   *
   * @param  {number} [breakpoints.small]
   *         The maximum width for the "vjs-layout-small" class.
   *
   * @param  {number} [breakpoints.medium]
   *         The maximum width for the "vjs-layout-medium" class.
   *
   * @param  {number} [breakpoints.large]
   *         The maximum width for the "vjs-layout-large" class.
   *
   * @param  {number} [breakpoints.xlarge]
   *         The maximum width for the "vjs-layout-x-large" class.
   *
   * @param  {number} [breakpoints.huge]
   *         The maximum width for the "vjs-layout-huge" class.
   *
   * @return {Object}
   *         An object mapping breakpoint names to maximum width values.
   */Player.prototype.breakpoints=function breakpoints(_breakpoints){// Used as a getter.
if(_breakpoints===undefined){return assign(this.breakpoints_);}this.breakpoint_='';this.breakpoints_=assign({},DEFAULT_BREAKPOINTS,_breakpoints);// When breakpoint definitions change, we need to update the currently
// selected breakpoint.
this.updateCurrentBreakpoint_();// Clone the breakpoints before returning.
return assign(this.breakpoints_);};/**
   * Get or set a flag indicating whether or not this player should adjust
   * its UI based on its dimensions.
   *
   * @param  {boolean} value
   *         Should be `true` if the player should adjust its UI based on its
   *         dimensions; otherwise, should be `false`.
   *
   * @return {boolean}
   *         Will be `true` if this player should adjust its UI based on its
   *         dimensions; otherwise, will be `false`.
   */Player.prototype.responsive=function responsive(value){// Used as a getter.
if(value===undefined){return this.responsive_;}value=Boolean(value);var current=this.responsive_;// Nothing changed.
if(value===current){return;}// The value actually changed, set it.
this.responsive_=value;// Start listening for breakpoints and set the initial breakpoint if the
// player is now responsive.
if(value){this.on('playerresize',this.updateCurrentBreakpoint_);this.updateCurrentBreakpoint_();// Stop listening for breakpoints if the player is no longer responsive.
}else {this.off('playerresize',this.updateCurrentBreakpoint_);this.removeCurrentBreakpoint_();}return value;};/**
   * Get current breakpoint name, if any.
   *
   * @return {string}
   *         If there is currently a breakpoint set, returns a the key from the
   *         breakpoints object matching it. Otherwise, returns an empty string.
   */Player.prototype.currentBreakpoint=function currentBreakpoint(){return this.breakpoint_;};/**
   * Get the current breakpoint class name.
   *
   * @return {string}
   *         The matching class name (e.g. `"vjs-layout-tiny"` or
   *         `"vjs-layout-large"`) for the current breakpoint. Empty string if
   *         there is no current breakpoint.
   */Player.prototype.currentBreakpointClass=function currentBreakpointClass(){return BREAKPOINT_CLASSES[this.breakpoint_]||'';};/**
   * Gets tag settings
   *
   * @param {Element} tag
   *        The player tag
   *
   * @return {Object}
   *         An object containing all of the settings
   *         for a player tag
   */Player.getTagSettings=function getTagSettings(tag){var baseOptions={sources:[],tracks:[]};var tagOptions=getAttributes(tag);var dataSetup=tagOptions['data-setup'];if(hasClass$1(tag,'vjs-fill')){tagOptions.fill=true;}if(hasClass$1(tag,'vjs-fluid')){tagOptions.fluid=true;}// Check if data-setup attr exists.
if(dataSetup!==null){// Parse options JSON
// If empty string, make it a parsable json object.
var _safeParseTuple=safeParseTuple(dataSetup||'{}'),err=_safeParseTuple[0],data=_safeParseTuple[1];if(err){log.error(err);}assign(tagOptions,data);}assign(baseOptions,tagOptions);// Get tag children settings
if(tag.hasChildNodes()){var children=tag.childNodes;for(var i=0,j=children.length;i<j;i++){var child=children[i];// Change case needed: http://ejohn.org/blog/nodename-case-sensitivity/
var childName=child.nodeName.toLowerCase();if(childName==='source'){baseOptions.sources.push(getAttributes(child));}else if(childName==='track'){baseOptions.tracks.push(getAttributes(child));}}}return baseOptions;};/**
   * Determine wether or not flexbox is supported
   *
   * @return {boolean}
   *         - true if flexbox is supported
   *         - false if flexbox is not supported
   */Player.prototype.flexNotSupported_=function flexNotSupported_(){var elem=document$1.createElement('i');// Note: We don't actually use flexBasis (or flexOrder), but it's one of the more
// common flex features that we can rely on when checking for flex support.
return !('flexBasis'in elem.style||'webkitFlexBasis'in elem.style||'mozFlexBasis'in elem.style||'msFlexBasis'in elem.style||// IE10-specific (2012 flex spec)
'msFlexOrder'in elem.style);};return Player;}(Component);/**
 * Get the {@link VideoTrackList}
 * @link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist
 *
 * @return {VideoTrackList}
 *         the current video track list
 *
 * @method Player.prototype.videoTracks
 */ /**
 * Get the {@link AudioTrackList}
 * @link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist
 *
 * @return {AudioTrackList}
 *         the current audio track list
 *
 * @method Player.prototype.audioTracks
 */ /**
 * Get the {@link TextTrackList}
 *
 * @link http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks
 *
 * @return {TextTrackList}
 *         the current text track list
 *
 * @method Player.prototype.textTracks
 */ /**
 * Get the remote {@link TextTrackList}
 *
 * @return {TextTrackList}
 *         The current remote text track list
 *
 * @method Player.prototype.remoteTextTracks
 */ /**
 * Get the remote {@link HtmlTrackElementList} tracks.
 *
 * @return {HtmlTrackElementList}
 *         The current remote text track element list
 *
 * @method Player.prototype.remoteTextTrackEls
 */ALL.names.forEach(function(name$$1){var props=ALL[name$$1];Player.prototype[props.getterName]=function(){if(this.tech_){return this.tech_[props.getterName]();}// if we have not yet loadTech_, we create {video,audio,text}Tracks_
// these will be passed to the tech during loading
this[props.privateName]=this[props.privateName]||new props.ListClass();return this[props.privateName];};});/**
 * Global player list
 *
 * @type {Object}
 */Player.players={};var navigator$1=window$1.navigator;/*
 * Player instance options, surfaced using options
 * options = Player.prototype.options_
 * Make changes in options, not here.
 *
 * @type {Object}
 * @private
 */Player.prototype.options_={// Default order of fallback technology
techOrder:Tech.defaultTechOrder_,html5:{},flash:{},// default inactivity timeout
inactivityTimeout:2000,// default playback rates
playbackRates:[],// Add playback rate selection by adding rates
// 'playbackRates': [0.5, 1, 1.5, 2],
// Included control sets
children:['mediaLoader','posterImage','textTrackDisplay','loadingSpinner','bigPlayButton','controlBar','errorDisplay','textTrackSettings'],language:navigator$1&&(navigator$1.languages&&navigator$1.languages[0]||navigator$1.userLanguage||navigator$1.language)||'en',// locales and their language translations
languages:{},// Default message to show when a video cannot be played.
notSupportedMessage:'No compatible source was found for this media.',breakpoints:{},responsive:false};if(!IS_IE8){Player.prototype.options_.children.push('resizeManager');}[/**
 * Returns whether or not the player is in the "ended" state.
 *
 * @return {Boolean} True if the player is in the ended state, false if not.
 * @method Player#ended
 */'ended',/**
 * Returns whether or not the player is in the "seeking" state.
 *
 * @return {Boolean} True if the player is in the seeking state, false if not.
 * @method Player#seeking
 */'seeking',/**
 * Returns the TimeRanges of the media that are currently available
 * for seeking to.
 *
 * @return {TimeRanges} the seekable intervals of the media timeline
 * @method Player#seekable
 */'seekable',/**
 * Returns the current state of network activity for the element, from
 * the codes in the list below.
 * - NETWORK_EMPTY (numeric value 0)
 *   The element has not yet been initialised. All attributes are in
 *   their initial states.
 * - NETWORK_IDLE (numeric value 1)
 *   The element's resource selection algorithm is active and has
 *   selected a resource, but it is not actually using the network at
 *   this time.
 * - NETWORK_LOADING (numeric value 2)
 *   The user agent is actively trying to download data.
 * - NETWORK_NO_SOURCE (numeric value 3)
 *   The element's resource selection algorithm is active, but it has
 *   not yet found a resource to use.
 *
 * @see https://html.spec.whatwg.org/multipage/embedded-content.html#network-states
 * @return {number} the current network activity state
 * @method Player#networkState
 */'networkState',/**
 * Returns a value that expresses the current state of the element
 * with respect to rendering the current playback position, from the
 * codes in the list below.
 * - HAVE_NOTHING (numeric value 0)
 *   No information regarding the media resource is available.
 * - HAVE_METADATA (numeric value 1)
 *   Enough of the resource has been obtained that the duration of the
 *   resource is available.
 * - HAVE_CURRENT_DATA (numeric value 2)
 *   Data for the immediate current playback position is available.
 * - HAVE_FUTURE_DATA (numeric value 3)
 *   Data for the immediate current playback position is available, as
 *   well as enough data for the user agent to advance the current
 *   playback position in the direction of playback.
 * - HAVE_ENOUGH_DATA (numeric value 4)
 *   The user agent estimates that enough data is available for
 *   playback to proceed uninterrupted.
 *
 * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-readystate
 * @return {number} the current playback rendering state
 * @method Player#readyState
 */'readyState'].forEach(function(fn){Player.prototype[fn]=function(){return this.techGet_(fn);};});TECH_EVENTS_RETRIGGER.forEach(function(event){Player.prototype['handleTech'+toTitleCase(event)+'_']=function(){return this.trigger(event);};});/**
 * Fired when the player has initial duration and dimension information
 *
 * @event Player#loadedmetadata
 * @type {EventTarget~Event}
 */ /**
 * Fired when the player has downloaded data at the current playback position
 *
 * @event Player#loadeddata
 * @type {EventTarget~Event}
 */ /**
 * Fired when the current playback position has changed *
 * During playback this is fired every 15-250 milliseconds, depending on the
 * playback technology in use.
 *
 * @event Player#timeupdate
 * @type {EventTarget~Event}
 */ /**
 * Fired when the volume changes
 *
 * @event Player#volumechange
 * @type {EventTarget~Event}
 */ /**
 * Reports whether or not a player has a plugin available.
 *
 * This does not report whether or not the plugin has ever been initialized
 * on this player. For that, [usingPlugin]{@link Player#usingPlugin}.
 *
 * @method Player#hasPlugin
 * @param  {string}  name
 *         The name of a plugin.
 *
 * @return {boolean}
 *         Whether or not this player has the requested plugin available.
 */ /**
 * Reports whether or not a player is using a plugin by name.
 *
 * For basic plugins, this only reports whether the plugin has _ever_ been
 * initialized on this player.
 *
 * @method Player#usingPlugin
 * @param  {string} name
 *         The name of a plugin.
 *
 * @return {boolean}
 *         Whether or not this player is using the requested plugin.
 */Component.registerComponent('Player',Player);/**
 * @file plugin.js
 */ /**
 * The base plugin name.
 *
 * @private
 * @constant
 * @type {string}
 */var BASE_PLUGIN_NAME='plugin';/**
 * The key on which a player's active plugins cache is stored.
 *
 * @private
 * @constant
 * @type     {string}
 */var PLUGIN_CACHE_KEY='activePlugins_';/**
 * Stores registered plugins in a private space.
 *
 * @private
 * @type    {Object}
 */var pluginStorage={};/**
 * Reports whether or not a plugin has been registered.
 *
 * @private
 * @param   {string} name
 *          The name of a plugin.
 *
 * @returns {boolean}
 *          Whether or not the plugin has been registered.
 */var pluginExists=function pluginExists(name){return pluginStorage.hasOwnProperty(name);};/**
 * Get a single registered plugin by name.
 *
 * @private
 * @param   {string} name
 *          The name of a plugin.
 *
 * @returns {Function|undefined}
 *          The plugin (or undefined).
 */var getPlugin=function getPlugin(name){return pluginExists(name)?pluginStorage[name]:undefined;};/**
 * Marks a plugin as "active" on a player.
 *
 * Also, ensures that the player has an object for tracking active plugins.
 *
 * @private
 * @param   {Player} player
 *          A Video.js player instance.
 *
 * @param   {string} name
 *          The name of a plugin.
 */var markPluginAsActive=function markPluginAsActive(player,name){player[PLUGIN_CACHE_KEY]=player[PLUGIN_CACHE_KEY]||{};player[PLUGIN_CACHE_KEY][name]=true;};/**
 * Triggers a pair of plugin setup events.
 *
 * @private
 * @param  {Player} player
 *         A Video.js player instance.
 *
 * @param  {Plugin~PluginEventHash} hash
 *         A plugin event hash.
 *
 * @param  {Boolean} [before]
 *         If true, prefixes the event name with "before". In other words,
 *         use this to trigger "beforepluginsetup" instead of "pluginsetup".
 */var triggerSetupEvent=function triggerSetupEvent(player,hash,before){var eventName=(before?'before':'')+'pluginsetup';player.trigger(eventName,hash);player.trigger(eventName+':'+hash.name,hash);};/**
 * Takes a basic plugin function and returns a wrapper function which marks
 * on the player that the plugin has been activated.
 *
 * @private
 * @param   {string} name
 *          The name of the plugin.
 *
 * @param   {Function} plugin
 *          The basic plugin.
 *
 * @returns {Function}
 *          A wrapper function for the given plugin.
 */var createBasicPlugin=function createBasicPlugin(name,plugin){var basicPluginWrapper=function basicPluginWrapper(){// We trigger the "beforepluginsetup" and "pluginsetup" events on the player
// regardless, but we want the hash to be consistent with the hash provided
// for advanced plugins.
//
// The only potentially counter-intuitive thing here is the `instance` in
// the "pluginsetup" event is the value returned by the `plugin` function.
triggerSetupEvent(this,{name:name,plugin:plugin,instance:null},true);var instance=plugin.apply(this,arguments);markPluginAsActive(this,name);triggerSetupEvent(this,{name:name,plugin:plugin,instance:instance});return instance;};Object.keys(plugin).forEach(function(prop){basicPluginWrapper[prop]=plugin[prop];});return basicPluginWrapper;};/**
 * Takes a plugin sub-class and returns a factory function for generating
 * instances of it.
 *
 * This factory function will replace itself with an instance of the requested
 * sub-class of Plugin.
 *
 * @private
 * @param   {string} name
 *          The name of the plugin.
 *
 * @param   {Plugin} PluginSubClass
 *          The advanced plugin.
 *
 * @returns {Function}
 */var createPluginFactory=function createPluginFactory(name,PluginSubClass){// Add a `name` property to the plugin prototype so that each plugin can
// refer to itself by name.
PluginSubClass.prototype.name=name;return function(){triggerSetupEvent(this,{name:name,plugin:PluginSubClass,instance:null},true);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}var instance=new(Function.prototype.bind.apply(PluginSubClass,[null].concat([this].concat(args))))();// The plugin is replaced by a function that returns the current instance.
this[name]=function(){return instance;};triggerSetupEvent(this,instance.getEventHash());return instance;};};/**
 * Parent class for all advanced plugins.
 *
 * @mixes   module:evented~EventedMixin
 * @mixes   module:stateful~StatefulMixin
 * @fires   Player#beforepluginsetup
 * @fires   Player#beforepluginsetup:$name
 * @fires   Player#pluginsetup
 * @fires   Player#pluginsetup:$name
 * @listens Player#dispose
 * @throws  {Error}
 *          If attempting to instantiate the base {@link Plugin} class
 *          directly instead of via a sub-class.
 */var Plugin=function(){/**
   * Creates an instance of this class.
   *
   * Sub-classes should call `super` to ensure plugins are properly initialized.
   *
   * @param {Player} player
   *        A Video.js player instance.
   */function Plugin(player){classCallCheck(this,Plugin);if(this.constructor===Plugin){throw new Error('Plugin must be sub-classed; not directly instantiated.');}this.player=player;// Make this object evented, but remove the added `trigger` method so we
// use the prototype version instead.
evented(this);delete this.trigger;stateful(this,this.constructor.defaultState);markPluginAsActive(player,this.name);// Auto-bind the dispose method so we can use it as a listener and unbind
// it later easily.
this.dispose=bind(this,this.dispose);// If the player is disposed, dispose the plugin.
player.on('dispose',this.dispose);}/**
   * Get the version of the plugin that was set on <pluginName>.VERSION
   */Plugin.prototype.version=function version(){return this.constructor.VERSION;};/**
   * Each event triggered by plugins includes a hash of additional data with
   * conventional properties.
   *
   * This returns that object or mutates an existing hash.
   *
   * @param   {Object} [hash={}]
   *          An object to be used as event an event hash.
   *
   * @returns {Plugin~PluginEventHash}
   *          An event hash object with provided properties mixed-in.
   */Plugin.prototype.getEventHash=function getEventHash(){var hash=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};hash.name=this.name;hash.plugin=this.constructor;hash.instance=this;return hash;};/**
   * Triggers an event on the plugin object and overrides
   * {@link module:evented~EventedMixin.trigger|EventedMixin.trigger}.
   *
   * @param   {string|Object} event
   *          An event type or an object with a type property.
   *
   * @param   {Object} [hash={}]
   *          Additional data hash to merge with a
   *          {@link Plugin~PluginEventHash|PluginEventHash}.
   *
   * @returns {boolean}
   *          Whether or not default was prevented.
   */Plugin.prototype.trigger=function trigger$$1(event){var hash=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return trigger(this.eventBusEl_,event,this.getEventHash(hash));};/**
   * Handles "statechanged" events on the plugin. No-op by default, override by
   * subclassing.
   *
   * @abstract
   * @param    {Event} e
   *           An event object provided by a "statechanged" event.
   *
   * @param    {Object} e.changes
   *           An object describing changes that occurred with the "statechanged"
   *           event.
   */Plugin.prototype.handleStateChanged=function handleStateChanged(e){};/**
   * Disposes a plugin.
   *
   * Subclasses can override this if they want, but for the sake of safety,
   * it's probably best to subscribe the "dispose" event.
   *
   * @fires Plugin#dispose
   */Plugin.prototype.dispose=function dispose(){var name=this.name,player=this.player;/**
     * Signals that a advanced plugin is about to be disposed.
     *
     * @event Plugin#dispose
     * @type  {EventTarget~Event}
     */this.trigger('dispose');this.off();player.off('dispose',this.dispose);// Eliminate any possible sources of leaking memory by clearing up
// references between the player and the plugin instance and nulling out
// the plugin's state and replacing methods with a function that throws.
player[PLUGIN_CACHE_KEY][name]=false;this.player=this.state=null;// Finally, replace the plugin name on the player with a new factory
// function, so that the plugin is ready to be set up again.
player[name]=createPluginFactory(name,pluginStorage[name]);};/**
   * Determines if a plugin is a basic plugin (i.e. not a sub-class of `Plugin`).
   *
   * @param   {string|Function} plugin
   *          If a string, matches the name of a plugin. If a function, will be
   *          tested directly.
   *
   * @returns {boolean}
   *          Whether or not a plugin is a basic plugin.
   */Plugin.isBasic=function isBasic(plugin){var p=typeof plugin==='string'?getPlugin(plugin):plugin;return typeof p==='function'&&!Plugin.prototype.isPrototypeOf(p.prototype);};/**
   * Register a Video.js plugin.
   *
   * @param   {string} name
   *          The name of the plugin to be registered. Must be a string and
   *          must not match an existing plugin or a method on the `Player`
   *          prototype.
   *
   * @param   {Function} plugin
   *          A sub-class of `Plugin` or a function for basic plugins.
   *
   * @returns {Function}
   *          For advanced plugins, a factory function for that plugin. For
   *          basic plugins, a wrapper function that initializes the plugin.
   */Plugin.registerPlugin=function registerPlugin(name,plugin){if(typeof name!=='string'){throw new Error('Illegal plugin name, "'+name+'", must be a string, was '+(typeof name==='undefined'?'undefined':_typeof$2(name))+'.');}if(pluginExists(name)){log.warn('A plugin named "'+name+'" already exists. You may want to avoid re-registering plugins!');}else if(Player.prototype.hasOwnProperty(name)){throw new Error('Illegal plugin name, "'+name+'", cannot share a name with an existing player method!');}if(typeof plugin!=='function'){throw new Error('Illegal plugin for "'+name+'", must be a function, was '+(typeof plugin==='undefined'?'undefined':_typeof$2(plugin))+'.');}pluginStorage[name]=plugin;// Add a player prototype method for all sub-classed plugins (but not for
// the base Plugin class).
if(name!==BASE_PLUGIN_NAME){if(Plugin.isBasic(plugin)){Player.prototype[name]=createBasicPlugin(name,plugin);}else {Player.prototype[name]=createPluginFactory(name,plugin);}}return plugin;};/**
   * De-register a Video.js plugin.
   *
   * @param {string} name
   *        The name of the plugin to be deregistered.
   */Plugin.deregisterPlugin=function deregisterPlugin(name){if(name===BASE_PLUGIN_NAME){throw new Error('Cannot de-register base plugin.');}if(pluginExists(name)){delete pluginStorage[name];delete Player.prototype[name];}};/**
   * Gets an object containing multiple Video.js plugins.
   *
   * @param   {Array} [names]
   *          If provided, should be an array of plugin names. Defaults to _all_
   *          plugin names.
   *
   * @returns {Object|undefined}
   *          An object containing plugin(s) associated with their name(s) or
   *          `undefined` if no matching plugins exist).
   */Plugin.getPlugins=function getPlugins(){var names=arguments.length>0&&arguments[0]!==undefined?arguments[0]:Object.keys(pluginStorage);var result=void 0;names.forEach(function(name){var plugin=getPlugin(name);if(plugin){result=result||{};result[name]=plugin;}});return result;};/**
   * Gets a plugin's version, if available
   *
   * @param   {string} name
   *          The name of a plugin.
   *
   * @returns {string}
   *          The plugin's version or an empty string.
   */Plugin.getPluginVersion=function getPluginVersion(name){var plugin=getPlugin(name);return plugin&&plugin.VERSION||'';};return Plugin;}();/**
 * Gets a plugin by name if it exists.
 *
 * @static
 * @method   getPlugin
 * @memberOf Plugin
 * @param    {string} name
 *           The name of a plugin.
 *
 * @returns  {Function|undefined}
 *           The plugin (or `undefined`).
 */Plugin.getPlugin=getPlugin;/**
 * The name of the base plugin class as it is registered.
 *
 * @type {string}
 */Plugin.BASE_PLUGIN_NAME=BASE_PLUGIN_NAME;Plugin.registerPlugin(BASE_PLUGIN_NAME,Plugin);/**
 * Documented in player.js
 *
 * @ignore
 */Player.prototype.usingPlugin=function(name){return !!this[PLUGIN_CACHE_KEY]&&this[PLUGIN_CACHE_KEY][name]===true;};/**
 * Documented in player.js
 *
 * @ignore
 */Player.prototype.hasPlugin=function(name){return !!pluginExists(name);};/**
 * Signals that a plugin is about to be set up on a player.
 *
 * @event    Player#beforepluginsetup
 * @type     {Plugin~PluginEventHash}
 */ /**
 * Signals that a plugin is about to be set up on a player - by name. The name
 * is the name of the plugin.
 *
 * @event    Player#beforepluginsetup:$name
 * @type     {Plugin~PluginEventHash}
 */ /**
 * Signals that a plugin has just been set up on a player.
 *
 * @event    Player#pluginsetup
 * @type     {Plugin~PluginEventHash}
 */ /**
 * Signals that a plugin has just been set up on a player - by name. The name
 * is the name of the plugin.
 *
 * @event    Player#pluginsetup:$name
 * @type     {Plugin~PluginEventHash}
 */ /**
 * @typedef  {Object} Plugin~PluginEventHash
 *
 * @property {string} instance
 *           For basic plugins, the return value of the plugin function. For
 *           advanced plugins, the plugin instance on which the event is fired.
 *
 * @property {string} name
 *           The name of the plugin.
 *
 * @property {string} plugin
 *           For basic plugins, the plugin function. For advanced plugins, the
 *           plugin class/constructor.
 */ /**
 * @file extend.js
 * @module extend
 */ /**
 * A combination of node inherits and babel's inherits (after transpile).
 * Both work the same but node adds `super_` to the subClass
 * and Bable adds the superClass as __proto__. Both seem useful.
 *
 * @param {Object} subClass
 *        The class to inherit to
 *
 * @param {Object} superClass
 *        The class to inherit from
 *
 * @private
 */var _inherits=function _inherits(subClass,superClass){if(typeof superClass!=='function'&&superClass!==null){throw new TypeError('Super expression must either be null or a function, not '+(typeof superClass==='undefined'?'undefined':_typeof$2(superClass)));}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass){// node
subClass.super_=superClass;}};/**
 * Function for subclassing using the same inheritance that
 * videojs uses internally
 *
 * @static
 * @const
 *
 * @param {Object} superClass
 *        The class to inherit from
 *
 * @param {Object} [subClassMethods={}]
 *        The class to inherit to
 *
 * @return {Object}
 *         The new object with subClassMethods that inherited superClass.
 */var extendFn=function extendFn(superClass){var subClassMethods=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var subClass=function subClass(){superClass.apply(this,arguments);};var methods={};if((typeof subClassMethods==='undefined'?'undefined':_typeof$2(subClassMethods))==='object'){if(subClassMethods.constructor!==Object.prototype.constructor){subClass=subClassMethods.constructor;}methods=subClassMethods;}else if(typeof subClassMethods==='function'){subClass=subClassMethods;}_inherits(subClass,superClass);// Extend subObj's prototype with functions and other properties from props
for(var name in methods){if(methods.hasOwnProperty(name)){subClass.prototype[name]=methods[name];}}return subClass;};/**
 * @file video.js
 * @module videojs
 */ // Include the built-in techs
// HTML5 Element Shim for IE8
if(typeof HTMLVideoElement==='undefined'&&isReal()){document$1.createElement('video');document$1.createElement('audio');document$1.createElement('track');document$1.createElement('video-js');}/**
 * Normalize an `id` value by trimming off a leading `#`
 *
 * @param   {string} id
 *          A string, maybe with a leading `#`.
 *
 * @returns {string}
 *          The string, without any leading `#`.
 */var normalizeId=function normalizeId(id){return id.indexOf('#')===0?id.slice(1):id;};/**
 * Doubles as the main function for users to create a player instance and also
 * the main library object.
 * The `videojs` function can be used to initialize or retrieve a player.
  *
 * @param {string|Element} id
 *        Video element or video element ID
 *
 * @param {Object} [options]
 *        Optional options object for config/settings
 *
 * @param {Component~ReadyCallback} [ready]
 *        Optional ready callback
 *
 * @return {Player}
 *         A player instance
 */function videojs(id,options,ready){var player=videojs.getPlayer(id);if(player){if(options){log.warn('Player "'+id+'" is already initialised. Options will not be applied.');}if(ready){player.ready(ready);}return player;}var el=typeof id==='string'?$$1('#'+normalizeId(id)):id;if(!isEl(el)){throw new TypeError('The element or ID supplied is not valid. (videojs)');}if(!document$1.body.contains(el)){log.warn('The element supplied is not included in the DOM');}options=options||{};videojs.hooks('beforesetup').forEach(function(hookFunction){var opts=hookFunction(el,mergeOptions(options));if(!isObject(opts)||Array.isArray(opts)){log.error('please return an object in beforesetup hooks');return;}options=mergeOptions(options,opts);});// We get the current "Player" component here in case an integration has
// replaced it with a custom player.
var PlayerComponent=Component.getComponent('Player');player=new PlayerComponent(el,options,ready);videojs.hooks('setup').forEach(function(hookFunction){return hookFunction(player);});return player;}/**
 * An Object that contains lifecycle hooks as keys which point to an array
 * of functions that are run when a lifecycle is triggered
 */videojs.hooks_={};/**
 * Get a list of hooks for a specific lifecycle
 * @function videojs.hooks
 *
 * @param {string} type
 *        the lifecyle to get hooks from
 *
 * @param {Function|Function[]} [fn]
 *        Optionally add a hook (or hooks) to the lifecycle that your are getting.
 *
 * @return {Array}
 *         an array of hooks, or an empty array if there are none.
 */videojs.hooks=function(type,fn){videojs.hooks_[type]=videojs.hooks_[type]||[];if(fn){videojs.hooks_[type]=videojs.hooks_[type].concat(fn);}return videojs.hooks_[type];};/**
 * Add a function hook to a specific videojs lifecycle.
 *
 * @param {string} type
 *        the lifecycle to hook the function to.
 *
 * @param {Function|Function[]}
 *        The function or array of functions to attach.
 */videojs.hook=function(type,fn){videojs.hooks(type,fn);};/**
 * Add a function hook that will only run once to a specific videojs lifecycle.
 *
 * @param {string} type
 *        the lifecycle to hook the function to.
 *
 * @param {Function|Function[]}
 *        The function or array of functions to attach.
 */videojs.hookOnce=function(type,fn){videojs.hooks(type,[].concat(fn).map(function(original){var wrapper=function wrapper(){videojs.removeHook(type,wrapper);return original.apply(undefined,arguments);};return wrapper;}));};/**
 * Remove a hook from a specific videojs lifecycle.
 *
 * @param {string} type
 *        the lifecycle that the function hooked to
 *
 * @param {Function} fn
 *        The hooked function to remove
 *
 * @return {boolean}
 *         The function that was removed or undef
 */videojs.removeHook=function(type,fn){var index=videojs.hooks(type).indexOf(fn);if(index<=-1){return false;}videojs.hooks_[type]=videojs.hooks_[type].slice();videojs.hooks_[type].splice(index,1);return true;};// Add default styles
if(window$1.VIDEOJS_NO_DYNAMIC_STYLE!==true&&isReal()){var style$1=$$1('.vjs-styles-defaults');if(!style$1){style$1=createStyleElement('vjs-styles-defaults');var head=$$1('head');if(head){head.insertBefore(style$1,head.firstChild);}setTextContent(style$1,'\n      .video-js {\n        width: 300px;\n        height: 150px;\n      }\n\n      .vjs-fluid {\n        padding-top: 56.25%\n      }\n    ');}}// Run Auto-load players
// You have to wait at least once in case this script is loaded after your
// video in the DOM (weird behavior only with minified version)
autoSetupTimeout(1,videojs);/**
 * Current software version. Follows semver.
 *
 * @type {string}
 */videojs.VERSION=version;/**
 * The global options object. These are the settings that take effect
 * if no overrides are specified when the player is created.
 *
 * @type {Object}
 */videojs.options=Player.prototype.options_;/**
 * Get an object with the currently created players, keyed by player ID
 *
 * @return {Object}
 *         The created players
 */videojs.getPlayers=function(){return Player.players;};/**
 * Get a single player based on an ID or DOM element.
 *
 * This is useful if you want to check if an element or ID has an associated
 * Video.js player, but not create one if it doesn't.
 *
 * @param   {string|Element} id
 *          An HTML element - `<video>`, `<audio>`, or `<video-js>` -
 *          or a string matching the `id` of such an element.
 *
 * @returns {Player|undefined}
 *          A player instance or `undefined` if there is no player instance
 *          matching the argument.
 */videojs.getPlayer=function(id){var players=Player.players;var tag=void 0;if(typeof id==='string'){var nId=normalizeId(id);var player=players[nId];if(player){return player;}tag=$$1('#'+nId);}else {tag=id;}if(isEl(tag)){var _tag=tag,_player=_tag.player,playerId=_tag.playerId;// Element may have a `player` property referring to an already created
// player instance. If so, return that.
if(_player||players[playerId]){return _player||players[playerId];}}};/**
 * Returns an array of all current players.
 *
 * @return {Array}
 *         An array of all players. The array will be in the order that
 *         `Object.keys` provides, which could potentially vary between
 *         JavaScript engines.
 *
 */videojs.getAllPlayers=function(){return(// Disposed players leave a key with a `null` value, so we need to make sure
// we filter those out.
Object.keys(Player.players).map(function(k){return Player.players[k];}).filter(Boolean));};/**
 * Expose players object.
 *
 * @memberOf videojs
 * @property {Object} players
 */videojs.players=Player.players;/**
 * Get a component class object by name
 *
 * @borrows Component.getComponent as videojs.getComponent
 */videojs.getComponent=Component.getComponent;/**
 * Register a component so it can referred to by name. Used when adding to other
 * components, either through addChild `component.addChild('myComponent')` or through
 * default children options  `{ children: ['myComponent'] }`.
 *
 * > NOTE: You could also just initialize the component before adding.
 * `component.addChild(new MyComponent());`
 *
 * @param {string} name
 *        The class name of the component
 *
 * @param {Component} comp
 *        The component class
 *
 * @return {Component}
 *         The newly registered component
 */videojs.registerComponent=function(name$$1,comp){if(Tech.isTech(comp)){log.warn('The '+name$$1+' tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)');}Component.registerComponent.call(Component,name$$1,comp);};/**
 * Get a Tech class object by name
 *
 * @borrows Tech.getTech as videojs.getTech
 */videojs.getTech=Tech.getTech;/**
 * Register a Tech so it can referred to by name.
 * This is used in the tech order for the player.
 *
 * @borrows Tech.registerTech as videojs.registerTech
 */videojs.registerTech=Tech.registerTech;/**
 * Register a middleware to a source type.
 *
 * @param {String} type A string representing a MIME type.
 * @param {function(player):object} middleware A middleware factory that takes a player.
 */videojs.use=use;/**
 * An object that can be returned by a middleware to signify
 * that the middleware is being terminated.
 *
 * @type {object}
 * @memberOf {videojs}
 * @property {object} middleware.TERMINATOR
 */ // Object.defineProperty is not available in IE8
if(!IS_IE8&&Object.defineProperty){Object.defineProperty(videojs,'middleware',{value:{},writeable:false,enumerable:true});Object.defineProperty(videojs.middleware,'TERMINATOR',{value:TERMINATOR,writeable:false,enumerable:true});}else {videojs.middleware={TERMINATOR:TERMINATOR};}/**
 * A suite of browser and device tests from {@link browser}.
 *
 * @type {Object}
 * @private
 */videojs.browser=browser;/**
 * Whether or not the browser supports touch events. Included for backward
 * compatibility with 4.x, but deprecated. Use `videojs.browser.TOUCH_ENABLED`
 * instead going forward.
 *
 * @deprecated since version 5.0
 * @type {boolean}
 */videojs.TOUCH_ENABLED=TOUCH_ENABLED;/**
 * Subclass an existing class
 * Mimics ES6 subclassing with the `extend` keyword
 *
 * @borrows extend:extendFn as videojs.extend
 */videojs.extend=extendFn;/**
 * Merge two options objects recursively
 * Performs a deep merge like lodash.merge but **only merges plain objects**
 * (not arrays, elements, anything else)
 * Other values will be copied directly from the second object.
 *
 * @borrows merge-options:mergeOptions as videojs.mergeOptions
 */videojs.mergeOptions=mergeOptions;/**
 * Change the context (this) of a function
 *
 * > NOTE: as of v5.0 we require an ES5 shim, so you should use the native
 * `function() {}.bind(newContext);` instead of this.
 *
 * @borrows fn:bind as videojs.bind
 */videojs.bind=bind;/**
 * Register a Video.js plugin.
 *
 * @borrows plugin:registerPlugin as videojs.registerPlugin
 * @method registerPlugin
 *
 * @param  {string} name
 *         The name of the plugin to be registered. Must be a string and
 *         must not match an existing plugin or a method on the `Player`
 *         prototype.
 *
 * @param  {Function} plugin
 *         A sub-class of `Plugin` or a function for basic plugins.
 *
 * @return {Function}
 *         For advanced plugins, a factory function for that plugin. For
 *         basic plugins, a wrapper function that initializes the plugin.
 */videojs.registerPlugin=Plugin.registerPlugin;/**
 * Deregister a Video.js plugin.
 *
 * @borrows plugin:deregisterPlugin as videojs.deregisterPlugin
 * @method deregisterPlugin
 *
 * @param  {string} name
 *         The name of the plugin to be deregistered. Must be a string and
 *         must match an existing plugin or a method on the `Player`
 *         prototype.
 *
 */videojs.deregisterPlugin=Plugin.deregisterPlugin;/**
 * Deprecated method to register a plugin with Video.js
 *
 * @deprecated
 *        videojs.plugin() is deprecated; use videojs.registerPlugin() instead
 *
 * @param {string} name
 *        The plugin name
 *
 * @param {Plugin|Function} plugin
 *         The plugin sub-class or function
 */videojs.plugin=function(name$$1,plugin){log.warn('videojs.plugin() is deprecated; use videojs.registerPlugin() instead');return Plugin.registerPlugin(name$$1,plugin);};/**
 * Gets an object containing multiple Video.js plugins.
 *
 * @param  {Array} [names]
 *         If provided, should be an array of plugin names. Defaults to _all_
 *         plugin names.
 *
 * @return {Object|undefined}
 *         An object containing plugin(s) associated with their name(s) or
 *         `undefined` if no matching plugins exist).
 */videojs.getPlugins=Plugin.getPlugins;/**
 * Gets a plugin by name if it exists.
 *
 * @param  {string} name
 *         The name of a plugin.
 *
 * @return {Function|undefined}
 *         The plugin (or `undefined`).
 */videojs.getPlugin=Plugin.getPlugin;/**
 * Gets a plugin's version, if available
 *
 * @param  {string} name
 *         The name of a plugin.
 *
 * @return {string}
 *         The plugin's version or an empty string.
 */videojs.getPluginVersion=Plugin.getPluginVersion;/**
 * Adding languages so that they're available to all players.
 * Example: `videojs.addLanguage('es', { 'Hello': 'Hola' });`
 *
 * @param {string} code
 *        The language code or dictionary property
 *
 * @param {Object} data
 *        The data values to be translated
 *
 * @return {Object}
 *         The resulting language dictionary object
 */videojs.addLanguage=function(code,data){var _mergeOptions;code=(''+code).toLowerCase();videojs.options.languages=mergeOptions(videojs.options.languages,(_mergeOptions={},_mergeOptions[code]=data,_mergeOptions));return videojs.options.languages[code];};/**
 * Log messages
 *
 * @borrows log:log as videojs.log
 */videojs.log=log;videojs.createLogger=createLogger;/**
 * Creates an emulated TimeRange object.
 *
 * @borrows time-ranges:createTimeRanges as videojs.createTimeRange
 */ /**
 * @borrows time-ranges:createTimeRanges as videojs.createTimeRanges
 */videojs.createTimeRange=videojs.createTimeRanges=createTimeRanges;/**
 * Format seconds as a time string, H:MM:SS or M:SS
 * Supplying a guide (in seconds) will force a number of leading zeros
 * to cover the length of the guide
 *
 * @borrows format-time:formatTime as videojs.formatTime
 */videojs.formatTime=formatTime;/**
 * Replaces format-time with a custom implementation, to be used in place of the default.
 *
 * @borrows format-time:setFormatTime as videojs.setFormatTime
 *
 * @method setFormatTime
 *
 * @param {Function} customFn
 *        A custom format-time function which will be called with the current time and guide (in seconds) as arguments.
 *        Passed fn should return a string.
 */videojs.setFormatTime=setFormatTime;/**
 * Resets format-time to the default implementation.
 *
 * @borrows format-time:resetFormatTime as videojs.resetFormatTime
 *
 * @method resetFormatTime
 */videojs.resetFormatTime=resetFormatTime;/**
 * Resolve and parse the elements of a URL
 *
 * @borrows url:parseUrl as videojs.parseUrl
 *
 */videojs.parseUrl=parseUrl;/**
 * Returns whether the url passed is a cross domain request or not.
 *
 * @borrows url:isCrossOrigin as videojs.isCrossOrigin
 */videojs.isCrossOrigin=isCrossOrigin;/**
 * Event target class.
 *
 * @borrows EventTarget as videojs.EventTarget
 */videojs.EventTarget=EventTarget;/**
 * Add an event listener to element
 * It stores the handler function in a separate cache object
 * and adds a generic handler to the element's event,
 * along with a unique id (guid) to the element.
 *
 * @borrows events:on as videojs.on
 */videojs.on=on;/**
 * Trigger a listener only once for an event
 *
 * @borrows events:one as videojs.one
 */videojs.one=one;/**
 * Removes event listeners from an element
 *
 * @borrows events:off as videojs.off
 */videojs.off=off;/**
 * Trigger an event for an element
 *
 * @borrows events:trigger as videojs.trigger
 */videojs.trigger=trigger;/**
 * A cross-browser XMLHttpRequest wrapper. Here's a simple example:
 *
 * @param {Object} options
 *        settings for the request.
 *
 * @return {XMLHttpRequest|XDomainRequest}
 *         The request object.
 *
 * @see https://github.com/Raynos/xhr
 */videojs.xhr=xhr;/**
 * TextTrack class
 *
 * @borrows TextTrack as videojs.TextTrack
 */videojs.TextTrack=TextTrack;/**
 * export the AudioTrack class so that source handlers can create
 * AudioTracks and then add them to the players AudioTrackList
 *
 * @borrows AudioTrack as videojs.AudioTrack
 */videojs.AudioTrack=AudioTrack;/**
 * export the VideoTrack class so that source handlers can create
 * VideoTracks and then add them to the players VideoTrackList
 *
 * @borrows VideoTrack as videojs.VideoTrack
 */videojs.VideoTrack=VideoTrack;/**
 * Determines, via duck typing, whether or not a value is a DOM element.
 *
 * @borrows dom:isEl as videojs.isEl
 * @deprecated Use videojs.dom.isEl() instead
 */ /**
 * Determines, via duck typing, whether or not a value is a text node.
 *
 * @borrows dom:isTextNode as videojs.isTextNode
 * @deprecated Use videojs.dom.isTextNode() instead
 */ /**
 * Creates an element and applies properties.
 *
 * @borrows dom:createEl as videojs.createEl
 * @deprecated Use videojs.dom.createEl() instead
 */ /**
 * Check if an element has a CSS class
 *
 * @borrows dom:hasElClass as videojs.hasClass
 * @deprecated Use videojs.dom.hasClass() instead
 */ /**
 * Add a CSS class name to an element
 *
 * @borrows dom:addElClass as videojs.addClass
 * @deprecated Use videojs.dom.addClass() instead
 */ /**
 * Remove a CSS class name from an element
 *
 * @borrows dom:removeElClass as videojs.removeClass
 * @deprecated Use videojs.dom.removeClass() instead
 */ /**
 * Adds or removes a CSS class name on an element depending on an optional
 * condition or the presence/absence of the class name.
 *
 * @borrows dom:toggleElClass as videojs.toggleClass
 * @deprecated Use videojs.dom.toggleClass() instead
 */ /**
 * Apply attributes to an HTML element.
 *
 * @borrows dom:setElAttributes as videojs.setAttribute
 * @deprecated Use videojs.dom.setAttributes() instead
 */ /**
 * Get an element's attribute values, as defined on the HTML tag
 * Attributes are not the same as properties. They're defined on the tag
 * or with setAttribute (which shouldn't be used with HTML)
 * This will return true or false for boolean attributes.
 *
 * @borrows dom:getElAttributes as videojs.getAttributes
 * @deprecated Use videojs.dom.getAttributes() instead
 */ /**
 * Empties the contents of an element.
 *
 * @borrows dom:emptyEl as videojs.emptyEl
 * @deprecated Use videojs.dom.emptyEl() instead
 */ /**
 * Normalizes and appends content to an element.
 *
 * The content for an element can be passed in multiple types and
 * combinations, whose behavior is as follows:
 *
 * - String
 *   Normalized into a text node.
 *
 * - Element, TextNode
 *   Passed through.
 *
 * - Array
 *   A one-dimensional array of strings, elements, nodes, or functions (which
 *   return single strings, elements, or nodes).
 *
 * - Function
 *   If the sole argument, is expected to produce a string, element,
 *   node, or array.
 *
 * @borrows dom:appendContents as videojs.appendContet
 * @deprecated Use videojs.dom.appendContent() instead
 */ /**
 * Normalizes and inserts content into an element; this is identical to
 * `appendContent()`, except it empties the element first.
 *
 * The content for an element can be passed in multiple types and
 * combinations, whose behavior is as follows:
 *
 * - String
 *   Normalized into a text node.
 *
 * - Element, TextNode
 *   Passed through.
 *
 * - Array
 *   A one-dimensional array of strings, elements, nodes, or functions (which
 *   return single strings, elements, or nodes).
 *
 * - Function
 *   If the sole argument, is expected to produce a string, element,
 *   node, or array.
 *
 * @borrows dom:insertContent as videojs.insertContent
 * @deprecated Use videojs.dom.insertContent() instead
 */['isEl','isTextNode','createEl','hasClass','addClass','removeClass','toggleClass','setAttributes','getAttributes','emptyEl','appendContent','insertContent'].forEach(function(k){videojs[k]=function(){log.warn('videojs.'+k+'() is deprecated; use videojs.dom.'+k+'() instead');return Dom[k].apply(null,arguments);};});/**
 * A safe getComputedStyle with an IE8 fallback.
 *
 * This is because in Firefox, if the player is loaded in an iframe with `display:none`,
 * then `getComputedStyle` returns `null`, so, we do a null-check to make sure
 * that the player doesn't break in these cases.
 * See https://bugzilla.mozilla.org/show_bug.cgi?id=548397 for more details.
 *
 * @borrows computed-style:computedStyle as videojs.computedStyle
 */videojs.computedStyle=computedStyle;/**
 * Export the Dom utilities for use in external plugins
 * and Tech's
 */videojs.dom=Dom;/**
 * Export the Url utilities for use in external plugins
 * and Tech's
 */videojs.url=Url;var video_cjs=videojs;

var vueVideoPlayer = createCommonjsModule(function (module, exports) {
!function (e, t) {
  module.exports = t(video_cjs) ;
}(commonjsGlobal, function (e) {
  return function (e) {
    function t(i) {
      if (n[i]) return n[i].exports;
      var r = n[i] = {
        i: i,
        l: !1,
        exports: {}
      };
      return e[i].call(r.exports, r, r.exports, t), r.l = !0, r.exports;
    }
    var n = {};
    return t.m = e, t.c = n, t.i = function (e) {
      return e;
    }, t.d = function (e, n, i) {
      t.o(e, n) || Object.defineProperty(e, n, {
        configurable: !1,
        enumerable: !0,
        get: i
      });
    }, t.n = function (e) {
      var n = e && e.__esModule ? function () {
        return e.default;
      } : function () {
        return e;
      };
      return t.d(n, "a", n), n;
    }, t.o = function (e, t) {
      return Object.prototype.hasOwnProperty.call(e, t);
    }, t.p = "/", t(t.s = 3);
  }([function (t, n) {
    t.exports = e;
  }, function (e, t, n) {

    function i(e, t, n) {
      return t in e ? Object.defineProperty(e, t, {
        value: n,
        enumerable: !0,
        configurable: !0,
        writable: !0
      }) : e[t] = n, e;
    }
    Object.defineProperty(t, "__esModule", {
      value: !0
    });
    var r = n(0),
      o = function (e) {
        return e && e.__esModule ? e : {
          default: e
        };
      }(r),
      s = window.videojs || o.default;
    "function" != typeof Object.assign && Object.defineProperty(Object, "assign", {
      value: function (e, t) {
        if (null == e) throw new TypeError("Cannot convert undefined or null to object");
        for (var n = Object(e), i = 1; i < arguments.length; i++) {
          var r = arguments[i];
          if (null != r) for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (n[o] = r[o]);
        }
        return n;
      },
      writable: !0,
      configurable: !0
    });
    var a = ["loadeddata", "canplay", "canplaythrough", "play", "pause", "waiting", "playing", "ended", "error"];
    t.default = {
      name: "video-player",
      props: {
        start: {
          type: Number,
          default: 0
        },
        crossOrigin: {
          type: String,
          default: ""
        },
        playsinline: {
          type: Boolean,
          default: !1
        },
        customEventName: {
          type: String,
          default: "statechanged"
        },
        options: {
          type: Object,
          required: !0
        },
        events: {
          type: Array,
          default: function () {
            return [];
          }
        },
        globalOptions: {
          type: Object,
          default: function () {
            return {
              controls: !0,
              controlBar: {
                remainingTimeDisplay: !1,
                playToggle: {},
                progressControl: {},
                fullscreenToggle: {},
                volumeMenuButton: {
                  inline: !1,
                  vertical: !0
                }
              },
              techOrder: ["html5"],
              plugins: {}
            };
          }
        },
        globalEvents: {
          type: Array,
          default: function () {
            return [];
          }
        }
      },
      data: function () {
        return {
          player: null,
          reseted: !0
        };
      },
      mounted: function () {
        this.player || this.initialize();
      },
      beforeDestroy: function () {
        this.player && this.dispose();
      },
      methods: {
        initialize: function () {
          var e = this,
            t = Object.assign({}, this.globalOptions, this.options);
          this.playsinline && (this.$refs.video.setAttribute("playsinline", this.playsinline), this.$refs.video.setAttribute("webkit-playsinline", this.playsinline), this.$refs.video.setAttribute("x5-playsinline", this.playsinline), this.$refs.video.setAttribute("x5-video-player-type", "h5"), this.$refs.video.setAttribute("x5-video-player-fullscreen", !1)), "" !== this.crossOrigin && (this.$refs.video.crossOrigin = this.crossOrigin, this.$refs.video.setAttribute("crossOrigin", this.crossOrigin));
          var n = function (t, n) {
            t && e.$emit(t, e.player), n && e.$emit(e.customEventName, i({}, t, n));
          };
          t.plugins && delete t.plugins.__ob__;
          var r = this;
          this.player = s(this.$refs.video, t, function () {
            for (var e = this, t = a.concat(r.events).concat(r.globalEvents), i = {}, o = 0; o < t.length; o++) "string" == typeof t[o] && void 0 === i[t[o]] && function (t) {
              i[t] = null, e.on(t, function () {
                n(t, !0);
              });
            }(t[o]);
            this.on("timeupdate", function () {
              n("timeupdate", this.currentTime());
            }), r.$emit("ready", this);
          });
        },
        dispose: function (e) {
          var t = this;
          this.player && this.player.dispose && ("Flash" !== this.player.techName_ && this.player.pause && this.player.pause(), this.player.dispose(), this.player = null, this.$nextTick(function () {
            t.reseted = !1, t.$nextTick(function () {
              t.reseted = !0, t.$nextTick(function () {
                e && e();
              });
            });
          }));
        }
      },
      watch: {
        options: {
          deep: !0,
          handler: function (e, t) {
            var n = this;
            this.dispose(function () {
              e && e.sources && e.sources.length && n.initialize();
            });
          }
        }
      }
    };
  }, function (e, t, n) {

    Object.defineProperty(t, "__esModule", {
      value: !0
    });
    var i = n(1),
      r = n.n(i);
    for (var o in i) ["default", "default"].indexOf(o) < 0 && function (e) {
      n.d(t, e, function () {
        return i[e];
      });
    }(o);
    var s = n(5),
      a = n(4),
      l = a(r.a, s.a, !1, null, null, null);
    t.default = l.exports;
  }, function (e, t, n) {

    function i(e) {
      return e && e.__esModule ? e : {
        default: e
      };
    }
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.install = t.videoPlayer = t.videojs = void 0;
    var r = n(0),
      o = i(r),
      s = n(2),
      a = i(s),
      l = window.videojs || o.default,
      u = function (e, t) {
        t && (t.options && (a.default.props.globalOptions.default = function () {
          return t.options;
        }), t.events && (a.default.props.globalEvents.default = function () {
          return t.events;
        })), e.component(a.default.name, a.default);
      },
      d = {
        videojs: l,
        videoPlayer: a.default,
        install: u
      };
    t.default = d, t.videojs = l, t.videoPlayer = a.default, t.install = u;
  }, function (e, t) {
    e.exports = function (e, t, n, i, r, o) {
      var s,
        a = e = e || {},
        l = typeof e.default;
      "object" !== l && "function" !== l || (s = e, a = e.default);
      var u = "function" == typeof a ? a.options : a;
      t && (u.render = t.render, u.staticRenderFns = t.staticRenderFns, u._compiled = !0), n && (u.functional = !0), r && (u._scopeId = r);
      var d;
      if (o ? (d = function (e) {
        e = e || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, e || "undefined" == typeof __VUE_SSR_CONTEXT__ || (e = __VUE_SSR_CONTEXT__), i && i.call(this, e), e && e._registeredComponents && e._registeredComponents.add(o);
      }, u._ssrRegister = d) : i && (d = i), d) {
        var c = u.functional,
          f = c ? u.render : u.beforeCreate;
        c ? (u._injectStyles = d, u.render = function (e, t) {
          return d.call(t), f(e, t);
        }) : u.beforeCreate = f ? [].concat(f, d) : [d];
      }
      return {
        esModule: s,
        exports: a,
        options: u
      };
    };
  }, function (e, t, n) {

    var i = function () {
        var e = this,
          t = e.$createElement,
          n = e._self._c || t;
        return e.reseted ? n("div", {
          staticClass: "video-player"
        }, [n("video", {
          ref: "video",
          staticClass: "video-js"
        })]) : e._e();
      },
      r = [],
      o = {
        render: i,
        staticRenderFns: r
      };
    t.a = o;
  }]);
});
});

var VueVideoPlayer = unwrapExports(vueVideoPlayer);
vueVideoPlayer.VueVideoPlayer;

//
var script$4G = {
  name: 'video-play',
  components: {
    videoPlayer: VueVideoPlayer.videoPlayer
  },
  props: {
    url: {
      type: String,
      default: '',
      require: true
    }
  },
  watch: {
    url: {
      handler() {
        // this.isPlay = false
        this.playerOptions.sources[0].src = this.url;
      },
      immediate: true
    }
  },
  data() {
    return {
      pageType: 'pc',
      isShowPlay: false,
      videoIcon,
      isPlay: false,
      playTime: 0,
      playDuration: '00:00',
      playCurrentTime: '00:00',
      totalDuration: 0,
      isShowControls: false,
      playerOptions: {
        playbackRates: [0.5, 1.0, 1.25, 1.5, 2.0],
        //播放速度
        autoplay: false,
        //如果true,浏览器准备好时开始回放。
        muted: false,
        // 默认情况下将会消除任何音频。
        loop: false,
        // 导致视频一结束就重新开始。
        preload: 'auto',
        // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频（如果浏览器支持）
        language: 'zh-CN',
        aspectRatio: '16:9',
        // 将播放器置于流畅模式，并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字（例如"16:9"或"4:3"）
        fluid: true,
        // 当true时，Video.js player将拥有流体大小。换句话说，它将按比例缩放以适应其容器。
        sources: [{
          type: '',
          //这里的种类支持很多种：基本视频格式、直播、流媒体等，具体可以参看git网址项目
          src: '' //url地址
        }],
        poster: '',
        //你的封面地址
        // width: document.documentElement.clientWidth, //播放器宽度
        notSupportedMessage: '获取视频失败，请刷新重试',
        //允许覆盖Video.js无法播放媒体源时显示的默认信息。
        controlBar: {
          timeDivider: true,
          durationDisplay: true,
          remainingTimeDisplay: false,
          fullscreenToggle: true //全屏按钮
        }
      },
      playerEvents: ['fullscreenchange']
    };
  },
  inject: ['wrapRoot', 'inKey'],
  created() {
    this.pageType = this.$route.query.pageType || 'pc';
  },
  methods: {
    onPlayerPlay(e) {
      let currentVideo = e.el_.children[0].getAttribute('id', 64);
      let videoList = document.getElementsByTagName('video');
      for (let i = 0; i < videoList.length; i++) {
        let id = videoList[i].getAttribute('id');
        if (currentVideo != id) {
          videoList[i].pause();
        }
      }
      let audio = document.querySelectorAll('audio');
      if (audio && audio.length) audio.forEach(i => i.pause());
    },
    showPlay() {
      this.isShowPlay = true;
      this.wrapRoot.currentInKey = this.inKey;
    },
    toggleFullscreen(e) {
      if (this.wrapRoot.currentInKey === this.inKey) {
        const data = {
          type: 'setIframeClass',
          value: e.isFullscreen()
        };
        window.parent.postMessage(data);
      }
    }
  }
};

/* script */
const __vue_script__$4G = script$4G;
/* template */
var __vue_render__$4G = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { staticClass: "video" },
    [
      _c(
        "div",
        {
          staticClass: "video-content",
          staticStyle: { "background-color": "#000" },
        },
        [
          _c("video", {
            staticStyle: { width: "180px", height: "100%" },
            attrs: { src: _vm.url },
          }),
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "play",
              on: {
                click: function ($event) {
                  $event.stopPropagation();
                  return _vm.showPlay.apply(null, arguments)
                },
              },
            },
            [_c("img", { attrs: { src: _vm.videoIcon, alt: "" } })]
          ),
        ]
      ),
      _vm._v(" "),
      _c(
        "el-dialog",
        {
          attrs: {
            top: "60px",
            width: _vm.pageType === "pc" ? "50%" : "100%",
            "custom-class": "video-play--dialog",
            "destroy-on-close": "",
            "append-to-body": "",
            visible: _vm.isShowPlay,
          },
          on: {
            "update:visible": function ($event) {
              _vm.isShowPlay = $event;
            },
          },
        },
        [
          _c("video-player", {
            ref: "videoPlayer",
            staticClass: "video-player vjs-custom-skin",
            attrs: {
              events: _vm.playerEvents,
              playsinline: true,
              options: _vm.playerOptions,
            },
            on: {
              "!fullscreenchange": function ($event) {
                return _vm.toggleFullscreen($event)
              },
              play: function ($event) {
                return _vm.onPlayerPlay($event)
              },
            },
          }),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$4G = [];
__vue_render__$4G._withStripped = true;

  /* style */
  const __vue_inject_styles__$4G = undefined;
  /* scoped */
  const __vue_scope_id__$4G = "data-v-7628e470";
  /* module identifier */
  const __vue_module_identifier__$4G = undefined;
  /* functional template */
  const __vue_is_functional_template__$4G = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4G = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4G, staticRenderFns: __vue_staticRenderFns__$4G },
    __vue_inject_styles__$4G,
    __vue_script__$4G,
    __vue_scope_id__$4G,
    __vue_is_functional_template__$4G,
    __vue_module_identifier__$4G,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4F = {
  name: 'bc-file-render',
  components: {
    audioPlay: __vue_component__$4H,
    videoPlay: __vue_component__$4G
  },
  props: {
    fileInfo: {
      type: Object,
      default: () => ({
        fileUrl: '',
        fileType: '',
        fileSuffix: ''
      }),
      required: true
    },
    showHandler: {
      type: Boolean,
      default: true
    },
    mobile: {
      type: Boolean,
      default: false
    },
    isLineFile: {
      type: Boolean,
      default: false
    },
    playbackControl: {
      type: String,
      default: '0'
    }
  },
  computed: {
    fileType() {
      let type;
      if (this.fileInfo.fileType.includes('image')) type = 'image';
      if (this.fileInfo.fileType.includes('audio')) type = 'audio';
      if (this.fileInfo.fileType.includes('video')) type = 'video';
      return type;
    }
  },
  methods: {
    againUpload() {
      // this.$emit('remove')
      this.$emit('againUpload');
    },
    remove() {
      this.$emit('remove');
    }
  }
};

/* script */
const __vue_script__$4F = script$4F;
/* template */
var __vue_render__$4F = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { staticClass: "file-render", attrs: { flex: "" } },
    [
      _vm.fileType === "image"
        ? _c("div", [
            _c("img", {
              staticClass: "image-file",
              attrs: { src: _vm.fileInfo.fileUrl },
            }),
          ])
        : _vm._e(),
      _vm._v(" "),
      _vm.fileType === "audio"
        ? _c("audio-play", {
            style: { width: _vm.showHandler ? "256px" : "100%" },
            attrs: {
              playbackControl: _vm.playbackControl,
              isLineFile: _vm.isLineFile,
              mobile: _vm.mobile,
              url: _vm.fileInfo.fileUrl,
            },
            on: {
              play: function ($event) {
                return _vm.$emit("play")
              },
            },
          })
        : _vm._e(),
      _vm._v(" "),
      _vm.fileType === "video"
        ? _c("video-play", {
            staticClass: "file-render--video",
            attrs: {
              playbackControl: _vm.playbackControl,
              isLineFile: _vm.isLineFile,
              mobile: _vm.mobile,
              url: _vm.fileInfo.fileUrl,
            },
            on: {
              play: function ($event) {
                return _vm.$emit("play")
              },
            },
          })
        : _vm._e(),
      _vm._v(" "),
      _vm.showHandler
        ? _c(
            "div",
            {
              staticClass: "file-info",
              class: { videoHandler: _vm.fileType === "video" },
              staticStyle: { "margin-left": "28px" },
            },
            [
              _vm.fileType !== "audio"
                ? [
                    _vm.fileInfo.fileName
                      ? _c(
                          "el-tooltip",
                          {
                            staticClass: "item",
                            attrs: {
                              "popper-class": "atooltip",
                              effect: "dark",
                              content: "文件名称：" + _vm.fileInfo.fileName,
                              placement: "top-start",
                            },
                          },
                          [
                            _c(
                              "div",
                              { staticClass: "fileName text-overflow" },
                              [
                                _vm._v(
                                  "文件名称：" + _vm._s(_vm.fileInfo.fileName)
                                ),
                              ]
                            ),
                          ]
                        )
                      : _vm._e(),
                    _vm._v(" "),
                    _c("div", { staticClass: "fileInfo" }, [
                      _vm._v("视频格式：" + _vm._s(_vm.fileInfo.fileSuffix)),
                    ]),
                  ]
                : _vm._e(),
              _vm._v(" "),
              _c(
                "div",
                { attrs: { flex: "cross:center" } },
                [
                  _c(
                    "el-button",
                    {
                      staticClass: "dialog-submit",
                      attrs: { type: "primary" },
                      on: { click: _vm.againUpload },
                    },
                    [_vm._v("重新上传")]
                  ),
                  _vm._v(" "),
                  _c(
                    "el-button",
                    { staticClass: "dialog-close", on: { click: _vm.remove } },
                    [_vm._v("删除")]
                  ),
                ],
                1
              ),
            ],
            2
          )
        : _vm._e(),
    ],
    1
  )
};
var __vue_staticRenderFns__$4F = [];
__vue_render__$4F._withStripped = true;

  /* style */
  const __vue_inject_styles__$4F = undefined;
  /* scoped */
  const __vue_scope_id__$4F = "data-v-506f1aca";
  /* module identifier */
  const __vue_module_identifier__$4F = undefined;
  /* functional template */
  const __vue_is_functional_template__$4F = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4F = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4F, staticRenderFns: __vue_staticRenderFns__$4F },
    __vue_inject_styles__$4F,
    __vue_script__$4F,
    __vue_scope_id__$4F,
    __vue_is_functional_template__$4F,
    __vue_module_identifier__$4F,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4E = {
  name: 'BcViewCommon',
  components: {
    bcFileRenderNew: __vue_component__$4F
  },
  props: {
    content: {
      type: String,
      default: ''
    },
    standardAnswer: {
      type: Array,
      default: () => []
    },
    fileInfo: {
      type: Object,
      default: () => ({
        fileUrl: '',
        fileType: '',
        fileSuffix: ''
      })
    },
    placeholder: {
      type: String,
      default: ''
    },
    border: {
      type: Boolean,
      default: true
    },
    mobile: {
      type: Boolean,
      default: false
    },
    isLineFile: {
      type: Boolean,
      default: false
    },
    playbackControl: {
      type: String,
      default: '0'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    pageType: {
      type: String,
      default: 'h5'
    }
  },
  data() {
    return {};
  },
  methods: {
    formatImg(str) {
      if (str) {
        let data = str.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, (match, p1) => {
          if (match.indexOf('style') !== -1) {
            let src = this.resourceBasisPath + p1.split('./')[1];
            let image = match.indexOf('http') !== -1 ? match : match.replace(p1, src);
            return image.split('style="')[0] + 'style="max-width:100% !important;' + image.split('style="')[1];
          } else if (match.indexOf('width') !== -1) {
            let src = this.resourceBasisPath + p1.split('./')[1];
            let image = match.indexOf('http') !== -1 ? match : match.replace(p1, src);
            return image;
          } else {
            return `<img src='${p1.indexOf('http') > -1 ? p1 : this.resourceBasisPath + p1.split('./')[1]}' style="max-width:100%;" />`;
          }
        });
        return data;
      }
    },
    showImage(e) {
      if (e.target.tagName == 'IMG') {
        this.$xmlImgPreview({
          multiple: true,
          nowImgIndex: 0,
          imgList: [{
            url: e.target.src,
            title: ''
          }]
        });
      }
    }
  }
};

/* script */
const __vue_script__$4E = script$4E;
/* template */
var __vue_render__$4E = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticClass: "content" }, [
    _c(
      "div",
      { staticClass: "stem-content", class: { "no-border": !_vm.border } },
      [
        !_vm.content && !_vm.fileInfo.fileUrl && !_vm.standardAnswer
          ? _c("div", { staticClass: "placeholder" }, [
              _vm._v(_vm._s(_vm.placeholder)),
            ])
          : _vm.content
          ? _c("div", {
              staticClass: "text-break-all",
              domProps: { innerHTML: _vm._s(_vm.formatImg(_vm.content)) },
              on: {
                click: function ($event) {
                  return _vm.showImage($event)
                },
              },
            })
          : _vm.standardAnswer
          ? _c(
              "div",
              _vm._l(_vm.standardAnswer, function (item, index) {
                return _c("div", {
                  key: index,
                  domProps: { innerHTML: _vm._s(_vm.formatImg(item.content)) },
                  on: {
                    click: function ($event) {
                      return _vm.showImage($event)
                    },
                  },
                })
              }),
              0
            )
          : _vm._e(),
        _vm._v(" "),
        _vm._t("default"),
        _vm._v(" "),
        _vm.fileInfo.fileUrl
          ? _c("bc-file-render-new", {
              style: {
                "margin-top": _vm.content ? "16px" : 0,
                padding: "10px 0",
              },
              attrs: {
                playbackControl: _vm.playbackControl,
                isLineFile: _vm.isLineFile,
                mobile: _vm.mobile,
                showHandler: false,
                fileInfo: _vm.fileInfo,
              },
              on: {
                play: function ($event) {
                  return _vm.$emit("play")
                },
              },
            })
          : _vm._e(),
      ],
      2
    ),
  ])
};
var __vue_staticRenderFns__$4E = [];
__vue_render__$4E._withStripped = true;

  /* style */
  const __vue_inject_styles__$4E = undefined;
  /* scoped */
  const __vue_scope_id__$4E = "data-v-091089da";
  /* module identifier */
  const __vue_module_identifier__$4E = undefined;
  /* functional template */
  const __vue_is_functional_template__$4E = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4E = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4E, staticRenderFns: __vue_staticRenderFns__$4E },
    __vue_inject_styles__$4E,
    __vue_script__$4E,
    __vue_scope_id__$4E,
    __vue_is_functional_template__$4E,
    __vue_module_identifier__$4E,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4D = {
  name: 'bc-view-option-radio',
  components: {
    BcViewCommon: __vue_component__$4E
  },
  props: {
    option: {
      type: [String, Array],
      default: ''
    },
    showTitle: {
      type: Boolean,
      default: true
    },
    isSubmit: {
      type: Boolean,
      default: true
    },
    value: {
      type: String,
      default: ''
    },
    readonly: {
      type: Boolean,
      default: false
    },
    answer: {
      type: Object,
      default: () => {}
    },
    type: {
      type: String,
      default: 'radio'
    },
    standardAnswer: {
      type: Array
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    pageType: {
      type: String,
      default: 'h5'
    }
  },
  data() {
    return {
      optionsList: [],
      selectData: '',
      isAnswer: false,
      radioJudeMap: {
        A: '正确',
        B: '错误'
      },
      serialNumber: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
    };
  },
  computed: {},
  watch: {
    value: {
      handler(val) {
        this.selectData = val;
      },
      immediate: true
    },
    option: {
      handler(val) {
        try {
          if (Array.isArray(val)) {
            this.optionsList = val;
          } else {
            this.optionsList = JSON.parse(val);
          }
        } catch (err) {
          this.optionsList = [];
        }
      },
      immediate: true
    }
  },
  methods: {
    isActive(item) {
      return item.title === this.selectData && !this.readonly;
    },
    isTrue(item) {
      // if (this.type === 'radio') {
      //   if (this.selectData) {
      //     //当前等于选中
      //     if (item.title === this.selectData) {
      //       //等于正确答案
      //       if (item.title === this.standardAnswer[0].title) {
      //         return true
      //       } else {
      //         return false
      //       }
      //     } else {
      //       //等于正确答案
      //       if (item.title === this.standardAnswer[0].title) {
      //         return true
      //       } else {
      //         return false
      //       }
      //     }
      //   } else {
      //     return false
      //   }
      // } else {
      //   if (this.selectData) {
      //     //当前等于选中
      //     if (item.title === this.selectData) {
      //       //等于正确答案
      //       if (item.content === this.standardAnswer[0]) {
      //         return true
      //       } else {
      //         return false
      //       }
      //     } else {
      //       //等于正确答案
      //       if (item.content === this.standardAnswer[0]) {
      //         return true
      //       } else {
      //         return false
      //       }
      //     }
      //   } else {
      //     return false
      //   }
      // }
      if (this.type === 'radio') {
        return this.isAnswer && this.selectData && this.selectData === item.title && this.standardAnswer.some(i => i.title === item.title);
      } else {
        return this.isAnswer && this.selectData && this.selectData === item.title && this.standardAnswer.some(i => i === item.content);
      }
    },
    isFalse(item) {
      if (!this.isAnswer) {
        return false;
      }
      if (this.type === 'radio') {
        if (this.selectData) {
          //当前为选中的
          if (item.title === this.selectData) {
            if (this.standardAnswer[0].title === item.title) {
              return false;
            } else {
              return true;
            }
          } else {
            return false;
          }
        } else {
          return false;
        }
      } else {
        if (this.selectData) {
          //当前为选中的
          if (item.title === this.selectData) {
            if (this.standardAnswer[0] === item.content) {
              return false;
            } else {
              return true;
            }
          } else {
            return false;
          }
        } else {
          return false;
        }
      }
    },
    submitAnswer() {
      console.log('🚀 ~ file: radio.vue:258 ~ submitAnswer ~ this.selectData:', this.selectData);
      if (!this.selectData && this.isSubmit) {
        this.$message.error('请选择答案');
        return;
      }
      let answerIsTrue = false;
      if (this.type === 'radio') {
        answerIsTrue = this.standardAnswer.some(i => i.title === this.selectData);
      } else {
        answerIsTrue = this.standardAnswer.some(i => i === this.radioJudeMap[this.selectData]);
      }
      this.isAnswer = true;
      this.$emit('showAnalysis', answerIsTrue);
    },
    afresh() {
      this.selectData = '';
      this.isAnswer = false;
      this.$emit('afresh');
    },
    select(item) {
      this.selectData = item;
      // this.$emit('showAnalysis')
    }
  }
};

var __$_require_static_images_leaflet_icons_correct_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAA0klEQVQokWMs2MbsycDAMJeBgUGSgTjwnIGBIZmJRE0MULVzmUjUBNfMRIYmMCBaowSPFkO9433SNIrzaDKU215iuPpqK6ZGE6loBkZGTHMkebUZKmwvM+y918Ww5moOpkYb+SyGLrdPDKzMnCjOK7O5yLD3XifDlptV2P044bg1w7XX2xm63D4zCHMpMYhxq4Odt+tOC8OWm9UYLgElgP/IAv4a3QxaYp4MTIwsDKeeLGLYfbcNq78xNBILKIpHUNojFbwAaUwBMUjQ+ZSBgSEZAPrMNTg71FhgAAAAAElFTkSuQmCC";

var __$_require_static_images_leaflet_icons_error_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAABNElEQVQokWO8ySDtycDAMJeBgUGSgTjwnIGBIRmk8RkJmmDgORNME39SBANfTBBOlTyBHgwCWfEwriQTXIaNlUFi8SQG3jBfDE3c7vYMUuvmMDDx8yIEbzJI/4fhZyFp/0HgRVIxXOyJbwJY7GVm5X9ktSgaQfhFcglY4SPrgP/31e3A7FfFTf/R1TGCdaMBDktjBrljG8GCT73jGL5u24fhfCYMEQYGhr8vXyOx32ANLAyNPP7uDIp3jzE89U1geGTlzyB3ZhsDX1wIhkYWZA6Xiy2D1Ia5DK9Lmhm+btkDFnsRl88gsWgiw/9fvxk+r4A4HyVUn0fnQEIvuxojIOByOTVwMbiNTPx8DK8L6hk+TF2A4axPS9czMHJwMDAJ8sPFyE1yL0CBkwJikKDpKQMDQzIArpej/rmzX0cAAAAASUVORK5CYII=";

/* script */
const __vue_script__$4D = script$4D;
var __vue_render__$4D = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", [
    _c(
      "div",
      { staticClass: "xml-checkbox-box" },
      _vm._l(_vm.optionsList, function (item, index) {
        return _c(
          "div",
          {
            key: index,
            staticClass: "option-item",
            class: {
              isActive: _vm.isActive(item),
              isTrue: _vm.isTrue(item),
              isFalse: _vm.isFalse(item),
            },
            attrs: { flex: "" },
            on: {
              click: function ($event) {
                $event.stopPropagation();
                return _vm.select(item.title)
              },
            },
          },
          [
            _c(
              "div",
              { staticClass: "questionSeq" },
              [
                _vm.isTrue(item)
                  ? _c("img", {
                      staticStyle: { "margin-right": "10px" },
                      attrs: {
                        src: __$_require_static_images_leaflet_icons_correct_png__,
                        alt: "",
                      },
                    })
                  : _vm._e(),
                _vm._v(" "),
                _vm.isFalse(item)
                  ? _c("img", {
                      staticStyle: { "margin-right": "10px" },
                      attrs: {
                        src: __$_require_static_images_leaflet_icons_error_png__,
                        alt: "",
                      },
                    })
                  : _vm._e(),
                _vm._v(" "),
                !_vm.readonly && !_vm.isTrue(item) && !_vm.isFalse(item)
                  ? _c(
                      "el-radio",
                      { attrs: { value: _vm.selectData, label: item.title } },
                      [_vm._v(_vm._s(""))]
                    )
                  : _vm._e(),
              ],
              1
            ),
            _vm._v(" "),
            _vm.showTitle
              ? _c(
                  "div",
                  {
                    staticClass: "questionSeq",
                    staticStyle: { "margin-right": "2px" },
                  },
                  [
                    _vm._v(
                      "\n        " +
                        _vm._s(_vm.serialNumber[index]) +
                        "\n      "
                    ),
                  ]
                )
              : _vm._e(),
            _vm._v(" "),
            _c("bc-view-common", {
              attrs: {
                "flex-box": "1",
                border: false,
                content: item.content,
                fileInfo: item.fileInfo,
                resourceBasisPath: _vm.resourceBasisPath,
                pageType: _vm.pageType,
              },
            }),
          ],
          1
        )
      }),
      0
    ),
    _vm._v(" "),
    _vm.isSubmit
      ? _c(
          "div",
          {
            staticClass: "mt-4",
            staticStyle: {
              display: "flex",
              "justify-content": "flex-end",
              "text-align": "center",
              "margin-top": "12px",
            },
          },
          [
            !_vm.selectData || !_vm.isAnswer
              ? _c(
                  "div",
                  {
                    staticClass: "xml-submit-answer",
                    on: { click: _vm.submitAnswer },
                  },
                  [_vm._v("提交作答")]
                )
              : _c(
                  "div",
                  {
                    staticClass: "xml-submit-answer",
                    on: {
                      click: function ($event) {
                        return _vm.afresh()
                      },
                    },
                  },
                  [_vm._v("重新作答")]
                ),
          ]
        )
      : _vm._e(),
  ])
};
var __vue_staticRenderFns__$4D = [];
__vue_render__$4D._withStripped = true;

  /* style */
  const __vue_inject_styles__$4D = undefined;
  /* scoped */
  const __vue_scope_id__$4D = "data-v-2aeaa1c8";
  /* module identifier */
  const __vue_module_identifier__$4D = undefined;
  /* functional template */
  const __vue_is_functional_template__$4D = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4D = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4D, staticRenderFns: __vue_staticRenderFns__$4D },
    __vue_inject_styles__$4D,
    __vue_script__$4D,
    __vue_scope_id__$4D,
    __vue_is_functional_template__$4D,
    __vue_module_identifier__$4D,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4C = {
  name: 'bc-view-option-checkbox',
  components: {
    BcViewCommon: __vue_component__$4E
  },
  props: {
    option: {
      type: [String, Array],
      default: ''
    },
    showTitle: {
      type: Boolean,
      default: true
    },
    isSubmit: {
      type: Boolean,
      default: true
    },
    value: {
      type: [String],
      default: ''
    },
    readonly: {
      type: Boolean,
      default: false
    },
    answer: {
      type: Object,
      default: () => {}
    },
    standardAnswer: {
      type: Array,
      default: () => []
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    pageType: {
      type: String,
      default: 'h5'
    }
  },
  data() {
    return {
      optionsList: [],
      selectData: [],
      isAnswer: false,
      serialNumber: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
    };
  },
  watch: {
    // value: {
    //   handler(val) {
    //     this.selectData = val ? val : []
    //   },
    //   immediate: true
    // },
    option: {
      handler(val) {
        try {
          if (Array.isArray(val)) {
            this.optionsList = val;
          } else {
            this.optionsList = JSON.parse(val);
          }
        } catch (err) {
          this.optionsList = [];
        }
      },
      immediate: true
    }
  },
  methods: {
    select(item, e) {
      // debugger
      if (e.target.tagName === 'INPUT') {
        e.stopPropagation();
        return;
      }
      if (this.readonly) return;
      let index = this.selectData.findIndex(i => i === item);
      if (index !== -1) {
        this.selectData.splice(index, 1);
      } else {
        this.selectData.push(item);
      }
      this.selectData.sort((a, b) => a.charCodeAt() - b.charCodeAt());
      this.$emit('change', this.selectData.join(''));
    },
    submitAnswer() {
      if (!this.selectData.length && this.isSubmit) {
        this.$message.error('请选择答案');
        return;
      }
      let answerIsTrue = this.standardAnswer.map(i => i.title).join('、') === this.selectData.join('、');
      this.isAnswer = true;
      this.$emit('showAnalysis', answerIsTrue);
    },
    afresh() {
      this.selectData = [];
      this.isAnswer = false;
      this.$emit('afresh');
    },
    SkipProgress(e, title, val) {
      if (e.target.targetName === 'INPUT') {
        e.stopPropagation();
      }
    }
  }
};

/* script */
const __vue_script__$4C = script$4C;
var __vue_render__$4C = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", [
    _c(
      "div",
      { staticClass: "xml-checkbox-box" },
      _vm._l(_vm.optionsList, function (item, index) {
        return _c(
          "div",
          {
            key: index,
            staticClass: "option-item",
            class: {
              isActive: _vm.selectData.includes(item.title) && !_vm.readonly,
              isTrue:
                _vm.isAnswer &&
                _vm.selectData.length &&
                _vm.selectData.includes(item.title) &&
                _vm.standardAnswer.some(function (i) {
                  return i.title === item.title
                }),
              isFalse:
                _vm.isAnswer &&
                _vm.selectData.length &&
                _vm.selectData.includes(item.title) &&
                _vm.standardAnswer.every(function (i) {
                  return i.title !== item.title
                }),
            },
            attrs: { flex: "" },
            on: {
              click: function ($event) {
                $event.stopPropagation();
                return _vm.select(item.title, $event)
              },
            },
          },
          [
            _c(
              "div",
              { staticClass: "questionSeq" },
              [
                _vm.isAnswer &&
                _vm.selectData.length &&
                _vm.selectData.includes(item.title) &&
                _vm.standardAnswer.some(function (i) {
                  return i.title === item.title
                })
                  ? _c("img", {
                      staticStyle: { "margin-right": "10px" },
                      attrs: {
                        src: __$_require_static_images_leaflet_icons_correct_png__,
                        alt: "",
                      },
                    })
                  : _vm._e(),
                _vm._v(" "),
                _vm.isAnswer &&
                _vm.selectData.length &&
                _vm.selectData.includes(item.title) &&
                _vm.standardAnswer.every(function (i) {
                  return i.title !== item.title
                })
                  ? _c("img", {
                      staticStyle: { "margin-right": "10px" },
                      attrs: {
                        src: __$_require_static_images_leaflet_icons_error_png__,
                        alt: "",
                      },
                    })
                  : _vm._e(),
                _vm._v(" "),
                !_vm.readonly && !_vm.isAnswer
                  ? _c(
                      "el-checkbox",
                      {
                        attrs: { value: _vm.selectData.includes(item.title) },
                        nativeOn: {
                          click: function ($event) {
                            _vm.SkipProgress(
                              $event,
                              item.title,
                              _vm.selectData.includes(item.title)
                            );
                          },
                        },
                      },
                      [_vm._v(_vm._s(""))]
                    )
                  : _vm._e(),
              ],
              1
            ),
            _vm._v(" "),
            _vm.showTitle
              ? _c(
                  "div",
                  {
                    staticClass: "questionSeq",
                    staticStyle: { "margin-right": "2px" },
                  },
                  [
                    _vm._v(
                      "\n        " +
                        _vm._s(_vm.serialNumber[index]) +
                        "\n      "
                    ),
                  ]
                )
              : _vm._e(),
            _vm._v(" "),
            _c("bc-view-common", {
              attrs: {
                "flex-box": "1",
                border: false,
                content: item.content,
                fileInfo: item.fileInfo,
                resourceBasisPath: _vm.resourceBasisPath,
                pageType: _vm.pageType,
              },
            }),
          ],
          1
        )
      }),
      0
    ),
    _vm._v(" "),
    _vm.isSubmit
      ? _c(
          "div",
          {
            staticClass: "mt-4",
            staticStyle: {
              display: "flex",
              "justify-content": "flex-end",
              "text-align": "center",
              "margin-top": "12px",
            },
          },
          [
            !_vm.selectData || !_vm.isAnswer
              ? _c(
                  "div",
                  {
                    staticClass: "xml-submit-answer",
                    on: { click: _vm.submitAnswer },
                  },
                  [_vm._v("提交作答")]
                )
              : _c(
                  "div",
                  {
                    staticClass: "xml-submit-answer",
                    on: {
                      click: function ($event) {
                        return _vm.afresh()
                      },
                    },
                  },
                  [_vm._v("重新作答")]
                ),
          ]
        )
      : _vm._e(),
  ])
};
var __vue_staticRenderFns__$4C = [];
__vue_render__$4C._withStripped = true;

  /* style */
  const __vue_inject_styles__$4C = undefined;
  /* scoped */
  const __vue_scope_id__$4C = "data-v-2dab3356";
  /* module identifier */
  const __vue_module_identifier__$4C = undefined;
  /* functional template */
  const __vue_is_functional_template__$4C = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4C = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4C, staticRenderFns: __vue_staticRenderFns__$4C },
    __vue_inject_styles__$4C,
    __vue_script__$4C,
    __vue_scope_id__$4C,
    __vue_is_functional_template__$4C,
    __vue_module_identifier__$4C,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4B = {
  name: 'QuestionItem',
  components: {
    BcViewOptionCheckbox: __vue_component__$4C,
    BcViewOptionRadio: __vue_component__$4D,
    BcViewCommon: __vue_component__$4E
  },
  // dicts: ['question_type'],
  data() {
    return {
      // isShowAnalysis: false,
      // isShowAnswer: false,
      // isShowKnowledge: false,
      inputAnswer: '',
      dict: {
        label: {
          question_type: {
            1: '单选题',
            2: '多选题',
            3: '判断题',
            13: '简答题'
          }
        }
      },
      isAnswer: false,
      serialNumber: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
    };
  },
  props: {
    question: Object,
    canShowAnswer: String,
    canShowAnalysis: String,
    canShowKnowledge: String,
    inKey: String,
    border: {
      type: Boolean,
      default: false
    },
    isSubmit: {
      //是否显示提交作答按钮
      type: Boolean,
      default: true
    },
    questionNumber: {
      type: Number,
      default: 0
    },
    isShowAi: {
      type: String,
      default: '1'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    pageType: {
      type: String,
      default: 'h5'
    }
  },
  provide: function () {
    return {
      inKey: this.inKey
    };
  },
  mounted() {
    console.log(this.question);
  },
  computed: {
    isShowAnalysis() {
      return this.isAnswer && this.canShowAnalysis === 'true';
    },
    isShowAnswer() {
      return this.isAnswer && this.canShowAnswer === 'true';
    },
    isShowKnowledge() {
      return this.isAnswer && this.canShowKnowledge === 'true';
    },
    isRadio() {
      return isRadio(this.question.questionType);
    },
    isCheck() {
      return isCheck(this.question.questionType);
    },
    showJudgeAnswer() {
      return showJudgeAnswer(this.question.questionType);
    },
    showRichTextAnswer() {
      return showRichTextAnswer(this.question.questionType);
    },
    showOptions() {
      return showOptions(this.question.questionType);
    },
    showSort() {
      return showSort(this.question.questionType);
    },
    isCloze() {
      return isCloze(this.question.questionType);
    },
    clozeLength() {
      let fillInTheBlanksSpan = this.question.stem.content.match(/fillInTheBlanksSpan/g);
      let sortString = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
      let data = fillInTheBlanksSpan ? fillInTheBlanksSpan.length : 0;
      let list = [];
      for (let i = 0; i < data; i++) {
        list.push({
          content: '',
          title: sortString.split('')[i]
        });
      }
      // return fillInTheBlanksSpan ? fillInTheBlanksSpan.length : 0
      return list;
    },
    standardAnswer() {
      try {
        let answerTitle = '';
        if (!this.showRichTextAnswer) {
          if (this.showOptions) {
            answerTitle = this.question.standardAnswer.map(i => i.title).join('、');
          } else if (this.showJudgeAnswer) {
            answerTitle = this.question.standardAnswer.map(i => i).join('、');
          } else if (this.showSort) {
            let questionOption = xeUtils.clone(this.question.questionOption, true);
            answerTitle = questionOption.sort((c, n) => c.index - n.index).map(i => i.title).join('、');
          }
        }
        return answerTitle;
      } catch (e) {
        console.log('异常：', e);
        return '';
      }
    }
  },
  methods: {
    showAnalysis(answer) {
      if (!this.showRichTextAnswer) {
        this.isAnswer = true;
        let params = {
          pass: answer,
          questionId: this.question.id,
          questionName: JSON.stringify(this.question.stem)
        };
        this.$emit('submitAnswer', params);
      } else {
        this.isAnswer = true;
      }
    },
    showAnalysis2(answer) {
      if (answer.questionType == 'shortSnswer' && this.isSubmit) {
        if (!answer.userAnswer) {
          this.$message.error('请先输入答案');
          return;
        }
      } else if (answer.questionType == 'fillInTheBlanks' && this.isSubmit) {
        for (let i = 0; i < this.clozeLength.length; i++) {
          if (!this.clozeLength[i].content) {
            this.$message.error('请先输入答案');
            return;
          }
        }
      }
      this.isAnswer = true;
      let params = {
        pass: answer,
        questionId: this.question.id,
        questionName: JSON.stringify(this.question.stem)
      };
      this.$emit('submitAnswer', params);
    },
    afresh(questionType) {
      this.isAnswer = false;
      if (questionType == 'shortSnswer') {
        this.inputAnswer = '';
      } else if (questionType == 'fillInTheBlanks') {
        for (let i = 0; i < this.clozeLength.length; i++) {
          this.clozeLength[i].content = '';
        }
      }
    },
    // 
    changeAnswer() {
      if (this.isRadio || this.showJudgeAnswer) {
        this.$refs.bcViewOptionRadio?.submitAnswer();
      }
      if (this.isCheck) {
        this.$refs.bcViewOptionCheckbox?.submitAnswer();
      }
      if (this.showRichTextAnswer && !this.isCloze) {
        this.showAnalysis2({
          questionId: this.question.id,
          questionName: JSON.stringify(this.question.stem),
          userAnswer: this.inputAnswer,
          questionType: 'shortSnswer'
        });
      }
      if (this.isCloze) {
        this.showAnalysis2({
          questionId: this.question.id,
          questionName: JSON.stringify(this.question.stem),
          userAnswer: this.clozeLength,
          questionType: 'fillInTheBlanks'
        });
      }
    },
    // AIanalysis(){
    //   let params = {
    //       questionOption: JSON.stringify(this.question.questionOption),
    //       questionName: JSON.stringify(this.question.stem)
    //   }
    //   this.$emit('setanalysis', params)
    // },
    AIanalysis() {
      let serialNumber = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T'];
      let option = '';
      let question = this.question.stem.content;
      let optionList = this.question.questionOption;
      for (let i = 0; i < optionList.length; i++) {
        if (optionList[i].content) {
          option += serialNumber[i] + '.' + this.removeStyle(optionList[i].content) + (i < optionList.length - 1 ? ';' : '');
        }
      }
      if (this.question.questionType == '3') {
        option = 'A.正确;B.错误';
      }
      const data = {
        type: 'AiAnalysis',
        value: this.removeStyle(question) + option,
        code: 'success'
      };
      this.$emit('setanalysis', data);
    },
    removeStyle(e) {
      if (e) {
        e = e.replace(/<[^>]+>/g, ''); //去除所有标签，以纯文本展示
        e = e.replace(/\s/gi, ''); //去除空格
        e = e.replace(/&nbsp;/gi, ''); //去除空格
        return e;
      }
    },
    getPaperList(list) {
      if (list.length > 0) {
        let answerList = [];
        list.map(item => {
          if (typeof item == 'string') {
            let data = {
              selected: false,
              ...JSON.parse(item)
            };
            answerList.push(data);
          } else {
            this.$set(item, 'selected', false);
            answerList = list;
          }
        });
        return answerList;
      }
    }
  }
};

var __$_require_static_images_leaflet_icons_ai_png__ = "data:image/png;base64, ";

/* script */
const __vue_script__$4B = script$4B;
var __vue_render__$4B = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", [
    _c(
      "div",
      {
        staticClass: "group-content",
        class: _vm.border ? "border-bottom" : "",
      },
      [
        _c("div", { staticClass: "group-content-box" }, [
          _c("div", { staticClass: "stem" }, [
            _c(
              "div",
              { staticClass: "stem-box", staticStyle: { display: "flex" } },
              [
                _c("bc-view-common", {
                  staticClass: "xml-question-title",
                  staticStyle: { flex: "1", "min-width": "0" },
                  attrs: {
                    content: _vm.question.stem.content,
                    border: false,
                    fileInfo: _vm.question.stem.fileInfo,
                    resourceBasisPath: _vm.resourceBasisPath,
                    isSubmit: _vm.isSubmit,
                    pageType: _vm.pageType,
                  },
                }),
              ],
              1
            ),
          ]),
        ]),
        _vm._v(" "),
        _vm.isRadio
          ? _c(
              "div",
              { staticClass: "mt-4" },
              [
                _c("bc-view-option-radio", {
                  ref: "bcViewOptionRadio",
                  attrs: {
                    standardAnswer: _vm.question.standardAnswer,
                    option: _vm.question.questionOption,
                    resourceBasisPath: _vm.resourceBasisPath,
                    isSubmit: _vm.isSubmit,
                    pageType: _vm.pageType,
                  },
                  on: { showAnalysis: _vm.showAnalysis, afresh: _vm.afresh },
                }),
              ],
              1
            )
          : _vm._e(),
        _vm._v(" "),
        _vm.isCheck
          ? _c(
              "div",
              { staticClass: "mt-4" },
              [
                _c("bc-view-option-checkbox", {
                  ref: "bcViewOptionCheckbox",
                  attrs: {
                    option: _vm.question.questionOption,
                    standardAnswer: _vm.question.standardAnswer,
                    resourceBasisPath: _vm.resourceBasisPath,
                    isSubmit: _vm.isSubmit,
                    pageType: _vm.pageType,
                  },
                  on: { showAnalysis: _vm.showAnalysis, afresh: _vm.afresh },
                }),
              ],
              1
            )
          : _vm._e(),
        _vm._v(" "),
        _vm.showRichTextAnswer && !_vm.isCloze
          ? _c(
              "div",
              {
                staticClass: "mt-4",
                staticStyle: { display: "flex", "flex-direction": "column" },
              },
              [
                _c("el-input", {
                  attrs: {
                    type: "textarea",
                    placeholder: "请输入您的回答",
                    autosize: { minRows: 2, maxRows: 8 },
                  },
                  model: {
                    value: _vm.inputAnswer,
                    callback: function ($$v) {
                      _vm.inputAnswer = $$v;
                    },
                    expression: "inputAnswer",
                  },
                }),
                _vm._v(" "),
                !_vm.isAnswer & _vm.isSubmit
                  ? _c(
                      "div",
                      {
                        staticClass:
                          "xml-submit-answer xml-submit-answer-right",
                        on: {
                          click: function ($event) {
                            _vm.showAnalysis2({
                              questionId: _vm.question.id,
                              questionName: JSON.stringify(_vm.question.stem),
                              userAnswer: _vm.inputAnswer,
                              questionType: "shortSnswer",
                            });
                          },
                        },
                      },
                      [_vm._v("\n        提交作答\n      ")]
                    )
                  : _vm.isAnswer & _vm.isSubmit
                  ? _c(
                      "div",
                      {
                        staticClass:
                          "xml-submit-answer xml-submit-answer-right",
                        on: {
                          click: function ($event) {
                            return _vm.afresh("shortSnswer")
                          },
                        },
                      },
                      [_vm._v("重新作答")]
                    )
                  : _vm._e(),
              ],
              1
            )
          : _vm._e(),
        _vm._v(" "),
        _vm.showJudgeAnswer
          ? _c(
              "div",
              [
                _c("bc-view-option-radio", {
                  ref: "bcViewOptionRadio",
                  attrs: {
                    standardAnswer: _vm.question.standardAnswer,
                    resourceBasisPath: _vm.resourceBasisPath,
                    pageType: _vm.pageType,
                    isSubmit: _vm.isSubmit,
                    type: "judge",
                    option: [
                      { title: "A", content: "正确" },
                      { title: "B", content: "错误" },
                    ],
                  },
                  on: { showAnalysis: _vm.showAnalysis, afresh: _vm.afresh },
                }),
              ],
              1
            )
          : _vm._e(),
        _vm._v(" "),
        _vm.isCloze
          ? _c(
              "div",
              [
                _vm._l(_vm.clozeLength, function (item, index) {
                  return _c("div", { key: index, staticClass: "isTrue" }, [
                    _c("input", {
                      directives: [
                        {
                          name: "model",
                          rawName: "v-model",
                          value: item.content,
                          expression: "item.content",
                        },
                      ],
                      staticClass: "answer-cloze-input",
                      attrs: {
                        maxlength: "100",
                        placeholder: "请输入...",
                        type: "text",
                      },
                      domProps: { value: item.content },
                      on: {
                        input: function ($event) {
                          if ($event.target.composing) {
                            return
                          }
                          _vm.$set(item, "content", $event.target.value);
                        },
                      },
                    }),
                  ])
                }),
                _vm._v(" "),
                !_vm.isAnswer && _vm.isSubmit
                  ? _c(
                      "div",
                      {
                        staticClass:
                          "xml-submit-answer xml-submit-answer-right",
                        on: {
                          click: function ($event) {
                            _vm.showAnalysis2({
                              questionId: _vm.question.id,
                              questionName: JSON.stringify(_vm.question.stem),
                              userAnswer: _vm.clozeLength,
                              questionType: "fillInTheBlanks",
                            });
                          },
                        },
                      },
                      [_vm._v("\n        提交作答\n      ")]
                    )
                  : _vm.isAnswer & _vm.isSubmit
                  ? _c(
                      "div",
                      {
                        staticClass:
                          "xml-submit-answer xml-submit-answer-right",
                        on: {
                          click: function ($event) {
                            return _vm.afresh("fillInTheBlanks")
                          },
                        },
                      },
                      [_vm._v("重新作答")]
                    )
                  : _vm._e(),
              ],
              2
            )
          : _vm._e(),
        _vm._v(" "),
        _vm.isShowAnswer
          ? _c("div", [
              !_vm.showRichTextAnswer
                ? _c("div", { staticClass: "mt-6" }, [
                    _c(
                      "div",
                      {
                        staticStyle: {
                          display: "flex",
                          "flex-direction": "column",
                        },
                      },
                      [
                        _c("div", { staticClass: "question-label" }, [
                          _vm._v(
                            _vm._s(
                              _vm.question.questionType == 13
                                ? "参考答案:"
                                : "正确答案："
                            )
                          ),
                        ]),
                        _vm._v(" "),
                        _c(
                          "div",
                          {
                            staticStyle: {
                              color: "#0070c1",
                              "min-width": "0",
                              flex: "1",
                              "line-height": "28px",
                            },
                          },
                          [
                            _vm.question.questionType == 3
                              ? [
                                  _c("span", [
                                    _vm._v(
                                      "\n                " +
                                        _vm._s(_vm.standardAnswer) +
                                        "\n              "
                                    ),
                                  ]),
                                ]
                              : _vm._l(
                                  _vm.getPaperList(_vm.question.questionOption),
                                  function (item, index) {
                                    return _c(
                                      "span",
                                      {
                                        directives: [
                                          {
                                            name: "show",
                                            rawName: "v-show",
                                            value: _vm.standardAnswer.includes(
                                              item.title
                                            ),
                                            expression:
                                              "standardAnswer.includes(item.title)",
                                          },
                                        ],
                                        key: index,
                                      },
                                      [
                                        _vm._v(
                                          "\n                " +
                                            _vm._s(_vm.serialNumber[index]) +
                                            "\n              "
                                        ),
                                      ]
                                    )
                                  }
                                ),
                          ],
                          2
                        ),
                      ]
                    ),
                  ])
                : _c("div", { staticClass: "mt-6" }, [
                    _c(
                      "div",
                      {
                        staticStyle: {
                          display: "flex",
                          "flex-direction": "column",
                        },
                      },
                      [
                        _c("div", { staticClass: "question-label" }, [
                          _vm._v(
                            _vm._s(
                              _vm.question.questionType == 13
                                ? "参考答案:"
                                : "正确答案："
                            )
                          ),
                        ]),
                        _vm._v(" "),
                        _c(
                          "div",
                          { staticStyle: { flex: "1", "min-width": "0" } },
                          [
                            _c("bc-view-common", {
                              staticStyle: { flex: "1", "min-width": "0" },
                              attrs: {
                                content: _vm.question.standardAnswer.content,
                                standardAnswer:
                                  _vm.question.questionType == 10
                                    ? _vm.question.standardAnswer
                                    : [],
                                border: false,
                                fileInfo: _vm.question.standardAnswer.fileInfo,
                                resourceBasisPath: _vm.resourceBasisPath,
                                isSubmit: _vm.isSubmit,
                                pageType: _vm.pageType,
                              },
                            }),
                          ],
                          1
                        ),
                      ]
                    ),
                  ]),
            ])
          : _vm._e(),
        _vm._v(" "),
        _vm.isShowAnalysis &&
        _vm.question.analysis &&
        (_vm.question.analysis.content ||
          (_vm.question.analysis.fileInfo &&
            _vm.question.analysis.fileInfo.fileUrl))
          ? _c(
              "div",
              {
                staticClass: "mt-6 flex-direction-column",
                attrs: { flex: "" },
              },
              [
                _c(
                  "div",
                  {
                    staticClass: "question-label",
                    staticStyle: { "line-height": "40px" },
                  },
                  [_vm._v("解析：")]
                ),
                _vm._v(" "),
                _c(
                  "div",
                  {
                    staticClass: "stem",
                    class: {
                      "analysis-content": _vm.question.analysis.content,
                    },
                    staticStyle: { "min-width": "0", flex: "1" },
                  },
                  [
                    _c("bc-view-common", {
                      attrs: {
                        border: false,
                        content: _vm.question.analysis.content,
                        fileInfo: _vm.question.analysis.fileInfo,
                        resourceBasisPath: _vm.resourceBasisPath,
                        isSubmit: _vm.isSubmit,
                        pageType: _vm.pageType,
                      },
                    }),
                  ],
                  1
                ),
              ]
            )
          : _vm._e(),
        _vm._v(" "),
        _vm.isShowKnowledge && _vm.question.knowledgePointVoList.length
          ? _c("div", { staticClass: "info-item", attrs: { flex: "" } }, [
              _c("div", { staticClass: "info-item--label" }, [
                _vm._v("知识点："),
              ]),
              _vm._v(" "),
              _c(
                "div",
                {
                  staticClass: "info-item--content",
                  staticStyle: { flex: "1" },
                },
                [
                  _vm.question.knowledgePointVoList &&
                  _vm.question.knowledgePointVoList.length
                    ? _vm._l(
                        _vm.question.knowledgePointVoList,
                        function (item) {
                          return _c(
                            "el-tag",
                            {
                              key: item.id,
                              staticStyle: {
                                "margin-right": "8px",
                                "margin-bottom": "8px",
                              },
                              attrs: { effect: "plain" },
                            },
                            [_vm._v(_vm._s(item.kpName))]
                          )
                        }
                      )
                    : [_c("span", [_vm._v("无")])],
                ],
                2
              ),
            ])
          : _vm._e(),
        _vm._v(" "),
        _vm.isShowAi == "0"
          ? _c("div", { staticClass: "AIbtn", on: { click: _vm.AIanalysis } }, [
              _c("img", {
                attrs: {
                  src: __$_require_static_images_leaflet_icons_ai_png__,
                  alt: "",
                },
              }),
            ])
          : _vm._e(),
      ]
    ),
  ])
};
var __vue_staticRenderFns__$4B = [];
__vue_render__$4B._withStripped = true;

  /* style */
  const __vue_inject_styles__$4B = undefined;
  /* scoped */
  const __vue_scope_id__$4B = "data-v-c6434d84";
  /* module identifier */
  const __vue_module_identifier__$4B = undefined;
  /* functional template */
  const __vue_is_functional_template__$4B = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4B = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4B, staticRenderFns: __vue_staticRenderFns__$4B },
    __vue_inject_styles__$4B,
    __vue_script__$4B,
    __vue_scope_id__$4B,
    __vue_is_functional_template__$4B,
    __vue_module_identifier__$4B,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4A = {
  name: 'XmlQuestionRender',
  components: {
    QuestionItem: __vue_component__$4B
  },
  // dicts: [
  //     "question_type",
  //     "difficulty",
  //     "examine_status",
  //     "answer_platform",
  //     "answer_situation",
  // ],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //属性中传递过来的块儿数据
    pBlockData: {},
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    isShowAi: {
      type: String,
      default: '1'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    isSubmit: {
      type: Boolean,
      default: true
    }
  },
  computed: {},
  provide: function () {
    return {
      wrapRoot: this
    };
  },
  watch: {
    pBlockData: {
      handler(newValue) {
        this.$nextTick(() => {
          this.blockData = Object.assign({}, this.blockData, newValue);
          this.questionSetList = this.blockData.questionSetList;
        });
      },
      deep: true,
      immediate: true
    }
  },
  data() {
    return {
      blockId: 'blockId' + Math.random(),
      //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
      blockData: {},
      //属性组件名
      propertyComponentsName: 'xml-question-property',
      radio1: null,
      questionSetList: [],
      currentInKey: null
    };
  },
  methods: {
    //AI解析
    setanalysis(item) {
      this.$emit('setanalysis', item);
    },
    submitAnswer(val) {
      if (!this.$route.query.templateId) {
        this.mode === 'preview' && this.$emit('submitAnswer', val);
      }
    },
    changeAnswer() {
      for (let i = 0; i < this.questionSetList.length; i++) {
        this.$refs['questionItem_' + this.questionSetList[i].id][0].changeAnswer();
      }
    },
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    uuid(prefix) {
      const s = [];
      const hexDigits = '0123456789abcdef';
      for (let i = 0; i < 36; i += 1) {
        s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
      }
      s[14] = '4';
      s[19] = hexDigits.substr(s[19] & 0x3 | 0x8, 1);
      const id = s.join('');
      return prefix ? prefix + '__' + id : id;
    }
  },
  created() {}
};

/* script */
const __vue_script__$4A = script$4A;
/* template */
var __vue_render__$4A = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      class: "xml-question-container-" + _vm.pageType,
      attrs: { id: _vm.blockId },
      on: { click: _vm.blockClick },
    },
    [
      _c("div", { staticClass: "question-box" }, [
        _c(
          "div",
          { staticClass: "question-item" },
          _vm._l(_vm.questionSetList, function (item, index) {
            return _c("QuestionItem", {
              key: item.id,
              ref: "questionItem_" + item.id,
              refInFor: true,
              staticClass: "mb-4 xml-group-item",
              attrs: {
                flex: "",
                inKey: _vm.uuid("qitem__"),
                question: item,
                "can-show-analysis": _vm.pBlockData.showAnalysis,
                "can-show-answer": _vm.pBlockData.showAnswer,
                "can-show-knowledge": _vm.pBlockData.showRecommend,
                border: index < _vm.questionSetList.length - 1 ? true : false,
                "question-number": index,
                "is-show-ai": _vm.isShowAi,
                resourceBasisPath: _vm.resourceBasisPath,
                pageType: _vm.pageType,
                isSubmit: _vm.isSubmit,
              },
              on: {
                submitAnswer: _vm.submitAnswer,
                setanalysis: _vm.setanalysis,
              },
            })
          }),
          1
        ),
      ]),
    ]
  )
};
var __vue_staticRenderFns__$4A = [];
__vue_render__$4A._withStripped = true;

  /* style */
  const __vue_inject_styles__$4A = undefined;
  /* scoped */
  const __vue_scope_id__$4A = "data-v-630ba314";
  /* module identifier */
  const __vue_module_identifier__$4A = undefined;
  /* functional template */
  const __vue_is_functional_template__$4A = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4A = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4A, staticRenderFns: __vue_staticRenderFns__$4A },
    __vue_inject_styles__$4A,
    __vue_script__$4A,
    __vue_scope_id__$4A,
    __vue_is_functional_template__$4A,
    __vue_module_identifier__$4A,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$4A.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('question-render', {
    prefix: options.prefix
  }), __vue_component__$4A);
};

var epub = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAoCAMAAAChHKjRAAAAAXNSR0IArs4c6QAAAjdQTFRFAAAAiXb/kG/0inD6inX6jW72jXL2eGLpe2fuinL2i3H3iHf6i3L5dmTvjHH3inP4inH2i3L2d2TuhW7vjHH5d2TqjnH5fWnyd2bskHb5jXX1jHH2i3H3i3H4i3H4d2Xsd2Xqi3H4cmLoi3L4inH3i3L3inL3i3L3jHL3hG3zi3L3jHL4jnT5i3L3i3L3jHH2bFPvbl/nb2DncF/ncVP1cWHncWHocWHpclP2cmLpc2Lpc2Lqc2Ppc2PqdGPpdGPqd1r1d1z0d2TreFv2eFz0eFz1eGDxeGbseVv1eVz1el31el32el71el72e133e1/2e2TxfGD1fGXxfWD3fWH2fmjxf2T2f2rwgGX3gGnygWX2gWb2gWb3gWrzgWzzgmb3gmf2gmzyg23zhGj3hGn2hGr2hGr3hG3zhWr3hWv2hWv3hWz3hW7zhW70hmz3h233h273iG34iG/3iW34iW74iW/3iXD3iXH2inD4inH3inP2i3D4i3H3i3H4i3L3i3L4i3P4jHL3jHL4jHP3jHP4jHT2jHT3jHrxjHryjXP4jXT3jXT5jXX3jXvyjnT5jnX4j3T5j3T6j3b3lYH2l4H4mIL4mYP4movynY/xpJL3pJfzpZL5pZjzqJX5q5n5r576saD6uaz3va/7zMT5zcP7z8X70Mb70sj708n708r71c381c761s382ND72db4393549z+4+H55+b66OL96+b+6+r67+v+8/L99PD/9vT+///9///+////0H5GmAAAADB0Uk5TAA0XMjI6OkZNVVpefX+HjJCRkpSeoausra2vs7W2t7i5v8TN1tbd3t/o6+7v8PH8u0jmrQAAAapJREFUOMtjYGBgYBZQ1sMAOpoKHAwIwF+HDfSlG9nzElADVGRuZScEVcNWiVORvY29KESRZDluRfb2VhJgRSp1OBQlgRTZW8uDFKnjUpRrZgtSZamER1Fji5MhSJG9qTgDgxoORXXd5e5mYGDMjltRXV9nTiIIxAkjKeoq8veFg5DK5rqWvgl9QDBRCklRacG8BfOhYMHs/Bq4hBySIu9Fe5DAXH+4hDRCUaXnqj3b12+EgE3rJidjVeS1ZM9ig4AgMAh1S+3HpWiFX2EJGBRXN9fhUrQyBFt0oylaahIWBQZ5bbgVrW2eMhUMyrLacCqCgx2TUnAr2gUFW1szcCpaHd7RCwLtkVlduB1uEREDAvGFXXWUBcFy5+x8MMgrwh2Yyxyy8sCgKDqtB6sijzV7dm7eAgHbNkxLwKaoznvhbqSkMjMYq6La2BlzZkHBnOmZ9VgVtVX4OLpCgUtgUzNWRXV1zS1w0Ig9CHADaZyZEwnIMGgQViTLoEpYkQiDWBUhNTXcDKwEDdJnZGAQJKCmgQtUQvHhVaPNCSkRWQSVdfWwAi1FHiagAgAPu3js6FbZbgAAAABJRU5ErkJggg==";

var resource = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAoCAMAAAChHKjRAAAAAXNSR0IArs4c6QAAAqNQTFRFAAAAiXb/kG/0inD6inX6jW72jXL2eGLpe2fuinL2i3H3iHf6i3L5dmTvjHH3inP4inH2i3L2d2TuhW7vjHH5d2TqjnH5fWnyd2bskHb5jXX1jHH2i3H3i3H4i3H4d2Xsd2Xqi3H4cmLoi3L4inH3i3L3inL3i3L3jHL3hG3zi3L3jHL4jnT5i3L3i3L3jHH2bl/nb2DncFfwcF/ncWHncWHocWHpcljxclnxcmLpc1f0c2Lpc2Lqc2Ppc2PqdGPpdGPqdVX3dVrydl7xd1n2d1r1d1r2d1z0d2TreFr2eFv2eFz2eGDweGDxeGbseVz2eV32el32e171e172e2H1e2PyfWD3fWH2fWL1fmH2fmL2fmP2f2P3f2T2gGrygWX2gWb2gWf2gWzxgWzzgmj2gmzyg2j3g2v1g23zg27xhGn3hGr2hG3zhHDxhW7zhW70hmv4hnHxh233h273h3D0h3LyiG73iW34iXD3iXH2inD3inH3inH4inP2i3D4i3H3i3L3i3P3i3P4jHL3jHL4jHL5jHP3jHP4jHT3jXP4jXP5jXT3jXT4jXT5jXf1jXryjnT5jnX4jnf3j3T5j3T6kX31kYDxkoLxk3v4k4PxlX74lYbxl4L2mInymYP4moT4m4n1n5HzoIz4oY35ppP5ppb2p5rzqZb5rp/4saH5s6P5s6T4tKX5tav1tqn4t6j5uan7urH1vKz8vrH5wbn2x7v7yL37yMH2yb77yb/6ycT2zMH7zMH8zML7zcj2zsT6zsT8z8X70Mb70Mv30sf80sn808741dL31dL41s3819D719P42M/929L93NX84N746OL+6Of67uj/8fH79PD/9fb8+Pn9+vf/+vn//fv//f3//f79/v3//v7////9///+////+rYR5QAAADB0Uk5TAA0XMjI6OkZNVVpefX+HjJCRkpSeoausra2vs7W2t7i5v8TN1tbd3t/o6+7v8PH8u0jmrQAAAe5JREFUOMtjYGBgYBZQ1sMAOpoKHAwIwN+ADUzIMXTgJaAGqMjM2l4IqoatGqciB1sHUYgiyUrcihwcrCXAilQacCjKAClysJEHKVLHpSjf1A6kylIJj6Lmdg8DkCIHE3EGBjUcihp6K/1MwcCYHbeihgmdeakgkCyMqai+HsZqnzB5AhBMkUJT1FYd6+Ud39CGIiiHoqitIth/3rats9zC65GVSSMp6ijyDl985M6DBzf2zA8IrmrDpqg7K2H5uQdQcHRRVHEbFkUpMy48QAJns4uxKIqZcw9Z0enEMiyKJkaUrr0GU3J4dmhWNxZF4RvOLshdexuk5Ni0zM2XlkRjUeSy/8GDM1MLt1w+MTNp9c0HD9Z7YlHkvwNkyIESZ6MV10GslYHYFO0Gu+aK4yaIs7ArOgSRnHQKQq/CpsjtJFjubvdBiKI1XlgUhS0Fy91q3Aumr/alYVHUHLLwPEhRw04geX9Xf3QPFkVtna4+yy4+eFBx6MH9fdPNIydiTQUNPeVWcRu3x647PtcisKsNe1IBRU2Bu1NVum9Qa3dDA05FDQ0tLW01dagJE1MRNkCkInXCimQYNAgrkmVQJaxIhEGslpCaem4GVoIG6TMyMAgSUNPEBSqh+PCq0eaElIgsgsq6eliBliIPE1ABAEFwqt5aEHsEAAAAAElFTkSuQmCC";

var image = {
  leaflet: {
    epub,
    resource
  }
};

//
// import { OuchnOss } from '@/api/business/file/OuchnOss'
// import { defaultCover } from '@/assets/remote'

var script$4z = {
  name: 'XmlResourceRender',
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //属性中传递过来的块儿数据
    pBlockData: {},
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    officePreviewPath: {
      type: String,
      default: ''
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  watch: {
    pBlockData: {
      handler(newValue) {
        this.$nextTick(() => {
          this.blockData = Object.assign({}, this.blockData, newValue);
        });
      },
      deep: true,
      immediate: true
    }
  },
  data() {
    return {
      ouchnOss: null,
      image,
      blockId: 'blockId' + Math.random(),
      //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
      blockData: {},
      //属性组件名
      propertyComponentsName: 'xml-resource-property'
    };
  },
  computed: {
    // isNotLocalView() {
    //   return !(process.env.VUE_APP_ENV === 'localview')
    // }
  },
  methods: {
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    countFileSize(fileSize) {
      if (!fileSize) return;
      if (fileSize < 1024) {
        return fileSize + 'B';
      } else if (fileSize < 1024 * 1024) {
        var temp = fileSize / 1024;
        temp = temp.toFixed(2);
        return temp + 'KB';
      } else if (fileSize < 1024 * 1024 * 1024) {
        var temp = fileSize / (1024 * 1024);
        temp = temp.toFixed(2);
        return temp + 'MB';
      } else {
        var temp = fileSize / (1024 * 1024 * 1024);
        temp = temp.toFixed(2);
        return temp + 'GB';
      }
    },
    downloadFile(item) {
      let data = {
        ...item
      };
      data.coverFileUrl = this.resourceBasisPath + data.coverFileUrl.split('./')[1];
      data.uploadFileUrl = this.resourceBasisPath + data.uploadFileUrl.split('./')[1];
      this.$emit('downloadFile', data);
    },
    // 无数据时
    noFileUrlClick() {
      this.$message.warning('没有目标文件');
    },
    downloadFileUrl(item, fileName) {
      let data = {
        ...item
      };
      if (item.uploadFileUrl.indexOf('http') === -1) {
        data.coverFileUrl = this.resourceBasisPath + data.coverFileUrl.split('./')[1];
        data.uploadFileUrl = this.resourceBasisPath + data.uploadFileUrl.split('./')[1];
      }
      if (this.mode == 'preview') {
        this.$emit('downloadFileUrl', {
          item,
          fileName,
          resourceType: this.blockData.resourceType
        });
      } else {
        this.$message.warning('资源仅支持在预览时下载');
      }
    },
    //  跳转office在线预览
    previewToPathClick(item) {
      console.log(item);
      if (this.mode == 'preview') {
        // if (item.fileFormat == 'pdf') {
        //   // const pdfUrl = '/pdfjs/web/viewer.html?file=' + encodeURIComponent(item.uploadFileUrl)
        //   this.$router.push({
        //     path: '/webView',
        //     query: {
        //       baseUrl: encodeURIComponent('/pdfjs/web/viewer.html?file=' + item.uploadFileUrl),
        //       title: item.title
        //     }
        //   })
        //   return
        // }
        if (item.fileFormat == 'zip' || item.fileFormat == 'rar' || item.fileFormat == '7z') return;
        if (item.fileFormat == '无') {
          this.$message.warning('没有目标文件');
          return;
        }
        if (item.fileFormat == '外部链接' && !item.link) {
          this.$message.warning('获取资源链接失败，请检查链接地址');
          return;
        }
        if (item.fileFormat == '外部链接') {
          window.open(item.link);
          return;
        }
        let url = this.resourceBasisPath + item.uploadFileUrl.split('./')[1];
        this.$emit('showFileReader', {
          fileFormat: item.fileFormat,
          fileUrl: url,
          title: item.title
        });
        // if (item.uploadFileUrl.indexOf('http') === -1) {
        //   window.open(
        //     (this.officePreviewPath ? this.officePreviewPath : 'https://view.officeapps.live.com/op/view.aspx?src=') +
        //       this.resourceBasisPath +
        //       item.uploadFileUrl.split('./')[1]
        //   )
        // } else {
        //   window.open(
        //     (this.officePreviewPath ? this.officePreviewPath : 'https://view.officeapps.live.com/op/view.aspx?src=') +
        //       item.uploadFileUrl
        //   )
        // }
      }
    }
  },
  created() {
    // if (this.isNotLocalView) {
    //   this.ouchnOss = new OuchnOss(true)
    // }
  }
};

var __$_require_static_images_default_over_resource_png__ = "f25e95524c42aff3.png";

var __$_require_static_images_leaflet_icons_download_bule_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAWCAYAAADafVyIAAAAAXNSR0IArs4c6QAAAkVJREFUSEvtlEtoE1EUhv9zJ6lpCkYzBl3oSouioosiWII2kwas4gMXdeFSt0ViR0lXmu6UNpN0IejGunGhIPjowlczWdiN6ELFhYgbG8RHJglYsWSSe2QC1dqal5CF4F0Nc8//f3P/O+cQ2ryozf5oCRBOWpPMiCiCgo+j/vfNfFxLAM2wXgPYCpZHTD1wtw2AXAagPjBHTH3N9H/AsgQ041+IqOcKu/3FXOBRLPBh6RHqnSByIe8TSmnFw7PrPi/WLftNtVThHKQcJaKL6dP+kcXFtQB9qdwuIWkGwDdzWF1dH5DMB8E8BWAVBCbNqHpiQfATIDBgRtUHznstVTgMKe84z8QYTetqvC7A2ew1Zjs98DqNFAHwrGTL8Ews8FUzrCcAgkLQzumo/2UoacWJcd7RMLA/M6zeXxpr3U7WjNx1gI4D4pNS4s2VDk4AOMlwdTPKhwRgAPgOLvea+toXf2q8hqMibFjjDOgALAAfAWwD8TswbSTglbRxIBNTs7W6uiGgmrNhHQNw47dsmW6ndf/RRuOiKYBj0p/4okkSzvwhMF0ydf9QI/PBm6zQ3on8lMuW2+c8HT1Ph1Y6MdRc/WP5HVJwt6mrtxqZa+PWVSjYR7uvFdiXraDk5i1mLPCmkbDZfc2wZgGsp+DlXNFbgM/uog2ZU7Uvq1njhbpQMv9WsNxEexLFMY8snZnvVJ6zVEbcJRQAu1W/X/Xc4bK9GFDsctxVRrl6yaGJ/D3FrhxkEsyEub93ryoVkuwlwdl5T9fgD6jm9+bSxCy2AAAAAElFTkSuQmCC";

var __$_require_static_images_leaflet_icons_resource_icon_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAeCAYAAAA/xX6fAAAAAXNSR0IArs4c6QAAAqdJREFUSEvFls9LVFEUx7/fOzZTiWPjFKhgUG5Mg0QNQQpRgpCC/ol+ULSwtlFQQctcucj8I2oRVAszDENwrMBRCWpTGdX8yNFsZsx74j5nnjqN43tPpbN73HPO59x7frxDFEg0Lo2EPi9gDwSHrGPiIyFPBWqwKcypQhs338wrR0X8TOr7IrwMQG3gRAPyMLiortXV8bcbUF7XAhoYEvIEwCmHToZQxZ4mMutQ31azgJOx5X6SV9wYk9LfWOW76sbGyk40Lk2AvAPgc2csqPfNLAWYjgGYAvEc8D1isPl9KT+cjC/3Eex1B1vRrlLfUa2+FJqOQPEmK1peFvPJaFxPA2jwAgwwjXqfMf9HBMQAKlK9ZFd67akBZgD4vQAJwZGyt6VMXwOZs6zsSNhVuhWggkZDmUl/SRnDL+lmbdtirmh25EnXRyAc5L6WCxZwa0XzA9Xq82Y3NOcCxS5TSJxKyFERMYnw0hYwheNQXrGy9aTnxg+pGGrUJ4esnJpmsz3a/Mn0dFYCh514KOc8Dvo+wFSpO+Ede3jrn2+Gv0ltZ0IfKOnD3Mw0O6HdsayK4bANlLnILICajOxGUvZjQYJYEr91i13MwtwqxJibnBUL6OtaoOcB4OKq2f8KtJ7URbReVNc8aSoyBEGXFy+ObdYXzcRtQG45NvakyLurOUxOHIOyJs7OSb7x8wSZi4wAOLFDxNXRZgPnJzqh5YW1GG6vCLTuZuj4auPb0FTkAQQXt5VHDDDYeskaNoWOZXZ8L8o5BKB9m6Drf8DFnEpqLAwpM3vqVqFj4J8zDLbH85wNcyUyugfzgb7c87rN6coStSDX86vFpsCCQroHoMPhE49C6xumQIrpO45cUuMN0OoclJw2yxqAcM5hHMQ0NJ9B6ccMts2UCuwvOp8JMVRGUysAAAAASUVORK5CYII=";

var __$_require_static_images_leaflet_icons_resource_elliptic_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIQAAAAaCAYAAAB2KPSUAAAAAXNSR0IArs4c6QAAB3VJREFUaEPtmttuJLcRhr+q7jlpd+WDhDgGBGOBXMW+i19gkQcP9gWcOztXARaGAMeBNra1kmamp8kKimzOQZqRRtqRIBsjgOKxe9isn1Wsvyjs//YrsLQCsl+N/Qosr8AeEHs8rKzAswaEmd1nfvcZ+xgwsG1fKiJbj932nbsa96SLuEHAy3OQtyCvQEYgfZD6HVLXyM8V0lPS2FqRSpCqq6vk9nNv68peL+XSXxZNyePv+ouwIrhouR66vJQPu/q8P2I+po15/CxiXwSsbbH2NdaAjcE+gL3Jv7H8OzfA8pQA2mph7lo4718j7PLuJOQ/gR68Q98PUBfsoEJ7FepC7CtaCzq5Sm1VUOpeRR2aXK6EKgqVempRL4t0OagKGlrU2zwFEClJUEC8zeeZ2mNqS+V132adgEyJpVx1gjPLbZ68LdWNWNXEmPuiGsHbvK41IRrB24IRqkhb9QmzQOvlWSAMD4itEZtIdHDNAnEaiA6koynx6jXxvxCvgWcFOLsCzYMAsSR8fz4J/ASq4Sl6PqDqV+i4ouop2o6pY01PKvr9GT2r6BPoo/RN6XnZc4PaIr1K6RPpI12y1NfD6CH0hFibUGPU4s9Ies4BUllSCimpORBiBoiRQZExkv7l/lv+pBNu3r0uf9x+JeH7m0u/QRBXGkYQJYjRGrQIbS5rizFDmAk5x2hSUpoQaURTXyuRGRVNyiNNKgeapsfMAo22zOoR7SwSR4HQBOLhlDA5IZ5CWAJMAstDQLIVIDoApMX8DvSLU2oXfNOjflnTu2oY1IGh1oxCZCjKUCKDoAzVGCIMzThQGJkwwuIIOPB2zOs+RjIIXPBQuWVIQjbqIugVgecxLtSKLHw3Fl4vyQ110hQZDEvJ0tjbv93NgMzVeVHrSTPIQs1HwA2Dg8Sf8HpIbTmFOWA64IjQOnhw0PjYOUCsQZggjDEmwBWiYzHGEcYiXHl7FCZVZGLK1CKTSpnElnFbMTnoM71omfVntA6Un09ov83zyIDe4uyycVEKCN6Cvn5H3R7Sp89g1nJgkRcYL4GXKa94JXAY4VCIrzBeeZ/BgYi4wAdAv0u+27Pwc1vSAL7bMfxU4IK+KcTVNv/CLGwXW9b/cxPVbfyVs8k1ZbDVRrhm25NlXHpPKee8nCskm5MONOWZOaCKcOa5g0OSqWmTBskpaxChmde9TZia2VgcLHCB8MHQDwrnBucEPiBcdH0Xolz2aq5omNbnNO9e077pALIJHOttqJn+AHV1xiDCyyB8ivAZwucSORLhGIlHGJ8Dn/o5UIQD890Owy45CAau2jshX9+9KhkAPodOpd/YtdsKrjsSbHPaebQx9/Ecro8tgHFt475VdPPUgaZoG+9z8LhmmXbJNclEhLGZg8TPqfyK8D9M35txZsp7zOv8Uhm/KlyEY6ZfOwD9NHXXTjEzPT1lcDnkM4MvTfgK4SsjnmD8GZEjgU+MpAVeQAKB7/R6rsKLKs+7etlWrxPwfYT+aNJ8Ri9eB6zltgKUYppK7kBxjTIGLgXXHvyG2XuE/wh6ivGjeIKfXkz45eSE6XVQrAjDzcQP0KvOOI7KN1H4mxC/IYqD4hg4TLbfD3kZAAUERei3qelntOZ/iKmsM19Fmzg4PLn5cfNyjnGG2o+Gfq/GPzXyfTjm7GuYLZuPG4D47idGL4b8xYy/m9gbjL9CAoNrAgdCUf3PQU3/IST7CB9RwFIA4sBwzXGG8C8xeSvCPy4n/PvbL/3AuiDK9oB4BGk8g1fuDhB7k/EMxLndFB7fZHSM48ccKgs3kPmB/aFyO9GujrrvobJwH7s/VJZ5uaexye3U6C4nx1g8cjcU+GSD2+nuZ+IZls4dy6TR3u1cAGE7tzO7opmnIJFX69zO35KbKeru5llUzj7K7VwCRaGl1xFTTki5y7mOmDqck1bulmZiqpBQOc809E1iasE+PiYxdV83d1PgaTfE1ILRXEdMFeE7ADJRZR4X47KQT4aebyCmLkW52AkxdV3PPYi6NoZBGDh1LcYoCqNEXZuzl3FkMBJJdaevV6jrFKNwcCxILXdvPVahHqvozFHRNpm6dpJrYaJSuWMzS3v2ihZk2N3qPNPXxe/PFpVEGi12dCGQfNxm6nqh1jtyKcU/csyji21k6lqEiRnORo7NNFHWTl2rMTZhnKhrY2o+7imp69tW66HBLVr6vS6gtS645ZpEhV6MDDzvYhtOc/c88IV4QOvu4JZ5NDRHNCWV57S3OKDuDGyVb18EuCyBIlHSOQ5hHgn18pbBrdYDWF2QK9HS0ZipMvXcd/6m4NbMA101zbMKbt29lW4Pf3tAzO837CL8HdsUBk9RzBQGXxP+jlmTpABWAcM8JO7k76J946elsLfTyNUi1F1AkdrBtIt+PkX42+9PLAWqSoxkPv9tAlfbyPG+9nSbd25e5PU3oFbYzYdekPF7Ff7D5VLM8kWZ5Qsy216OKR+xfEmmXIDxvnJJpuR+j2F/Qeaj4HH3w/srdHev0a5HPKmG2PXk9+/b/QrsAbH7Nf1dv3EPiN+1+HY/+f8DdDLzV5L1opoAAAAASUVORK5CYII=";

var __$_require_static_images_leaflet_icons_download_white_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAAAjlJREFUSEvtlcurjWEUh59fSpFLJOUUcquDciuXRExkrkxMMDkGkpPEgAEDipJIIuU2MPAnKJLEQK4hhDoZSCEhcv1p7dbJbnf23t+3nW201+Sr911rPd+6vqJFsT0NeJ7mOyUdLONKZZSrdW1PBV7kWa+kI2V8/Qt4CvAyYVskHeuAG2Wgk+rC/WG701yDN062J0p6NVD+i6ba9gTgvaRv1X7qdrXtS8AqYI+kvbXwImDb64DzuVpnSnK/n0bgR8CsVNwnaXfNymzYXLY3AqfT5hcwVNLvIuAxwA2gO5X3S9rVb9goYtvrgbOpGyleKulOoVSHku3hwGNgchodkrQ972YAz/J8q6Sjed4DnMzz78AiSfdrS9V0c9keD1wHAhRSidz2WOBdnvVIOlWT3oh0uaRbAzVnU3BGMQ64CUxPJ5slHbf9BRgGrAA+A7fz/gewWNLdehupEDjhAYi/n53OLgArgS7gakQHDAG+AkskPWi0BguDEz4y0z6njtOALpD0pBE07kqBqxruIRDjVC0/gfmS4q6plAYnfFTWs7/mUdOItBC0ErHtgG8D3ko61/RXU8H26KxtfNdIulfCdlmA1wIX06hL0uuiDlrRsx1N+jHAO4AD6aRb0tNWHBa1yb3wJsC9wOH/GPGISlltbwDOJHhus/krGlk9Pdsxkh8CPAnoS8XLwGpJ8Zq0RWyfADZVxsl2PF/xjIV8Aq4B7YDPAyLQvwvE9hVgIRA1aKfEdutraYEMxl/9AUsz/weMzneQAAAAAElFTkSuQmCC";

/* script */
const __vue_script__$4z = script$4z;
var __vue_render__$4z = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      class: "xml-resource-container-" + _vm.pageType,
      attrs: { id: _vm.blockId },
      on: { click: _vm.blockClick },
    },
    [
      _c("div", { staticClass: "resource-box" }, [
        _c(
          "div",
          {
            class: [
              "preview-container-resource",
              "preview-container-resource-" + _vm.mode,
            ],
          },
          [
            _vm.blockData.styleMode == "A" || !_vm.blockData.styleMode
              ? _c(
                  "div",
                  [
                    _vm.blockData.resourceSetList &&
                    _vm.blockData.resourceSetList.length
                      ? _vm._l(
                          _vm.blockData.resourceSetList,
                          function (item, index) {
                            return _c(
                              "div",
                              {
                                key: index,
                                staticClass:
                                  "workbench-shop-item resource-style1 xml-group-item",
                              },
                              [
                                _c(
                                  "div",
                                  {
                                    staticClass:
                                      "shop-item-img slip-over-cover",
                                    on: {
                                      click: function ($event) {
                                        return _vm.previewToPathClick(item)
                                      },
                                    },
                                  },
                                  [
                                    _c("el-image", {
                                      staticClass:
                                        "shop-item-img-resource xml-round-6",
                                      attrs: {
                                        src: item.coverFileUrl
                                          ? item.coverFileUrl.indexOf("./") !==
                                            -1
                                            ? _vm.resourceBasisPath +
                                              item.coverFileUrl.split("./")[1]
                                            : item.coverFileUrl
                                          : __$_require_static_images_default_over_resource_png__,
                                      },
                                    }),
                                  ],
                                  1
                                ),
                                _vm._v(" "),
                                _c("div", { staticClass: "shop-item-desc" }, [
                                  _c("div", { staticClass: "filecont" }, [
                                    _c(
                                      "div",
                                      {
                                        staticClass:
                                          "xml-resource-title shop-item-desc-title preview-item-file",
                                        on: {
                                          click: function ($event) {
                                            return _vm.previewToPathClick(item)
                                          },
                                        },
                                      },
                                      [
                                        _vm._v(
                                          "\n                  " +
                                            _vm._s(
                                              item.title
                                                ? item.title
                                                : "资源样例"
                                            ) +
                                            "\n                "
                                        ),
                                      ]
                                    ),
                                    _vm._v(" "),
                                    _c(
                                      "div",
                                      { staticClass: "shop-item-desc-detail" },
                                      [
                                        _vm._v(
                                          "\n                  文件格式：" +
                                            _vm._s(
                                              item.fileFormat
                                                ? item.fileFormat
                                                : "无"
                                            ) +
                                            "\n\n                  "
                                        ),
                                        _vm.blockData.resourceType == "0" &&
                                        item.source != ""
                                          ? _c(
                                              "div",
                                              {
                                                staticClass: "pointer",
                                                on: {
                                                  click: function ($event) {
                                                    return _vm.downloadFileUrl(
                                                      item,
                                                      item.title +
                                                        "." +
                                                        item.fileFormat
                                                    )
                                                  },
                                                },
                                              },
                                              [
                                                _c("img", {
                                                  staticClass:
                                                    "shop-item-img-resource",
                                                  attrs: {
                                                    src: __$_require_static_images_leaflet_icons_download_bule_png__,
                                                  },
                                                }),
                                                _vm._v(
                                                  "立即下载\n                  "
                                                ),
                                              ]
                                            )
                                          : _vm._e(),
                                      ]
                                    ),
                                    _vm._v(" "),
                                    _c(
                                      "div",
                                      { staticClass: "shop-item-desc-detail" },
                                      [
                                        _vm._v(
                                          "\n                  文件大小：" +
                                            _vm._s(
                                              _vm.countFileSize(item.fileSize)
                                                ? _vm.countFileSize(
                                                    item.fileSize
                                                  )
                                                : "无"
                                            ) +
                                            "\n                "
                                        ),
                                      ]
                                    ),
                                  ]),
                                ]),
                              ]
                            )
                          }
                        )
                      : [
                          _c(
                            "div",
                            {
                              staticClass:
                                "workbench-shop-item resource-style1 xml-group-item",
                            },
                            [
                              _c("div", { staticClass: "shop-item-img" }, [
                                _c("img", {
                                  staticClass: "shop-item-img-resource",
                                  attrs: {
                                    src: __$_require_static_images_default_over_resource_png__,
                                  },
                                }),
                              ]),
                              _vm._v(" "),
                              _c("div", { staticClass: "shop-item-desc" }, [
                                _vm._m(0),
                                _vm._v(" "),
                                _vm.blockData.resourceType == "0"
                                  ? _c(
                                      "div",
                                      { staticClass: "shop-item-desc-detail" },
                                      [
                                        _c("div", [
                                          _c("img", {
                                            staticClass:
                                              "shop-item-img-resource",
                                            attrs: {
                                              src: __$_require_static_images_leaflet_icons_download_bule_png__,
                                            },
                                          }),
                                          _vm._v("立即下载\n                "),
                                        ]),
                                      ]
                                    )
                                  : _vm._e(),
                              ]),
                            ]
                          ),
                        ],
                  ],
                  2
                )
              : _vm._e(),
            _vm._v(" "),
            _vm.blockData.styleMode == "B"
              ? _c(
                  "div",
                  [
                    _vm.blockData.resourceSetList &&
                    _vm.blockData.resourceSetList.length
                      ? _vm._l(
                          _vm.blockData.resourceSetList,
                          function (item, index) {
                            return _c(
                              "div",
                              {
                                key: index,
                                staticClass:
                                  "style-mode__item--body xml-group-item",
                              },
                              [
                                _c("div", { staticClass: "right" }, [
                                  _c(
                                    "div",
                                    {
                                      staticClass: "title",
                                      on: {
                                        click: function ($event) {
                                          return _vm.previewToPathClick(item)
                                        },
                                      },
                                    },
                                    [
                                      _c("img", {
                                        attrs: {
                                          src: __$_require_static_images_leaflet_icons_resource_icon_png__,
                                          alt: "",
                                        },
                                      }),
                                      _vm._v(" "),
                                      _c(
                                        "span",
                                        { staticClass: "xml-resource-title" },
                                        [
                                          _vm._v(
                                            _vm._s(
                                              item.title
                                                ? item.title
                                                : "资源样例"
                                            )
                                          ),
                                        ]
                                      ),
                                    ]
                                  ),
                                  _vm._v(" "),
                                  _c("div", { staticClass: "downloadbtn" }, [
                                    _vm.blockData.resourceType == "0" &&
                                    item.source != ""
                                      ? _c(
                                          "div",
                                          {
                                            staticClass: "pointer",
                                            on: {
                                              click: function ($event) {
                                                return _vm.downloadFileUrl(
                                                  item,
                                                  item.title +
                                                    "." +
                                                    item.fileFormat
                                                )
                                              },
                                            },
                                          },
                                          [
                                            _c("img", {
                                              staticClass:
                                                "shop-item-img-resource",
                                              attrs: {
                                                src: __$_require_static_images_leaflet_icons_download_bule_png__,
                                              },
                                            }),
                                            _vm._v(
                                              "立即下载\n                "
                                            ),
                                          ]
                                        )
                                      : _vm._e(),
                                  ]),
                                ]),
                                _vm._v(" "),
                                _c("div", { staticClass: "left" }, [
                                  _c(
                                    "div",
                                    {
                                      staticClass: "default-cover",
                                      on: {
                                        click: function ($event) {
                                          return _vm.previewToPathClick(item)
                                        },
                                      },
                                    },
                                    [
                                      _c("el-image", {
                                        staticClass:
                                          "shop-item-img-resource xml-round-6",
                                        attrs: {
                                          src: item.coverFileUrl
                                            ? item.coverFileUrl.indexOf(
                                                "./"
                                              ) !== -1
                                              ? _vm.resourceBasisPath +
                                                item.coverFileUrl.split("./")[1]
                                              : item.coverFileUrl
                                            : __$_require_static_images_default_over_resource_png__,
                                        },
                                      }),
                                    ],
                                    1
                                  ),
                                  _vm._v(" "),
                                  _c(
                                    "div",
                                    { staticClass: "cover-bot-elliptic" },
                                    [
                                      _c("img", {
                                        attrs: {
                                          src: __$_require_static_images_leaflet_icons_resource_elliptic_png__,
                                          alt: "",
                                        },
                                      }),
                                    ]
                                  ),
                                ]),
                              ]
                            )
                          }
                        )
                      : [
                          _c(
                            "div",
                            {
                              staticClass:
                                "style-mode__item--body xml-group-item",
                            },
                            [
                              _c("div", { staticClass: "right" }, [
                                _c("div", { staticClass: "title" }, [
                                  _c("img", {
                                    attrs: {
                                      src: __$_require_static_images_leaflet_icons_resource_icon_png__,
                                      alt: "",
                                    },
                                  }),
                                  _vm._v("资源名称\n              "),
                                ]),
                                _vm._v(" "),
                                _c("div", { staticClass: "downloadbtn" }, [
                                  _vm.blockData.resourceType == "0"
                                    ? _c("div", [
                                        _c("img", {
                                          staticClass: "shop-item-img-resource",
                                          attrs: {
                                            src: __$_require_static_images_leaflet_icons_download_bule_png__,
                                          },
                                        }),
                                        _vm._v("立即下载\n                "),
                                      ])
                                    : _vm._e(),
                                ]),
                              ]),
                              _vm._v(" "),
                              _c("div", { staticClass: "left" }, [
                                _c("div", { staticClass: "default-cover" }, [
                                  _c("img", {
                                    staticClass: "shop-item-img-resource",
                                    attrs: {
                                      src: __$_require_static_images_default_over_resource_png__,
                                    },
                                  }),
                                ]),
                                _vm._v(" "),
                                _c(
                                  "div",
                                  { staticClass: "cover-bot-elliptic" },
                                  [
                                    _c("img", {
                                      attrs: {
                                        src: __$_require_static_images_leaflet_icons_resource_elliptic_png__,
                                        alt: "",
                                      },
                                    }),
                                  ]
                                ),
                              ]),
                            ]
                          ),
                        ],
                  ],
                  2
                )
              : _vm._e(),
            _vm._v(" "),
            _vm.blockData.styleMode == "C"
              ? _c(
                  "div",
                  [
                    _vm.blockData.resourceSetList &&
                    _vm.blockData.resourceSetList.length
                      ? [
                          _c(
                            "div",
                            { staticClass: "style-mode__item--body" },
                            [
                              _c(
                                "el-row",
                                _vm._l(
                                  _vm.blockData.resourceSetList,
                                  function (item, index) {
                                    return _c(
                                      "el-col",
                                      { key: index, attrs: { span: 6 } },
                                      [
                                        _c(
                                          "div",
                                          {
                                            staticClass:
                                              "filecard xml-group-item",
                                          },
                                          [
                                            _c(
                                              "div",
                                              { staticClass: "default-cover" },
                                              [
                                                _c("el-image", {
                                                  staticClass:
                                                    "shop-item-img-resource xml-round-6",
                                                  attrs: {
                                                    src: item.coverFileUrl
                                                      ? item.coverFileUrl.indexOf(
                                                          "./"
                                                        ) !== -1
                                                        ? _vm.resourceBasisPath +
                                                          item.coverFileUrl.split(
                                                            "./"
                                                          )[1]
                                                        : item.coverFileUrl
                                                      : __$_require_static_images_default_over_resource_png__,
                                                  },
                                                }),
                                                _vm._v(" "),
                                                _vm.blockData.resourceType ==
                                                  "0" && item.source != ""
                                                  ? _c(
                                                      "div",
                                                      {
                                                        staticClass:
                                                          "downloadmask pointer",
                                                        on: {
                                                          click: function (
                                                            $event
                                                          ) {
                                                            return _vm.downloadFileUrl(
                                                              item,
                                                              item.title +
                                                                "." +
                                                                item.fileFormat
                                                            )
                                                          },
                                                        },
                                                      },
                                                      [
                                                        _c("img", {
                                                          staticClass:
                                                            "shop-item-img-resource",
                                                          attrs: {
                                                            src: __$_require_static_images_leaflet_icons_download_white_png__,
                                                          },
                                                        }),
                                                        _vm._v(
                                                          "\n                      立即下载\n                    "
                                                        ),
                                                      ]
                                                    )
                                                  : _vm._e(),
                                              ],
                                              1
                                            ),
                                            _vm._v(" "),
                                            _c(
                                              "div",
                                              {
                                                staticClass:
                                                  "xml-resource-title filename",
                                                on: {
                                                  click: function ($event) {
                                                    return _vm.previewToPathClick(
                                                      item
                                                    )
                                                  },
                                                },
                                              },
                                              [
                                                _vm._v(
                                                  "\n                    " +
                                                    _vm._s(
                                                      item.title
                                                        ? item.title
                                                        : "资源样例"
                                                    ) +
                                                    "\n                  "
                                                ),
                                              ]
                                            ),
                                          ]
                                        ),
                                      ]
                                    )
                                  }
                                ),
                                1
                              ),
                            ],
                            1
                          ),
                        ]
                      : [
                          _c(
                            "div",
                            { staticClass: "style-mode__item--body" },
                            [
                              _c(
                                "el-row",
                                [
                                  _c("el-col", { attrs: { span: 8 } }, [
                                    _c(
                                      "div",
                                      {
                                        staticClass: "filecard xml-group-item",
                                      },
                                      [
                                        _c(
                                          "div",
                                          { staticClass: "default-cover" },
                                          [
                                            _c("img", {
                                              staticClass:
                                                "shop-item-img-resource",
                                              attrs: {
                                                src: __$_require_static_images_default_over_resource_png__,
                                              },
                                            }),
                                            _vm._v(" "),
                                            _vm.blockData.resourceType == "0"
                                              ? _c(
                                                  "div",
                                                  {
                                                    staticClass: "downloadmask",
                                                  },
                                                  [
                                                    _c("img", {
                                                      staticClass:
                                                        "shop-item-img-resource",
                                                      attrs: {
                                                        src: __$_require_static_images_leaflet_icons_download_white_png__,
                                                      },
                                                    }),
                                                    _vm._v(
                                                      "\n                      立即下载\n                    "
                                                    ),
                                                  ]
                                                )
                                              : _vm._e(),
                                          ]
                                        ),
                                        _vm._v(" "),
                                        _c("div", { staticClass: "filename" }, [
                                          _vm._v(
                                            "资源名称资源名称资源名称资源名称资源名称"
                                          ),
                                        ]),
                                      ]
                                    ),
                                  ]),
                                ],
                                1
                              ),
                            ],
                            1
                          ),
                        ],
                  ],
                  2
                )
              : _vm._e(),
          ]
        ),
      ]),
    ]
  )
};
var __vue_staticRenderFns__$4z = [
  function () {
    var _vm = this;
    var _h = _vm.$createElement;
    var _c = _vm._self._c || _h;
    return _c("div", [
      _c("div", { staticClass: "shop-item-desc-title" }, [_vm._v("资源样例")]),
      _vm._v(" "),
      _c("div", { staticClass: "shop-item-desc-detail" }, [
        _vm._v("文件格式：无"),
      ]),
      _vm._v(" "),
      _c("div", { staticClass: "shop-item-desc-detail" }, [
        _vm._v("文件大小：0"),
      ]),
    ])
  },
];
__vue_render__$4z._withStripped = true;

  /* style */
  const __vue_inject_styles__$4z = undefined;
  /* scoped */
  const __vue_scope_id__$4z = "data-v-2be4d8c2";
  /* module identifier */
  const __vue_module_identifier__$4z = undefined;
  /* functional template */
  const __vue_is_functional_template__$4z = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4z = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4z, staticRenderFns: __vue_staticRenderFns__$4z },
    __vue_inject_styles__$4z,
    __vue_script__$4z,
    __vue_scope_id__$4z,
    __vue_is_functional_template__$4z,
    __vue_module_identifier__$4z,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$4z.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('resource-render', {
    prefix: options.prefix
  }), __vue_component__$4z);
};

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

var script$4y = {
  name: 'PdfView',
  props: {
    show: {
      type: Boolean,
      default: false
    },
    baseUrl: {
      type: String,
      default: ''
    },
    textInfo: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      src: encodeURI('http://ouchn-textbook-public.oss-cn-qingdao.aliyuncs.com/ouchn-test-paper-web/stem-files/faf5276a-e523-4df1-8d11-ac858c954cf3.pdf'),
      loading: false,
      width: 300,
      height: 900
    };
  },
  methods: {
    onBackClick() {
      this.$emit('handleClose', false);
    }
  }
};

var __$_require_static_images_leaflet_icons_back_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAABACAYAAAB2kAXpAAAAAXNSR0IArs4c6QAABABJREFUaEPVmluopmMUx39/UUy44cJMg+FikEMuGMnIOJcwlHIYpKkZmchxuJDT5MIpIzXIpMkhh5QwlPPx0uHKhbiYKCJXSMTor7U9W4/t29/3rP3t55usm137+z/v+r3Pca31vGIHme19gVXAEuBXYKukd6ZxtCO4bJ8HPAHsNsP/RknXxf8mDmZ7NfDYkA65UtKmiYLZvhp4YMQofSVpycTAbN8M3NkwdbZL2mUiYLbvBW5ogArJ15L27w5m+yHgikaokK2WtKUrmO2ngQsTUBsk3dZ1Vdp+EViZgFov6b5u+5jtnYE3gBMTUOskPVzr53UobS8A3gWWJaBWSYoh/5fNG5jtfYA4Ug5JQJ0j6aVB+nkBs70f8CEQf1tsO3CqpPdmE48NZvswIBzs1UJUDuwTJH00TD8WmO2jgbeBPRqhfgBOkvTZKP2cwWyvKFA7jXJSfv8GOF7Sthb9nMBsx/4U+1SrfQ6skPR9a4M0mO1LgcdbHQAxl2Ki/5hok4vHbK8DNiUcxPZxmqQ/E22mpM09Zvsm4K6EgwiVz07o8xus7TuAWxNOnpF0UUL/H+nIHrP9IHBVwslmSWsT+oHSoWC2twCXJZzcL+n6hH5W6axgtl8Azk04uV1SDPm82EAw26/Hakp4uFbSqCQj8bgZq7KELW8BxyaeslbS5oS+SfpPj9neE3gfOLKp5d+iCyQ9l9A3S6fASroeEcKBzS3hLEmvJPQpqWwvLWHLwsaWv5cj5oNG/ZxkAfZTImz5uRzGn87JW6JRgLlR/20kGJK+aNSPJWsF+wRYLum3sbwlGv/vweJdYyhPlhRBX3eLHvsDiCS1xX4pk//jFvE4mgA7puSDkay2WLxIBH+zpl4tDxmlmd5gDy9we49qUP2+UtLLCX1KWh9JB5SNtjVpDUd9j6TpVylpfhzihyZer+8hXsHtXgojRyXg+oY9FVys0jdjBSbg+geKFeBW4MwEXP/QuoJ7Fjg/Adc/GangHgEuT8D1T98quHuA9Qm4/glvBXcLsCEBFyWC0yVFoS5lIxPemU+zfQ2wMeElztVTuhZVqp5bAzyagOtfhqrgYqXGim21/oW7Cu4MIDKl1inRv9RZwR0HxPm6a2PXxW1u3+JwBRdJciTLkTS3WP9yegV3UInpFrWQFU3fC4gKbjEQiXDEdq3W98qmgouLiNhYj2glA/peclVw8XVA3MAtT8D1vRasQWy/FkdSAq7/RWrVe88D8Z1Fq10i6anWjbH1oQN1yVrul5KWTgQsaBPV78l93lANa3x3Ed9fDLPvJC2cWI9VcDcCdw8hm1qdEwcrwxphelzOz/T/pKS4RGuOCsaa/IMa2z4YuLicElHVfLWu6f4FuhpYUNovLf0AAAAASUVORK5CYII=";

/* script */
const __vue_script__$4y = script$4y;
var __vue_render__$4y = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      directives: [
        {
          name: "show",
          rawName: "v-show",
          value: _vm.show,
          expression: "show",
        },
      ],
      staticClass: "xml-epub-pdf-view",
    },
    [
      _c("div", { staticClass: "xmlPreviewSearch-title" }, [
        _c("img", {
          staticClass: "img",
          attrs: {
            src: __$_require_static_images_leaflet_icons_back_png__,
          },
          on: { click: _vm.onBackClick },
        }),
        _vm._v(" "),
        _c("div", { staticClass: "xmlPreviewSearch-sou" }, [
          _vm._v(_vm._s(_vm.textInfo)),
        ]),
      ]),
      _vm._v(" "),
      _c(
        "div",
        {
          directives: [
            {
              name: "loading",
              rawName: "v-loading",
              value: _vm.loading,
              expression: "loading",
            },
          ],
          staticClass: "mod-config",
          staticStyle: { height: "calc(100vh - 60px)", width: "100%" },
          attrs: {
            "element-loading-text": "拼命加载中",
            "element-loading-spinner": "el-icon-loading",
            "element-loading-background": "rgba(0, 0, 0, 0.8)",
          },
        },
        [
          _c("iframe", {
            staticClass: "xml-iframe-web-view",
            attrs: { frameborder: "0", src: _vm.baseUrl },
          }),
        ]
      ),
    ]
  )
};
var __vue_staticRenderFns__$4y = [];
__vue_render__$4y._withStripped = true;

  /* style */
  const __vue_inject_styles__$4y = undefined;
  /* scoped */
  const __vue_scope_id__$4y = undefined;
  /* module identifier */
  const __vue_module_identifier__$4y = undefined;
  /* functional template */
  const __vue_is_functional_template__$4y = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4y = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4y, staticRenderFns: __vue_staticRenderFns__$4y },
    __vue_inject_styles__$4y,
    __vue_script__$4y,
    __vue_scope_id__$4y,
    __vue_is_functional_template__$4y,
    __vue_module_identifier__$4y,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4x = {
  name: 'XmlEbookRender',
  components: {
    PdfView: __vue_component__$4y
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'preview';
      }
    },
    //属性中传递过来的块儿数据
    pBlockData: {},
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  watch: {
    pBlockData: {
      handler(newValue) {
        console.log('XmlEbook组件(ruleIndex:' + this.ruleIndex + ')，watch触发，变量pBlockData：', newValue);
        this.$nextTick(() => {
          this.blockData = Object.assign({}, this.blockData, newValue);
          // this.ebookSetList=Object.assign({},this.blockData.ebookSetList);
        });
      },
      deep: true,
      immediate: true
    }
  },
  data() {
    return {
      image,
      blockId: 'blockId' + Math.random(),
      //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
      blockData: {},
      //属性组件名
      propertyComponentsName: 'xml-ebook-property',
      showPdf: false,
      baseUrl: '',
      textInfo: ''
      // ebookSetList:[]
    };
  },
  methods: {
    handleClose() {
      this.showPdf = false;
    },
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    goRead(info) {
      console.log('🚀 ~ goRead ~ info:', info);
      if (this.mode === 'preview') {
        if (info.source != 'netlink') {
          const baseUrl = info.uploadFileUrl.indexOf('./') !== -1 ? this.resourceBasisPath + info.uploadFileUrl.split('./')[1] : info.uploadFileUrl;
          this.$emit('showFileReader', {
            fileFormat: info.fileFormat,
            fileUrl: baseUrl,
            title: info.name || info.title
          });
          // if (info.uploadFileUrl) {
          //   if (info.uploadFileUrl.indexOf('.epub') > 0) {
          //     this.baseUrl = 'epubjs/index.html#/epub-read?flow=scrolled&bookPath=' + baseUrl
          //     this.showPdf = true
          //     this.textInfo = info.name||info.title
          //   } else {
          //     // const baseUrl = this.resourceBasisPath + info.uploadFileUrl.split('./')[1]
          //     this.baseUrl = `/pdfjs/web/viewer.html?file=${baseUrl}`
          //     this.showPdf = true
          //     this.textInfo = info.name||info.title
          //   }
          // }
        } else {
          if (info.link) {
            window.open(info.link, '_blank');
            // this.$emit('showPdfRead', { type: 'link', url: info.link, pageType: this.pageType })
          } else {
            this.$message.warning('获取资源链接失败，请检查链接地址');
          }
        }
      }
    }
  },
  created() {
    // this.blockData = Object.assign( this.blockData,this.pBlockData)
  }
};

var __$_require_static_images_default_over_ebook_png__ = "2539d578aeabf7c9.png";

/* script */
const __vue_script__$4x = script$4x;
var __vue_render__$4x = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      class: ["xml-ebook-container", "xml-ebook-container-" + _vm.pageType],
      attrs: { id: _vm.blockId },
      on: { click: _vm.blockClick },
    },
    [
      _vm.blockData.styleMode === "A"
        ? _c(
            "div",
            { staticClass: "resource-box xml-group-item" },
            _vm._l(_vm.blockData.ebookSetList, function (item, index) {
              return _c(
                "div",
                {
                  key: index + Math.random(),
                  staticClass: "workbench-shop-item",
                  on: {
                    click: function ($event) {
                      return _vm.goRead(item)
                    },
                  },
                },
                [
                  _c("el-image", {
                    staticClass: "shop-item-img-resource-first xml-round-6",
                    attrs: {
                      src: item.coverFileUrl
                        ? item.coverFileUrl.indexOf("./") !== -1
                          ? _vm.resourceBasisPath +
                            item.coverFileUrl.split("./")[1]
                          : item.coverFileUrl
                        : __$_require_static_images_default_over_ebook_png__,
                    },
                  }),
                  _vm._v(" "),
                  _c("div", { staticClass: "shop-item-desc" }, [
                    _c(
                      "div",
                      {
                        directives: [
                          {
                            name: "show",
                            rawName: "v-show",
                            value: item.name,
                            expression: "item.name",
                          },
                        ],
                        staticClass: "xml-ebook-title shop-item-desc-title",
                      },
                      [_vm._v(_vm._s(item.name))]
                    ),
                    _vm._v(" "),
                    _c(
                      "div",
                      {
                        directives: [
                          {
                            name: "show",
                            rawName: "v-show",
                            value: item.author,
                            expression: "item.author",
                          },
                        ],
                        staticClass: "shop-item-desc-detail",
                      },
                      [_vm._v("作者：" + _vm._s(item.author))]
                    ),
                    _vm._v(" "),
                    _c(
                      "div",
                      {
                        directives: [
                          {
                            name: "show",
                            rawName: "v-show",
                            value: item.publisher,
                            expression: "item.publisher",
                          },
                        ],
                        staticClass: "shop-item-desc-detail",
                      },
                      [_vm._v("出版社：" + _vm._s(item.publisher))]
                    ),
                    _vm._v(" "),
                    _c(
                      "div",
                      {
                        directives: [
                          {
                            name: "show",
                            rawName: "v-show",
                            value: item.isbn,
                            expression: "item.isbn",
                          },
                        ],
                        staticClass: "shop-item-desc-detail",
                      },
                      [_vm._v("ISBN:" + _vm._s(item.isbn))]
                    ),
                  ]),
                ],
                1
              )
            }),
            0
          )
        : _vm._e(),
      _vm._v(" "),
      _vm.blockData.styleMode === "B"
        ? _c(
            "div",
            { staticClass: "resource-box xml-group-item" },
            _vm._l(_vm.blockData.ebookSetList, function (item, index) {
              return _c(
                "div",
                {
                  key: index + Math.random(),
                  staticClass: "workbench-shop-item styleB",
                },
                [
                  _c("iframe", {
                    attrs: {
                      width: "100%",
                      height: "600",
                      src:
                        item.uploadFileUrl.indexOf(".epub") !== -1
                          ? "epubjs/index.html#/epub-read?flow=scrolled&bookPath=" +
                            item.uploadFileUrl
                          : item.uploadFileUrl.indexOf(".pdf") !== -1
                          ? "/pdfjs/web/viewer.html?file=" + item.uploadFileUrl
                          : item.uploadFileUrl,
                      frameborder: "0",
                    },
                  }),
                  _vm._v(" "),
                  _c("div", { staticClass: "xml-ebook-title title" }, [
                    _vm._v(_vm._s(item.name)),
                  ]),
                ]
              )
            }),
            0
          )
        : _vm._e(),
      _vm._v(" "),
      _vm.blockData.styleMode === "C"
        ? _c(
            "div",
            { staticClass: "resource-box resource-box-sytleC xml-group-item" },
            _vm._l(_vm.blockData.ebookSetList, function (item, index) {
              return _c(
                "div",
                {
                  key: index + Math.random(),
                  staticClass: "workbench-shop-item",
                  on: {
                    click: function ($event) {
                      return _vm.goRead(item)
                    },
                  },
                },
                [
                  _c("el-image", {
                    staticClass: "shop-item-img-resource xml-round-6",
                    attrs: {
                      src: item.coverFileUrl
                        ? item.coverFileUrl.indexOf("./") !== -1
                          ? _vm.resourceBasisPath +
                            item.coverFileUrl.split("./")[1]
                          : item.coverFileUrl
                        : __$_require_static_images_default_over_ebook_png__,
                    },
                  }),
                  _vm._v(" "),
                  _c("span", { staticClass: "xml-ebook-title" }, [
                    _vm._v(_vm._s(item.name)),
                  ]),
                ],
                1
              )
            }),
            0
          )
        : _vm._e(),
      _vm._v(" "),
      _vm.blockData.styleMode === "D"
        ? _c(
            "div",
            { staticClass: "resource-box resource-box-sytleD xml-group-item" },
            _vm._l(_vm.blockData.ebookSetList, function (item, index) {
              return _c(
                "div",
                {
                  key: index + Math.random(),
                  staticClass: "ebook_style_4 workbench-shop-item",
                  on: {
                    click: function ($event) {
                      return _vm.goRead(item)
                    },
                  },
                },
                [
                  _c(
                    "div",
                    { staticClass: "left" },
                    [
                      _c("el-image", {
                        attrs: {
                          src: item.coverFileUrl
                            ? item.coverFileUrl.indexOf("./") !== -1
                              ? _vm.resourceBasisPath +
                                item.coverFileUrl.split("./")[1]
                              : item.coverFileUrl
                            : __$_require_static_images_default_over_ebook_png__,
                        },
                      }),
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c(
                    "div",
                    { staticClass: "right" },
                    [
                      _c(
                        "el-tooltip",
                        {
                          staticClass: "item",
                          attrs: { effect: "dark", placement: "top-start" },
                        },
                        [
                          _c(
                            "div",
                            {
                              staticClass: "title-popper",
                              attrs: { slot: "content" },
                              slot: "content",
                            },
                            [_vm._v(_vm._s(item.name))]
                          ),
                          _vm._v(" "),
                          _c(
                            "div",
                            { staticClass: "xml-ebook-title title-box" },
                            [_vm._v(_vm._s(item.name))]
                          ),
                        ]
                      ),
                      _vm._v(" "),
                      _c("div", { staticClass: "book_info" }, [
                        _vm._v(
                          "文件大小：" +
                            _vm._s(_vm._f("bytesToSizeNew")(item.fileSize))
                        ),
                      ]),
                    ],
                    1
                  ),
                ]
              )
            }),
            0
          )
        : _vm._e(),
      _vm._v(" "),
      _c("PdfView", {
        attrs: {
          show: _vm.showPdf,
          baseUrl: _vm.baseUrl,
          textInfo: _vm.textInfo,
        },
        on: { handleClose: _vm.handleClose },
      }),
    ],
    1
  )
};
var __vue_staticRenderFns__$4x = [];
__vue_render__$4x._withStripped = true;

  /* style */
  const __vue_inject_styles__$4x = undefined;
  /* scoped */
  const __vue_scope_id__$4x = "data-v-7ea50222";
  /* module identifier */
  const __vue_module_identifier__$4x = undefined;
  /* functional template */
  const __vue_is_functional_template__$4x = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4x = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4x, staticRenderFns: __vue_staticRenderFns__$4x },
    __vue_inject_styles__$4x,
    __vue_script__$4x,
    __vue_scope_id__$4x,
    __vue_is_functional_template__$4x,
    __vue_module_identifier__$4x,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$4x.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('ebook-render', {
    prefix: options.prefix
  }), __vue_component__$4x);
};

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

// import { Player, Video, Ui, ClickToPlay, Skeleton, Controls, ScrubberControl } from '@vime/vue'
var script$4w = {
  name: 'VmPlayer',
  // components: { Player, Video, Ui, ClickToPlay, Skeleton, Controls, ScrubberControl },
  props: {
    src: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      currentTime: 0
    };
  },
  computed: {
    player() {
      return this.$refs.player;
    }
  },
  mounted() {},
  watch: {},
  methods: {
    // Example function to showcase updating property.
    seekForward() {
      this.currentTime = this.currentTime + 5;
    },
    // Example function to showcase calling player method.
    enterFullscreen() {
      this.player.enterFulllscreen();
    },
    onTimeUpdate(time) {
      this.currentTime = time;
    },
    onFullscreenChange(active) {
    },
    onPlaybackReady() {
      // ...
    }
  }
};

/* script */
const __vue_script__$4w = script$4w;

/* template */
var __vue_render__$4w = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "Player",
    {
      ref: "player",
      attrs: {
        controls: "",
        autoplay: "",
        muted: "",
        playsinline: "",
        currentTime: _vm.currentTime,
      },
      on: {
        vPlaybackReady: _vm.onPlaybackReady,
        vmCurrentTimeChange: _vm.onTimeUpdate,
        vmFullscreenChange: _vm.onFullscreenChange,
      },
    },
    [
      _c("Video", [
        _c("source", { attrs: { "data-src": _vm.src, type: "video/mp4" } }),
      ]),
      _vm._v(" "),
      _c(
        "Ui",
        [
          _c("ClickToPlay"),
          _vm._v(" "),
          _c("Skeleton"),
          _vm._v(" "),
          _c(
            "Controls",
            { attrs: { fullWidth: "", activeDuration: 3200 } },
            [_c("ScrubberControl")],
            1
          ),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$4w = [];
__vue_render__$4w._withStripped = true;

  /* style */
  const __vue_inject_styles__$4w = undefined;
  /* scoped */
  const __vue_scope_id__$4w = undefined;
  /* module identifier */
  const __vue_module_identifier__$4w = undefined;
  /* functional template */
  const __vue_is_functional_template__$4w = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4w = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4w, staticRenderFns: __vue_staticRenderFns__$4w },
    __vue_inject_styles__$4w,
    __vue_script__$4w,
    __vue_scope_id__$4w,
    __vue_is_functional_template__$4w,
    __vue_module_identifier__$4w,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4v = {
  name: 'VideoPlayer',
  components: {
    VmPlayer: __vue_component__$4w,
    videoPlayer: VueVideoPlayer.videoPlayer
  },
  props: {
    src: {
      type: String,
      default: ''
    },
    // 这里接收父组件传来的src参数，视频的url
    loop: {
      type: Boolean,
      default: false
    },
    //控制循环还是单次播放
    canSkip: {
      type: Boolean,
      default: true
    },
    //是否允许控制播放进度
    playStyle: {
      type: String,
      default: 'yuan-wen'
    },
    //yuan-wen:原文播放；tan-chaung：弹窗播放；tiao-zhuan：跳转播放
    title: {
      type: String,
      default: ''
    },
    //视频标题
    link: {
      type: String,
      default: ''
    },
    //链接地址
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    aspectRatio: '16:9',
    poster: {
      type: String,
      default: ''
    },
    titlePosition: {
      type: String,
      default: ''
    },
    titleAlign: {
      type: String,
      default: ''
    },
    playerIndex: {
      type: Number,
      default: -1
    },
    content: {
      type: String,
      default: '暂无简介'
    },
    isEmptyPlaceholder: {
      type: Boolean,
      default: false
    },
    initialTime: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      // 用于存放<video>标签对象，方便调用原生API
      videoRef: null,
      videoContainer: null,
      // 是否暂停，用于控制播放与暂停
      isPaused: true,
      // 播放当前时间
      currentTime: '00:00',
      totalTime: '00:00',
      // 声音是否静音
      isMuted: false,
      scrollDuration: 0,
      isShow: true,
      // 是否全屏
      isFullScreen: false,
      controlsActive: false,
      isVideoEnd: false,
      stopDefaultEvent: false,
      lastOperateTimeStamp: '',
      timeData: null,
      isAmin: false,
      playerOptions: {
        playbackRates: [0.5, 1.0, 1.25, 1.5, 2.0],
        //播放速度
        autoplay: false,
        //如果true,浏览器准备好时开始回放。
        muted: false,
        // 默认情况下将会消除任何音频。
        loop: false,
        // 导致视频一结束就重新开始。
        preload: 'auto',
        // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频（如果浏览器支持）
        language: 'zh-CN',
        aspectRatio: this.aspectRatio,
        // 将播放器置于流畅模式，并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字（例如"16:9"或"4:3"）
        fluid: true,
        // 当true时，Video.js player将拥有流体大小。换句话说，它将按比例缩放以适应其容器。
        sources: [{
          type: '',
          //这里的种类支持很多种：基本视频格式、直播、流媒体等，具体可以参看git网址项目
          src: this.src
        }],
        poster: this.poster,
        //你的封面地址
        // width: document.documentElement.clientWidth, //播放器宽度
        notSupportedMessage: '获取视频失败，请检查链接地址',
        //允许覆盖Video.js无法播放媒体源时显示的默认信息。
        controlBar: {
          timeDivider: false,
          durationDisplay: true,
          remainingTimeDisplay: false,
          fullscreenToggle: true,
          //全屏按钮
          progressControl: true,
          volumePanel: {
            inline: false
          }
        }
      },
      playerEvents: ['fullscreenchange', 'timeupdate']
    };
  },
  computed: {
    durationVar() {
      return {
        '--scroll-duration': this.scrollDuration + 's',
        'text-align': this.titleAlign
      };
    },
    videoAndMusicStop() {
      let playState = sessionStorage.getItem('SET_PLAY_STATE');
      return playState;
    },
    isAsyncConvert() {
      return this.src.split('__')[0] === 'convertTask';
    },
    computedAlign() {
      let style = {};
      switch (this.titleAlign) {
        case 'left':
          style = {
            justifyContent: 'flex-start'
          };
          break;
        case 'center':
          style = {
            justifyContent: 'center'
          };
          break;
        case 'right':
          style = {
            justifyContent: 'flex-end'
          };
          break;
      }
      return style;
    }
  },
  mounted() {
    this.timeData = 'v' + Math.random();
    // 加载完毕后，先获取<video>标签DOM对象
    this.videoRef = this.$refs.videoRef;
    this.videoContainer = this.$refs.videoContainer;
    this.checkTitleScroll();
    if (this.mode === 'preview' && this.playStyle === 'yuan-wen') {
      this.$emit('resetTimeUpdate');
    }
  },
  watch: {
    title: {
      handler(n, o) {
        this.checkTitleScroll();
      }
    },
    titlePosition: {
      handler(n, o) {
        this.checkTitleScroll();
      }
    },
    poster: {
      handler(n, o) {
        !this.isAsyncConvert && this.$nextTick(function () {
          this.playerOptions.poster = n;
        });
      }
    },
    canSkip: {
      handler(n, o) {
        !this.isAsyncConvert && this.$nextTick(function () {
          // this.$refs.videoRef.src = n
          //alert(n);
          // this.playerOptions.controlBar.progressControl = n
        });
      },
      immediate: true
    },
    loop: {
      handler(n, o) {
        !this.isAsyncConvert && this.$nextTick(function () {
          // this.$refs.videoRef.src = n
          //alert(n);
          this.playerOptions.loop = n;
        });
      },
      immediate: true
    },
    src: {
      handler(n, o) {
        if (n == '') {
          this.isShow = false;
        } else {
          this.isShow = true;
        }
        !this.isAsyncConvert && this.$nextTick(function () {
          // this.$refs.videoRef.src = n
          this.playerOptions.sources[0].src = n;
        });
      },
      immediate: true
    },
    videoAndMusicStop(val) {
      let currentPlayStamp = val || '--';
      if (currentPlayStamp !== this.src + '__playTimeStamp__' + this.lastOperateTimeStamp) {
        this.videoRef.stopPlay();
        this.handlePause();
      }
    }
  },
  methods: {
    checkTitleScroll() {
      this.$nextTick(() => {
        if (this.$refs.previewTitleText) {
          let titleWidth = this.$refs.previewTitleText.offsetWidth;
          let parentWidth = this.$refs.parentTitle.offsetWidth;
          if (titleWidth >= parentWidth + 1) {
            this.isAmin = true;
            // this.$refs.previewTitleText.classList.value = 'animate-title'
            this.scrollDuration = titleWidth / 60 + 1;
          } else {
            this.isAmin = false;
          }
        }
      });
    },
    playsinLine() {
      let ua = navigator.userAgent.toLocaleLowerCase();
      //
      if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) {
        return false;
      } else {
        return true;
      }
    },
    toggleFullscreen(item, e) {
      // this.isFullScreen = !this.isFullScreen
      let videoParent = document.getElementById(item);
      videoParent.getElementsByTagName('video')[0].id;
      let bar = videoParent.querySelector('.vjs-control-bar');
      if (e.isFullscreen() == true) bar.className = 'vjs-control-bar fullscren';else {
        // alert(1);
        bar.className = 'vjs-control-bar';
      }
      this.videoPlayerDom = videoParent.getElementsByTagName('video')[0];

      //  if (this.wrapRoot && this.wrapRoot.currentInKey === this.inKey) {
      const data = {
        type: 'setIframeClass',
        value: e.isFullscreen()
      };
      window.parent.postMessage(data);
      //  }
      //this.isFullScreen = !this.isFullScreen;
      if (/AppleWebKit.*mobile/i.test(navigator.userAgent) || /MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent)) {
        if (window.location.href.indexOf('?mobile') < 0) {
          try {
            if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
              //   alert(1);

              this.videoPlayer.attr('x-webkit-airplay', 'true') //设置允许设备播放
              .attr('x5-playsinline', 'true') // 设置android在微信中内联播放视频
              .attr('x5-video-player-type', 'web') // 关闭同层X5内核播放器    x5-video-player-type='h5' 启用Ｈ5同层播放器
              // .attr('x5-video-player-fullscreen','true')  // 进入全屏通知
              .attr('x5-video-orientation', 'portrait'); //控制横竖屏 可选值： landscape 横屏, portraint竖屏  默

              return;
            } else if (/iPad/i.test(navigator.userAgent)) {
              //window.location.href="平板页面";
            } else {
              //window.location.href="其他移动端页面"
            }
          } catch (e) {}
        }
      }
      //this.videoPlayer.controls = false;
      //this.playerOptions.controls = true;
      //   bar.className = "vjs-control-bar";
    },
    onPlayerPlay(e) {
      let currentVideo = e.el_.children[0].getAttribute('id', 64);
      let videoList = document.getElementsByTagName('video');
      for (let i = 0; i < videoList.length; i++) {
        let id = videoList[i].getAttribute('id');
        if (currentVideo != id) {
          this.videoPlayerDom = videoList[i];
        }
      }

      //let audio = document.querySelectorAll('audio')
      //if (audio && audio.length) audio.forEach((i) => i.pause())
    },
    handlePlay(item, e) {
      // if (this.stopDefaultEvent) return
      // if (this.mode==='editor') {
      //   this.videoRef.pause()
      //   this.$message.warning('视频仅支持在预览模式下播放')
      //   return
      // }
      this.videoId = item;
      let videoParent = document.getElementById(item);
      let id = videoParent.getElementsByTagName('video')[0].id;
      this.videoPlayerDom = videoParent.getElementsByTagName('video')[0];
      item = id;
      this.isPaused = false;
      let audio = document.querySelectorAll('audio');
      if (audio && audio.length) {
        audio.forEach(i => i.pause());
      }
      let video = document.querySelectorAll('video');
      video.forEach(i => {
        if (i.id != item) {
          i.pause();
        }
      });
      this.setPlayStamp();
      if (this.playStyle === 'tiao-zhuan') {
        setTimeout(() => {
          videoParent.getElementsByTagName('video')[0].pause();
        }, 150);
        if (this.link) {
          window.location.href = this.link;
        } else {
          this.$message.warning('获取资源链接失败，请检查链接地址');
        }

        // window.open(this.src,"_blank")
      }
      if (this.playStyle === 'tan-chuang') {
        setTimeout(() => {
          videoParent.getElementsByTagName('video')[0].pause();
          videoParent.getElementsByTagName('video')[0].currentTime = 0;
          this.$refs.videoRef.player.src('');
        }, 300);
        this.$emit('showDialog', {
          url: this.src,
          title: this.title,
          content: this.content,
          poster: this.poster,
          playerIndex: this.playerIndex,
          initialTime: this.initialTime
        });
        setTimeout(() => {
          // videojs(videoParent.getElementsByTagName('video')[0]).trigger('loadstart')
          // this.$refs.videoRef.player.reset()
          this.$refs.videoRef.player.load();
          this.$refs.videoRef.player.src(this.src);
        }, 500);
      }
    },
    handlePause() {
      if (this.stopDefaultEvent) return;
      this.isPaused = true;
    },
    // 播放与暂停,注意,这里isPause的变化,对应图标的变化
    togglePlay(event) {
      if (this.mode === 'editor') ;
    },
    doPlay() {
      this.isPaused = !this.isPaused;
      this.stopDefaultEvent = true;
      if (this.isPaused) ; else {
        let audio = document.querySelectorAll('audio');
        if (audio && audio.length) {
          audio.forEach(i => i.pause());
        }
        let video = document.querySelectorAll('video');
        video.forEach(i => {
          if (i.id != this.timeData) {
            i.pause();
          }
        });
        // this.videoRef.play()
        this.setPlayStamp();
      }
      setTimeout(() => {
        this.stopDefaultEvent = false;
      }, 500);
    },
    setPlayStamp() {
      let timeStamp = new Date().getTime();
      this.lastOperateTimeStamp = timeStamp;
      let playStamp = `${this.src}__playTimeStamp__${timeStamp}`;
      // this.$store.commit('leaflet/SET_PLAY_STATE', this.src)
      // this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      sessionStorage.setItem('SET_PLAY_STATE', playStamp); //存储
    },
    rePlay() {
      // this.videoRef.play()
      this.isPaused = false;
      this.isVideoEnd = false;
    },
    // 停止播放
    stopPlay() {
      //this.videoRef.pause()
      this.videoRef.currentTime = 0;
      // 停止播放了，要将播放图标从暂停切换到播放,isPaused为true的时候，图标是播放
      this.isPaused = true;
    },
    playEnd() {
      if (!this.loop) {
        this.videoRef.currentTime = 0;
        this.isPaused = true;
        this.isVideoEnd = true;
      }
    },
    // 定义一个时间处理函数，例如将100秒，处理成1:40
    timeFormat(time) {
      let minute = Math.floor(time % 3600 / 60); // 取余
      let second = Math.floor(time % 60);
      minute = minute < 10 ? '0' + minute : minute;
      second = second < 10 ? '0' + second : second;
      return `${minute}:${second}`;
    },
    // 当事件oncanplay触发时，获取视频的总时间信息，然后通过timeFormat函数处理成00:00的格式，并渲染到template中
    getTotalTime() {
      this.currentTime = this.timeFormat(this.videoRef.currentTime);
      this.totalTime = this.timeFormat(this.videoRef.duration);
    },
    // 时间timeupdate触发时，更新当前播放时间
    timeUpdate(e) {
      // this.currentTime = this.timeFormat(this.videoRef.currentTime)
      // this.$emit('timeUpdate', { event: e, time: this.videoRef.currentTime })
      if (e.currentTime() >= this.initialTime) {
        this.currentTime = this.timeFormat(e.currentTime());
        this.$emit('timeUpdate', {
          event: e,
          time: e.currentTime()
        });
      } else {
        e.currentTime(this.initialTime);
      }
    },
    handleError(player) {
      if (player.error()?.message.includes('The media could not be loaded')) {
        player.error('服务器或网络错误, 视频资源无法加载');
        player.errorDisplay.contentEl_.innerText = '服务器或网络错误, 视频资源无法加载';
      }
    },
    playerReadied(player) {
      if (this.initialTime > 0) {
        player.currentTime(this.initialTime);
      }
    },
    // 声音是否静音
    toggleMuted() {
      this.isMuted = !this.isMuted;
      this.videoRef.muted = !this.videoRef.muted;
    },
    // 切换全屏,注意，这里进入全屏时，使用的元素是this.video，而不是this.myvideo。video是myvideo的父标签，这样控制条才能正确显示
    toggleFullScreen(event) {
      let fullscreen = document.webkitIsFullScreen || document.fullscreen;
      this.isFullScreen = fullscreen;
      if (!this.isFullScreen) {
        this.isFullScreen = !this.isFullScreen;
        const inFun = this.videoContainer.requestFullscreen || this.videoContainer.webkitRequestFullScreen;
        inFun.call(this.videoContainer);
      } else {
        this.isFullScreen = !this.isFullScreen;
        const exitFun = document.exitFullscreen || this.document.webkitExitFullScreen;
        exitFun.call(document);
      }
    }
  }
};

/* script */
const __vue_script__$4v = script$4v;

/* template */
var __vue_render__$4v = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      ref: "videoContainer",
      staticClass: "xml-video-player xml-video-player-16-9",
      on: { click: _vm.togglePlay },
    },
    [
      _vm.isAsyncConvert
        ? [_vm._m(0)]
        : [
            _c("video-player", {
              ref: "videoRef",
              class: [
                "video-player",
                "vjs-custom-skin",
                _vm.canSkip ? "" : "vjs-no-select",
                _vm.title && _vm.titlePosition === "bottom"
                  ? "with-bottom-title"
                  : "",
                _vm.mode === "editor"
                  ? "is-edit-mode"
                  : _vm.mode === "demo"
                  ? "is-demo-mode"
                  : "",
                _vm.isEmptyPlaceholder ? ".vjs-empty-placeholder" : "",
              ],
              style: { width: "100%", height: "100%", overflow: "hide" },
              attrs: {
                id: _vm.timeData,
                events: _vm.playerEvents,
                playsinline: true,
                options: _vm.playerOptions,
                "x5-video-orientation": "portraint",
              },
              on: {
                "!click": function ($event) {
                  return _vm.togglePlay($event)
                },
                play: function ($event) {
                  return _vm.handlePlay(_vm.timeData, $event)
                },
                error: _vm.handleError,
                ready: _vm.playerReadied,
                "!fullscreenchange": function ($event) {
                  return _vm.toggleFullscreen(_vm.timeData, $event)
                },
                timeupdate: _vm.timeUpdate,
              },
            }),
          ],
      _vm._v(" "),
      _c(
        "div",
        {
          directives: [
            {
              name: "show",
              rawName: "v-show",
              value: _vm.title && _vm.titlePosition === "bottom",
              expression: "title && titlePosition === 'bottom'",
            },
          ],
          staticClass: "video-title",
          style: _vm.computedAlign,
        },
        [
          _c(
            "div",
            {
              ref: "parentTitle",
              staticStyle: { width: "100%" },
              style: _vm.durationVar,
            },
            [
              _c(
                "div",
                {
                  ref: "previewTitleText",
                  class: _vm.isAmin ? "animate-title" : "",
                },
                [_vm._v(_vm._s(_vm.title))]
              ),
            ]
          ),
        ]
      ),
      _vm._v(" "),
      _c("div", {
        directives: [
          {
            name: "show",
            rawName: "v-show",
            value: _vm.mode == "editor",
            expression: "mode == 'editor'",
          },
        ],
        staticClass: "dialog-box",
      }),
    ],
    2
  )
};
var __vue_staticRenderFns__$4v = [
  function () {
    var _vm = this;
    var _h = _vm.$createElement;
    var _c = _vm._self._c || _h;
    return _c("div", { staticClass: "convert-placeholder" }, [
      _c("div", { staticClass: "convert-placeholder__text" }, [
        _vm._v("视频转码中，无法即时预览，请稍候在活页/教材预览中查看"),
      ]),
    ])
  },
];
__vue_render__$4v._withStripped = true;

  /* style */
  const __vue_inject_styles__$4v = undefined;
  /* scoped */
  const __vue_scope_id__$4v = undefined;
  /* module identifier */
  const __vue_module_identifier__$4v = undefined;
  /* functional template */
  const __vue_is_functional_template__$4v = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4v = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4v, staticRenderFns: __vue_staticRenderFns__$4v },
    __vue_inject_styles__$4v,
    __vue_script__$4v,
    __vue_scope_id__$4v,
    __vue_is_functional_template__$4v,
    __vue_module_identifier__$4v,
    false,
    undefined,
    undefined,
    undefined
  );

var playIcon$2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHIAAAByCAMAAAC4A3VPAAAAAXNSR0IArs4c6QAAAZtQTFRFAAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////LHKW/AAAAIl0Uk5TAAECAwQFBgcICQoLDQ4PEBESExQVFhcYGRwdHh8gISIjJCUmJygpKistLi8wMTIzNDU2Nzg6Ozw9Pj9AQUJFRkdJS0xOUFFSVFVYWV9gYWJjZWZnaWprbG1ub3BydHZ3eHl7fH1+gIGCg4SFhoeIiouMjo+QkpOUlZaYmZqbnJ2en6ChoqOkpabH29nvAAADgElEQVRo3u2a+0MSQRDHB4/CEiFLwtJMkx6+DSuTqAw1Lcm0q4jKB6VSQRi+34Qc3fzZ/eAdcnDAcne7/nLfH29n9nO3LLOzOwtgypQpU6bOTJa+aHL6Kpmt1R9PvrTrRj5HRNwj6odbRERcsehF7iMiotBa2dK2ISIiigM6iTY8UcpbydKZkExf6P3KpNTR8aPydu6YZCg06UXeS0ldZQfLmTVsS2bilP4pew3lzoZLGznSaNSwAgC4cx8wXsqk40AeCr/FkL+m+4/8Ca/VDbqOpPb0U6PCgXNdZn7gVJrvZGTiQ+NC0EV54MRI8cD1ZuUX8hgZ9mwrcreL1oKmZ6LUcthmbKg9Nyczl22KhjGZuHlDcxh3NHsDwbdFmpWRuJv/+EvucaTYJxjwNjsqTuHWWEZEI5X51VIWeGkpi4Yru+QsTXycQSpKPShFDCA1+dSJXqSom6prwV+ayJTK72lLIFVFikOlHylrsESOQ1Ex1USOqsSuAuQ36kj8XIA8oo9cUxLb6RMxo0ROMECicnWbI3FZ7Xb3f/2nHflEgVwhcXEBAPQmNSOVyVqUxEWKH8+0LnAfq0fKxvVvtCE/aUcCtEVE1kgA3zpzJEBQEFkjwbXMHAkwkGCOBOvkAWskgGU+yxoJltY11kgAzr/DGglw4V2aNRLAvimyRkJNzz5rJIB9UmCNBHCEBdZIgPY9kTUS7GnmyLIpOCVkP3Mkt8EcGWI9fTp/MP6TuPgs21BgC7AOeH3bIltk86LIdvFyTgnIdL209pOeiRmF7NglzqCNQTbMC4gskfWvqtr36UdyPdXkzUYgm7YYb4Pq3ld/dqsLaRs5ZLultXg2Ddi4E52ISLUALq7xICakQC6QuNgBAGqDadSoaQVylsRljINa35b2o6ZRZRWJyGd7DvVIWRJzMzjCyxbUhfaYH47CPH1kuADpo3/QfbdwVdihjVwqWoiGaSN7ipDn43SJIZU6pjNFk7iverHlPkWicJl1MfHwVqmEdJhSyTR2vXTW3RinUBg+DlnL7mY8G0YTo1cq7RFrXLd9k7M8z/N5+VuCJ1I4P7zxPD8zPuRpqOaGQejUf4TMg8vLo+u0XGpoy+UbGdJXPV0cYtouUvyU/WdIPbpyU0br/ZfvJ/5TVmKX7pMZf9Si+f7LUPh3NNhZU821q4nI6sJoo3ll0pQpU6bORv8BFtxQhtIU9fkAAAAASUVORK5CYII=";

var titleLeftIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAAuCAYAAABjwOorAAAAAXNSR0IArs4c6QAABQ1JREFUaEPtWGtsk1UYft7TbmtBmOCFAHJryy0aYyJB4w8CatQfGo0LxsREQ2IwUYOoWceQyweBQiFozJQfmKi/xAsEjDEKiZj4A/+oIUGNhrZOLgqKMOSySdv3Medr6751q2xdRwfpyf4s5z19n+c87+18gqt0yVXKCzViV5qyNcVqig2TG6iF4jARot8wylbsJodjAw2YQsCU8pYF/moP4wgek2y/EVXIsGxioY2cbATrhBhfGot+pzRvJVslUSG8/f6ZsonhQ/oi7VglyuWUEo2eOEbq+uRY3zt4RtL9RlUBw/KJAZjxKidqmu8BuKNPLIQC3KXGOKmoHPLahONcIIq5vc4Z/JboxHY4khkMv0ERs46nxLmgTvkugLF9AhEcp8i65AVsxxq5WLAJbeJ0n3IvBZN6nCPOwCcPJprl66oSw0L6QrejWcCoBSI2LIn8H2yMksJPFen1v7QEfvaCDcUzi3xq2uiadS8K9iSXSRMgLJfcoBWzjm0hAfiGIe6U/C/S0mOOJAQnCVmbPIZdaJN//gPr0ESCiJFcbC+E9oRlKaAaWZyKys6qEoNDE27AfDF8XYgxxWBy1849MCaWiErSuz9l/fnxdSa4HYKZlpBrSSuVfJ/twsJ2RzrKIVcRxazjG1bzmsYReFrIJVoUWi4wwVmBrEUQnySWeFSzisc5xyg/gKe6ElDxycuJZvm4qsQASmgTIiarqygy1xta3RnELwkTSy2Tw8Vgbb4JzFIh/J6945kGaWp/ceCqVUwxF8xi1oXCmCfgagHGuDlWyLUc2k5A1tZ3Ys+PngppN8Zt5shRqm1QuTWvsE02Evp+ssW3ZaCqVZYYgKmv8Vp/Gk9AuUi8Iel6sqmDby+m4fz6ivxeDDa8jpNMPd+EojFPzhaTU5qRF5Ir5MhAyFWcmA3JSAyzYfC8CG/zgnELH5khJJZIYR+29Z5GbOM24FIq6gvkhLr7UKt/W5WJAXDoj4zI3A34nhXkb9+DSsmf0mqWH26V073AOvSHA7rUwHinkqwSKwcycw6BYjmoNiTrLuJxAR92G7ANwsKy/2Vky6ED2IePek/+EYejEdAWMZiALAQ+EGp+4Ai0FVfUUioOGTGXXIyz/KJPQmR2D2K5dDvaIab1ZIuc7QvczM2cllU8B2rANnsBMirpralooMfMWRViucaduU+MvwnE6GIQKtiWapEv+gTn0ITqsw8Yn8wr7BPmaLITW+GIXirfhlQx63zyBo4JAE00ehcBv533C09TEXMifQEr2x3pKkVuehBPKTChcIppfJZaId9UnZgFMCPGWerHI0Kdln9xdw+3YnYkorK3FNCJMV4XMHhUBCOtDYHT5wx2nGiW8/9HbsgVc507NNODuIfAAqiOoi0G+WUUZzo6TfzPNXKuFNBpcc6s09zzJmNAMTiYbJY/qk8s9wJoNMBDgN5M02NsAmk+L5lrl4q5EvuXR7G88/AGRkRwP0XH5apk/jsQ0ZEG3u6zr10JxNypZBPmkZgDIFBoASJut9qfiOKrwTwuvXdwWRWzjq+Pc1Sj4l4BptK2XrengaI43dWA3UdfklNlitTj2GUnZr3bYVfqMJ+ecYuKjBAHk8uxvxKqVYWY+3bbiFuQxY1+kxu17CcpfxZ/+9M4UPykKUfBKhEDsJr1oSCC2tU9Q/oBTQAXBvvpLRfdV+mqEbvShK0pVlNsmNxALRSHiRD9hlFTrN9XNUwM/wU+QeA+cB9fBQAAAABJRU5ErkJggg==";

var titleRightIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAAuCAYAAABjwOorAAAAAXNSR0IArs4c6QAABSNJREFUaEPtWEtslFUU/r77Tx9TmphqEHkUCp0GA0YN6soQE1e6kBijBInESAwFFFQS+kQZCNBSRCS6UeMGN6aAQlxQEhIIMS58kZCoCDMtYEuqAgWF0k7/uZ/5pw9m+rAz06EFMrO8c8893+Pcc88McZd+eJfyQpbYneZs1rGsY7eJAtlSvE2MSBrGxDj2iXLKLmI+cjBjJKTWItrt4mTrBrYlzSZu44QQm12vR3ywb0NmwUig5aBFxIrwev51RxArCSrfl29XA6wEce8IoCXDN8LX8TmCtBNETCzejql+i/zBADrzcKV1HS/HrwcatEBWmwk8DYww+Rh95cis/L2S/6ZDyosZcynO2KLpfh++lFScAILohlgequax/vUZH8if5+J1WFUTKBwOtIQLrstnz73LlnRJZYRYaX20nOBuMFEkAU3XDJf+uZ7X+wEGGiILYH1BAE8m3HNPXkEgBHBlqBL7AWrCiM2sU1GO0Q+0mBIPQsBFkU81V/F8//q0oAry8/GqkWpB5MSoMAY/VjUeCyvtu+4zFfFipEsu/VIMygT89j1YvtmrNEgCErqt4drmCu6PBzV7hx52rLYCeHS4pAIuRHu4uGUDz6VLJj4ubWJz6jXTQHsJTE90S0e7cs2K1nW80b8+ZYcmFUaxFFBVTIK+T28FAgaIiKwK3cAhbGJkQokFtkdXS1w3SKVLcvlieAP/uLkuBuoxD4i5NTe2HvMXkHcvBRfigS5hV1sNL2WCVNrNY9ZWTc119LUSO1tEYG24iofiwU3eqMKiSVgiac2wXRA8DUWCoarcX8faMMZWii/JKXvCVgNmkaxuljL1bVe7qWnddbMEPU9KtmFujtEWGM6EjTW/gRgCVy35cXc7DifGjd23lO9Y7G5RuwkUxaW/2kOWn61gezwkrxP6/dFXDMyywVAF9FBs6jHYMzhu7LTSeKDL6twVonm+t1kDNIhY8MNwJY8mAhLnNCDgyG4CeP8QYuSpqO35rKUq52QmSzC+MSUt0Oz3NcvnYhuA3P4gwZ5Am9kZ+ojdCQdtVG6Z374GcdFQUroMmMauXByJ755JA0liY/Kl2CinrBmrZezjiIJwIETxD2Q2h2r49+BcpXUKGIMaCPckPAeyPTDmuAz2pTu5J8Er+VmxdKeK6dq3QBR487YFXNHsaa7kj8MlCtRrFWkXxr7z5nPjtXkjyIatdRvDtbm/3IoSTLkUS+u1BMY+NhAonQp1Ol8M96B6btHYdwj4+96t2ItF4YqFPYw237EhpZuMDSnsSaoUS+pU4hgsI+B48lOms6cLn54N8sqQXBIDDXYViIcGRIiC1piIsTjRDRw8X82OFDCmtXV0YkH5Avl4QcSsWBe0cGnQdKaSvw2XsWSbHnQcu5yEb6AMvSoU2uiYA6EKhtNCmmLQqMRKGvSAY/EceydyMIrzZyJoQpDukFzeYFyA5bC2NKFhENccmuOnS/AdFjOaIsa0to9KbN5GFXbGjU6++9ARWjuotfelDtRrPoRFMP3PgYVoPCJnop04eDbIrrRQphE0KrGkz2yUE2jGywKmse9HJ70eCHREDb65FdPF/2HLGLHAZs1nHhYKvf990JvbhW65+D5Uy5+TFihDGzNDLChfWQGekRJ/SVuhvfknNGHv+NyreE0yQiywRnluMYp8nX2d0HuPfdC1yei4UM7ODJmQ0jEZIZZSxnHanCU2TkJnLE3WsYxJOU4HZR0bJ6EzlibrWMakHKeDso6Nk9AZS/Mf+LvuPmZJ/LcAAAAASUVORK5CYII=";

//
var script$4u = {
  name: 'VideoModalPlayer',
  components: {
    videoPlayer: VueVideoPlayer.videoPlayer
  },
  props: {
    src: {
      type: String,
      default: ''
    },
    // 这里接收父组件传来的src参数，视频的url
    loop: {
      type: Boolean,
      default: false
    },
    //控制循环还是单次播放
    canSkip: {
      type: Boolean,
      default: true
    },
    //是否允许控制播放进度
    playStyle: {
      type: String,
      default: 'yuan-wen'
    },
    //yuan-wen:原文播放；tan-chaung：弹窗播放；tiao-zhuan：跳转播放
    title: {
      type: String,
      default: ''
    },
    //视频标题
    link: {
      type: String,
      default: ''
    },
    //链接地址
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    aspectRatio: '4:3',
    poster: {
      type: String,
      default: ''
    },
    content: {
      type: String,
      default: '暂无简介'
    },
    initialTime: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      playIcon: playIcon$2,
      titleLeftIcon,
      titleRightIcon,
      // 用于存放<video>标签对象，方便调用原生API
      videoRef: null,
      videoContainer: null,
      // 是否暂停，用于控制播放与暂停
      isPaused: true,
      // 播放当前时间
      currentTime: '00:00',
      totalTime: '00:00',
      // 声音是否静音
      isMuted: false,
      // 是否全屏
      isFullScreen: false,
      controlsActive: false,
      isVideoEnd: false,
      stopDefaultEvent: false,
      lastOperateTimeStamp: '',
      timeData: null,
      playerEvents: ['fullscreenchange', 'timeupdate'],
      playerOptions: {
        playbackRates: [0.5, 1.0, 1.25, 1.5, 2.0],
        //播放速度
        autoplay: false,
        //如果true,浏览器准备好时开始回放。
        muted: false,
        // 默认情况下将会消除任何音频。
        loop: false,
        // 导致视频一结束就重新开始。
        preload: 'auto',
        // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频（如果浏览器支持）
        language: 'zh-CN',
        aspectRatio: this.aspectRatio,
        // 将播放器置于流畅模式，并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字（例如"16:9"或"4:3"）
        fluid: true,
        // 当true时，Video.js player将拥有流体大小。换句话说，它将按比例缩放以适应其容器。
        sources: [{
          type: '',
          //这里的种类支持很多种：基本视频格式、直播、流媒体等，具体可以参看git网址项目
          src: this.src
        }],
        poster: this.poster,
        //你的封面地址
        // width: document.documentElement.clientWidth, //播放器宽度
        notSupportedMessage: '获取视频失败，请检查链接地址',
        //允许覆盖Video.js无法播放媒体源时显示的默认信息。
        controls: true,
        controlBar: {
          timeDivider: false,
          durationDisplay: true,
          remainingTimeDisplay: false,
          fullscreenToggle: true,
          //全屏按钮
          progressControl: true,
          volumePanel: {
            inline: false
          }
        }
      }
    };
  },
  computed: {
    player() {
      return this.$refs.videoRef.player;
    },
    videoAndMusicStop() {
      let playState = sessionStorage.getItem('SET_PLAY_STATE');
      return playState;
    },
    isAsyncConvert() {
      return this.src.split('__')[0] === 'convertTask';
    }
  },
  mounted() {
    this.timeData = 'v' + Math.random();
    // 加载完毕后，先获取<video>标签DOM对象
    this.videoRef = this.$refs.videoRef;
    this.videoContainer = this.$refs.videoContainer;
    if (this.mode === 'preview') {
      this.$emit('resetTimeUpdate');
    }
  },
  watch: {
    canSkip: {
      handler(n, o) {
        !this.isAsyncConvert && this.$nextTick(function () {
          // this.$refs.videoRef.src = n
          //alert(n);
          // this.playerOptions.controlBar.progressControl = n;
        });
      },
      immediate: true
    },
    loop: {
      handler(n, o) {
        !this.isAsyncConvert && this.$nextTick(function () {
          // this.$refs.videoRef.src = n
          //alert(n);
          this.playerOptions.loop = n;
        });
      },
      immediate: true
    },
    src: {
      handler(n, o) {
        !this.isAsyncConvert && this.$nextTick(function () {
          // this.$refs.videoRef.src = n
          this.playerOptions.sources.src = n;
        });
      },
      immediate: true
    },
    videoAndMusicStop(val) {
      console.log('watch');
      let currentPlayStamp = val || '--';
      if (currentPlayStamp !== this.src + '__playTimeStamp__' + this.lastOperateTimeStamp) {
        this.videoRef.pause();
        this.handlePause();
      }
    }
  },
  methods: {
    toggleFullscreen(item, e) {
      // this.isFullScreen = !this.isFullScreen
      let videoParent = document.getElementById(item);
      videoParent.getElementsByTagName('video')[0].id;
      let bar = videoParent.querySelector('.vjs-control-bar');
      console.log(e.isFullscreen());
      if (e.isFullscreen() == true) {
        bar.className = 'vjs-control-bar fullscren';
      } else {
        // alert(1);
        bar.className = 'vjs-control-bar';
      }
      console.log(bar);
      this.videoPlayerDom = videoParent.getElementsByTagName('video')[0];
      console.log('======', e.isFullscreen());
      const data = {
        type: 'setIframeClass',
        value: e.isFullscreen()
      };
      window.parent.postMessage(data);

      //this.isFullScreen = !this.isFullScreen;
      if (/AppleWebKit.*mobile/i.test(navigator.userAgent) || /MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent)) {
        if (window.location.href.indexOf('?mobile') < 0) {
          try {
            if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
              //   alert(1);

              this.videoPlayer.attr('x-webkit-airplay', 'true') //设置允许设备播放
              .attr('x5-playsinline', 'true') // 设置android在微信中内联播放视频
              .attr('x5-video-player-type', 'web') // 关闭同层X5内核播放器    x5-video-player-type='h5' 启用Ｈ5同层播放器
              // .attr('x5-video-player-fullscreen','true')  // 进入全屏通知
              .attr('x5-video-orientation', 'portrait'); //控制横竖屏 可选值： landscape 横屏, portraint竖屏  默

              return;
            } else if (/iPad/i.test(navigator.userAgent)) {
              //window.location.href="平板页面";
            } else {
              //window.location.href="其他移动端页面"
            }
          } catch (e) {}
        }
      }
      //this.videoPlayer.controls = false;
      //this.playerOptions.controls = true;
      //   bar.className = "vjs-control-bar";
    },
    handlePlay(item) {
      if (this.stopDefaultEvent) return;
      // if (this.mode==='editor') {
      //   this.$message.warning('视频仅支持在预览模式下播放')
      //   return
      // }
      this.isPaused = false;
      let audio = document.querySelectorAll('audio');
      if (audio && audio.length) {
        audio.forEach(i => i.pause());
      }
      let video = document.querySelectorAll('video');
      video.forEach(i => {
        if (i.id != item) {
          i.pause();
        }
      });
      this.setPlayStamp();
      // if (this.playStyle === 'tiao-zhuan') {
      //   setTimeout(() => {
      //     this.videoRef.pause()
      //   }, 650)
      //   if (this.link) {
      //     window.location.href = this.link
      //   } else {
      //     this.$message.warning('跳转链接未配置')
      //   }

      //   // window.open(this.src,"_blank")
      // }
      // if (this.playStyle === 'tan-chuang') {
      //   setTimeout(() => {
      //     this.videoRef.pause()
      //   }, 650)
      //   this.$emit('showDialog', { url: this.src, title: this.title })
      // }
    },
    handlePause() {
      if (this.stopDefaultEvent) return;
      this.isPaused = true;
    },
    // 播放与暂停,注意,这里isPause的变化,对应图标的变化
    togglePlay() {
      console.log('播放');
      if (this.mode === 'editor') ; else {
        if (this.playStyle === 'yuan-wen') ;
        // if (this.playStyle === 'tiao-zhuan') {
        //   setTimeout(() => {
        //     this.videoRef.pause()
        //   }, 650)
        //   if (this.link) {
        //     window.location.href = this.link
        //   } else {
        //     this.$message.error('跳转链接未配置')
        //   }

        //   // window.open(this.src,"_blank")
        // }
        // if (this.playStyle === 'tan-chuang') {
        //   setTimeout(() => {
        //     this.videoRef.pause()
        //   }, 150)
        //   this.$emit('showDialog', { url: this.src, title: this.title })
        // }
      }
    },
    doPlay() {
      this.isPaused = !this.isPaused;
      this.stopDefaultEvent = true;
      if (this.isPaused) {
        this.videoRef.pause();
      } else {
        let audio = document.querySelectorAll('audio');
        if (audio && audio.length) {
          audio.forEach(i => i.pause());
        }
        let video = document.querySelectorAll('video');
        video.forEach(i => {
          if (i.id != this.timeData) {
            i.pause();
          }
        });
        this.videoRef.play();
        this.setPlayStamp();
      }
      setTimeout(() => {
        this.stopDefaultEvent = false;
      }, 500);
    },
    setPlayStamp() {
      let timeStamp = new Date().getTime();
      this.lastOperateTimeStamp = timeStamp;
      let playStamp = `${this.src}__playTimeStamp__${timeStamp}`;
      // this.$store.commit('leaflet/SET_PLAY_STATE', this.src)
      // this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      sessionStorage.setItem('SET_PLAY_STATE', playStamp); //存储
    },
    rePlay() {
      this.videoRef.play();
      this.isPaused = false;
      this.isVideoEnd = false;
    },
    // 停止播放
    stopPlay() {
      this.videoRef.pause();
      this.videoRef.currentTime = 0;
      // 停止播放了，要将播放图标从暂停切换到播放,isPaused为true的时候，图标是播放
      this.isPaused = true;
    },
    playEnd() {
      if (!this.loop) {
        this.videoRef.currentTime = 0;
        this.isPaused = true;
        this.isVideoEnd = true;
      }
    },
    // 定义一个时间处理函数，例如将100秒，处理成1:40
    timeFormat(time) {
      let minute = Math.floor(time % 3600 / 60); // 取余
      let second = Math.floor(time % 60);
      minute = minute < 10 ? '0' + minute : minute;
      second = second < 10 ? '0' + second : second;
      return `${minute}:${second}`;
    },
    // 当事件oncanplay触发时，获取视频的总时间信息，然后通过timeFormat函数处理成00:00的格式，并渲染到template中
    getTotalTime() {
      this.currentTime = this.timeFormat(this.videoRef.currentTime);
      this.totalTime = this.timeFormat(this.videoRef.duration);
    },
    handleError(player) {
      console.log('%c%s', 'font-size:2em;background: #00965E;color: #FFF', '播放器错误', player);
      if (player.error()?.message.includes('The media could not be loaded')) {
        player.error('服务器或网络错误, 视频资源无法加载');
        player.errorDisplay.contentEl_.innerText = '服务器或网络错误, 视频资源无法加载';
      }
    },
    playerReadied(player) {
      if (this.initialTime > 0) {
        player.currentTime(this.initialTime);
      }
    },
    // 时间timeupdate触发时，更新当前播放时间
    timeUpdate(e) {
      // this.currentTime = this.timeFormat(this.videoRef.currentTime)
      // this.$emit('timeUpdate', { event: e, time: this.videoRef.currentTime })

      if (e.currentTime() >= this.initialTime) {
        this.currentTime = this.timeFormat(e.currentTime());
        this.$emit('timeUpdate', {
          event: e,
          time: e.currentTime()
        });
      } else {
        e.currentTime(this.initialTime);
      }
    },
    // 声音是否静音
    toggleMuted() {
      this.isMuted = !this.isMuted;
      this.videoRef.muted = !this.videoRef.muted;
    },
    // 切换全屏,注意，这里进入全屏时，使用的元素是this.video，而不是this.myvideo。video是myvideo的父标签，这样控制条才能正确显示
    toggleFullScreen(event) {
      let fullscreen = document.webkitIsFullScreen || document.fullscreen;
      this.isFullScreen = fullscreen;
      if (!this.isFullScreen) {
        this.isFullScreen = !this.isFullScreen;
        const inFun = this.videoContainer.requestFullscreen || this.videoContainer.webkitRequestFullScreen;
        inFun.call(this.videoContainer);
      } else {
        this.isFullScreen = !this.isFullScreen;
        const exitFun = document.exitFullscreen || this.document.webkitExitFullScreen;
        exitFun.call(document);
      }
    }
  }
};

/* script */
const __vue_script__$4u = script$4u;

/* template */
var __vue_render__$4u = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      ref: "videoContainer",
      staticClass: "xml-video-player modal-player xml-video-player-16-9",
    },
    [
      _vm.isAsyncConvert
        ? [_vm._m(0)]
        : [
            _vm.title
              ? _c("div", { staticClass: "title-block" }, [
                  _c("div", { staticClass: "title-adorn" }, [
                    _c("img", { attrs: { src: _vm.titleLeftIcon } }),
                  ]),
                  _vm._v(" "),
                  _c("div", { staticClass: "title" }, [
                    _vm._v(_vm._s(_vm.title)),
                  ]),
                  _vm._v(" "),
                  _c("div", { staticClass: "title-adorn" }, [
                    _c("img", { attrs: { src: _vm.titleRightIcon } }),
                  ]),
                ])
              : _vm._e(),
            _vm._v(" "),
            _c("div", { class: ["fixed-ratio-container"] }, [
              _c(
                "div",
                { class: ["xml-video__wrapper", _vm.mode] },
                [
                  _c("video-player", {
                    ref: "videoRef",
                    class: [
                      "video-player",
                      "vjs-custom-skin",
                      _vm.canSkip ? "" : "vjs-no-select",
                    ],
                    style: { width: "100%", height: "100%", overflow: "hide" },
                    attrs: {
                      id: _vm.timeData,
                      playsinline: true,
                      options: _vm.playerOptions,
                      events: _vm.playerEvents,
                    },
                    on: {
                      error: _vm.handleError,
                      ready: _vm.playerReadied,
                      "!fullscreenchange": function ($event) {
                        return _vm.toggleFullscreen(_vm.timeData, $event)
                      },
                      timeupdate: _vm.timeUpdate,
                    },
                  }),
                ],
                1
              ),
            ]),
          ],
    ],
    2
  )
};
var __vue_staticRenderFns__$4u = [
  function () {
    var _vm = this;
    var _h = _vm.$createElement;
    var _c = _vm._self._c || _h;
    return _c("div", { staticClass: "convert-placeholder" }, [
      _c("div", [
        _vm._v("视频转码中，无法即时预览，请稍候在活页/教材预览中查看"),
      ]),
    ])
  },
];
__vue_render__$4u._withStripped = true;

  /* style */
  const __vue_inject_styles__$4u = undefined;
  /* scoped */
  const __vue_scope_id__$4u = undefined;
  /* module identifier */
  const __vue_module_identifier__$4u = undefined;
  /* functional template */
  const __vue_is_functional_template__$4u = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4u = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4u, staticRenderFns: __vue_staticRenderFns__$4u },
    __vue_inject_styles__$4u,
    __vue_script__$4u,
    __vue_scope_id__$4u,
    __vue_is_functional_template__$4u,
    __vue_module_identifier__$4u,
    false,
    undefined,
    undefined,
    undefined
  );

//
// import '../block.scss'
var script$4t = {
  name: 'XmlVideoRender',
  components: {
    VideoPlayer: __vue_component__$4v,
    VideoModalPlayer: __vue_component__$4u
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //属性中传递过来的块儿数据
    pBlockData: {},
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  watch: {
    pBlockData: {
      handler(newValue) {
        this.$nextTick(() => {
          this.blockData = Object.assign({}, this.blockData, newValue);
        });
      },
      deep: true,
      immediate: true
    }
  },
  data() {
    return {
      blockId: 'blockId' + Math.random(),
      //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
      blockData: {
        playMode: 'xun-huan',
        scheduleControl: 'yes',
        playStyle: 'yuan-wen',
        link: '',
        titlePosition: 'under',
        titleAlign: 'left'
      },
      //属性组件名
      propertyComponentsName: 'xml-video-property',
      dialogShow: false,
      curVideoUrl: '',
      curVideoTitle: '',
      curVideoContent: '',
      curVideoPoster: '',
      currentPlayer: {},
      initialTime: 0,
      modalPlayerKey: 'mpk' + new Date().getTime()
    };
  },
  methods: {
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    showDialog(param) {
      console.log(param);
      this.initialTime = param.initialTime;
      this.curVideoUrl = param.url;
      this.curVideoTitle = param.title;
      this.curVideoContent = param.content;
      this.curVideoPoster = param.poster;
      this.currentPlayer = this.blockData.videoSetList[param.playerIndex];
      this.modalPlayerKey = 'mpk' + new Date().getTime();
      this.$nextTick(() => {
        this.dialogShow = true;
      });
    },
    timeUpdate({
      event,
      time
    }, data) {
      // console.log({event, time, data});
      this.$EventBus.$emit('videoTimeUpdate', {
        event,
        time,
        data
      });
    },
    resetTimeUpdate(data) {
      this.$EventBus.$emit('resetTimeUpdate', data);
    }
  },
  computed: {
    isEmpty() {
      return !(this.blockData.videoSetList && this.blockData.videoSetList.length);
    }
  }
};

/* script */
const __vue_script__$4t = script$4t;
/* template */
var __vue_render__$4t = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      class: [
        "xml-video-container",
        "video-content",
        "xml-video-container-" + _vm.pageType,
      ],
      attrs: { id: _vm.blockId },
      on: { click: _vm.blockClick },
    },
    [
      _vm.isEmpty
        ? [
            _c("div", [
              _c(
                "div",
                {
                  class: [
                    "fixed-ratio-container xml-group-item",
                    _vm.blockData.titlePosition === "under"
                      ? "with-under-title"
                      : "",
                  ],
                },
                [
                  _c("div", { class: ["xml-video__wrapper", _vm.mode] }, [
                    _c(
                      "div",
                      { staticClass: "xml-video-player-box" },
                      [
                        _c("video-player", {
                          attrs: {
                            src: "",
                            title: "这是视频名称",
                            mode: _vm.mode,
                            isEmptyPlaceholder: "",
                            titleAlign: _vm.blockData.titleAlign,
                            titlePosition: _vm.blockData.titlePosition,
                          },
                        }),
                      ],
                      1
                    ),
                  ]),
                ]
              ),
              _vm._v(" "),
              _vm.blockData.titlePosition === "under"
                ? _c(
                    "div",
                    {
                      staticClass: "xml-video-title video-title--under",
                      style: { textAlign: _vm.blockData.titleAlign },
                    },
                    [_vm._v("\n        这是视频名称\n      ")]
                  )
                : _vm._e(),
            ]),
          ]
        : _vm._l(_vm.blockData.videoSetList, function (item, index) {
            return _c("div", { key: index }, [
              _c(
                "div",
                {
                  class: [
                    "fixed-ratio-container xml-group-item",
                    _vm.blockData.titlePosition === "under"
                      ? "with-under-title"
                      : "",
                  ],
                },
                [
                  _c("div", { class: ["xml-video__wrapper", _vm.mode] }, [
                    _c(
                      "div",
                      { staticClass: "xml-video-player-box" },
                      [
                        _c("video-player", {
                          attrs: {
                            poster: item.coverFileUrl
                              ? item.coverFileUrl.indexOf("./") !== -1
                                ? _vm.resourceBasisPath +
                                  item.coverFileUrl.split("./")[1]
                                : item.coverFileUrl
                              : "",
                            mode: _vm.mode,
                            loop: _vm.blockData.playMode !== "dan-ci",
                            src: item.uploadFileUrl
                              ? item.uploadFileUrl.indexOf("./") !== -1
                                ? _vm.resourceBasisPath +
                                  item.uploadFileUrl.split("./")[1]
                                : item.uploadFileUrl
                              : "",
                            playStyle: _vm.blockData.playStyle,
                            title: item.title || "",
                            link: item.link,
                            playerIndex: index,
                            canSkip: _vm.blockData.scheduleControl === "yes",
                            content: item.content,
                            titlePosition: _vm.blockData.titlePosition,
                            titleAlign: _vm.blockData.titleAlign,
                            initialTime: item.currentTime
                              ? item.currentTime
                              : 0,
                          },
                          on: {
                            showDialog: _vm.showDialog,
                            timeUpdate: function (e) {
                              return _vm.timeUpdate(e, item)
                            },
                            resetTimeUpdate: function ($event) {
                              return _vm.resetTimeUpdate(item)
                            },
                          },
                        }),
                      ],
                      1
                    ),
                  ]),
                ]
              ),
              _vm._v(" "),
              _vm.blockData.titlePosition === "under" && item.title
                ? _c(
                    "div",
                    {
                      staticClass: "xml-video-title video-title--under",
                      style: { textAlign: _vm.blockData.titleAlign },
                    },
                    [_vm._v("\n        " + _vm._s(item.title) + "\n      ")]
                  )
                : _vm._e(),
            ])
          }),
      _vm._v(" "),
      _c(
        "el-dialog",
        {
          staticClass: "resource-preview player-dialog",
          attrs: {
            title: "",
            visible: _vm.dialogShow,
            "destroy-on-close": true,
            width: "100%",
            modal: false,
            "show-close": false,
            "append-to-body": "",
            "custom-class": "preview-modal-video",
            "close-on-click-modal": true,
          },
          on: {
            "update:visible": function ($event) {
              _vm.dialogShow = $event;
            },
          },
        },
        [
          _c(
            "div",
            { staticClass: "xml-modal-player__wrapper xml-group-item" },
            [
              _c("video-modal-player", {
                key: _vm.modalPlayerKey,
                attrs: {
                  mode: _vm.mode,
                  loop: _vm.blockData.playMode !== "dan-ci",
                  src: _vm.curVideoUrl,
                  canSkip: _vm.blockData.scheduleControl === "yes",
                  playStyle: "yuan-wen",
                  title: _vm.curVideoTitle,
                  initialTime: _vm.initialTime,
                  poster: _vm.curVideoPoster,
                  content: _vm.curVideoContent,
                },
                on: {
                  timeUpdate: function (e) {
                    return _vm.timeUpdate(e, _vm.currentPlayer)
                  },
                  resetTimeUpdate: function ($event) {
                    return _vm.resetTimeUpdate(_vm.currentPlayer)
                  },
                },
              }),
            ],
            1
          ),
        ]
      ),
    ],
    2
  )
};
var __vue_staticRenderFns__$4t = [];
__vue_render__$4t._withStripped = true;

  /* style */
  const __vue_inject_styles__$4t = undefined;
  /* scoped */
  const __vue_scope_id__$4t = "data-v-82da5782";
  /* module identifier */
  const __vue_module_identifier__$4t = undefined;
  /* functional template */
  const __vue_is_functional_template__$4t = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4t = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4t, staticRenderFns: __vue_staticRenderFns__$4t },
    __vue_inject_styles__$4t,
    __vue_script__$4t,
    __vue_scope_id__$4t,
    __vue_is_functional_template__$4t,
    __vue_module_identifier__$4t,
    false,
    undefined,
    undefined,
    undefined
  );

//
// import '../block.scss'
var script$4s = {
  name: 'XmlVideoImgRender',
  components: {
    VideoPlayer: __vue_component__$4v,
    VideoModalPlayer: __vue_component__$4u
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //属性中传递过来的块儿数据
    pBlockData: {},
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  watch: {
    pBlockData: {
      handler(newValue) {
        this.$nextTick(() => {
          this.blockData = Object.assign({}, this.blockData, newValue);
        });
      },
      deep: true,
      immediate: true
    }
  },
  data() {
    return {
      blockId: 'blockId' + Math.random(),
      //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
      blockData: {
        playMode: 'xun-huan',
        scheduleControl: 'yes',
        playStyle: 'yuan-wen',
        link: '',
        titlePosition: 'under',
        titleAlign: 'left'
      },
      //属性组件名
      propertyComponentsName: 'xml-video-property',
      dialogShow: false,
      curVideoUrl: '',
      curVideoTitle: '',
      curVideoContent: '',
      curVideoPoster: '',
      currentPlayer: {},
      modalPlayerKey: 'mpk' + new Date().getTime()
    };
  },
  methods: {
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    showDialog(param) {
      this.curVideoUrl = param.url;
      this.curVideoTitle = param.title;
      this.curVideoContent = param.content;
      this.curVideoPoster = param.poster;
      this.currentPlayer = this.blockData.videoSetList[param.playerIndex];
      this.modalPlayerKey = 'mpk' + new Date().getTime();
      this.$nextTick(() => {
        this.dialogShow = true;
      });
    },
    timeUpdate({
      event,
      time
    }, data) {
      // console.log({event, time, data});
      this.$EventBus.$emit('videoTimeUpdate', {
        event,
        time,
        data
      });
    },
    resetTimeUpdate(data) {
      this.$EventBus.$emit('resetTimeUpdate', data);
    }
  },
  computed: {
    isEmpty() {
      return !(this.blockData.videoSetList && this.blockData.videoSetList.length);
    }
  }
};

var __$_require_images_play_circle_png__ = "data:image/png;base64, ";

/* script */
const __vue_script__$4s = script$4s;
var __vue_render__$4s = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      class: [
        "xml-video-container",
        "video-content",
        "xml-video-container-" + _vm.pageType,
      ],
      attrs: { id: _vm.blockId },
      on: { click: _vm.blockClick },
    },
    _vm._l(_vm.blockData.videoSetList, function (item, index) {
      return _c("div", { key: index }, [
        _c("div", { staticClass: "xml-video-container-pdf" }, [
          _c("img", {
            staticClass: "cover",
            attrs: { src: item.coverFileUrl, alt: "" },
          }),
          _vm._v(" "),
          _vm._m(0, true),
        ]),
        _vm._v(" "),
        _vm.blockData.titlePosition === "under" && item.title
          ? _c(
              "div",
              {
                staticClass: "video-title--under",
                style: { textAlign: _vm.blockData.titleAlign },
              },
              [_vm._v("\n      " + _vm._s(item.title) + "\n    ")]
            )
          : _vm._e(),
      ])
    }),
    0
  )
};
var __vue_staticRenderFns__$4s = [
  function () {
    var _vm = this;
    var _h = _vm.$createElement;
    var _c = _vm._self._c || _h;
    return _c("div", { staticClass: "play-box" }, [
      _c("img", {
        staticClass: "play",
        attrs: { src: __$_require_images_play_circle_png__, alt: "" },
      }),
    ])
  },
];
__vue_render__$4s._withStripped = true;

  /* style */
  const __vue_inject_styles__$4s = undefined;
  /* scoped */
  const __vue_scope_id__$4s = "data-v-3c5e97c1";
  /* module identifier */
  const __vue_module_identifier__$4s = undefined;
  /* functional template */
  const __vue_is_functional_template__$4s = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4s = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4s, staticRenderFns: __vue_staticRenderFns__$4s },
    __vue_inject_styles__$4s,
    __vue_script__$4s,
    __vue_scope_id__$4s,
    __vue_is_functional_template__$4s,
    __vue_module_identifier__$4s,
    false,
    undefined,
    undefined,
    undefined
  );

const video = [__vue_component__$4t, __vue_component__$4s];
var XmlVideo = {
  ...video
};

//
// import { defaultCover } from '@/assets/remote'

/***
 * 试卷块儿
 */
var script$4r = {
  name: 'XmlTestPaperRender',
  components: {
    QuestionItem: __vue_component__$4B
  },
  // dicts: ['question_type', 'difficulty', 'examine_status', 'answer_platform', 'answer_situation'],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //属性中传递过来的块儿数据
    pBlockData: {},
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    reader: {
      type: Boolean,
      default: false
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    isShowAi: {
      type: String,
      default: '1'
    },
    BookName: {
      type: String,
      default: ''
    }
  },
  computed: {},
  watch: {
    pBlockData: {
      handler(newValue) {
        this.$nextTick(() => {
          console.log('Question组件(ruleIndex:' + this.ruleIndex + ')，watch触发，变量pBlockData：', newValue);
          this.blockData = Object.assign({}, this.blockData, newValue);
        });
      },
      deep: true,
      immediate: true
    },
    pageType: {
      deep: true,
      immediate: true,
      handler(newValue) {
        this.tmpPageType = newValue;
      }
    }
  },
  data() {
    return {
      blockId: 'blockId' + Math.random(),
      //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
      blockData: {},
      //属性组件名
      propertyComponentsName: 'xml-test-paper-property',
      radio1: null,
      tmpPageType: ''
      // defaultCover
    };
  },
  methods: {
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    pageClick(info) {
      this.$emit('openTestPaper', {
        info: info,
        showRobot: this.isShowAi == '0' ? 'true' : 'false'
      });
      // console.log(this.BookName, '打印的info')
      //info.link 跳转地址
      // window.href = info.link
      // if (this.reader) {
      //   this.$emit('openTestPaper', { info: info, showRobot: this.isShowAi == '0' ? 'true' : 'false' })
      //   return
      // }
      // if (this.mode === 'preview') {
      //   if (this.tmpPageType === 'h5' || this.tmpPageType === 'pad') {
      // const url =
      //   process.env.VUE_APP_TESTPAPER_WEB +
      //   `/mobile-answer?testPaperId=${info.id}&showRobot=${this.isShowAi == '0' ? 'true' : 'false'}&BookName=${
      //     this.BookName
      //   }`
      // // const url = info.link
      // console.log('跳转url:' + url)
      // // window.location.href = url
      // this.$router.push({
      //   path: '/webView',
      //   query: {
      //     baseUrl: encodeURIComponent(url),
      //     title: info.paperName
      //   }
      // })
      //   } else {
      //     console.log(this.blockData)
      //     // window.location.href = process.env.VUE_APP_TESTPAPER_WEB + `/answer?testPaperId=${info.id}`
      //     this.$router.push({
      //       path: '/webView',
      //       query: {
      //         baseUrl: encodeURIComponent(
      //           process.env.VUE_APP_TESTPAPER_WEB +
      //             `/answer?testPaperId=${info.id}&showRobot=${this.isShowAi == '0' ? 'true' : 'false'}&BookName=${
      //               this.BookName
      //             }`
      //         ),
      //         title: info.paperName
      //       }
      //     })
      //     // window.location.href = info.link
      //   }
      // }
    }
  },
  created() {}
};

var __$_require_static_images_default_over_test_aper_png__ = "data:image/png;base64, ";

/* script */
const __vue_script__$4r = script$4r;
var __vue_render__$4r = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      class: "xml-question-container-" + _vm.pageType,
      attrs: { id: _vm.blockId },
      on: { click: _vm.blockClick },
    },
    [
      _c(
        "div",
        { staticClass: "question", staticStyle: { height: "100%" } },
        _vm._l(_vm.blockData.testPaperSetList, function (item, index) {
          return _c(
            "div",
            {
              key: index + Math.random(),
              staticClass: "workbench-shop-item xml-group-item",
              on: {
                click: function ($event) {
                  return _vm.pageClick(item)
                },
              },
            },
            [
              _vm._m(0, true),
              _vm._v(" "),
              _c("div", { staticClass: "text" }, [
                _c("div", { staticClass: "xml-paper-title title" }, [
                  _vm._v(_vm._s(item.paperName || item.title)),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "info" }, [
                  _c(
                    "span",
                    {
                      directives: [
                        {
                          name: "show",
                          rawName: "v-show",
                          value: item.questionNum,
                          expression: "item.questionNum",
                        },
                      ],
                    },
                    [_vm._v("共" + _vm._s(item.questionNum) + "题")]
                  ),
                  _vm._v(" "),
                  _c("span"),
                  _vm._v(" "),
                  _c(
                    "span",
                    {
                      directives: [
                        {
                          name: "show",
                          rawName: "v-show",
                          value: item.fullMark > 0,
                          expression: "item.fullMark > 0",
                        },
                      ],
                    },
                    [
                      _vm._v("\n            满分"),
                      _c("span", [_vm._v(_vm._s(item.fullMark))]),
                      _vm._v("分"),
                    ]
                  ),
                ]),
              ]),
            ]
          )
        }),
        0
      ),
    ]
  )
};
var __vue_staticRenderFns__$4r = [
  function () {
    var _vm = this;
    var _h = _vm.$createElement;
    var _c = _vm._self._c || _h;
    return _c("div", { staticClass: "shop-item-img" }, [
      _c("img", {
        staticClass: "question-img",
        attrs: {
          src: __$_require_static_images_default_over_test_aper_png__,
        },
      }),
    ])
  },
];
__vue_render__$4r._withStripped = true;

  /* style */
  const __vue_inject_styles__$4r = undefined;
  /* scoped */
  const __vue_scope_id__$4r = "data-v-5c4b43e7";
  /* module identifier */
  const __vue_module_identifier__$4r = undefined;
  /* functional template */
  const __vue_is_functional_template__$4r = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4r = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4r, staticRenderFns: __vue_staticRenderFns__$4r },
    __vue_inject_styles__$4r,
    __vue_script__$4r,
    __vue_scope_id__$4r,
    __vue_is_functional_template__$4r,
    __vue_module_identifier__$4r,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$4r.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('test-paper-render', {
    prefix: options.prefix
  }), __vue_component__$4r);
};

//
var script$4q = {
  name: 'XmlRecorderRender',
  components: {
    RecordPlayer: __vue_component__$4O
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    //属性中传递过来的块儿数据
    pBlockData: {},
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  watch: {
    pBlockData: {
      handler(newValue) {
        this.$nextTick(() => {
          console.log('新data', newValue);
          this.blockData = Object.assign({}, this.blockData, newValue);
        });
      },
      deep: true,
      immediate: true
    }
  },
  data() {
    return {
      blockId: 'blockId' + Math.random(),
      //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
      blockData: {
        playMode: 'xun-huan',
        scheduleControl: 'yes',
        playStyle: 'yuan-wen',
        styleMode: 'A'
      },
      //属性组件名
      propertyComponentsName: 'xml-recorder-property',
      dialogShow: false,
      curRecordUrl: '',
      curRecordTitle: '',
      curCoverFileUrl: '',
      curRecordContent: '',
      currentPlayer: {},
      modalPlayerKey: 'mpk' + new Date().getTime()
    };
  },
  methods: {
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    showDialog(param) {
      this.curRecordUrl = param.url;
      this.curRecordTitle = param.title;
      this.curCoverFileUrl = param.coverFileUrl;
      this.curRecordContent = param.content;
      this.currentPlayer = this.blockData.recordSetList[param.playerIndex];
      this.modalPlayerKey = 'mpk' + new Date().getTime();
      this.$nextTick(() => {
        this.dialogShow = true;
      });
    },
    timeUpdate({
      event,
      time
    }, data) {
      // console.log({event, time, data});
      this.$EventBus.$emit('audioTimeUpdate', {
        event,
        time,
        data
      });
    },
    getresdata({
      blob,
      duration
    }) {
      this.$emit('getresdata', {
        blob,
        duration
      });
    }
  },
  created() {},
  computed: {
    isEmpty() {
      return !(this.blockData.recordSetList && this.blockData.recordSetList.length);
    }
  }
};

/* script */
const __vue_script__$4q = script$4q;

/* template */
var __vue_render__$4q = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "xml-recorder-container",
      class: "xml-recorder-container-" + _vm.pageType,
      attrs: { id: _vm.blockId },
      on: { click: _vm.blockClick },
    },
    [
      [
        _c("div", { staticClass: "fixed-ratio-container" }, [
          _c(
            "div",
            {
              class: [
                "xml-recorder__wrapper",
                "style-mode--" + _vm.blockData.styleMode,
                _vm.mode,
              ],
            },
            [
              _c(
                "div",
                { staticClass: "xml-recorder-player-box xml-group-item" },
                [
                  _c("record-player", {
                    attrs: {
                      mode: _vm.mode,
                      loop: _vm.blockData.playMode === "xun-huan",
                      "play-mode": _vm.blockData.playMode,
                      "play-style": _vm.blockData.playStyle,
                      scheduleControl: _vm.blockData.scheduleControl,
                    },
                    on: { resData: _vm.getresdata },
                  }),
                ],
                1
              ),
            ]
          ),
        ]),
      ],
      _vm._v(" "),
      _c(
        "el-dialog",
        {
          staticClass: "resource-preview player-dialog",
          attrs: {
            title: "",
            visible: _vm.dialogShow,
            "destroy-on-close": true,
            width: "100%",
            modal: false,
            "show-close": false,
            "append-to-body": "",
            "custom-class": "preview-modal-recorder",
            "close-on-click-modal": true,
          },
          on: {
            "update:visible": function ($event) {
              _vm.dialogShow = $event;
            },
          },
        },
        [
          _c(
            "div",
            { staticClass: "xml-modal-player__wrapper" },
            [
              _c("xml-audio-modal-player", {
                key: _vm.modalPlayerKey,
                attrs: {
                  mode: _vm.mode,
                  styleMode: _vm.blockData.styleMode,
                  "play-style": "yuan-wen",
                  "play-mode": _vm.blockData.playMode,
                  url: _vm.curRecordUrl,
                  loop: _vm.blockData.playMode === "xun-huan",
                  title: _vm.curRecordTitle,
                  content: _vm.curRecordContent,
                  scheduleControl: _vm.blockData.scheduleControl,
                  "cover-image-url": _vm.curCoverFileUrl,
                },
                on: {
                  timeUpdate: function (e) {
                    return _vm.timeUpdate(e, _vm.currentPlayer)
                  },
                },
              }),
            ],
            1
          ),
        ]
      ),
    ],
    2
  )
};
var __vue_staticRenderFns__$4q = [];
__vue_render__$4q._withStripped = true;

  /* style */
  const __vue_inject_styles__$4q = undefined;
  /* scoped */
  const __vue_scope_id__$4q = undefined;
  /* module identifier */
  const __vue_module_identifier__$4q = undefined;
  /* functional template */
  const __vue_is_functional_template__$4q = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4q = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4q, staticRenderFns: __vue_staticRenderFns__$4q },
    __vue_inject_styles__$4q,
    __vue_script__$4q,
    __vue_scope_id__$4q,
    __vue_is_functional_template__$4q,
    __vue_module_identifier__$4q,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$4q.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('single-recorder-group-render', {
    prefix: options.prefix
  }), __vue_component__$4q);
};

var checkbox = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAPCAYAAADtc08vAAACT0lEQVQ4T3WTv2tUQRDHv7Pvnqig8VQwIvgjqJWVaGMj2PkHxE548N5uDrUwJBJNQK2NNhoOsrsXrxL1bJQgEhRPrGxUBG0iWIigEHJ3Ri3O93Zkz3vhjMk2y8585zOzszuEv4viOD5GREeJaBsRUdeeb98BvAXwXGv9Wym1nZljAC8piqL1YRgOE9FmAHPM/MU55/LILMuoUCh46HEi2ppl2VwQBKeY+UOz2ZwiKWWJiDY0Go2btVotW5G59yiklFeIaADA+0ajMen1pJQyhUJhuFwu/1greHBwcF2xWDwL4HBXM6W1ftW5u1JqRGt9QykVeoO/Yy9IKbURwAiAgwCWmPkNEf3UWt/pAJIkUcz8IAiC8845AeCWtfabd/pgIhpj5gFmZufcNQA7hBADxhizDEjT9FEYhuNEVATwi4jM4uLiu2KxONbNDOfcrLX2XpIkJwDst9bqZYA/RFHUH4bhBBFtAcAAvgLY6UXM/Hl+fv5yvV5P1wR4YalU2uWcuwSgL++Dr5yZr1prP3nbfwAp5RljTDkP8JA0TSeEEJu62Z8ZY6q5X0p5UgjRPz09fTt/heta69EVnd8N4CIzF7IsG5mZmVnK/Uqpc1mWfaxUKk86ACnlJIBZY8yLlRDn3CFr7ePcniTJPiHEeLvdvlCtVpsdwNDQ0AFmHnXOPWy1Wk9rtVp7lQ8l4jg+EgRB5Jy7b62t55rO0MRxvEcIcRrAXgALRJT2NFH4AQPQAnBXa/26N8E/U6eU6kvT1A+O/1CdFQSBf9KW1nphlcrwB3YxGYrLREgxAAAAAElFTkSuQmCC";

var chackboxactive = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAPCAYAAADtc08vAAACU0lEQVQ4T3VTO2hUQRQ9d+a91RWNaUJQMRHRCGlc2ey+N2sTsBHRxg+BdLEKllooKaxESSEoIQh+EFKI2ghRg5BgtspMgksKYQuDkE6DAXGbTeZ9rry37PKMZKq5d84998ydMwQADIjI80ZZiCsM9BNAST6zNph5boPo2VGtm1yp9IfMT4l5hnhwcH/Y1TULoh6O4ykC6gyE7WKSkmLmY4L5OoiOCOapmOg+AYvS2hEKlZph5oNOo3GN6nW7o3MnZEAGShkChgAsONZeoFotoECpRtPa41212uauxcXivtB1X4PoUoKJmUf2GPM22ScEH1ytL/Lw8N40Ua1uZYm4UOgO8vmPBFTAvMnAewJ+u8bcSvGh77+UUXQ3kPIdEUmH6CotLX1Ph1sodIf5/DwS2cwxmM8z0QkA5ZwxYx2CMI4fSCkXARwG8x8iGpPApwCYJ+Bsqoh50jXmjvX9cQF4TpYgCbbK5QEpZRXAoRTOvEZEA61a/uo2GkPJkHclSIGeNxgK8RlAb2YOEUeRn1tZ+ZLk/iOwSr3KaT3aLkhIIiGqDPSkd2R+4hhzo30e+P7NRJmj9XhrBkqtSa0HKDVka9ly+bQQYgGA29zePnlgdfVX+yxU6g0BWmr9KCWwvv9NEE06Wr/IPp8tlQpSiHNyeflhRl0xFGLRsfYU1Wo/Wj4olSqQcg5E9xxgmrRu7jRU4sJIqcsApmPmiZwxzztWTyUrdYaAx2AuMrBORFlLCwB9AH4S823HmNlsg39+HXtebyBlH6JIdkBE7AIbZMz6TmVJ/BfZ8hBQpXDnDQAAAABJRU5ErkJggg==";

var playIcon$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAtCAYAAABf9xDlAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OEE1RTlCNzNCOTk2MTFFRTg1MkJBRkNBN0FBNEIwN0QiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OEE1RTlCNzRCOTk2MTFFRTg1MkJBRkNBN0FBNEIwN0QiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4QTVFOUI3MUI5OTYxMUVFODUyQkFGQ0E3QUE0QjA3RCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4QTVFOUI3MkI5OTYxMUVFODUyQkFGQ0E3QUE0QjA3RCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ppwbv/YAAAJ+SURBVHja7Ji/SxxBFMfnohL8weEPLhaKopKk0COxNIWYRq6w8C+wsbI7LCwOsUiT2iJwjTbGUkijpIvIcaY0iFVMFL0TzsNDRQ3hlMl35bswTm5vZ39EJPjgw7pv3g9n5+2buRVSSmFIAnwEh6BMDqlLmMQwSdIFNqS7bNDWd7KXoCjNpUifivEitxkrSwPYBr3Cm/wEcXClDzyp4jTjI5Ggz0ylAaeZ1YA8aBf+pAA6wI3JzOIBEgn6xnVlrYNxBMwr901g0iXBArjQYhg9Rl2ege8g6jB+Dp6D42pBnB5jEkiFQpVEgmMFzSfppRpDl3tN5rRmT0G9ViA7LmvWrxXIL/DbpBoHQUIrELc1S2kF8hl8vWPl0MeSMrgk9bj/b4E8iGr8J2JX41TAxmu0E9gzk/e9ZmnQQlIhxE4p8dL6S21tmKf8Ox9CsrwSr0ad2RHoVgz3Q0imxrBiH9lrtgqGQIxbeR1bT7PPRKdscWXOqgg27Zmt8dmO8r5sP2efkmYMwZgttznYt9rABciACHXNIOejJ+boKxgrw9htaqOcpfG0ohsEJQ+JSvSx/aepn9VPxHX8L27AhKJ/AbIGibK0tf0mGCvD2H9tMTGwRecPIKqMjYFlcKD8sDigbkyxi9JXMlas2lm/ESzR+AS8BwOaTURZW5sB2p7Qd4mxjM76b8EcGOG99Sp847VEXStL/BWvlqyDd+CLn67fB8bBG54zOkEjxy5BjueTLPgEfoS9xWzx+vpxp35MFp64/IC33v4FcGbQrs7BotoxvHwtaAe7Prr+Ln09JVsJcPRe8fJpooefGIKI9dVgz6RAhkMoh2HTarwKIdm1rvgjwADXwMhaII0Z/AAAAABJRU5ErkJggg==";

var pauseIcon$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAAcCAYAAAA9UNxEAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTlFQzg3NThCOTk2MTFFRTlENDY5MUNCQzg0RTlFQzgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTlFQzg3NTlCOTk2MTFFRTlENDY5MUNCQzg0RTlFQzgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5OUVDODc1NkI5OTYxMUVFOUQ0NjkxQ0JDODRFOUVDOCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5OUVDODc1N0I5OTYxMUVFOUQ0NjkxQ0JDODRFOUVDOCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PngvZYIAAAJRSURBVHja7JlLKEVBGMcdj7ySVxaeRfLckZIrdEWJjYUlIWxs2CiKhWJjoaykFCvXzmtFVyllwcZKKGFFEaG8Ltd/8l3G6Yx7zpyDW85Xv87cOXO+M/+Zb2bOzFW8Xm/Qf7Jgg+WLwDIYMPHODvAI1kDID2hKBynCu6yHDeD2flqOwWd9bHM+CiV9iKgEHvAMHFplvuvhTJClykvk0lE6WroflKjywwRpI8YioxO0qaK0iu6FAqfWg6EChxVgHSigFrglKuUCZSQ6icLYKmsHU5R+AHOUVlSNonsM+1qK3S/38/I4sAkOQTGXn0rXGJCsQ0QNOAErINxP2VQunWvFpMXnK3581AEHyKYJSdZ6QAao1xgGfzZLaxnfG5Em/EQLhlozhWypCd/VYB40MseVoAnMgu0AWzbjwQx1TC4tizLGfKSBBiZ4EcRSKGUGmOBYLgoTTPiJ8a0sweTU15r2l5Yt2BZsC7YF24Jtwbbgfyv4XpA2as90fWGCX+mHJwAFn4MxsA+GTfgZBAdgiAmeANdgXNLZC5f2WNALzPiTxT6Qx23yZWySNh+jTHAvfUePSDrbABckdsFEpVwk9Bjs/lTIiI54HgUtr2WntHGPAFdc/i0XAZc66jJNDXaj4523qrA3LZhtlltoUnPpnFzUk0oXnWIsqSr4nV3qLMfOs7IoqmatEHwE8k1GzxahtldB2oixBuz+jWVpj65P4Eyysqt0ZQd2hxYPUY9gWH6YYvCvFnZC2Qp2gt5PKmWtgMb+ncWCmd91mjectJx9sTcBBgBvGSJPfLhgBQAAAABJRU5ErkJggg==";

var playIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABxBJREFUeF7dW2tsFFUU/s5sCygo7W4JwfggkZAYNNYnqBB31iI2jYnERwyiRuILFcJuwZQEAgYfDbSzii8CYqDlYRQhUQNIS3cFkRbERxXTYMCCgGI7U0ssXbbbOWa2bu1ruzOzM8suN9lfe+53vvPdc2fu4wwhBc1ddjYPjnA+VM4XBMdogHPAyGFoP2onQgsxt6is/g1QI1RuRFZWY9Cb22g3PbLLgcevFLKqFjKRm4AbTPth3gjQtmHZqNox13XWNE6cjpYK4C5TJhOpj4BQCNA4i8kqALZAVVcH5o86ZBW2JQKIkjID4BkAiqwilgBntVVCJCWA6FeKAC4BY3KKAu/lhsGlWWGhtLrE2WrWvykBCt5Uru5ktQRMs806tqofAT8xqDTgc24yg2lYgHvKW0SV1FUAxptxaFsfxocRYdiivd7hfxjxYUgAj7/5cWaqMOIgxbYNTFgc9Lq26PWrWwBRkr9I4UNOL/8B7ZhoUdDrfE0PiC4BREmuAlCgBzBdbJjopaDX+W4iPgkFEP3yWjBmJQJKy/+ZnwwU5w06ZQcVwF3etJRIWJKWwekkRcC0Gp9rVzzzuAJ4pObpDNqq0086m9ULwtB7d88bcWYgkgMK4Fl+5lrOzv4SzNemc2T6uVFlwOd8QrcAbkneSsB0/Q7S35KI59Z4897uy7RfBrjLlZlEXJn+IRlkyDjtECJTqr2jj/Xs2UuAwpU8NBRp+Qbgmw3CZ4r5moDP9WxcATySUsLgNzIlGlM8mYoCxc7tsb7dGVBQqozsHML1AK42BZwhnYiwrsbreqqfAJ5yZTYTv5chcSRDs41JuD523NadAaJf3mv3vn786CxMGJOF+lMdONrUmUwQSfallwM+5woNJCqAWCZPg4CdSaIO2n1J0QjcPX5It82+o2FU1oVw5EzETrfxsA8EfK6J3QLYveTtG3yMVaiDUVnXjs0HQykXgRl3BItdtV0ZICkBgN12sfj8xVwMHxJ/2/Hd7x3YUBvCDyc77KLQD5dApTU+50IqXClfHorA9JlaIsbavF814/JEZtH/Nx5oj06LcIR12Sdp1BDwua4jtyTfR8COJMHids+/MhvSw5fphm/4MxKdFvuP2Z8NHecdTnJLTc8ThPd1MzRoaFSAGPy2H0KorA3h73bVoEcD5qp6K3kk5Q3WjrZtamYF0OicUDqj2bC7IWwLO2I8ogmwmcGP2uIBQDICxDjtPHwey3e1WU6RmUpI9Ct7wWzbxYYVAmiRf3wohFV7zlkqAhGVkSjJPwOYYClyDzCrBNAgZ1W0olG2bgVJhA9I9MunwLgiEwQoq2rD9p/PW0aVgC1aBmh5dYllqH2ArMyA13f8g2prH4jVmgAtAHIyQYAn1rXiZIt1U4BBn5MoKd8DnJ/uAqyvbcf6/e3W0iSqII9f2cbMD1iL/D9aslNAWxRX2BF811b4LfL4ZT8z5qWjANomSQu+/qQ9W2Zm9RVNgKeZsSadBIioXaO+oc7ilO8bpMNRQGJZ0y0QhG/TRYCDx7tG/fBpe0a9R5yhYVnOHOo6Cle0N4Etr8JxoxxYPXNkQn3PRxjag+6j1B2OVAd8rqn/HYjI+wDcmZClSYPPXsjFiKHxD0Rqf+sadW0rnKqmzf9g8ailUVYX6kisLczRwD85lPojMXTypMCCvLquDFjRPBEOqrVT/YEORbXgf/3LuoWNbv6EuoDXNUmz73ksXgtG9KTUrqatCW68KgtfHQlbuqkxyjeW/r0EsHsaGCVppz3DcVvQlxN983VnwDSp1RlGR50NJa52xmIG+9OAz/VQrGOvR7PH3zKHWV1pBjVj+pDwYMCb21350u/dJPpl258FF0osIhys8bpu7+m/f4GEX3mMmDdcKJJ2+mWB7g/Oc2r1jt1twNWJW5K3E7SS94unaYXVQV/ewr4RDSiA6FfuAngXGJdeFBIQ9nBr/T3BpWK/pWbc9alban6JQP2KijJQEAUseALFuT8OxH3QQkmxXF4LytAq0f+iJVW4u2Z+7p54A5ewVNYtNX9HoJsycOTBRDODXufGwbgnFEDrLEpySq5rrRSZGWXBYteCRJi6BNBAMunNQKB3anzOOYmC77UU1mMsSspygBOqqgfLLhsCXq3xuRbrxdedATFAUZK9AJYBGK7XSYrsDH8tYjgDukVY0TyRBVpGhKkpCm5wNya/FzItQIxNdAstCM/Yebc4WOTazQ4ErO67vDUyKIanQF/wKf62MQ713HOpFMKKwGNxJC1ADEgTIhvhh1RWC23aR7SCeBN3CpuC851fGxnlpNcBRp25pdZxAqmFAHuYo+V3Zi9fTwHYycD+LIGqquc5TxjlksjesgwYzJF7RZMbAtyCIFzDTGMBHgtgLAgtYGh3EtqviUCNKtTjADc6OtVfdi8YrRVv29r+BTKBrQtOiFe6AAAAAElFTkSuQmCC";

var pauseIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABrJJREFUeF7lm21sU1UYx//PXbcJQ0d7mREkuixqlqiwRA0MQdqymIAoIOAHooD4Fkkc6R0TSCCMQALK1js00YhRXNTEOExQJBOBtgg6UFFQTAxgggYRYe2GA2EvvY+5hc52Xdt7u1O4y863pv/zvPzuyzn3POcQrkFzqmfLwFQKULEE6XYGFwMoAmAHwQ6GHcBJgE4S8UlN035nSdq51yM3Zzs8yoaDivrQbd1aeJqEnMkMdgK4JUM/IQb2SCTt01hqCiiFJzK0k7SbUADO2tBEytHmgWkegELRwTLQJJHU1IW8rfs8BX+JsC8EgLM+NB0anifwoyKCSmuDcJo17e2wNPSt/oLoF4BrnnhvMjoIYHPAI69JCy2JICMAk9SLI23a5XUgLMrUsch+zNhFGq/yV484aNauaQBONTiHGGsBlJp1lmX9RQCr/IqsmvFjCoDb27KSQXryFm70vl9xzDcaoGEAbrXlJWZ6zajh66z7ya/IY43EYAiA0xusIqDWiEErafyKnDa/tAK3GlzKjI1WSsxoLAzeHlBGPJZKnxKAq651PkhrMOrQijrSuNK3dMTryWJLCsBdF5zAEnaCMcyKiZmJiUmaFfDYt/XVp08Azhq/jQrH7AHjITOOLKtlnGfSKgJK0feJc6k+onZ6W9YTaLllE8ogMP07IqDI09IC0Ke3pPH2DHxYvgsTPRnwOD6MDTThEXCrwW+Z8YDls8kkQMJBv0cenxSAS219HKx9kontVH3Gjs6FTQKOnu5GRzenNJ9vI9wzyoZuDThyqkt0KCCSKn0ee8+oEHcHuLzBrQBmi/TqnXsTykbbIiaPnw3jjb3/Jk1MB7V48lDceXNORH/4VDeUxn9EhgOAT+Qhd9xOpTCkG+4B4PS23U8IfyfS2+S78rD6kfhR9NMjHdjk079bEtsSdwFmjM2P+2PNjgvYe6xTZFhgQk30E7oHgMsbfBVAtUhPC8qHYMH4IXEmU13V2Lsl2qnhwCU0NF8SGZZ+2XveBREAD288U9CVk3sUgL5YKaxZFoCeYZjH6+sHEQDOupaFRLRFWOZXDVkZALO2JlBVVBMB4PIGdwBImCT0F4iVAQD4xq/ID14BoAb/BGNUfxPu3d/SAJgvc3u7nSrUtpIwh38Tnbxuz9IA9AGRUU7ZnPpaHgC0F8lZd66GSFo9GO8AItST2xusZ2DJ4ARA28ilhhrAbHgV1Qwoqz8CAB0mpzf0WbZKWtYHgDZyeYO7AFSYubJGtQMAwCX9HdDIwByjSZnRWR4A4TS51eDbzHjWTGJGtZYHAPxCbjW0kZmXGk3KjM7yAIj2k7MutIyIN5hJzKjW6gAI9BG564JzmfCx0aTM6AYAgA3kqj13HyQpYb3cTKLJtFYHwPpUeOL6NntufjiyPia6WR8Apl79HA4dAfOYQQeAJHsUwMtgfmWQATjgV+TyK0tiamsZsfbjYAJAoA0+xbEidlX4AIBxIiFY+R3AwNSAIn8RAyBUDbC+NC6sWRYAYb/fI0/SE/2/MKK2FhNr+tJ4gSgC7tI8rJwaXxj5/OcOeHf3XRhRKgow/d74wsi6pgvw/Sq2MEJMi31VjjfjAOg/3GpwCzMWigIwLJ+gFzvuKLpS6tKb0tiOw0lqfmWjc+Gde2OP9sS5cKQ0dqEjdT3RZLx/5HTSmN3LHecTALjqQtNArC+RC2t3j7ShvCQXtw7PQeB4Z9oyl64tL8lDWAMCxzqFF0gJtMKnOHqm/gnlcZc3uBnAc8IIWMoQ/XCDzT6hqZI6omElAKhQ/y4Ja7Z9IPF1guvNgpmeClQ5PoiNo889QgNsU6QhrsS0zVflmNVbnHyXWBZXigxFLFZ0lsM0JVDt0Ee5uJYUgLO2pZRySN8pJrxkJjY3Q9Ze8Cuy/m5LaKk3SqrBRWC8Y8iFdUUNfkVOOrSn3SqbzcpR1pkR3vV75GdS+UkLQO88ECEw0BhQ5CfSQTYEYABC2ONXZEO1DsMAIhCse1ok5kJn6cBE1IPVzgvFTWoI1T6PbOpcg6k7INaZSx8hgLVWGCb1550JaiYnTTMGEHkkaltKJYnWZqu0ZuAF1gyG6quSG9Npk/3fLwBRo25v69MMTT8taujFk2mwMf0OAdicbHJjxr4QAFGHrk1tU6CF50HDbJD4o7MENDPwnojEozELBRA16lRbh0MLz5QkaQYzzzRzReK1fIyZvpKAL7VcNAcq5VOZ2+q7Z1YA9HblVFuL0d1dDImKAS6WSBrORHZm2Ak8hIA2ENoAatOYzyCsHerScOjrZUXtohPube8/AMNbG4WK/N0AAAAASUVORK5CYII=";

var audioIcon = "data:image/png;base64, ";

var coverLocal$1 = "data:image/png;base64, ";

var playRepeat$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAaCAMAAADhRa4NAAAAAXNSR0IArs4c6QAAAi5QTFRFAAAAAID/QID/M5n/JJL/SZL/TYD/O4nrQJ/vR47xQIz/OovoQ5DpPYXrPYX1QJLtPo3tRJDuOI//QI/vOpL4QpLwOZzxQI7qRYr4Po/sPo/zPYztPZL5QIvuQJHuOZL1RI3vPYrwQYzwOY7xQo7sQo3tQpHtPY7vQY7zI4XzPI/wQI/sQZDtSpHtP4/uPo3nPo3xQYvuRoDuQY3vQIn1QI/tOpfxP4zvQY3sKrv1MYv1QJDtQI/tPpLwQJDxQo/sQI7tQYzuPI7vQZDvQY3xQI7sM6nyQY3sQJLvPpLtQI/tQI/vRIntQI7uQI7vQY7uQY7tQY3tQo7tPYzxP47wQpDuRJDxQo7tQo7vQI3tQ5PtRI3uQJXxQYvxQZDxQJDuQ5DsQI7uPozsOpPtQY7tQI7tQI7uQI/uQ43sQY7tQI/tQY7tQ43vQ4/tQY7tQovsQI/tQY7uQI/wQo7uQo7tQI/uQYztQ43vQYvtQY7tQI7qQI7vQY3uQo/tQI/rQY7uQY7tQo7uP43vQI3vQY7tQY7rQpDvQY7tQY/tQY7tQY7vQY7sQo7tQ5DrQY7sQY7tQo7tQY7tQI3sQI7qQI7sQI/qQI/tQI/uQY3rQY3sQY3tQY7rQY7sQY7tQY/sQY/tQozsQo3pQo3qQo3sQo3tQo7rQo7sQo7tQo7uQo/qQo/sQo/tQ4nrQ4vuQ4zsQ43sQ47qQ47rQ47sQ4/qQ4/sRIvrRobsSI/qS3/qS5DpVRNwpwAAAJJ0Uk5TAAIEBQcHCg0QEhQWFxkZHB0eICAjIyQkJSkpKiosLDExMjM2Njo6Pz9BRERHSElKSktMTlBUXV1eYmNjZGdsbXN2fH6Ch4iJjI+Pj4+Tk5WZmpqgpaWmq6usrq+wsLGzs7a4ubm8vsLHyMvLy8vMzc/V1tbZ3N3e4ePm5ubp6+vs7e7u8PHy8/T29vj5+vz8/P6b5lOEAAABY0lEQVQYGY3BhztVYRwH8C+XsiIjM3tlFZGSPcsoM5SVUXZ2ocgOmSUj76+Lm3OsZEb/HR5d93iPp8fnAyn3+JzyqlfpoddxoeC6n0QkkJJYtgNkHCqVIpU9CguMTG2gLywFHL+Z3wuPLXHqdpmgKlVAyuuv0GgFjYjpjRpIXJlgFbqQunv49Qk08nbfgxOy+OsW1DzWlzzBK9ivh5pzfyFkDH4o7fFfr/8k4J/7VyFz7V7sQr7eA5x4xrpNwHsx16V820o49lIg6jIHJ+ibSMQ+AcjcpkkS+0zAubNGRC4A3k2VjH8cITvw/FfGXHDM2MZU6HF1gpy+OU4pBma9IeemgFrGchNkbrAOqFnQwUPwauff4MzT5VEznBcn7DlCo32r1xZSUcSiIWE9vPrZF2e0k1SbuTjnZqdIxQFaOGEU1bYznQiO4XNSfR+qTkvOaiaRPoRDzqdokIgYI2qJ0cGlHQE0EGWmZ0WkvQAAAABJRU5ErkJggg==";

var playOnce$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAgCAMAAAA2a+hwAAAAAXNSR0IArs4c6QAAAlJQTFRFAAAAgID/QID/QID/OY7jRovoO4nrSZLtRIjuPIfwQIzyQJnySZLzRpfzQ4X0QIrqQo7sPo3tEN73RI/wPI3yQZDrPo/sQ4ztQ4zzO4jtQY7tPo7uPYvuQI/vOY3vPo3vPIzrQZHwNqL1QI7wRYTrK4b2QY/uP47uR47yQIvvP43rQI/wP5DwSXz0QozuPYvxQY/uQI3uQY3vQI/yQZDzQpDwQ472QI3uPIn3P4vqQo7vQo3tQI3uQJDuQI7uQI3uQI7sQo7sQpHxQY3sPo7vQI7tQI/xQY7tQY3tQY3vPo7vQo/rP5HuQY3uQJDxQorsQo7sQo7vOI3xQovrQo3rQY7tQY3tQI7tQI3sPY/wN5vvQo7vNKPyQY7tQ43tQY/uQorsQI7sQY3uPJfwQI7wPpPuP4/vQY7tTnTsRJPxP47vQYzsPZDvP43uQo7sO5jvQY3uPZDwQ4ftQI7tQo3uQY7uQo7uQY7tQY7tQ43wQY7tQI3tQI7uQI7tQI/wP4zuQ5DtQY7tRJHsQI7tQY7tQI7tQY7uQI7uQY3uQo7tPpHtQI7tQY/sQY7sQY/tQY7tQY7tQY3sQY/uQI7tQY7tQo7uQo/uSY7tQY/tTXnqQY3tQY7tQY7tQY7tQY7tQY7uQY7tPZXtQY3tQY7tQY7tQY7tQo/tP5LqQI/rQI/sQY3sQY7rQY7sQY7tQY/rQY/sQY/tQZDtQozsQo3rQo3sQo3tQo7qQo7rQo7sQo7tQo/tQ4vsQ4zrQ47qQ47sRIfrRInsRI/rRI/sRYnsR4TqR4fqvnKd/wAAAKd0Uk5TAAIECAkLDQ4PERQUFRYXGBsdHyImJykqKisrLS4wMTEzMzQ0NDs7PT1AQURFRklLS0xOUFNVWFxdYWFlZ2doa2xsbW5vb3BxcnJzdHl5fHx8fH+AgIGCg4iJjIyOjpGSkpOUlZeZm56goaKio6OjpKaqqq6vsLO0t7i5vL7GxsfHyMjLy8zN0tTW2trc4ubn6erq7Ozs7Ozu7vHz9Pb3+Pn6+/v9/v6utNnsAAABnklEQVQYGY3BhVsTcQDH4c8QRbCwu7tbVFQsPLu7u3t2YRfYXRhg7r4GMnYzMPm/nLf7nTjkeXxf/lv7I3OoVP+IllCpvg80l39rNiTrkrQymQpqTD4rV7QriabkRx3tnXdP9tQqkDGAP1IPKXw6qy7ZciYCqbLnY6RdkDKBUVI2MUlL39jr8eQV3elATKdTI4kb+6FsMa7NZY/rkWDw8589ielS8qU3FWwquRoAcu0N+Opg3AxNgFalr2rhSd/3qBuece8vwszvOXjGFEiz8dQOC46GRuNK3iMVaDzG+TBct3vgSpGGrpOFse0rPH3blLhGrdkqC2P5OyhUQ3y7ZWEs/AG31RlfUBbGmiLIdQbiC8rC2P8SNkaW4QvKwrgfhkGhu/h2aRKedsVhqGnb/TAOazqend8OAit0BWP4ycbEdXxR2hJIeRJZS6LArc87+K2Xo2n8Len46xsBXAs+fVxFeU3OhJ61wTNL0XPdMarOkPOwLb7M/GIdGNE8rVr1+n1WX3OcYw0oJ32LnKhcjvKGkaDFohOFirm8PQPPL6EvjEOwGD5qAAAAAElFTkSuQmCC";

var recStartIcon = "data:image/png;base64, ";

var recStopIcon = "data:image/png;base64, ";

var recDelete = "data:image/png;base64, ";

var recMockWave = "data:image/png;base64, ";

var core = createCommonjsModule(function (module, exports) {
(function (root, factory) {
  {
    // CommonJS
    module.exports = factory();
  }
})(commonjsGlobal, function () {
  /*globals window, global, require*/

  /**
   * CryptoJS core components.
   */
  var CryptoJS = CryptoJS || function (Math, undefined$1) {
    var crypto;

    // Native crypto from window (Browser)
    if (typeof window !== 'undefined' && window.crypto) {
      crypto = window.crypto;
    }

    // Native crypto in web worker (Browser)
    if (typeof self !== 'undefined' && self.crypto) {
      crypto = self.crypto;
    }

    // Native crypto from worker
    if (typeof globalThis !== 'undefined' && globalThis.crypto) {
      crypto = globalThis.crypto;
    }

    // Native (experimental IE 11) crypto from window (Browser)
    if (!crypto && typeof window !== 'undefined' && window.msCrypto) {
      crypto = window.msCrypto;
    }

    // Native crypto from global (NodeJS)
    if (!crypto && typeof commonjsGlobal !== 'undefined' && commonjsGlobal.crypto) {
      crypto = commonjsGlobal.crypto;
    }

    // Native crypto import via require (NodeJS)
    if (!crypto && typeof commonjsRequire === 'function') {
      try {
        crypto = crypto$1;
      } catch (err) {}
    }

    /*
     * Cryptographically secure pseudorandom number generator
     *
     * As Math.random() is cryptographically not safe to use
     */
    var cryptoSecureRandomInt = function () {
      if (crypto) {
        // Use getRandomValues method (Browser)
        if (typeof crypto.getRandomValues === 'function') {
          try {
            return crypto.getRandomValues(new Uint32Array(1))[0];
          } catch (err) {}
        }

        // Use randomBytes method (NodeJS)
        if (typeof crypto.randomBytes === 'function') {
          try {
            return crypto.randomBytes(4).readInt32LE();
          } catch (err) {}
        }
      }
      throw new Error('Native crypto module could not be used to get secure random number.');
    };

    /*
     * Local polyfill of Object.create
      */
    var create = Object.create || function () {
      function F() {}
      return function (obj) {
        var subtype;
        F.prototype = obj;
        subtype = new F();
        F.prototype = null;
        return subtype;
      };
    }();

    /**
     * CryptoJS namespace.
     */
    var C = {};

    /**
     * Library namespace.
     */
    var C_lib = C.lib = {};

    /**
     * Base object for prototypal inheritance.
     */
    var Base = C_lib.Base = function () {
      return {
        /**
         * Creates a new object that inherits from this object.
         *
         * @param {Object} overrides Properties to copy into the new object.
         *
         * @return {Object} The new object.
         *
         * @static
         *
         * @example
         *
         *     var MyType = CryptoJS.lib.Base.extend({
         *         field: 'value',
         *
         *         method: function () {
         *         }
         *     });
         */
        extend: function (overrides) {
          // Spawn
          var subtype = create(this);

          // Augment
          if (overrides) {
            subtype.mixIn(overrides);
          }

          // Create default initializer
          if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {
            subtype.init = function () {
              subtype.$super.init.apply(this, arguments);
            };
          }

          // Initializer's prototype is the subtype object
          subtype.init.prototype = subtype;

          // Reference supertype
          subtype.$super = this;
          return subtype;
        },
        /**
         * Extends this object and runs the init method.
         * Arguments to create() will be passed to init().
         *
         * @return {Object} The new object.
         *
         * @static
         *
         * @example
         *
         *     var instance = MyType.create();
         */
        create: function () {
          var instance = this.extend();
          instance.init.apply(instance, arguments);
          return instance;
        },
        /**
         * Initializes a newly created object.
         * Override this method to add some logic when your objects are created.
         *
         * @example
         *
         *     var MyType = CryptoJS.lib.Base.extend({
         *         init: function () {
         *             // ...
         *         }
         *     });
         */
        init: function () {},
        /**
         * Copies properties into this object.
         *
         * @param {Object} properties The properties to mix in.
         *
         * @example
         *
         *     MyType.mixIn({
         *         field: 'value'
         *     });
         */
        mixIn: function (properties) {
          for (var propertyName in properties) {
            if (properties.hasOwnProperty(propertyName)) {
              this[propertyName] = properties[propertyName];
            }
          }

          // IE won't copy toString using the loop above
          if (properties.hasOwnProperty('toString')) {
            this.toString = properties.toString;
          }
        },
        /**
         * Creates a copy of this object.
         *
         * @return {Object} The clone.
         *
         * @example
         *
         *     var clone = instance.clone();
         */
        clone: function () {
          return this.init.prototype.extend(this);
        }
      };
    }();

    /**
     * An array of 32-bit words.
     *
     * @property {Array} words The array of 32-bit words.
     * @property {number} sigBytes The number of significant bytes in this word array.
     */
    var WordArray = C_lib.WordArray = Base.extend({
      /**
       * Initializes a newly created word array.
       *
       * @param {Array} words (Optional) An array of 32-bit words.
       * @param {number} sigBytes (Optional) The number of significant bytes in the words.
       *
       * @example
       *
       *     var wordArray = CryptoJS.lib.WordArray.create();
       *     var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
       *     var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
       */
      init: function (words, sigBytes) {
        words = this.words = words || [];
        if (sigBytes != undefined$1) {
          this.sigBytes = sigBytes;
        } else {
          this.sigBytes = words.length * 4;
        }
      },
      /**
       * Converts this word array to a string.
       *
       * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
       *
       * @return {string} The stringified word array.
       *
       * @example
       *
       *     var string = wordArray + '';
       *     var string = wordArray.toString();
       *     var string = wordArray.toString(CryptoJS.enc.Utf8);
       */
      toString: function (encoder) {
        return (encoder || Hex).stringify(this);
      },
      /**
       * Concatenates a word array to this word array.
       *
       * @param {WordArray} wordArray The word array to append.
       *
       * @return {WordArray} This word array.
       *
       * @example
       *
       *     wordArray1.concat(wordArray2);
       */
      concat: function (wordArray) {
        // Shortcuts
        var thisWords = this.words;
        var thatWords = wordArray.words;
        var thisSigBytes = this.sigBytes;
        var thatSigBytes = wordArray.sigBytes;

        // Clamp excess bits
        this.clamp();

        // Concat
        if (thisSigBytes % 4) {
          // Copy one byte at a time
          for (var i = 0; i < thatSigBytes; i++) {
            var thatByte = thatWords[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
            thisWords[thisSigBytes + i >>> 2] |= thatByte << 24 - (thisSigBytes + i) % 4 * 8;
          }
        } else {
          // Copy one word at a time
          for (var j = 0; j < thatSigBytes; j += 4) {
            thisWords[thisSigBytes + j >>> 2] = thatWords[j >>> 2];
          }
        }
        this.sigBytes += thatSigBytes;

        // Chainable
        return this;
      },
      /**
       * Removes insignificant bits.
       *
       * @example
       *
       *     wordArray.clamp();
       */
      clamp: function () {
        // Shortcuts
        var words = this.words;
        var sigBytes = this.sigBytes;

        // Clamp
        words[sigBytes >>> 2] &= 0xffffffff << 32 - sigBytes % 4 * 8;
        words.length = Math.ceil(sigBytes / 4);
      },
      /**
       * Creates a copy of this word array.
       *
       * @return {WordArray} The clone.
       *
       * @example
       *
       *     var clone = wordArray.clone();
       */
      clone: function () {
        var clone = Base.clone.call(this);
        clone.words = this.words.slice(0);
        return clone;
      },
      /**
       * Creates a word array filled with random bytes.
       *
       * @param {number} nBytes The number of random bytes to generate.
       *
       * @return {WordArray} The random word array.
       *
       * @static
       *
       * @example
       *
       *     var wordArray = CryptoJS.lib.WordArray.random(16);
       */
      random: function (nBytes) {
        var words = [];
        for (var i = 0; i < nBytes; i += 4) {
          words.push(cryptoSecureRandomInt());
        }
        return new WordArray.init(words, nBytes);
      }
    });

    /**
     * Encoder namespace.
     */
    var C_enc = C.enc = {};

    /**
     * Hex encoding strategy.
     */
    var Hex = C_enc.Hex = {
      /**
       * Converts a word array to a hex string.
       *
       * @param {WordArray} wordArray The word array.
       *
       * @return {string} The hex string.
       *
       * @static
       *
       * @example
       *
       *     var hexString = CryptoJS.enc.Hex.stringify(wordArray);
       */
      stringify: function (wordArray) {
        // Shortcuts
        var words = wordArray.words;
        var sigBytes = wordArray.sigBytes;

        // Convert
        var hexChars = [];
        for (var i = 0; i < sigBytes; i++) {
          var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
          hexChars.push((bite >>> 4).toString(16));
          hexChars.push((bite & 0x0f).toString(16));
        }
        return hexChars.join('');
      },
      /**
       * Converts a hex string to a word array.
       *
       * @param {string} hexStr The hex string.
       *
       * @return {WordArray} The word array.
       *
       * @static
       *
       * @example
       *
       *     var wordArray = CryptoJS.enc.Hex.parse(hexString);
       */
      parse: function (hexStr) {
        // Shortcut
        var hexStrLength = hexStr.length;

        // Convert
        var words = [];
        for (var i = 0; i < hexStrLength; i += 2) {
          words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << 24 - i % 8 * 4;
        }
        return new WordArray.init(words, hexStrLength / 2);
      }
    };

    /**
     * Latin1 encoding strategy.
     */
    var Latin1 = C_enc.Latin1 = {
      /**
       * Converts a word array to a Latin1 string.
       *
       * @param {WordArray} wordArray The word array.
       *
       * @return {string} The Latin1 string.
       *
       * @static
       *
       * @example
       *
       *     var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
       */
      stringify: function (wordArray) {
        // Shortcuts
        var words = wordArray.words;
        var sigBytes = wordArray.sigBytes;

        // Convert
        var latin1Chars = [];
        for (var i = 0; i < sigBytes; i++) {
          var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
          latin1Chars.push(String.fromCharCode(bite));
        }
        return latin1Chars.join('');
      },
      /**
       * Converts a Latin1 string to a word array.
       *
       * @param {string} latin1Str The Latin1 string.
       *
       * @return {WordArray} The word array.
       *
       * @static
       *
       * @example
       *
       *     var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
       */
      parse: function (latin1Str) {
        // Shortcut
        var latin1StrLength = latin1Str.length;

        // Convert
        var words = [];
        for (var i = 0; i < latin1StrLength; i++) {
          words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << 24 - i % 4 * 8;
        }
        return new WordArray.init(words, latin1StrLength);
      }
    };

    /**
     * UTF-8 encoding strategy.
     */
    var Utf8 = C_enc.Utf8 = {
      /**
       * Converts a word array to a UTF-8 string.
       *
       * @param {WordArray} wordArray The word array.
       *
       * @return {string} The UTF-8 string.
       *
       * @static
       *
       * @example
       *
       *     var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
       */
      stringify: function (wordArray) {
        try {
          return decodeURIComponent(escape(Latin1.stringify(wordArray)));
        } catch (e) {
          throw new Error('Malformed UTF-8 data');
        }
      },
      /**
       * Converts a UTF-8 string to a word array.
       *
       * @param {string} utf8Str The UTF-8 string.
       *
       * @return {WordArray} The word array.
       *
       * @static
       *
       * @example
       *
       *     var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
       */
      parse: function (utf8Str) {
        return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
      }
    };

    /**
     * Abstract buffered block algorithm template.
     *
     * The property blockSize must be implemented in a concrete subtype.
     *
     * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
     */
    var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
      /**
       * Resets this block algorithm's data buffer to its initial state.
       *
       * @example
       *
       *     bufferedBlockAlgorithm.reset();
       */
      reset: function () {
        // Initial values
        this._data = new WordArray.init();
        this._nDataBytes = 0;
      },
      /**
       * Adds new data to this block algorithm's buffer.
       *
       * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
       *
       * @example
       *
       *     bufferedBlockAlgorithm._append('data');
       *     bufferedBlockAlgorithm._append(wordArray);
       */
      _append: function (data) {
        // Convert string to WordArray, else assume WordArray already
        if (typeof data == 'string') {
          data = Utf8.parse(data);
        }

        // Append
        this._data.concat(data);
        this._nDataBytes += data.sigBytes;
      },
      /**
       * Processes available data blocks.
       *
       * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
       *
       * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
       *
       * @return {WordArray} The processed data.
       *
       * @example
       *
       *     var processedData = bufferedBlockAlgorithm._process();
       *     var processedData = bufferedBlockAlgorithm._process(!!'flush');
       */
      _process: function (doFlush) {
        var processedWords;

        // Shortcuts
        var data = this._data;
        var dataWords = data.words;
        var dataSigBytes = data.sigBytes;
        var blockSize = this.blockSize;
        var blockSizeBytes = blockSize * 4;

        // Count blocks ready
        var nBlocksReady = dataSigBytes / blockSizeBytes;
        if (doFlush) {
          // Round up to include partial blocks
          nBlocksReady = Math.ceil(nBlocksReady);
        } else {
          // Round down to include only full blocks,
          // less the number of blocks that must remain in the buffer
          nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
        }

        // Count words ready
        var nWordsReady = nBlocksReady * blockSize;

        // Count bytes ready
        var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);

        // Process blocks
        if (nWordsReady) {
          for (var offset = 0; offset < nWordsReady; offset += blockSize) {
            // Perform concrete-algorithm logic
            this._doProcessBlock(dataWords, offset);
          }

          // Remove processed words
          processedWords = dataWords.splice(0, nWordsReady);
          data.sigBytes -= nBytesReady;
        }

        // Return processed words
        return new WordArray.init(processedWords, nBytesReady);
      },
      /**
       * Creates a copy of this object.
       *
       * @return {Object} The clone.
       *
       * @example
       *
       *     var clone = bufferedBlockAlgorithm.clone();
       */
      clone: function () {
        var clone = Base.clone.call(this);
        clone._data = this._data.clone();
        return clone;
      },
      _minBufferSize: 0
    });

    /**
     * Abstract hasher template.
     *
     * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
     */
    C_lib.Hasher = BufferedBlockAlgorithm.extend({
      /**
       * Configuration options.
       */
      cfg: Base.extend(),
      /**
       * Initializes a newly created hasher.
       *
       * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
       *
       * @example
       *
       *     var hasher = CryptoJS.algo.SHA256.create();
       */
      init: function (cfg) {
        // Apply config defaults
        this.cfg = this.cfg.extend(cfg);

        // Set initial values
        this.reset();
      },
      /**
       * Resets this hasher to its initial state.
       *
       * @example
       *
       *     hasher.reset();
       */
      reset: function () {
        // Reset data buffer
        BufferedBlockAlgorithm.reset.call(this);

        // Perform concrete-hasher logic
        this._doReset();
      },
      /**
       * Updates this hasher with a message.
       *
       * @param {WordArray|string} messageUpdate The message to append.
       *
       * @return {Hasher} This hasher.
       *
       * @example
       *
       *     hasher.update('message');
       *     hasher.update(wordArray);
       */
      update: function (messageUpdate) {
        // Append
        this._append(messageUpdate);

        // Update the hash
        this._process();

        // Chainable
        return this;
      },
      /**
       * Finalizes the hash computation.
       * Note that the finalize operation is effectively a destructive, read-once operation.
       *
       * @param {WordArray|string} messageUpdate (Optional) A final message update.
       *
       * @return {WordArray} The hash.
       *
       * @example
       *
       *     var hash = hasher.finalize();
       *     var hash = hasher.finalize('message');
       *     var hash = hasher.finalize(wordArray);
       */
      finalize: function (messageUpdate) {
        // Final message update
        if (messageUpdate) {
          this._append(messageUpdate);
        }

        // Perform concrete-hasher logic
        var hash = this._doFinalize();
        return hash;
      },
      blockSize: 512 / 32,
      /**
       * Creates a shortcut function to a hasher's object interface.
       *
       * @param {Hasher} hasher The hasher to create a helper for.
       *
       * @return {Function} The shortcut function.
       *
       * @static
       *
       * @example
       *
       *     var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
       */
      _createHelper: function (hasher) {
        return function (message, cfg) {
          return new hasher.init(cfg).finalize(message);
        };
      },
      /**
       * Creates a shortcut function to the HMAC's object interface.
       *
       * @param {Hasher} hasher The hasher to use in this HMAC helper.
       *
       * @return {Function} The shortcut function.
       *
       * @static
       *
       * @example
       *
       *     var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
       */
      _createHmacHelper: function (hasher) {
        return function (message, key) {
          return new C_algo.HMAC.init(hasher, key).finalize(message);
        };
      }
    });

    /**
     * Algorithm namespace.
     */
    var C_algo = C.algo = {};
    return C;
  }(Math);
  return CryptoJS;
});
});

var x64Core = createCommonjsModule(function (module, exports) {
(function (root, factory) {
  {
    // CommonJS
    module.exports = factory(core);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function (undefined$1) {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var Base = C_lib.Base;
    var X32WordArray = C_lib.WordArray;

    /**
     * x64 namespace.
     */
    var C_x64 = C.x64 = {};

    /**
     * A 64-bit word.
     */
    C_x64.Word = Base.extend({
      /**
       * Initializes a newly created 64-bit word.
       *
       * @param {number} high The high 32 bits.
       * @param {number} low The low 32 bits.
       *
       * @example
       *
       *     var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
       */
      init: function (high, low) {
        this.high = high;
        this.low = low;
      }

      /**
       * Bitwise NOTs this word.
       *
       * @return {X64Word} A new x64-Word object after negating.
       *
       * @example
       *
       *     var negated = x64Word.not();
       */
      // not: function () {
      // var high = ~this.high;
      // var low = ~this.low;

      // return X64Word.create(high, low);
      // },

      /**
       * Bitwise ANDs this word with the passed word.
       *
       * @param {X64Word} word The x64-Word to AND with this word.
       *
       * @return {X64Word} A new x64-Word object after ANDing.
       *
       * @example
       *
       *     var anded = x64Word.and(anotherX64Word);
       */
      // and: function (word) {
      // var high = this.high & word.high;
      // var low = this.low & word.low;

      // return X64Word.create(high, low);
      // },

      /**
       * Bitwise ORs this word with the passed word.
       *
       * @param {X64Word} word The x64-Word to OR with this word.
       *
       * @return {X64Word} A new x64-Word object after ORing.
       *
       * @example
       *
       *     var ored = x64Word.or(anotherX64Word);
       */
      // or: function (word) {
      // var high = this.high | word.high;
      // var low = this.low | word.low;

      // return X64Word.create(high, low);
      // },

      /**
       * Bitwise XORs this word with the passed word.
       *
       * @param {X64Word} word The x64-Word to XOR with this word.
       *
       * @return {X64Word} A new x64-Word object after XORing.
       *
       * @example
       *
       *     var xored = x64Word.xor(anotherX64Word);
       */
      // xor: function (word) {
      // var high = this.high ^ word.high;
      // var low = this.low ^ word.low;

      // return X64Word.create(high, low);
      // },

      /**
       * Shifts this word n bits to the left.
       *
       * @param {number} n The number of bits to shift.
       *
       * @return {X64Word} A new x64-Word object after shifting.
       *
       * @example
       *
       *     var shifted = x64Word.shiftL(25);
       */
      // shiftL: function (n) {
      // if (n < 32) {
      // var high = (this.high << n) | (this.low >>> (32 - n));
      // var low = this.low << n;
      // } else {
      // var high = this.low << (n - 32);
      // var low = 0;
      // }

      // return X64Word.create(high, low);
      // },

      /**
       * Shifts this word n bits to the right.
       *
       * @param {number} n The number of bits to shift.
       *
       * @return {X64Word} A new x64-Word object after shifting.
       *
       * @example
       *
       *     var shifted = x64Word.shiftR(7);
       */
      // shiftR: function (n) {
      // if (n < 32) {
      // var low = (this.low >>> n) | (this.high << (32 - n));
      // var high = this.high >>> n;
      // } else {
      // var low = this.high >>> (n - 32);
      // var high = 0;
      // }

      // return X64Word.create(high, low);
      // },

      /**
       * Rotates this word n bits to the left.
       *
       * @param {number} n The number of bits to rotate.
       *
       * @return {X64Word} A new x64-Word object after rotating.
       *
       * @example
       *
       *     var rotated = x64Word.rotL(25);
       */
      // rotL: function (n) {
      // return this.shiftL(n).or(this.shiftR(64 - n));
      // },

      /**
       * Rotates this word n bits to the right.
       *
       * @param {number} n The number of bits to rotate.
       *
       * @return {X64Word} A new x64-Word object after rotating.
       *
       * @example
       *
       *     var rotated = x64Word.rotR(7);
       */
      // rotR: function (n) {
      // return this.shiftR(n).or(this.shiftL(64 - n));
      // },

      /**
       * Adds this word with the passed word.
       *
       * @param {X64Word} word The x64-Word to add with this word.
       *
       * @return {X64Word} A new x64-Word object after adding.
       *
       * @example
       *
       *     var added = x64Word.add(anotherX64Word);
       */
      // add: function (word) {
      // var low = (this.low + word.low) | 0;
      // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
      // var high = (this.high + word.high + carry) | 0;

      // return X64Word.create(high, low);
      // }
    });

    /**
     * An array of 64-bit words.
     *
     * @property {Array} words The array of CryptoJS.x64.Word objects.
     * @property {number} sigBytes The number of significant bytes in this word array.
     */
    C_x64.WordArray = Base.extend({
      /**
       * Initializes a newly created word array.
       *
       * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
       * @param {number} sigBytes (Optional) The number of significant bytes in the words.
       *
       * @example
       *
       *     var wordArray = CryptoJS.x64.WordArray.create();
       *
       *     var wordArray = CryptoJS.x64.WordArray.create([
       *         CryptoJS.x64.Word.create(0x00010203, 0x04050607),
       *         CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
       *     ]);
       *
       *     var wordArray = CryptoJS.x64.WordArray.create([
       *         CryptoJS.x64.Word.create(0x00010203, 0x04050607),
       *         CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
       *     ], 10);
       */
      init: function (words, sigBytes) {
        words = this.words = words || [];
        if (sigBytes != undefined$1) {
          this.sigBytes = sigBytes;
        } else {
          this.sigBytes = words.length * 8;
        }
      },
      /**
       * Converts this 64-bit word array to a 32-bit word array.
       *
       * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
       *
       * @example
       *
       *     var x32WordArray = x64WordArray.toX32();
       */
      toX32: function () {
        // Shortcuts
        var x64Words = this.words;
        var x64WordsLength = x64Words.length;

        // Convert
        var x32Words = [];
        for (var i = 0; i < x64WordsLength; i++) {
          var x64Word = x64Words[i];
          x32Words.push(x64Word.high);
          x32Words.push(x64Word.low);
        }
        return X32WordArray.create(x32Words, this.sigBytes);
      },
      /**
       * Creates a copy of this word array.
       *
       * @return {X64WordArray} The clone.
       *
       * @example
       *
       *     var clone = x64WordArray.clone();
       */
      clone: function () {
        var clone = Base.clone.call(this);

        // Clone "words" array
        var words = clone.words = this.words.slice(0);

        // Clone each X64Word object
        var wordsLength = words.length;
        for (var i = 0; i < wordsLength; i++) {
          words[i] = words[i].clone();
        }
        return clone;
      }
    });
  })();
  return CryptoJS;
});
});

var libTypedarrays = createCommonjsModule(function (module, exports) {
(function (root, factory) {
  {
    // CommonJS
    module.exports = factory(core);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Check if typed arrays are supported
    if (typeof ArrayBuffer != 'function') {
      return;
    }

    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var WordArray = C_lib.WordArray;

    // Reference original init
    var superInit = WordArray.init;

    // Augment WordArray.init to handle typed arrays
    var subInit = WordArray.init = function (typedArray) {
      // Convert buffers to uint8
      if (typedArray instanceof ArrayBuffer) {
        typedArray = new Uint8Array(typedArray);
      }

      // Convert other array views to uint8
      if (typedArray instanceof Int8Array || typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray || typedArray instanceof Int16Array || typedArray instanceof Uint16Array || typedArray instanceof Int32Array || typedArray instanceof Uint32Array || typedArray instanceof Float32Array || typedArray instanceof Float64Array) {
        typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
      }

      // Handle Uint8Array
      if (typedArray instanceof Uint8Array) {
        // Shortcut
        var typedArrayByteLength = typedArray.byteLength;

        // Extract bytes
        var words = [];
        for (var i = 0; i < typedArrayByteLength; i++) {
          words[i >>> 2] |= typedArray[i] << 24 - i % 4 * 8;
        }

        // Initialize this word array
        superInit.call(this, words, typedArrayByteLength);
      } else {
        // Else call normal init
        superInit.apply(this, arguments);
      }
    };
    subInit.prototype = WordArray;
  })();
  return CryptoJS.lib.WordArray;
});
});

var encUtf16 = createCommonjsModule(function (module, exports) {
(function (root, factory) {
  {
    // CommonJS
    module.exports = factory(core);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var WordArray = C_lib.WordArray;
    var C_enc = C.enc;

    /**
     * UTF-16 BE encoding strategy.
     */
    C_enc.Utf16 = C_enc.Utf16BE = {
      /**
       * Converts a word array to a UTF-16 BE string.
       *
       * @param {WordArray} wordArray The word array.
       *
       * @return {string} The UTF-16 BE string.
       *
       * @static
       *
       * @example
       *
       *     var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
       */
      stringify: function (wordArray) {
        // Shortcuts
        var words = wordArray.words;
        var sigBytes = wordArray.sigBytes;

        // Convert
        var utf16Chars = [];
        for (var i = 0; i < sigBytes; i += 2) {
          var codePoint = words[i >>> 2] >>> 16 - i % 4 * 8 & 0xffff;
          utf16Chars.push(String.fromCharCode(codePoint));
        }
        return utf16Chars.join('');
      },
      /**
       * Converts a UTF-16 BE string to a word array.
       *
       * @param {string} utf16Str The UTF-16 BE string.
       *
       * @return {WordArray} The word array.
       *
       * @static
       *
       * @example
       *
       *     var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
       */
      parse: function (utf16Str) {
        // Shortcut
        var utf16StrLength = utf16Str.length;

        // Convert
        var words = [];
        for (var i = 0; i < utf16StrLength; i++) {
          words[i >>> 1] |= utf16Str.charCodeAt(i) << 16 - i % 2 * 16;
        }
        return WordArray.create(words, utf16StrLength * 2);
      }
    };

    /**
     * UTF-16 LE encoding strategy.
     */
    C_enc.Utf16LE = {
      /**
       * Converts a word array to a UTF-16 LE string.
       *
       * @param {WordArray} wordArray The word array.
       *
       * @return {string} The UTF-16 LE string.
       *
       * @static
       *
       * @example
       *
       *     var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
       */
      stringify: function (wordArray) {
        // Shortcuts
        var words = wordArray.words;
        var sigBytes = wordArray.sigBytes;

        // Convert
        var utf16Chars = [];
        for (var i = 0; i < sigBytes; i += 2) {
          var codePoint = swapEndian(words[i >>> 2] >>> 16 - i % 4 * 8 & 0xffff);
          utf16Chars.push(String.fromCharCode(codePoint));
        }
        return utf16Chars.join('');
      },
      /**
       * Converts a UTF-16 LE string to a word array.
       *
       * @param {string} utf16Str The UTF-16 LE string.
       *
       * @return {WordArray} The word array.
       *
       * @static
       *
       * @example
       *
       *     var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
       */
      parse: function (utf16Str) {
        // Shortcut
        var utf16StrLength = utf16Str.length;

        // Convert
        var words = [];
        for (var i = 0; i < utf16StrLength; i++) {
          words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << 16 - i % 2 * 16);
        }
        return WordArray.create(words, utf16StrLength * 2);
      }
    };
    function swapEndian(word) {
      return word << 8 & 0xff00ff00 | word >>> 8 & 0x00ff00ff;
    }
  })();
  return CryptoJS.enc.Utf16;
});
});

var encBase64 = createCommonjsModule(function (module, exports) {
(function (root, factory) {
  {
    // CommonJS
    module.exports = factory(core);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var WordArray = C_lib.WordArray;
    var C_enc = C.enc;

    /**
     * Base64 encoding strategy.
     */
    C_enc.Base64 = {
      /**
       * Converts a word array to a Base64 string.
       *
       * @param {WordArray} wordArray The word array.
       *
       * @return {string} The Base64 string.
       *
       * @static
       *
       * @example
       *
       *     var base64String = CryptoJS.enc.Base64.stringify(wordArray);
       */
      stringify: function (wordArray) {
        // Shortcuts
        var words = wordArray.words;
        var sigBytes = wordArray.sigBytes;
        var map = this._map;

        // Clamp excess bits
        wordArray.clamp();

        // Convert
        var base64Chars = [];
        for (var i = 0; i < sigBytes; i += 3) {
          var byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
          var byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 0xff;
          var byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 0xff;
          var triplet = byte1 << 16 | byte2 << 8 | byte3;
          for (var j = 0; j < 4 && i + j * 0.75 < sigBytes; j++) {
            base64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 0x3f));
          }
        }

        // Add padding
        var paddingChar = map.charAt(64);
        if (paddingChar) {
          while (base64Chars.length % 4) {
            base64Chars.push(paddingChar);
          }
        }
        return base64Chars.join('');
      },
      /**
       * Converts a Base64 string to a word array.
       *
       * @param {string} base64Str The Base64 string.
       *
       * @return {WordArray} The word array.
       *
       * @static
       *
       * @example
       *
       *     var wordArray = CryptoJS.enc.Base64.parse(base64String);
       */
      parse: function (base64Str) {
        // Shortcuts
        var base64StrLength = base64Str.length;
        var map = this._map;
        var reverseMap = this._reverseMap;
        if (!reverseMap) {
          reverseMap = this._reverseMap = [];
          for (var j = 0; j < map.length; j++) {
            reverseMap[map.charCodeAt(j)] = j;
          }
        }

        // Ignore padding
        var paddingChar = map.charAt(64);
        if (paddingChar) {
          var paddingIndex = base64Str.indexOf(paddingChar);
          if (paddingIndex !== -1) {
            base64StrLength = paddingIndex;
          }
        }

        // Convert
        return parseLoop(base64Str, base64StrLength, reverseMap);
      },
      _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
    };
    function parseLoop(base64Str, base64StrLength, reverseMap) {
      var words = [];
      var nBytes = 0;
      for (var i = 0; i < base64StrLength; i++) {
        if (i % 4) {
          var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2;
          var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2;
          var bitsCombined = bits1 | bits2;
          words[nBytes >>> 2] |= bitsCombined << 24 - nBytes % 4 * 8;
          nBytes++;
        }
      }
      return WordArray.create(words, nBytes);
    }
  })();
  return CryptoJS.enc.Base64;
});
});

var encBase64url = createCommonjsModule(function (module, exports) {
(function (root, factory) {
  {
    // CommonJS
    module.exports = factory(core);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var WordArray = C_lib.WordArray;
    var C_enc = C.enc;

    /**
     * Base64url encoding strategy.
     */
    C_enc.Base64url = {
      /**
       * Converts a word array to a Base64url string.
       *
       * @param {WordArray} wordArray The word array.
       *
       * @param {boolean} urlSafe Whether to use url safe
       *
       * @return {string} The Base64url string.
       *
       * @static
       *
       * @example
       *
       *     var base64String = CryptoJS.enc.Base64url.stringify(wordArray);
       */
      stringify: function (wordArray, urlSafe) {
        if (urlSafe === undefined) {
          urlSafe = true;
        }
        // Shortcuts
        var words = wordArray.words;
        var sigBytes = wordArray.sigBytes;
        var map = urlSafe ? this._safe_map : this._map;

        // Clamp excess bits
        wordArray.clamp();

        // Convert
        var base64Chars = [];
        for (var i = 0; i < sigBytes; i += 3) {
          var byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
          var byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 0xff;
          var byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 0xff;
          var triplet = byte1 << 16 | byte2 << 8 | byte3;
          for (var j = 0; j < 4 && i + j * 0.75 < sigBytes; j++) {
            base64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 0x3f));
          }
        }

        // Add padding
        var paddingChar = map.charAt(64);
        if (paddingChar) {
          while (base64Chars.length % 4) {
            base64Chars.push(paddingChar);
          }
        }
        return base64Chars.join('');
      },
      /**
       * Converts a Base64url string to a word array.
       *
       * @param {string} base64Str The Base64url string.
       *
       * @param {boolean} urlSafe Whether to use url safe
       *
       * @return {WordArray} The word array.
       *
       * @static
       *
       * @example
       *
       *     var wordArray = CryptoJS.enc.Base64url.parse(base64String);
       */
      parse: function (base64Str, urlSafe) {
        if (urlSafe === undefined) {
          urlSafe = true;
        }

        // Shortcuts
        var base64StrLength = base64Str.length;
        var map = urlSafe ? this._safe_map : this._map;
        var reverseMap = this._reverseMap;
        if (!reverseMap) {
          reverseMap = this._reverseMap = [];
          for (var j = 0; j < map.length; j++) {
            reverseMap[map.charCodeAt(j)] = j;
          }
        }

        // Ignore padding
        var paddingChar = map.charAt(64);
        if (paddingChar) {
          var paddingIndex = base64Str.indexOf(paddingChar);
          if (paddingIndex !== -1) {
            base64StrLength = paddingIndex;
          }
        }

        // Convert
        return parseLoop(base64Str, base64StrLength, reverseMap);
      },
      _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
      _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'
    };
    function parseLoop(base64Str, base64StrLength, reverseMap) {
      var words = [];
      var nBytes = 0;
      for (var i = 0; i < base64StrLength; i++) {
        if (i % 4) {
          var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2;
          var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2;
          var bitsCombined = bits1 | bits2;
          words[nBytes >>> 2] |= bitsCombined << 24 - nBytes % 4 * 8;
          nBytes++;
        }
      }
      return WordArray.create(words, nBytes);
    }
  })();
  return CryptoJS.enc.Base64url;
});
});

var md5 = createCommonjsModule(function (module, exports) {
(function (root, factory) {
  {
    // CommonJS
    module.exports = factory(core);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function (Math) {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var WordArray = C_lib.WordArray;
    var Hasher = C_lib.Hasher;
    var C_algo = C.algo;

    // Constants table
    var T = [];

    // Compute constants
    (function () {
      for (var i = 0; i < 64; i++) {
        T[i] = Math.abs(Math.sin(i + 1)) * 0x100000000 | 0;
      }
    })();

    /**
     * MD5 hash algorithm.
     */
    var MD5 = C_algo.MD5 = Hasher.extend({
      _doReset: function () {
        this._hash = new WordArray.init([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476]);
      },
      _doProcessBlock: function (M, offset) {
        // Swap endian
        for (var i = 0; i < 16; i++) {
          // Shortcuts
          var offset_i = offset + i;
          var M_offset_i = M[offset_i];
          M[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 0x00ff00ff | (M_offset_i << 24 | M_offset_i >>> 8) & 0xff00ff00;
        }

        // Shortcuts
        var H = this._hash.words;
        var M_offset_0 = M[offset + 0];
        var M_offset_1 = M[offset + 1];
        var M_offset_2 = M[offset + 2];
        var M_offset_3 = M[offset + 3];
        var M_offset_4 = M[offset + 4];
        var M_offset_5 = M[offset + 5];
        var M_offset_6 = M[offset + 6];
        var M_offset_7 = M[offset + 7];
        var M_offset_8 = M[offset + 8];
        var M_offset_9 = M[offset + 9];
        var M_offset_10 = M[offset + 10];
        var M_offset_11 = M[offset + 11];
        var M_offset_12 = M[offset + 12];
        var M_offset_13 = M[offset + 13];
        var M_offset_14 = M[offset + 14];
        var M_offset_15 = M[offset + 15];

        // Working variables
        var a = H[0];
        var b = H[1];
        var c = H[2];
        var d = H[3];

        // Computation
        a = FF(a, b, c, d, M_offset_0, 7, T[0]);
        d = FF(d, a, b, c, M_offset_1, 12, T[1]);
        c = FF(c, d, a, b, M_offset_2, 17, T[2]);
        b = FF(b, c, d, a, M_offset_3, 22, T[3]);
        a = FF(a, b, c, d, M_offset_4, 7, T[4]);
        d = FF(d, a, b, c, M_offset_5, 12, T[5]);
        c = FF(c, d, a, b, M_offset_6, 17, T[6]);
        b = FF(b, c, d, a, M_offset_7, 22, T[7]);
        a = FF(a, b, c, d, M_offset_8, 7, T[8]);
        d = FF(d, a, b, c, M_offset_9, 12, T[9]);
        c = FF(c, d, a, b, M_offset_10, 17, T[10]);
        b = FF(b, c, d, a, M_offset_11, 22, T[11]);
        a = FF(a, b, c, d, M_offset_12, 7, T[12]);
        d = FF(d, a, b, c, M_offset_13, 12, T[13]);
        c = FF(c, d, a, b, M_offset_14, 17, T[14]);
        b = FF(b, c, d, a, M_offset_15, 22, T[15]);
        a = GG(a, b, c, d, M_offset_1, 5, T[16]);
        d = GG(d, a, b, c, M_offset_6, 9, T[17]);
        c = GG(c, d, a, b, M_offset_11, 14, T[18]);
        b = GG(b, c, d, a, M_offset_0, 20, T[19]);
        a = GG(a, b, c, d, M_offset_5, 5, T[20]);
        d = GG(d, a, b, c, M_offset_10, 9, T[21]);
        c = GG(c, d, a, b, M_offset_15, 14, T[22]);
        b = GG(b, c, d, a, M_offset_4, 20, T[23]);
        a = GG(a, b, c, d, M_offset_9, 5, T[24]);
        d = GG(d, a, b, c, M_offset_14, 9, T[25]);
        c = GG(c, d, a, b, M_offset_3, 14, T[26]);
        b = GG(b, c, d, a, M_offset_8, 20, T[27]);
        a = GG(a, b, c, d, M_offset_13, 5, T[28]);
        d = GG(d, a, b, c, M_offset_2, 9, T[29]);
        c = GG(c, d, a, b, M_offset_7, 14, T[30]);
        b = GG(b, c, d, a, M_offset_12, 20, T[31]);
        a = HH(a, b, c, d, M_offset_5, 4, T[32]);
        d = HH(d, a, b, c, M_offset_8, 11, T[33]);
        c = HH(c, d, a, b, M_offset_11, 16, T[34]);
        b = HH(b, c, d, a, M_offset_14, 23, T[35]);
        a = HH(a, b, c, d, M_offset_1, 4, T[36]);
        d = HH(d, a, b, c, M_offset_4, 11, T[37]);
        c = HH(c, d, a, b, M_offset_7, 16, T[38]);
        b = HH(b, c, d, a, M_offset_10, 23, T[39]);
        a = HH(a, b, c, d, M_offset_13, 4, T[40]);
        d = HH(d, a, b, c, M_offset_0, 11, T[41]);
        c = HH(c, d, a, b, M_offset_3, 16, T[42]);
        b = HH(b, c, d, a, M_offset_6, 23, T[43]);
        a = HH(a, b, c, d, M_offset_9, 4, T[44]);
        d = HH(d, a, b, c, M_offset_12, 11, T[45]);
        c = HH(c, d, a, b, M_offset_15, 16, T[46]);
        b = HH(b, c, d, a, M_offset_2, 23, T[47]);
        a = II(a, b, c, d, M_offset_0, 6, T[48]);
        d = II(d, a, b, c, M_offset_7, 10, T[49]);
        c = II(c, d, a, b, M_offset_14, 15, T[50]);
        b = II(b, c, d, a, M_offset_5, 21, T[51]);
        a = II(a, b, c, d, M_offset_12, 6, T[52]);
        d = II(d, a, b, c, M_offset_3, 10, T[53]);
        c = II(c, d, a, b, M_offset_10, 15, T[54]);
        b = II(b, c, d, a, M_offset_1, 21, T[55]);
        a = II(a, b, c, d, M_offset_8, 6, T[56]);
        d = II(d, a, b, c, M_offset_15, 10, T[57]);
        c = II(c, d, a, b, M_offset_6, 15, T[58]);
        b = II(b, c, d, a, M_offset_13, 21, T[59]);
        a = II(a, b, c, d, M_offset_4, 6, T[60]);
        d = II(d, a, b, c, M_offset_11, 10, T[61]);
        c = II(c, d, a, b, M_offset_2, 15, T[62]);
        b = II(b, c, d, a, M_offset_9, 21, T[63]);

        // Intermediate hash value
        H[0] = H[0] + a | 0;
        H[1] = H[1] + b | 0;
        H[2] = H[2] + c | 0;
        H[3] = H[3] + d | 0;
      },
      _doFinalize: function () {
        // Shortcuts
        var data = this._data;
        var dataWords = data.words;
        var nBitsTotal = this._nDataBytes * 8;
        var nBitsLeft = data.sigBytes * 8;

        // Add padding
        dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;
        var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);
        var nBitsTotalL = nBitsTotal;
        dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = (nBitsTotalH << 8 | nBitsTotalH >>> 24) & 0x00ff00ff | (nBitsTotalH << 24 | nBitsTotalH >>> 8) & 0xff00ff00;
        dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotalL << 8 | nBitsTotalL >>> 24) & 0x00ff00ff | (nBitsTotalL << 24 | nBitsTotalL >>> 8) & 0xff00ff00;
        data.sigBytes = (dataWords.length + 1) * 4;

        // Hash final blocks
        this._process();

        // Shortcuts
        var hash = this._hash;
        var H = hash.words;

        // Swap endian
        for (var i = 0; i < 4; i++) {
          // Shortcut
          var H_i = H[i];
          H[i] = (H_i << 8 | H_i >>> 24) & 0x00ff00ff | (H_i << 24 | H_i >>> 8) & 0xff00ff00;
        }

        // Return final computed hash
        return hash;
      },
      clone: function () {
        var clone = Hasher.clone.call(this);
        clone._hash = this._hash.clone();
        return clone;
      }
    });
    function FF(a, b, c, d, x, s, t) {
      var n = a + (b & c | ~b & d) + x + t;
      return (n << s | n >>> 32 - s) + b;
    }
    function GG(a, b, c, d, x, s, t) {
      var n = a + (b & d | c & ~d) + x + t;
      return (n << s | n >>> 32 - s) + b;
    }
    function HH(a, b, c, d, x, s, t) {
      var n = a + (b ^ c ^ d) + x + t;
      return (n << s | n >>> 32 - s) + b;
    }
    function II(a, b, c, d, x, s, t) {
      var n = a + (c ^ (b | ~d)) + x + t;
      return (n << s | n >>> 32 - s) + b;
    }

    /**
     * Shortcut function to the hasher's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     *
     * @return {WordArray} The hash.
     *
     * @static
     *
     * @example
     *
     *     var hash = CryptoJS.MD5('message');
     *     var hash = CryptoJS.MD5(wordArray);
     */
    C.MD5 = Hasher._createHelper(MD5);

    /**
     * Shortcut function to the HMAC's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     * @param {WordArray|string} key The secret key.
     *
     * @return {WordArray} The HMAC.
     *
     * @static
     *
     * @example
     *
     *     var hmac = CryptoJS.HmacMD5(message, key);
     */
    C.HmacMD5 = Hasher._createHmacHelper(MD5);
  })(Math);
  return CryptoJS.MD5;
});
});

var sha1 = createCommonjsModule(function (module, exports) {
(function (root, factory) {
  {
    // CommonJS
    module.exports = factory(core);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var WordArray = C_lib.WordArray;
    var Hasher = C_lib.Hasher;
    var C_algo = C.algo;

    // Reusable object
    var W = [];

    /**
     * SHA-1 hash algorithm.
     */
    var SHA1 = C_algo.SHA1 = Hasher.extend({
      _doReset: function () {
        this._hash = new WordArray.init([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]);
      },
      _doProcessBlock: function (M, offset) {
        // Shortcut
        var H = this._hash.words;

        // Working variables
        var a = H[0];
        var b = H[1];
        var c = H[2];
        var d = H[3];
        var e = H[4];

        // Computation
        for (var i = 0; i < 80; i++) {
          if (i < 16) {
            W[i] = M[offset + i] | 0;
          } else {
            var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
            W[i] = n << 1 | n >>> 31;
          }
          var t = (a << 5 | a >>> 27) + e + W[i];
          if (i < 20) {
            t += (b & c | ~b & d) + 0x5a827999;
          } else if (i < 40) {
            t += (b ^ c ^ d) + 0x6ed9eba1;
          } else if (i < 60) {
            t += (b & c | b & d | c & d) - 0x70e44324;
          } else /* if (i < 80) */{
              t += (b ^ c ^ d) - 0x359d3e2a;
            }
          e = d;
          d = c;
          c = b << 30 | b >>> 2;
          b = a;
          a = t;
        }

        // Intermediate hash value
        H[0] = H[0] + a | 0;
        H[1] = H[1] + b | 0;
        H[2] = H[2] + c | 0;
        H[3] = H[3] + d | 0;
        H[4] = H[4] + e | 0;
      },
      _doFinalize: function () {
        // Shortcuts
        var data = this._data;
        var dataWords = data.words;
        var nBitsTotal = this._nDataBytes * 8;
        var nBitsLeft = data.sigBytes * 8;

        // Add padding
        dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;
        dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
        dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;
        data.sigBytes = dataWords.length * 4;

        // Hash final blocks
        this._process();

        // Return final computed hash
        return this._hash;
      },
      clone: function () {
        var clone = Hasher.clone.call(this);
        clone._hash = this._hash.clone();
        return clone;
      }
    });

    /**
     * Shortcut function to the hasher's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     *
     * @return {WordArray} The hash.
     *
     * @static
     *
     * @example
     *
     *     var hash = CryptoJS.SHA1('message');
     *     var hash = CryptoJS.SHA1(wordArray);
     */
    C.SHA1 = Hasher._createHelper(SHA1);

    /**
     * Shortcut function to the HMAC's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     * @param {WordArray|string} key The secret key.
     *
     * @return {WordArray} The HMAC.
     *
     * @static
     *
     * @example
     *
     *     var hmac = CryptoJS.HmacSHA1(message, key);
     */
    C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
  })();
  return CryptoJS.SHA1;
});
});

var sha256 = createCommonjsModule(function (module, exports) {
(function (root, factory) {
  {
    // CommonJS
    module.exports = factory(core);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function (Math) {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var WordArray = C_lib.WordArray;
    var Hasher = C_lib.Hasher;
    var C_algo = C.algo;

    // Initialization and round constants tables
    var H = [];
    var K = [];

    // Compute constants
    (function () {
      function isPrime(n) {
        var sqrtN = Math.sqrt(n);
        for (var factor = 2; factor <= sqrtN; factor++) {
          if (!(n % factor)) {
            return false;
          }
        }
        return true;
      }
      function getFractionalBits(n) {
        return (n - (n | 0)) * 0x100000000 | 0;
      }
      var n = 2;
      var nPrime = 0;
      while (nPrime < 64) {
        if (isPrime(n)) {
          if (nPrime < 8) {
            H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));
          }
          K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));
          nPrime++;
        }
        n++;
      }
    })();

    // Reusable object
    var W = [];

    /**
     * SHA-256 hash algorithm.
     */
    var SHA256 = C_algo.SHA256 = Hasher.extend({
      _doReset: function () {
        this._hash = new WordArray.init(H.slice(0));
      },
      _doProcessBlock: function (M, offset) {
        // Shortcut
        var H = this._hash.words;

        // Working variables
        var a = H[0];
        var b = H[1];
        var c = H[2];
        var d = H[3];
        var e = H[4];
        var f = H[5];
        var g = H[6];
        var h = H[7];

        // Computation
        for (var i = 0; i < 64; i++) {
          if (i < 16) {
            W[i] = M[offset + i] | 0;
          } else {
            var gamma0x = W[i - 15];
            var gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3;
            var gamma1x = W[i - 2];
            var gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10;
            W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
          }
          var ch = e & f ^ ~e & g;
          var maj = a & b ^ a & c ^ b & c;
          var sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22);
          var sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25);
          var t1 = h + sigma1 + ch + K[i] + W[i];
          var t2 = sigma0 + maj;
          h = g;
          g = f;
          f = e;
          e = d + t1 | 0;
          d = c;
          c = b;
          b = a;
          a = t1 + t2 | 0;
        }

        // Intermediate hash value
        H[0] = H[0] + a | 0;
        H[1] = H[1] + b | 0;
        H[2] = H[2] + c | 0;
        H[3] = H[3] + d | 0;
        H[4] = H[4] + e | 0;
        H[5] = H[5] + f | 0;
        H[6] = H[6] + g | 0;
        H[7] = H[7] + h | 0;
      },
      _doFinalize: function () {
        // Shortcuts
        var data = this._data;
        var dataWords = data.words;
        var nBitsTotal = this._nDataBytes * 8;
        var nBitsLeft = data.sigBytes * 8;

        // Add padding
        dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;
        dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
        dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;
        data.sigBytes = dataWords.length * 4;

        // Hash final blocks
        this._process();

        // Return final computed hash
        return this._hash;
      },
      clone: function () {
        var clone = Hasher.clone.call(this);
        clone._hash = this._hash.clone();
        return clone;
      }
    });

    /**
     * Shortcut function to the hasher's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     *
     * @return {WordArray} The hash.
     *
     * @static
     *
     * @example
     *
     *     var hash = CryptoJS.SHA256('message');
     *     var hash = CryptoJS.SHA256(wordArray);
     */
    C.SHA256 = Hasher._createHelper(SHA256);

    /**
     * Shortcut function to the HMAC's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     * @param {WordArray|string} key The secret key.
     *
     * @return {WordArray} The HMAC.
     *
     * @static
     *
     * @example
     *
     *     var hmac = CryptoJS.HmacSHA256(message, key);
     */
    C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
  })(Math);
  return CryptoJS.SHA256;
});
});

var sha224 = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, sha256);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var WordArray = C_lib.WordArray;
    var C_algo = C.algo;
    var SHA256 = C_algo.SHA256;

    /**
     * SHA-224 hash algorithm.
     */
    var SHA224 = C_algo.SHA224 = SHA256.extend({
      _doReset: function () {
        this._hash = new WordArray.init([0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4]);
      },
      _doFinalize: function () {
        var hash = SHA256._doFinalize.call(this);
        hash.sigBytes -= 4;
        return hash;
      }
    });

    /**
     * Shortcut function to the hasher's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     *
     * @return {WordArray} The hash.
     *
     * @static
     *
     * @example
     *
     *     var hash = CryptoJS.SHA224('message');
     *     var hash = CryptoJS.SHA224(wordArray);
     */
    C.SHA224 = SHA256._createHelper(SHA224);

    /**
     * Shortcut function to the HMAC's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     * @param {WordArray|string} key The secret key.
     *
     * @return {WordArray} The HMAC.
     *
     * @static
     *
     * @example
     *
     *     var hmac = CryptoJS.HmacSHA224(message, key);
     */
    C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
  })();
  return CryptoJS.SHA224;
});
});

var sha512 = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, x64Core);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var Hasher = C_lib.Hasher;
    var C_x64 = C.x64;
    var X64Word = C_x64.Word;
    var X64WordArray = C_x64.WordArray;
    var C_algo = C.algo;
    function X64Word_create() {
      return X64Word.create.apply(X64Word, arguments);
    }

    // Constants
    var K = [X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)];

    // Reusable objects
    var W = [];
    (function () {
      for (var i = 0; i < 80; i++) {
        W[i] = X64Word_create();
      }
    })();

    /**
     * SHA-512 hash algorithm.
     */
    var SHA512 = C_algo.SHA512 = Hasher.extend({
      _doReset: function () {
        this._hash = new X64WordArray.init([new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179)]);
      },
      _doProcessBlock: function (M, offset) {
        // Shortcuts
        var H = this._hash.words;
        var H0 = H[0];
        var H1 = H[1];
        var H2 = H[2];
        var H3 = H[3];
        var H4 = H[4];
        var H5 = H[5];
        var H6 = H[6];
        var H7 = H[7];
        var H0h = H0.high;
        var H0l = H0.low;
        var H1h = H1.high;
        var H1l = H1.low;
        var H2h = H2.high;
        var H2l = H2.low;
        var H3h = H3.high;
        var H3l = H3.low;
        var H4h = H4.high;
        var H4l = H4.low;
        var H5h = H5.high;
        var H5l = H5.low;
        var H6h = H6.high;
        var H6l = H6.low;
        var H7h = H7.high;
        var H7l = H7.low;

        // Working variables
        var ah = H0h;
        var al = H0l;
        var bh = H1h;
        var bl = H1l;
        var ch = H2h;
        var cl = H2l;
        var dh = H3h;
        var dl = H3l;
        var eh = H4h;
        var el = H4l;
        var fh = H5h;
        var fl = H5l;
        var gh = H6h;
        var gl = H6l;
        var hh = H7h;
        var hl = H7l;

        // Rounds
        for (var i = 0; i < 80; i++) {
          var Wil;
          var Wih;

          // Shortcut
          var Wi = W[i];

          // Extend message
          if (i < 16) {
            Wih = Wi.high = M[offset + i * 2] | 0;
            Wil = Wi.low = M[offset + i * 2 + 1] | 0;
          } else {
            // Gamma0
            var gamma0x = W[i - 15];
            var gamma0xh = gamma0x.high;
            var gamma0xl = gamma0x.low;
            var gamma0h = (gamma0xh >>> 1 | gamma0xl << 31) ^ (gamma0xh >>> 8 | gamma0xl << 24) ^ gamma0xh >>> 7;
            var gamma0l = (gamma0xl >>> 1 | gamma0xh << 31) ^ (gamma0xl >>> 8 | gamma0xh << 24) ^ (gamma0xl >>> 7 | gamma0xh << 25);

            // Gamma1
            var gamma1x = W[i - 2];
            var gamma1xh = gamma1x.high;
            var gamma1xl = gamma1x.low;
            var gamma1h = (gamma1xh >>> 19 | gamma1xl << 13) ^ (gamma1xh << 3 | gamma1xl >>> 29) ^ gamma1xh >>> 6;
            var gamma1l = (gamma1xl >>> 19 | gamma1xh << 13) ^ (gamma1xl << 3 | gamma1xh >>> 29) ^ (gamma1xl >>> 6 | gamma1xh << 26);

            // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
            var Wi7 = W[i - 7];
            var Wi7h = Wi7.high;
            var Wi7l = Wi7.low;
            var Wi16 = W[i - 16];
            var Wi16h = Wi16.high;
            var Wi16l = Wi16.low;
            Wil = gamma0l + Wi7l;
            Wih = gamma0h + Wi7h + (Wil >>> 0 < gamma0l >>> 0 ? 1 : 0);
            Wil = Wil + gamma1l;
            Wih = Wih + gamma1h + (Wil >>> 0 < gamma1l >>> 0 ? 1 : 0);
            Wil = Wil + Wi16l;
            Wih = Wih + Wi16h + (Wil >>> 0 < Wi16l >>> 0 ? 1 : 0);
            Wi.high = Wih;
            Wi.low = Wil;
          }
          var chh = eh & fh ^ ~eh & gh;
          var chl = el & fl ^ ~el & gl;
          var majh = ah & bh ^ ah & ch ^ bh & ch;
          var majl = al & bl ^ al & cl ^ bl & cl;
          var sigma0h = (ah >>> 28 | al << 4) ^ (ah << 30 | al >>> 2) ^ (ah << 25 | al >>> 7);
          var sigma0l = (al >>> 28 | ah << 4) ^ (al << 30 | ah >>> 2) ^ (al << 25 | ah >>> 7);
          var sigma1h = (eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9);
          var sigma1l = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9);

          // t1 = h + sigma1 + ch + K[i] + W[i]
          var Ki = K[i];
          var Kih = Ki.high;
          var Kil = Ki.low;
          var t1l = hl + sigma1l;
          var t1h = hh + sigma1h + (t1l >>> 0 < hl >>> 0 ? 1 : 0);
          var t1l = t1l + chl;
          var t1h = t1h + chh + (t1l >>> 0 < chl >>> 0 ? 1 : 0);
          var t1l = t1l + Kil;
          var t1h = t1h + Kih + (t1l >>> 0 < Kil >>> 0 ? 1 : 0);
          var t1l = t1l + Wil;
          var t1h = t1h + Wih + (t1l >>> 0 < Wil >>> 0 ? 1 : 0);

          // t2 = sigma0 + maj
          var t2l = sigma0l + majl;
          var t2h = sigma0h + majh + (t2l >>> 0 < sigma0l >>> 0 ? 1 : 0);

          // Update working variables
          hh = gh;
          hl = gl;
          gh = fh;
          gl = fl;
          fh = eh;
          fl = el;
          el = dl + t1l | 0;
          eh = dh + t1h + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
          dh = ch;
          dl = cl;
          ch = bh;
          cl = bl;
          bh = ah;
          bl = al;
          al = t1l + t2l | 0;
          ah = t1h + t2h + (al >>> 0 < t1l >>> 0 ? 1 : 0) | 0;
        }

        // Intermediate hash value
        H0l = H0.low = H0l + al;
        H0.high = H0h + ah + (H0l >>> 0 < al >>> 0 ? 1 : 0);
        H1l = H1.low = H1l + bl;
        H1.high = H1h + bh + (H1l >>> 0 < bl >>> 0 ? 1 : 0);
        H2l = H2.low = H2l + cl;
        H2.high = H2h + ch + (H2l >>> 0 < cl >>> 0 ? 1 : 0);
        H3l = H3.low = H3l + dl;
        H3.high = H3h + dh + (H3l >>> 0 < dl >>> 0 ? 1 : 0);
        H4l = H4.low = H4l + el;
        H4.high = H4h + eh + (H4l >>> 0 < el >>> 0 ? 1 : 0);
        H5l = H5.low = H5l + fl;
        H5.high = H5h + fh + (H5l >>> 0 < fl >>> 0 ? 1 : 0);
        H6l = H6.low = H6l + gl;
        H6.high = H6h + gh + (H6l >>> 0 < gl >>> 0 ? 1 : 0);
        H7l = H7.low = H7l + hl;
        H7.high = H7h + hh + (H7l >>> 0 < hl >>> 0 ? 1 : 0);
      },
      _doFinalize: function () {
        // Shortcuts
        var data = this._data;
        var dataWords = data.words;
        var nBitsTotal = this._nDataBytes * 8;
        var nBitsLeft = data.sigBytes * 8;

        // Add padding
        dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;
        dataWords[(nBitsLeft + 128 >>> 10 << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);
        dataWords[(nBitsLeft + 128 >>> 10 << 5) + 31] = nBitsTotal;
        data.sigBytes = dataWords.length * 4;

        // Hash final blocks
        this._process();

        // Convert hash to 32-bit word array before returning
        var hash = this._hash.toX32();

        // Return final computed hash
        return hash;
      },
      clone: function () {
        var clone = Hasher.clone.call(this);
        clone._hash = this._hash.clone();
        return clone;
      },
      blockSize: 1024 / 32
    });

    /**
     * Shortcut function to the hasher's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     *
     * @return {WordArray} The hash.
     *
     * @static
     *
     * @example
     *
     *     var hash = CryptoJS.SHA512('message');
     *     var hash = CryptoJS.SHA512(wordArray);
     */
    C.SHA512 = Hasher._createHelper(SHA512);

    /**
     * Shortcut function to the HMAC's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     * @param {WordArray|string} key The secret key.
     *
     * @return {WordArray} The HMAC.
     *
     * @static
     *
     * @example
     *
     *     var hmac = CryptoJS.HmacSHA512(message, key);
     */
    C.HmacSHA512 = Hasher._createHmacHelper(SHA512);
  })();
  return CryptoJS.SHA512;
});
});

var sha384 = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, x64Core, sha512);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_x64 = C.x64;
    var X64Word = C_x64.Word;
    var X64WordArray = C_x64.WordArray;
    var C_algo = C.algo;
    var SHA512 = C_algo.SHA512;

    /**
     * SHA-384 hash algorithm.
     */
    var SHA384 = C_algo.SHA384 = SHA512.extend({
      _doReset: function () {
        this._hash = new X64WordArray.init([new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)]);
      },
      _doFinalize: function () {
        var hash = SHA512._doFinalize.call(this);
        hash.sigBytes -= 16;
        return hash;
      }
    });

    /**
     * Shortcut function to the hasher's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     *
     * @return {WordArray} The hash.
     *
     * @static
     *
     * @example
     *
     *     var hash = CryptoJS.SHA384('message');
     *     var hash = CryptoJS.SHA384(wordArray);
     */
    C.SHA384 = SHA512._createHelper(SHA384);

    /**
     * Shortcut function to the HMAC's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     * @param {WordArray|string} key The secret key.
     *
     * @return {WordArray} The HMAC.
     *
     * @static
     *
     * @example
     *
     *     var hmac = CryptoJS.HmacSHA384(message, key);
     */
    C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
  })();
  return CryptoJS.SHA384;
});
});

var sha3 = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, x64Core);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function (Math) {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var WordArray = C_lib.WordArray;
    var Hasher = C_lib.Hasher;
    var C_x64 = C.x64;
    var X64Word = C_x64.Word;
    var C_algo = C.algo;

    // Constants tables
    var RHO_OFFSETS = [];
    var PI_INDEXES = [];
    var ROUND_CONSTANTS = [];

    // Compute Constants
    (function () {
      // Compute rho offset constants
      var x = 1,
        y = 0;
      for (var t = 0; t < 24; t++) {
        RHO_OFFSETS[x + 5 * y] = (t + 1) * (t + 2) / 2 % 64;
        var newX = y % 5;
        var newY = (2 * x + 3 * y) % 5;
        x = newX;
        y = newY;
      }

      // Compute pi index constants
      for (var x = 0; x < 5; x++) {
        for (var y = 0; y < 5; y++) {
          PI_INDEXES[x + 5 * y] = y + (2 * x + 3 * y) % 5 * 5;
        }
      }

      // Compute round constants
      var LFSR = 0x01;
      for (var i = 0; i < 24; i++) {
        var roundConstantMsw = 0;
        var roundConstantLsw = 0;
        for (var j = 0; j < 7; j++) {
          if (LFSR & 0x01) {
            var bitPosition = (1 << j) - 1;
            if (bitPosition < 32) {
              roundConstantLsw ^= 1 << bitPosition;
            } else /* if (bitPosition >= 32) */{
                roundConstantMsw ^= 1 << bitPosition - 32;
              }
          }

          // Compute next LFSR
          if (LFSR & 0x80) {
            // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1
            LFSR = LFSR << 1 ^ 0x71;
          } else {
            LFSR <<= 1;
          }
        }
        ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);
      }
    })();

    // Reusable objects for temporary values
    var T = [];
    (function () {
      for (var i = 0; i < 25; i++) {
        T[i] = X64Word.create();
      }
    })();

    /**
     * SHA-3 hash algorithm.
     */
    var SHA3 = C_algo.SHA3 = Hasher.extend({
      /**
       * Configuration options.
       *
       * @property {number} outputLength
       *   The desired number of bits in the output hash.
       *   Only values permitted are: 224, 256, 384, 512.
       *   Default: 512
       */
      cfg: Hasher.cfg.extend({
        outputLength: 512
      }),
      _doReset: function () {
        var state = this._state = [];
        for (var i = 0; i < 25; i++) {
          state[i] = new X64Word.init();
        }
        this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
      },
      _doProcessBlock: function (M, offset) {
        // Shortcuts
        var state = this._state;
        var nBlockSizeLanes = this.blockSize / 2;

        // Absorb
        for (var i = 0; i < nBlockSizeLanes; i++) {
          // Shortcuts
          var M2i = M[offset + 2 * i];
          var M2i1 = M[offset + 2 * i + 1];

          // Swap endian
          M2i = (M2i << 8 | M2i >>> 24) & 0x00ff00ff | (M2i << 24 | M2i >>> 8) & 0xff00ff00;
          M2i1 = (M2i1 << 8 | M2i1 >>> 24) & 0x00ff00ff | (M2i1 << 24 | M2i1 >>> 8) & 0xff00ff00;

          // Absorb message into state
          var lane = state[i];
          lane.high ^= M2i1;
          lane.low ^= M2i;
        }

        // Rounds
        for (var round = 0; round < 24; round++) {
          // Theta
          for (var x = 0; x < 5; x++) {
            // Mix column lanes
            var tMsw = 0,
              tLsw = 0;
            for (var y = 0; y < 5; y++) {
              var lane = state[x + 5 * y];
              tMsw ^= lane.high;
              tLsw ^= lane.low;
            }

            // Temporary values
            var Tx = T[x];
            Tx.high = tMsw;
            Tx.low = tLsw;
          }
          for (var x = 0; x < 5; x++) {
            // Shortcuts
            var Tx4 = T[(x + 4) % 5];
            var Tx1 = T[(x + 1) % 5];
            var Tx1Msw = Tx1.high;
            var Tx1Lsw = Tx1.low;

            // Mix surrounding columns
            var tMsw = Tx4.high ^ (Tx1Msw << 1 | Tx1Lsw >>> 31);
            var tLsw = Tx4.low ^ (Tx1Lsw << 1 | Tx1Msw >>> 31);
            for (var y = 0; y < 5; y++) {
              var lane = state[x + 5 * y];
              lane.high ^= tMsw;
              lane.low ^= tLsw;
            }
          }

          // Rho Pi
          for (var laneIndex = 1; laneIndex < 25; laneIndex++) {
            var tMsw;
            var tLsw;

            // Shortcuts
            var lane = state[laneIndex];
            var laneMsw = lane.high;
            var laneLsw = lane.low;
            var rhoOffset = RHO_OFFSETS[laneIndex];

            // Rotate lanes
            if (rhoOffset < 32) {
              tMsw = laneMsw << rhoOffset | laneLsw >>> 32 - rhoOffset;
              tLsw = laneLsw << rhoOffset | laneMsw >>> 32 - rhoOffset;
            } else /* if (rhoOffset >= 32) */{
                tMsw = laneLsw << rhoOffset - 32 | laneMsw >>> 64 - rhoOffset;
                tLsw = laneMsw << rhoOffset - 32 | laneLsw >>> 64 - rhoOffset;
              }

            // Transpose lanes
            var TPiLane = T[PI_INDEXES[laneIndex]];
            TPiLane.high = tMsw;
            TPiLane.low = tLsw;
          }

          // Rho pi at x = y = 0
          var T0 = T[0];
          var state0 = state[0];
          T0.high = state0.high;
          T0.low = state0.low;

          // Chi
          for (var x = 0; x < 5; x++) {
            for (var y = 0; y < 5; y++) {
              // Shortcuts
              var laneIndex = x + 5 * y;
              var lane = state[laneIndex];
              var TLane = T[laneIndex];
              var Tx1Lane = T[(x + 1) % 5 + 5 * y];
              var Tx2Lane = T[(x + 2) % 5 + 5 * y];

              // Mix rows
              lane.high = TLane.high ^ ~Tx1Lane.high & Tx2Lane.high;
              lane.low = TLane.low ^ ~Tx1Lane.low & Tx2Lane.low;
            }
          }

          // Iota
          var lane = state[0];
          var roundConstant = ROUND_CONSTANTS[round];
          lane.high ^= roundConstant.high;
          lane.low ^= roundConstant.low;
        }
      },
      _doFinalize: function () {
        // Shortcuts
        var data = this._data;
        var dataWords = data.words;
        this._nDataBytes * 8;
        var nBitsLeft = data.sigBytes * 8;
        var blockSizeBits = this.blockSize * 32;

        // Add padding
        dataWords[nBitsLeft >>> 5] |= 0x1 << 24 - nBitsLeft % 32;
        dataWords[(Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits >>> 5) - 1] |= 0x80;
        data.sigBytes = dataWords.length * 4;

        // Hash final blocks
        this._process();

        // Shortcuts
        var state = this._state;
        var outputLengthBytes = this.cfg.outputLength / 8;
        var outputLengthLanes = outputLengthBytes / 8;

        // Squeeze
        var hashWords = [];
        for (var i = 0; i < outputLengthLanes; i++) {
          // Shortcuts
          var lane = state[i];
          var laneMsw = lane.high;
          var laneLsw = lane.low;

          // Swap endian
          laneMsw = (laneMsw << 8 | laneMsw >>> 24) & 0x00ff00ff | (laneMsw << 24 | laneMsw >>> 8) & 0xff00ff00;
          laneLsw = (laneLsw << 8 | laneLsw >>> 24) & 0x00ff00ff | (laneLsw << 24 | laneLsw >>> 8) & 0xff00ff00;

          // Squeeze state to retrieve hash
          hashWords.push(laneLsw);
          hashWords.push(laneMsw);
        }

        // Return final computed hash
        return new WordArray.init(hashWords, outputLengthBytes);
      },
      clone: function () {
        var clone = Hasher.clone.call(this);
        var state = clone._state = this._state.slice(0);
        for (var i = 0; i < 25; i++) {
          state[i] = state[i].clone();
        }
        return clone;
      }
    });

    /**
     * Shortcut function to the hasher's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     *
     * @return {WordArray} The hash.
     *
     * @static
     *
     * @example
     *
     *     var hash = CryptoJS.SHA3('message');
     *     var hash = CryptoJS.SHA3(wordArray);
     */
    C.SHA3 = Hasher._createHelper(SHA3);

    /**
     * Shortcut function to the HMAC's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     * @param {WordArray|string} key The secret key.
     *
     * @return {WordArray} The HMAC.
     *
     * @static
     *
     * @example
     *
     *     var hmac = CryptoJS.HmacSHA3(message, key);
     */
    C.HmacSHA3 = Hasher._createHmacHelper(SHA3);
  })(Math);
  return CryptoJS.SHA3;
});
});

var ripemd160 = createCommonjsModule(function (module, exports) {
(function (root, factory) {
  {
    // CommonJS
    module.exports = factory(core);
  }
})(commonjsGlobal, function (CryptoJS) {
  /** @preserve
  (c) 2012 by Cédric Mesnil. All rights reserved.
  	Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  	    - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
      - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */

  (function (Math) {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var WordArray = C_lib.WordArray;
    var Hasher = C_lib.Hasher;
    var C_algo = C.algo;

    // Constants table
    var _zl = WordArray.create([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]);
    var _zr = WordArray.create([5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]);
    var _sl = WordArray.create([11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]);
    var _sr = WordArray.create([8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]);
    var _hl = WordArray.create([0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);
    var _hr = WordArray.create([0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);

    /**
     * RIPEMD160 hash algorithm.
     */
    var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({
      _doReset: function () {
        this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);
      },
      _doProcessBlock: function (M, offset) {
        // Swap endian
        for (var i = 0; i < 16; i++) {
          // Shortcuts
          var offset_i = offset + i;
          var M_offset_i = M[offset_i];

          // Swap
          M[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 0x00ff00ff | (M_offset_i << 24 | M_offset_i >>> 8) & 0xff00ff00;
        }
        // Shortcut
        var H = this._hash.words;
        var hl = _hl.words;
        var hr = _hr.words;
        var zl = _zl.words;
        var zr = _zr.words;
        var sl = _sl.words;
        var sr = _sr.words;

        // Working variables
        var al, bl, cl, dl, el;
        var ar, br, cr, dr, er;
        ar = al = H[0];
        br = bl = H[1];
        cr = cl = H[2];
        dr = dl = H[3];
        er = el = H[4];
        // Computation
        var t;
        for (var i = 0; i < 80; i += 1) {
          t = al + M[offset + zl[i]] | 0;
          if (i < 16) {
            t += f1(bl, cl, dl) + hl[0];
          } else if (i < 32) {
            t += f2(bl, cl, dl) + hl[1];
          } else if (i < 48) {
            t += f3(bl, cl, dl) + hl[2];
          } else if (i < 64) {
            t += f4(bl, cl, dl) + hl[3];
          } else {
            // if (i<80) {
            t += f5(bl, cl, dl) + hl[4];
          }
          t = t | 0;
          t = rotl(t, sl[i]);
          t = t + el | 0;
          al = el;
          el = dl;
          dl = rotl(cl, 10);
          cl = bl;
          bl = t;
          t = ar + M[offset + zr[i]] | 0;
          if (i < 16) {
            t += f5(br, cr, dr) + hr[0];
          } else if (i < 32) {
            t += f4(br, cr, dr) + hr[1];
          } else if (i < 48) {
            t += f3(br, cr, dr) + hr[2];
          } else if (i < 64) {
            t += f2(br, cr, dr) + hr[3];
          } else {
            // if (i<80) {
            t += f1(br, cr, dr) + hr[4];
          }
          t = t | 0;
          t = rotl(t, sr[i]);
          t = t + er | 0;
          ar = er;
          er = dr;
          dr = rotl(cr, 10);
          cr = br;
          br = t;
        }
        // Intermediate hash value
        t = H[1] + cl + dr | 0;
        H[1] = H[2] + dl + er | 0;
        H[2] = H[3] + el + ar | 0;
        H[3] = H[4] + al + br | 0;
        H[4] = H[0] + bl + cr | 0;
        H[0] = t;
      },
      _doFinalize: function () {
        // Shortcuts
        var data = this._data;
        var dataWords = data.words;
        var nBitsTotal = this._nDataBytes * 8;
        var nBitsLeft = data.sigBytes * 8;

        // Add padding
        dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;
        dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotal << 8 | nBitsTotal >>> 24) & 0x00ff00ff | (nBitsTotal << 24 | nBitsTotal >>> 8) & 0xff00ff00;
        data.sigBytes = (dataWords.length + 1) * 4;

        // Hash final blocks
        this._process();

        // Shortcuts
        var hash = this._hash;
        var H = hash.words;

        // Swap endian
        for (var i = 0; i < 5; i++) {
          // Shortcut
          var H_i = H[i];

          // Swap
          H[i] = (H_i << 8 | H_i >>> 24) & 0x00ff00ff | (H_i << 24 | H_i >>> 8) & 0xff00ff00;
        }

        // Return final computed hash
        return hash;
      },
      clone: function () {
        var clone = Hasher.clone.call(this);
        clone._hash = this._hash.clone();
        return clone;
      }
    });
    function f1(x, y, z) {
      return x ^ y ^ z;
    }
    function f2(x, y, z) {
      return x & y | ~x & z;
    }
    function f3(x, y, z) {
      return (x | ~y) ^ z;
    }
    function f4(x, y, z) {
      return x & z | y & ~z;
    }
    function f5(x, y, z) {
      return x ^ (y | ~z);
    }
    function rotl(x, n) {
      return x << n | x >>> 32 - n;
    }

    /**
     * Shortcut function to the hasher's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     *
     * @return {WordArray} The hash.
     *
     * @static
     *
     * @example
     *
     *     var hash = CryptoJS.RIPEMD160('message');
     *     var hash = CryptoJS.RIPEMD160(wordArray);
     */
    C.RIPEMD160 = Hasher._createHelper(RIPEMD160);

    /**
     * Shortcut function to the HMAC's object interface.
     *
     * @param {WordArray|string} message The message to hash.
     * @param {WordArray|string} key The secret key.
     *
     * @return {WordArray} The HMAC.
     *
     * @static
     *
     * @example
     *
     *     var hmac = CryptoJS.HmacRIPEMD160(message, key);
     */
    C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);
  })();
  return CryptoJS.RIPEMD160;
});
});

var hmac = createCommonjsModule(function (module, exports) {
(function (root, factory) {
  {
    // CommonJS
    module.exports = factory(core);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var Base = C_lib.Base;
    var C_enc = C.enc;
    var Utf8 = C_enc.Utf8;
    var C_algo = C.algo;

    /**
     * HMAC algorithm.
     */
    C_algo.HMAC = Base.extend({
      /**
       * Initializes a newly created HMAC.
       *
       * @param {Hasher} hasher The hash algorithm to use.
       * @param {WordArray|string} key The secret key.
       *
       * @example
       *
       *     var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
       */
      init: function (hasher, key) {
        // Init hasher
        hasher = this._hasher = new hasher.init();

        // Convert string to WordArray, else assume WordArray already
        if (typeof key == 'string') {
          key = Utf8.parse(key);
        }

        // Shortcuts
        var hasherBlockSize = hasher.blockSize;
        var hasherBlockSizeBytes = hasherBlockSize * 4;

        // Allow arbitrary length keys
        if (key.sigBytes > hasherBlockSizeBytes) {
          key = hasher.finalize(key);
        }

        // Clamp excess bits
        key.clamp();

        // Clone key for inner and outer pads
        var oKey = this._oKey = key.clone();
        var iKey = this._iKey = key.clone();

        // Shortcuts
        var oKeyWords = oKey.words;
        var iKeyWords = iKey.words;

        // XOR keys with pad constants
        for (var i = 0; i < hasherBlockSize; i++) {
          oKeyWords[i] ^= 0x5c5c5c5c;
          iKeyWords[i] ^= 0x36363636;
        }
        oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;

        // Set initial values
        this.reset();
      },
      /**
       * Resets this HMAC to its initial state.
       *
       * @example
       *
       *     hmacHasher.reset();
       */
      reset: function () {
        // Shortcut
        var hasher = this._hasher;

        // Reset
        hasher.reset();
        hasher.update(this._iKey);
      },
      /**
       * Updates this HMAC with a message.
       *
       * @param {WordArray|string} messageUpdate The message to append.
       *
       * @return {HMAC} This HMAC instance.
       *
       * @example
       *
       *     hmacHasher.update('message');
       *     hmacHasher.update(wordArray);
       */
      update: function (messageUpdate) {
        this._hasher.update(messageUpdate);

        // Chainable
        return this;
      },
      /**
       * Finalizes the HMAC computation.
       * Note that the finalize operation is effectively a destructive, read-once operation.
       *
       * @param {WordArray|string} messageUpdate (Optional) A final message update.
       *
       * @return {WordArray} The HMAC.
       *
       * @example
       *
       *     var hmac = hmacHasher.finalize();
       *     var hmac = hmacHasher.finalize('message');
       *     var hmac = hmacHasher.finalize(wordArray);
       */
      finalize: function (messageUpdate) {
        // Shortcut
        var hasher = this._hasher;

        // Compute HMAC
        var innerHash = hasher.finalize(messageUpdate);
        hasher.reset();
        var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));
        return hmac;
      }
    });
  })();
});
});

var pbkdf2 = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, sha256, hmac);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var Base = C_lib.Base;
    var WordArray = C_lib.WordArray;
    var C_algo = C.algo;
    var SHA256 = C_algo.SHA256;
    var HMAC = C_algo.HMAC;

    /**
     * Password-Based Key Derivation Function 2 algorithm.
     */
    var PBKDF2 = C_algo.PBKDF2 = Base.extend({
      /**
       * Configuration options.
       *
       * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
       * @property {Hasher} hasher The hasher to use. Default: SHA256
       * @property {number} iterations The number of iterations to perform. Default: 250000
       */
      cfg: Base.extend({
        keySize: 128 / 32,
        hasher: SHA256,
        iterations: 250000
      }),
      /**
       * Initializes a newly created key derivation function.
       *
       * @param {Object} cfg (Optional) The configuration options to use for the derivation.
       *
       * @example
       *
       *     var kdf = CryptoJS.algo.PBKDF2.create();
       *     var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
       *     var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
       */
      init: function (cfg) {
        this.cfg = this.cfg.extend(cfg);
      },
      /**
       * Computes the Password-Based Key Derivation Function 2.
       *
       * @param {WordArray|string} password The password.
       * @param {WordArray|string} salt A salt.
       *
       * @return {WordArray} The derived key.
       *
       * @example
       *
       *     var key = kdf.compute(password, salt);
       */
      compute: function (password, salt) {
        // Shortcut
        var cfg = this.cfg;

        // Init HMAC
        var hmac = HMAC.create(cfg.hasher, password);

        // Initial values
        var derivedKey = WordArray.create();
        var blockIndex = WordArray.create([0x00000001]);

        // Shortcuts
        var derivedKeyWords = derivedKey.words;
        var blockIndexWords = blockIndex.words;
        var keySize = cfg.keySize;
        var iterations = cfg.iterations;

        // Generate key
        while (derivedKeyWords.length < keySize) {
          var block = hmac.update(salt).finalize(blockIndex);
          hmac.reset();

          // Shortcuts
          var blockWords = block.words;
          var blockWordsLength = blockWords.length;

          // Iterations
          var intermediate = block;
          for (var i = 1; i < iterations; i++) {
            intermediate = hmac.finalize(intermediate);
            hmac.reset();

            // Shortcut
            var intermediateWords = intermediate.words;

            // XOR intermediate with block
            for (var j = 0; j < blockWordsLength; j++) {
              blockWords[j] ^= intermediateWords[j];
            }
          }
          derivedKey.concat(block);
          blockIndexWords[0]++;
        }
        derivedKey.sigBytes = keySize * 4;
        return derivedKey;
      }
    });

    /**
     * Computes the Password-Based Key Derivation Function 2.
     *
     * @param {WordArray|string} password The password.
     * @param {WordArray|string} salt A salt.
     * @param {Object} cfg (Optional) The configuration options to use for this computation.
     *
     * @return {WordArray} The derived key.
     *
     * @static
     *
     * @example
     *
     *     var key = CryptoJS.PBKDF2(password, salt);
     *     var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });
     *     var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });
     */
    C.PBKDF2 = function (password, salt, cfg) {
      return PBKDF2.create(cfg).compute(password, salt);
    };
  })();
  return CryptoJS.PBKDF2;
});
});

var evpkdf = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, sha1, hmac);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var Base = C_lib.Base;
    var WordArray = C_lib.WordArray;
    var C_algo = C.algo;
    var MD5 = C_algo.MD5;

    /**
     * This key derivation function is meant to conform with EVP_BytesToKey.
     * www.openssl.org/docs/crypto/EVP_BytesToKey.html
     */
    var EvpKDF = C_algo.EvpKDF = Base.extend({
      /**
       * Configuration options.
       *
       * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
       * @property {Hasher} hasher The hash algorithm to use. Default: MD5
       * @property {number} iterations The number of iterations to perform. Default: 1
       */
      cfg: Base.extend({
        keySize: 128 / 32,
        hasher: MD5,
        iterations: 1
      }),
      /**
       * Initializes a newly created key derivation function.
       *
       * @param {Object} cfg (Optional) The configuration options to use for the derivation.
       *
       * @example
       *
       *     var kdf = CryptoJS.algo.EvpKDF.create();
       *     var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
       *     var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
       */
      init: function (cfg) {
        this.cfg = this.cfg.extend(cfg);
      },
      /**
       * Derives a key from a password.
       *
       * @param {WordArray|string} password The password.
       * @param {WordArray|string} salt A salt.
       *
       * @return {WordArray} The derived key.
       *
       * @example
       *
       *     var key = kdf.compute(password, salt);
       */
      compute: function (password, salt) {
        var block;

        // Shortcut
        var cfg = this.cfg;

        // Init hasher
        var hasher = cfg.hasher.create();

        // Initial values
        var derivedKey = WordArray.create();

        // Shortcuts
        var derivedKeyWords = derivedKey.words;
        var keySize = cfg.keySize;
        var iterations = cfg.iterations;

        // Generate key
        while (derivedKeyWords.length < keySize) {
          if (block) {
            hasher.update(block);
          }
          block = hasher.update(password).finalize(salt);
          hasher.reset();

          // Iterations
          for (var i = 1; i < iterations; i++) {
            block = hasher.finalize(block);
            hasher.reset();
          }
          derivedKey.concat(block);
        }
        derivedKey.sigBytes = keySize * 4;
        return derivedKey;
      }
    });

    /**
     * Derives a key from a password.
     *
     * @param {WordArray|string} password The password.
     * @param {WordArray|string} salt A salt.
     * @param {Object} cfg (Optional) The configuration options to use for this computation.
     *
     * @return {WordArray} The derived key.
     *
     * @static
     *
     * @example
     *
     *     var key = CryptoJS.EvpKDF(password, salt);
     *     var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });
     *     var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
     */
    C.EvpKDF = function (password, salt, cfg) {
      return EvpKDF.create(cfg).compute(password, salt);
    };
  })();
  return CryptoJS.EvpKDF;
});
});

var cipherCore = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, evpkdf);
  }
})(commonjsGlobal, function (CryptoJS) {
  /**
   * Cipher core components.
   */
  CryptoJS.lib.Cipher || function (undefined$1) {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var Base = C_lib.Base;
    var WordArray = C_lib.WordArray;
    var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;
    var C_enc = C.enc;
    C_enc.Utf8;
    var Base64 = C_enc.Base64;
    var C_algo = C.algo;
    var EvpKDF = C_algo.EvpKDF;

    /**
     * Abstract base cipher template.
     *
     * @property {number} keySize This cipher's key size. Default: 4 (128 bits)
     * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)
     * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.
     * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.
     */
    var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
      /**
       * Configuration options.
       *
       * @property {WordArray} iv The IV to use for this operation.
       */
      cfg: Base.extend(),
      /**
       * Creates this cipher in encryption mode.
       *
       * @param {WordArray} key The key.
       * @param {Object} cfg (Optional) The configuration options to use for this operation.
       *
       * @return {Cipher} A cipher instance.
       *
       * @static
       *
       * @example
       *
       *     var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
       */
      createEncryptor: function (key, cfg) {
        return this.create(this._ENC_XFORM_MODE, key, cfg);
      },
      /**
       * Creates this cipher in decryption mode.
       *
       * @param {WordArray} key The key.
       * @param {Object} cfg (Optional) The configuration options to use for this operation.
       *
       * @return {Cipher} A cipher instance.
       *
       * @static
       *
       * @example
       *
       *     var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
       */
      createDecryptor: function (key, cfg) {
        return this.create(this._DEC_XFORM_MODE, key, cfg);
      },
      /**
       * Initializes a newly created cipher.
       *
       * @param {number} xformMode Either the encryption or decryption transormation mode constant.
       * @param {WordArray} key The key.
       * @param {Object} cfg (Optional) The configuration options to use for this operation.
       *
       * @example
       *
       *     var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
       */
      init: function (xformMode, key, cfg) {
        // Apply config defaults
        this.cfg = this.cfg.extend(cfg);

        // Store transform mode and key
        this._xformMode = xformMode;
        this._key = key;

        // Set initial values
        this.reset();
      },
      /**
       * Resets this cipher to its initial state.
       *
       * @example
       *
       *     cipher.reset();
       */
      reset: function () {
        // Reset data buffer
        BufferedBlockAlgorithm.reset.call(this);

        // Perform concrete-cipher logic
        this._doReset();
      },
      /**
       * Adds data to be encrypted or decrypted.
       *
       * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
       *
       * @return {WordArray} The data after processing.
       *
       * @example
       *
       *     var encrypted = cipher.process('data');
       *     var encrypted = cipher.process(wordArray);
       */
      process: function (dataUpdate) {
        // Append
        this._append(dataUpdate);

        // Process available blocks
        return this._process();
      },
      /**
       * Finalizes the encryption or decryption process.
       * Note that the finalize operation is effectively a destructive, read-once operation.
       *
       * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
       *
       * @return {WordArray} The data after final processing.
       *
       * @example
       *
       *     var encrypted = cipher.finalize();
       *     var encrypted = cipher.finalize('data');
       *     var encrypted = cipher.finalize(wordArray);
       */
      finalize: function (dataUpdate) {
        // Final data update
        if (dataUpdate) {
          this._append(dataUpdate);
        }

        // Perform concrete-cipher logic
        var finalProcessedData = this._doFinalize();
        return finalProcessedData;
      },
      keySize: 128 / 32,
      ivSize: 128 / 32,
      _ENC_XFORM_MODE: 1,
      _DEC_XFORM_MODE: 2,
      /**
       * Creates shortcut functions to a cipher's object interface.
       *
       * @param {Cipher} cipher The cipher to create a helper for.
       *
       * @return {Object} An object with encrypt and decrypt shortcut functions.
       *
       * @static
       *
       * @example
       *
       *     var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
       */
      _createHelper: function () {
        function selectCipherStrategy(key) {
          if (typeof key == 'string') {
            return PasswordBasedCipher;
          } else {
            return SerializableCipher;
          }
        }
        return function (cipher) {
          return {
            encrypt: function (message, key, cfg) {
              return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
            },
            decrypt: function (ciphertext, key, cfg) {
              return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
            }
          };
        };
      }()
    });

    /**
     * Abstract base stream cipher template.
     *
     * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)
     */
    C_lib.StreamCipher = Cipher.extend({
      _doFinalize: function () {
        // Process partial blocks
        var finalProcessedBlocks = this._process(!!'flush');
        return finalProcessedBlocks;
      },
      blockSize: 1
    });

    /**
     * Mode namespace.
     */
    var C_mode = C.mode = {};

    /**
     * Abstract base block cipher mode template.
     */
    var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
      /**
       * Creates this mode for encryption.
       *
       * @param {Cipher} cipher A block cipher instance.
       * @param {Array} iv The IV words.
       *
       * @static
       *
       * @example
       *
       *     var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
       */
      createEncryptor: function (cipher, iv) {
        return this.Encryptor.create(cipher, iv);
      },
      /**
       * Creates this mode for decryption.
       *
       * @param {Cipher} cipher A block cipher instance.
       * @param {Array} iv The IV words.
       *
       * @static
       *
       * @example
       *
       *     var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
       */
      createDecryptor: function (cipher, iv) {
        return this.Decryptor.create(cipher, iv);
      },
      /**
       * Initializes a newly created mode.
       *
       * @param {Cipher} cipher A block cipher instance.
       * @param {Array} iv The IV words.
       *
       * @example
       *
       *     var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
       */
      init: function (cipher, iv) {
        this._cipher = cipher;
        this._iv = iv;
      }
    });

    /**
     * Cipher Block Chaining mode.
     */
    var CBC = C_mode.CBC = function () {
      /**
       * Abstract base CBC mode.
       */
      var CBC = BlockCipherMode.extend();

      /**
       * CBC encryptor.
       */
      CBC.Encryptor = CBC.extend({
        /**
         * Processes the data block at offset.
         *
         * @param {Array} words The data words to operate on.
         * @param {number} offset The offset where the block starts.
         *
         * @example
         *
         *     mode.processBlock(data.words, offset);
         */
        processBlock: function (words, offset) {
          // Shortcuts
          var cipher = this._cipher;
          var blockSize = cipher.blockSize;

          // XOR and encrypt
          xorBlock.call(this, words, offset, blockSize);
          cipher.encryptBlock(words, offset);

          // Remember this block to use with next block
          this._prevBlock = words.slice(offset, offset + blockSize);
        }
      });

      /**
       * CBC decryptor.
       */
      CBC.Decryptor = CBC.extend({
        /**
         * Processes the data block at offset.
         *
         * @param {Array} words The data words to operate on.
         * @param {number} offset The offset where the block starts.
         *
         * @example
         *
         *     mode.processBlock(data.words, offset);
         */
        processBlock: function (words, offset) {
          // Shortcuts
          var cipher = this._cipher;
          var blockSize = cipher.blockSize;

          // Remember this block to use with next block
          var thisBlock = words.slice(offset, offset + blockSize);

          // Decrypt and XOR
          cipher.decryptBlock(words, offset);
          xorBlock.call(this, words, offset, blockSize);

          // This block becomes the previous block
          this._prevBlock = thisBlock;
        }
      });
      function xorBlock(words, offset, blockSize) {
        var block;

        // Shortcut
        var iv = this._iv;

        // Choose mixing block
        if (iv) {
          block = iv;

          // Remove IV for subsequent blocks
          this._iv = undefined$1;
        } else {
          block = this._prevBlock;
        }

        // XOR blocks
        for (var i = 0; i < blockSize; i++) {
          words[offset + i] ^= block[i];
        }
      }
      return CBC;
    }();

    /**
     * Padding namespace.
     */
    var C_pad = C.pad = {};

    /**
     * PKCS #5/7 padding strategy.
     */
    var Pkcs7 = C_pad.Pkcs7 = {
      /**
       * Pads data using the algorithm defined in PKCS #5/7.
       *
       * @param {WordArray} data The data to pad.
       * @param {number} blockSize The multiple that the data should be padded to.
       *
       * @static
       *
       * @example
       *
       *     CryptoJS.pad.Pkcs7.pad(wordArray, 4);
       */
      pad: function (data, blockSize) {
        // Shortcut
        var blockSizeBytes = blockSize * 4;

        // Count padding bytes
        var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;

        // Create padding word
        var paddingWord = nPaddingBytes << 24 | nPaddingBytes << 16 | nPaddingBytes << 8 | nPaddingBytes;

        // Create padding
        var paddingWords = [];
        for (var i = 0; i < nPaddingBytes; i += 4) {
          paddingWords.push(paddingWord);
        }
        var padding = WordArray.create(paddingWords, nPaddingBytes);

        // Add padding
        data.concat(padding);
      },
      /**
       * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
       *
       * @param {WordArray} data The data to unpad.
       *
       * @static
       *
       * @example
       *
       *     CryptoJS.pad.Pkcs7.unpad(wordArray);
       */
      unpad: function (data) {
        // Get number of padding bytes from last byte
        var nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 0xff;

        // Remove padding
        data.sigBytes -= nPaddingBytes;
      }
    };

    /**
     * Abstract base block cipher template.
     *
     * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)
     */
    C_lib.BlockCipher = Cipher.extend({
      /**
       * Configuration options.
       *
       * @property {Mode} mode The block mode to use. Default: CBC
       * @property {Padding} padding The padding strategy to use. Default: Pkcs7
       */
      cfg: Cipher.cfg.extend({
        mode: CBC,
        padding: Pkcs7
      }),
      reset: function () {
        var modeCreator;

        // Reset cipher
        Cipher.reset.call(this);

        // Shortcuts
        var cfg = this.cfg;
        var iv = cfg.iv;
        var mode = cfg.mode;

        // Reset block mode
        if (this._xformMode == this._ENC_XFORM_MODE) {
          modeCreator = mode.createEncryptor;
        } else /* if (this._xformMode == this._DEC_XFORM_MODE) */{
            modeCreator = mode.createDecryptor;
            // Keep at least one block in the buffer for unpadding
            this._minBufferSize = 1;
          }
        if (this._mode && this._mode.__creator == modeCreator) {
          this._mode.init(this, iv && iv.words);
        } else {
          this._mode = modeCreator.call(mode, this, iv && iv.words);
          this._mode.__creator = modeCreator;
        }
      },
      _doProcessBlock: function (words, offset) {
        this._mode.processBlock(words, offset);
      },
      _doFinalize: function () {
        var finalProcessedBlocks;

        // Shortcut
        var padding = this.cfg.padding;

        // Finalize
        if (this._xformMode == this._ENC_XFORM_MODE) {
          // Pad data
          padding.pad(this._data, this.blockSize);

          // Process final blocks
          finalProcessedBlocks = this._process(!!'flush');
        } else /* if (this._xformMode == this._DEC_XFORM_MODE) */{
            // Process final blocks
            finalProcessedBlocks = this._process(!!'flush');

            // Unpad data
            padding.unpad(finalProcessedBlocks);
          }
        return finalProcessedBlocks;
      },
      blockSize: 128 / 32
    });

    /**
     * A collection of cipher parameters.
     *
     * @property {WordArray} ciphertext The raw ciphertext.
     * @property {WordArray} key The key to this ciphertext.
     * @property {WordArray} iv The IV used in the ciphering operation.
     * @property {WordArray} salt The salt used with a key derivation function.
     * @property {Cipher} algorithm The cipher algorithm.
     * @property {Mode} mode The block mode used in the ciphering operation.
     * @property {Padding} padding The padding scheme used in the ciphering operation.
     * @property {number} blockSize The block size of the cipher.
     * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.
     */
    var CipherParams = C_lib.CipherParams = Base.extend({
      /**
       * Initializes a newly created cipher params object.
       *
       * @param {Object} cipherParams An object with any of the possible cipher parameters.
       *
       * @example
       *
       *     var cipherParams = CryptoJS.lib.CipherParams.create({
       *         ciphertext: ciphertextWordArray,
       *         key: keyWordArray,
       *         iv: ivWordArray,
       *         salt: saltWordArray,
       *         algorithm: CryptoJS.algo.AES,
       *         mode: CryptoJS.mode.CBC,
       *         padding: CryptoJS.pad.PKCS7,
       *         blockSize: 4,
       *         formatter: CryptoJS.format.OpenSSL
       *     });
       */
      init: function (cipherParams) {
        this.mixIn(cipherParams);
      },
      /**
       * Converts this cipher params object to a string.
       *
       * @param {Format} formatter (Optional) The formatting strategy to use.
       *
       * @return {string} The stringified cipher params.
       *
       * @throws Error If neither the formatter nor the default formatter is set.
       *
       * @example
       *
       *     var string = cipherParams + '';
       *     var string = cipherParams.toString();
       *     var string = cipherParams.toString(CryptoJS.format.OpenSSL);
       */
      toString: function (formatter) {
        return (formatter || this.formatter).stringify(this);
      }
    });

    /**
     * Format namespace.
     */
    var C_format = C.format = {};

    /**
     * OpenSSL formatting strategy.
     */
    var OpenSSLFormatter = C_format.OpenSSL = {
      /**
       * Converts a cipher params object to an OpenSSL-compatible string.
       *
       * @param {CipherParams} cipherParams The cipher params object.
       *
       * @return {string} The OpenSSL-compatible string.
       *
       * @static
       *
       * @example
       *
       *     var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
       */
      stringify: function (cipherParams) {
        var wordArray;

        // Shortcuts
        var ciphertext = cipherParams.ciphertext;
        var salt = cipherParams.salt;

        // Format
        if (salt) {
          wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);
        } else {
          wordArray = ciphertext;
        }
        return wordArray.toString(Base64);
      },
      /**
       * Converts an OpenSSL-compatible string to a cipher params object.
       *
       * @param {string} openSSLStr The OpenSSL-compatible string.
       *
       * @return {CipherParams} The cipher params object.
       *
       * @static
       *
       * @example
       *
       *     var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
       */
      parse: function (openSSLStr) {
        var salt;

        // Parse base64
        var ciphertext = Base64.parse(openSSLStr);

        // Shortcut
        var ciphertextWords = ciphertext.words;

        // Test for salt
        if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {
          // Extract salt
          salt = WordArray.create(ciphertextWords.slice(2, 4));

          // Remove salt from ciphertext
          ciphertextWords.splice(0, 4);
          ciphertext.sigBytes -= 16;
        }
        return CipherParams.create({
          ciphertext: ciphertext,
          salt: salt
        });
      }
    };

    /**
     * A cipher wrapper that returns ciphertext as a serializable cipher params object.
     */
    var SerializableCipher = C_lib.SerializableCipher = Base.extend({
      /**
       * Configuration options.
       *
       * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
       */
      cfg: Base.extend({
        format: OpenSSLFormatter
      }),
      /**
       * Encrypts a message.
       *
       * @param {Cipher} cipher The cipher algorithm to use.
       * @param {WordArray|string} message The message to encrypt.
       * @param {WordArray} key The key.
       * @param {Object} cfg (Optional) The configuration options to use for this operation.
       *
       * @return {CipherParams} A cipher params object.
       *
       * @static
       *
       * @example
       *
       *     var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
       *     var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
       *     var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
       */
      encrypt: function (cipher, message, key, cfg) {
        // Apply config defaults
        cfg = this.cfg.extend(cfg);

        // Encrypt
        var encryptor = cipher.createEncryptor(key, cfg);
        var ciphertext = encryptor.finalize(message);

        // Shortcut
        var cipherCfg = encryptor.cfg;

        // Create and return serializable cipher params
        return CipherParams.create({
          ciphertext: ciphertext,
          key: key,
          iv: cipherCfg.iv,
          algorithm: cipher,
          mode: cipherCfg.mode,
          padding: cipherCfg.padding,
          blockSize: cipher.blockSize,
          formatter: cfg.format
        });
      },
      /**
       * Decrypts serialized ciphertext.
       *
       * @param {Cipher} cipher The cipher algorithm to use.
       * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
       * @param {WordArray} key The key.
       * @param {Object} cfg (Optional) The configuration options to use for this operation.
       *
       * @return {WordArray} The plaintext.
       *
       * @static
       *
       * @example
       *
       *     var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
       *     var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
       */
      decrypt: function (cipher, ciphertext, key, cfg) {
        // Apply config defaults
        cfg = this.cfg.extend(cfg);

        // Convert string to CipherParams
        ciphertext = this._parse(ciphertext, cfg.format);

        // Decrypt
        var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
        return plaintext;
      },
      /**
       * Converts serialized ciphertext to CipherParams,
       * else assumed CipherParams already and returns ciphertext unchanged.
       *
       * @param {CipherParams|string} ciphertext The ciphertext.
       * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
       *
       * @return {CipherParams} The unserialized ciphertext.
       *
       * @static
       *
       * @example
       *
       *     var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
       */
      _parse: function (ciphertext, format) {
        if (typeof ciphertext == 'string') {
          return format.parse(ciphertext, this);
        } else {
          return ciphertext;
        }
      }
    });

    /**
     * Key derivation function namespace.
     */
    var C_kdf = C.kdf = {};

    /**
     * OpenSSL key derivation function.
     */
    var OpenSSLKdf = C_kdf.OpenSSL = {
      /**
       * Derives a key and IV from a password.
       *
       * @param {string} password The password to derive from.
       * @param {number} keySize The size in words of the key to generate.
       * @param {number} ivSize The size in words of the IV to generate.
       * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
       *
       * @return {CipherParams} A cipher params object with the key, IV, and salt.
       *
       * @static
       *
       * @example
       *
       *     var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
       *     var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
       */
      execute: function (password, keySize, ivSize, salt, hasher) {
        // Generate random salt
        if (!salt) {
          salt = WordArray.random(64 / 8);
        }

        // Derive key and IV
        if (!hasher) {
          var key = EvpKDF.create({
            keySize: keySize + ivSize
          }).compute(password, salt);
        } else {
          var key = EvpKDF.create({
            keySize: keySize + ivSize,
            hasher: hasher
          }).compute(password, salt);
        }

        // Separate key and IV
        var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
        key.sigBytes = keySize * 4;

        // Return params
        return CipherParams.create({
          key: key,
          iv: iv,
          salt: salt
        });
      }
    };

    /**
     * A serializable cipher wrapper that derives the key from a password,
     * and returns ciphertext as a serializable cipher params object.
     */
    var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
      /**
       * Configuration options.
       *
       * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
       */
      cfg: SerializableCipher.cfg.extend({
        kdf: OpenSSLKdf
      }),
      /**
       * Encrypts a message using a password.
       *
       * @param {Cipher} cipher The cipher algorithm to use.
       * @param {WordArray|string} message The message to encrypt.
       * @param {string} password The password.
       * @param {Object} cfg (Optional) The configuration options to use for this operation.
       *
       * @return {CipherParams} A cipher params object.
       *
       * @static
       *
       * @example
       *
       *     var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
       *     var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
       */
      encrypt: function (cipher, message, password, cfg) {
        // Apply config defaults
        cfg = this.cfg.extend(cfg);

        // Derive key and other params
        var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, cfg.salt, cfg.hasher);

        // Add IV to config
        cfg.iv = derivedParams.iv;

        // Encrypt
        var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);

        // Mix in derived params
        ciphertext.mixIn(derivedParams);
        return ciphertext;
      },
      /**
       * Decrypts serialized ciphertext using a password.
       *
       * @param {Cipher} cipher The cipher algorithm to use.
       * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
       * @param {string} password The password.
       * @param {Object} cfg (Optional) The configuration options to use for this operation.
       *
       * @return {WordArray} The plaintext.
       *
       * @static
       *
       * @example
       *
       *     var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
       *     var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
       */
      decrypt: function (cipher, ciphertext, password, cfg) {
        // Apply config defaults
        cfg = this.cfg.extend(cfg);

        // Convert string to CipherParams
        ciphertext = this._parse(ciphertext, cfg.format);

        // Derive key and other params
        var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt, cfg.hasher);

        // Add IV to config
        cfg.iv = derivedParams.iv;

        // Decrypt
        var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);
        return plaintext;
      }
    });
  }();
});
});

var modeCfb = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  /**
   * Cipher Feedback block mode.
   */
  CryptoJS.mode.CFB = function () {
    var CFB = CryptoJS.lib.BlockCipherMode.extend();
    CFB.Encryptor = CFB.extend({
      processBlock: function (words, offset) {
        // Shortcuts
        var cipher = this._cipher;
        var blockSize = cipher.blockSize;
        generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);

        // Remember this block to use with next block
        this._prevBlock = words.slice(offset, offset + blockSize);
      }
    });
    CFB.Decryptor = CFB.extend({
      processBlock: function (words, offset) {
        // Shortcuts
        var cipher = this._cipher;
        var blockSize = cipher.blockSize;

        // Remember this block to use with next block
        var thisBlock = words.slice(offset, offset + blockSize);
        generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);

        // This block becomes the previous block
        this._prevBlock = thisBlock;
      }
    });
    function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
      var keystream;

      // Shortcut
      var iv = this._iv;

      // Generate keystream
      if (iv) {
        keystream = iv.slice(0);

        // Remove IV for subsequent blocks
        this._iv = undefined;
      } else {
        keystream = this._prevBlock;
      }
      cipher.encryptBlock(keystream, 0);

      // Encrypt
      for (var i = 0; i < blockSize; i++) {
        words[offset + i] ^= keystream[i];
      }
    }
    return CFB;
  }();
  return CryptoJS.mode.CFB;
});
});

var modeCtr = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  /**
   * Counter block mode.
   */
  CryptoJS.mode.CTR = function () {
    var CTR = CryptoJS.lib.BlockCipherMode.extend();
    var Encryptor = CTR.Encryptor = CTR.extend({
      processBlock: function (words, offset) {
        // Shortcuts
        var cipher = this._cipher;
        var blockSize = cipher.blockSize;
        var iv = this._iv;
        var counter = this._counter;

        // Generate keystream
        if (iv) {
          counter = this._counter = iv.slice(0);

          // Remove IV for subsequent blocks
          this._iv = undefined;
        }
        var keystream = counter.slice(0);
        cipher.encryptBlock(keystream, 0);

        // Increment counter
        counter[blockSize - 1] = counter[blockSize - 1] + 1 | 0;

        // Encrypt
        for (var i = 0; i < blockSize; i++) {
          words[offset + i] ^= keystream[i];
        }
      }
    });
    CTR.Decryptor = Encryptor;
    return CTR;
  }();
  return CryptoJS.mode.CTR;
});
});

var modeCtrGladman = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  /** @preserve
   * Counter block mode compatible with  Dr Brian Gladman fileenc.c
   * derived from CryptoJS.mode.CTR
   * Jan Hruby jhruby.web@gmail.com
   */
  CryptoJS.mode.CTRGladman = function () {
    var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();
    function incWord(word) {
      if ((word >> 24 & 0xff) === 0xff) {
        //overflow
        var b1 = word >> 16 & 0xff;
        var b2 = word >> 8 & 0xff;
        var b3 = word & 0xff;
        if (b1 === 0xff)
          // overflow b1
          {
            b1 = 0;
            if (b2 === 0xff) {
              b2 = 0;
              if (b3 === 0xff) {
                b3 = 0;
              } else {
                ++b3;
              }
            } else {
              ++b2;
            }
          } else {
          ++b1;
        }
        word = 0;
        word += b1 << 16;
        word += b2 << 8;
        word += b3;
      } else {
        word += 0x01 << 24;
      }
      return word;
    }
    function incCounter(counter) {
      if ((counter[0] = incWord(counter[0])) === 0) {
        // encr_data in fileenc.c from  Dr Brian Gladman's counts only with DWORD j < 8
        counter[1] = incWord(counter[1]);
      }
      return counter;
    }
    var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
      processBlock: function (words, offset) {
        // Shortcuts
        var cipher = this._cipher;
        var blockSize = cipher.blockSize;
        var iv = this._iv;
        var counter = this._counter;

        // Generate keystream
        if (iv) {
          counter = this._counter = iv.slice(0);

          // Remove IV for subsequent blocks
          this._iv = undefined;
        }
        incCounter(counter);
        var keystream = counter.slice(0);
        cipher.encryptBlock(keystream, 0);

        // Encrypt
        for (var i = 0; i < blockSize; i++) {
          words[offset + i] ^= keystream[i];
        }
      }
    });
    CTRGladman.Decryptor = Encryptor;
    return CTRGladman;
  }();
  return CryptoJS.mode.CTRGladman;
});
});

var modeOfb = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  /**
   * Output Feedback block mode.
   */
  CryptoJS.mode.OFB = function () {
    var OFB = CryptoJS.lib.BlockCipherMode.extend();
    var Encryptor = OFB.Encryptor = OFB.extend({
      processBlock: function (words, offset) {
        // Shortcuts
        var cipher = this._cipher;
        var blockSize = cipher.blockSize;
        var iv = this._iv;
        var keystream = this._keystream;

        // Generate keystream
        if (iv) {
          keystream = this._keystream = iv.slice(0);

          // Remove IV for subsequent blocks
          this._iv = undefined;
        }
        cipher.encryptBlock(keystream, 0);

        // Encrypt
        for (var i = 0; i < blockSize; i++) {
          words[offset + i] ^= keystream[i];
        }
      }
    });
    OFB.Decryptor = Encryptor;
    return OFB;
  }();
  return CryptoJS.mode.OFB;
});
});

var modeEcb = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  /**
   * Electronic Codebook block mode.
   */
  CryptoJS.mode.ECB = function () {
    var ECB = CryptoJS.lib.BlockCipherMode.extend();
    ECB.Encryptor = ECB.extend({
      processBlock: function (words, offset) {
        this._cipher.encryptBlock(words, offset);
      }
    });
    ECB.Decryptor = ECB.extend({
      processBlock: function (words, offset) {
        this._cipher.decryptBlock(words, offset);
      }
    });
    return ECB;
  }();
  return CryptoJS.mode.ECB;
});
});

var padAnsix923 = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  /**
   * ANSI X.923 padding strategy.
   */
  CryptoJS.pad.AnsiX923 = {
    pad: function (data, blockSize) {
      // Shortcuts
      var dataSigBytes = data.sigBytes;
      var blockSizeBytes = blockSize * 4;

      // Count padding bytes
      var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;

      // Compute last byte position
      var lastBytePos = dataSigBytes + nPaddingBytes - 1;

      // Pad
      data.clamp();
      data.words[lastBytePos >>> 2] |= nPaddingBytes << 24 - lastBytePos % 4 * 8;
      data.sigBytes += nPaddingBytes;
    },
    unpad: function (data) {
      // Get number of padding bytes from last byte
      var nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 0xff;

      // Remove padding
      data.sigBytes -= nPaddingBytes;
    }
  };
  return CryptoJS.pad.Ansix923;
});
});

var padIso10126 = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  /**
   * ISO 10126 padding strategy.
   */
  CryptoJS.pad.Iso10126 = {
    pad: function (data, blockSize) {
      // Shortcut
      var blockSizeBytes = blockSize * 4;

      // Count padding bytes
      var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;

      // Pad
      data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
    },
    unpad: function (data) {
      // Get number of padding bytes from last byte
      var nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 0xff;

      // Remove padding
      data.sigBytes -= nPaddingBytes;
    }
  };
  return CryptoJS.pad.Iso10126;
});
});

var padIso97971 = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  /**
   * ISO/IEC 9797-1 Padding Method 2.
   */
  CryptoJS.pad.Iso97971 = {
    pad: function (data, blockSize) {
      // Add 0x80 byte
      data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));

      // Zero pad the rest
      CryptoJS.pad.ZeroPadding.pad(data, blockSize);
    },
    unpad: function (data) {
      // Remove zero padding
      CryptoJS.pad.ZeroPadding.unpad(data);

      // Remove one more byte -- the 0x80 byte
      data.sigBytes--;
    }
  };
  return CryptoJS.pad.Iso97971;
});
});

var padZeropadding = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  /**
   * Zero padding strategy.
   */
  CryptoJS.pad.ZeroPadding = {
    pad: function (data, blockSize) {
      // Shortcut
      var blockSizeBytes = blockSize * 4;

      // Pad
      data.clamp();
      data.sigBytes += blockSizeBytes - (data.sigBytes % blockSizeBytes || blockSizeBytes);
    },
    unpad: function (data) {
      // Shortcut
      var dataWords = data.words;

      // Unpad
      var i = data.sigBytes - 1;
      for (var i = data.sigBytes - 1; i >= 0; i--) {
        if (dataWords[i >>> 2] >>> 24 - i % 4 * 8 & 0xff) {
          data.sigBytes = i + 1;
          break;
        }
      }
    }
  };
  return CryptoJS.pad.ZeroPadding;
});
});

var padNopadding = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  /**
   * A noop padding strategy.
   */
  CryptoJS.pad.NoPadding = {
    pad: function () {},
    unpad: function () {}
  };
  return CryptoJS.pad.NoPadding;
});
});

var formatHex = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function (undefined$1) {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var CipherParams = C_lib.CipherParams;
    var C_enc = C.enc;
    var Hex = C_enc.Hex;
    var C_format = C.format;
    C_format.Hex = {
      /**
       * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
       *
       * @param {CipherParams} cipherParams The cipher params object.
       *
       * @return {string} The hexadecimally encoded string.
       *
       * @static
       *
       * @example
       *
       *     var hexString = CryptoJS.format.Hex.stringify(cipherParams);
       */
      stringify: function (cipherParams) {
        return cipherParams.ciphertext.toString(Hex);
      },
      /**
       * Converts a hexadecimally encoded ciphertext string to a cipher params object.
       *
       * @param {string} input The hexadecimally encoded string.
       *
       * @return {CipherParams} The cipher params object.
       *
       * @static
       *
       * @example
       *
       *     var cipherParams = CryptoJS.format.Hex.parse(hexString);
       */
      parse: function (input) {
        var ciphertext = Hex.parse(input);
        return CipherParams.create({
          ciphertext: ciphertext
        });
      }
    };
  })();
  return CryptoJS.format.Hex;
});
});

var aes = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, encBase64, md5, evpkdf, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var BlockCipher = C_lib.BlockCipher;
    var C_algo = C.algo;

    // Lookup tables
    var SBOX = [];
    var INV_SBOX = [];
    var SUB_MIX_0 = [];
    var SUB_MIX_1 = [];
    var SUB_MIX_2 = [];
    var SUB_MIX_3 = [];
    var INV_SUB_MIX_0 = [];
    var INV_SUB_MIX_1 = [];
    var INV_SUB_MIX_2 = [];
    var INV_SUB_MIX_3 = [];

    // Compute lookup tables
    (function () {
      // Compute double table
      var d = [];
      for (var i = 0; i < 256; i++) {
        if (i < 128) {
          d[i] = i << 1;
        } else {
          d[i] = i << 1 ^ 0x11b;
        }
      }

      // Walk GF(2^8)
      var x = 0;
      var xi = 0;
      for (var i = 0; i < 256; i++) {
        // Compute sbox
        var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;
        sx = sx >>> 8 ^ sx & 0xff ^ 0x63;
        SBOX[x] = sx;
        INV_SBOX[sx] = x;

        // Compute multiplication
        var x2 = d[x];
        var x4 = d[x2];
        var x8 = d[x4];

        // Compute sub bytes, mix columns tables
        var t = d[sx] * 0x101 ^ sx * 0x1010100;
        SUB_MIX_0[x] = t << 24 | t >>> 8;
        SUB_MIX_1[x] = t << 16 | t >>> 16;
        SUB_MIX_2[x] = t << 8 | t >>> 24;
        SUB_MIX_3[x] = t;

        // Compute inv sub bytes, inv mix columns tables
        var t = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;
        INV_SUB_MIX_0[sx] = t << 24 | t >>> 8;
        INV_SUB_MIX_1[sx] = t << 16 | t >>> 16;
        INV_SUB_MIX_2[sx] = t << 8 | t >>> 24;
        INV_SUB_MIX_3[sx] = t;

        // Compute next counter
        if (!x) {
          x = xi = 1;
        } else {
          x = x2 ^ d[d[d[x8 ^ x2]]];
          xi ^= d[d[xi]];
        }
      }
    })();

    // Precomputed Rcon lookup
    var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];

    /**
     * AES block cipher algorithm.
     */
    var AES = C_algo.AES = BlockCipher.extend({
      _doReset: function () {
        var t;

        // Skip reset of nRounds has been set before and key did not change
        if (this._nRounds && this._keyPriorReset === this._key) {
          return;
        }

        // Shortcuts
        var key = this._keyPriorReset = this._key;
        var keyWords = key.words;
        var keySize = key.sigBytes / 4;

        // Compute number of rounds
        var nRounds = this._nRounds = keySize + 6;

        // Compute number of key schedule rows
        var ksRows = (nRounds + 1) * 4;

        // Compute key schedule
        var keySchedule = this._keySchedule = [];
        for (var ksRow = 0; ksRow < ksRows; ksRow++) {
          if (ksRow < keySize) {
            keySchedule[ksRow] = keyWords[ksRow];
          } else {
            t = keySchedule[ksRow - 1];
            if (!(ksRow % keySize)) {
              // Rot word
              t = t << 8 | t >>> 24;

              // Sub word
              t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 0xff] << 16 | SBOX[t >>> 8 & 0xff] << 8 | SBOX[t & 0xff];

              // Mix Rcon
              t ^= RCON[ksRow / keySize | 0] << 24;
            } else if (keySize > 6 && ksRow % keySize == 4) {
              // Sub word
              t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 0xff] << 16 | SBOX[t >>> 8 & 0xff] << 8 | SBOX[t & 0xff];
            }
            keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
          }
        }

        // Compute inv key schedule
        var invKeySchedule = this._invKeySchedule = [];
        for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {
          var ksRow = ksRows - invKsRow;
          if (invKsRow % 4) {
            var t = keySchedule[ksRow];
          } else {
            var t = keySchedule[ksRow - 4];
          }
          if (invKsRow < 4 || ksRow <= 4) {
            invKeySchedule[invKsRow] = t;
          } else {
            invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[t >>> 16 & 0xff]] ^ INV_SUB_MIX_2[SBOX[t >>> 8 & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];
          }
        }
      },
      encryptBlock: function (M, offset) {
        this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
      },
      decryptBlock: function (M, offset) {
        // Swap 2nd and 4th rows
        var t = M[offset + 1];
        M[offset + 1] = M[offset + 3];
        M[offset + 3] = t;
        this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);

        // Inv swap 2nd and 4th rows
        var t = M[offset + 1];
        M[offset + 1] = M[offset + 3];
        M[offset + 3] = t;
      },
      _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {
        // Shortcut
        var nRounds = this._nRounds;

        // Get input, add round key
        var s0 = M[offset] ^ keySchedule[0];
        var s1 = M[offset + 1] ^ keySchedule[1];
        var s2 = M[offset + 2] ^ keySchedule[2];
        var s3 = M[offset + 3] ^ keySchedule[3];

        // Key schedule row counter
        var ksRow = 4;

        // Rounds
        for (var round = 1; round < nRounds; round++) {
          // Shift rows, sub bytes, mix columns, add round key
          var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[s1 >>> 16 & 0xff] ^ SUB_MIX_2[s2 >>> 8 & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++];
          var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[s2 >>> 16 & 0xff] ^ SUB_MIX_2[s3 >>> 8 & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++];
          var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[s3 >>> 16 & 0xff] ^ SUB_MIX_2[s0 >>> 8 & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++];
          var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[s0 >>> 16 & 0xff] ^ SUB_MIX_2[s1 >>> 8 & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++];

          // Update state
          s0 = t0;
          s1 = t1;
          s2 = t2;
          s3 = t3;
        }

        // Shift rows, sub bytes, add round key
        var t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 0xff] << 16 | SBOX[s2 >>> 8 & 0xff] << 8 | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];
        var t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s2 >>> 16 & 0xff] << 16 | SBOX[s3 >>> 8 & 0xff] << 8 | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];
        var t2 = (SBOX[s2 >>> 24] << 24 | SBOX[s3 >>> 16 & 0xff] << 16 | SBOX[s0 >>> 8 & 0xff] << 8 | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];
        var t3 = (SBOX[s3 >>> 24] << 24 | SBOX[s0 >>> 16 & 0xff] << 16 | SBOX[s1 >>> 8 & 0xff] << 8 | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];

        // Set output
        M[offset] = t0;
        M[offset + 1] = t1;
        M[offset + 2] = t2;
        M[offset + 3] = t3;
      },
      keySize: 256 / 32
    });

    /**
     * Shortcut functions to the cipher's object interface.
     *
     * @example
     *
     *     var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);
     *     var plaintext  = CryptoJS.AES.decrypt(ciphertext, key, cfg);
     */
    C.AES = BlockCipher._createHelper(AES);
  })();
  return CryptoJS.AES;
});
});

var tripledes = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, encBase64, md5, evpkdf, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var WordArray = C_lib.WordArray;
    var BlockCipher = C_lib.BlockCipher;
    var C_algo = C.algo;

    // Permuted Choice 1 constants
    var PC1 = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4];

    // Permuted Choice 2 constants
    var PC2 = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32];

    // Cumulative bit shift constants
    var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];

    // SBOXes and round permutation constants
    var SBOX_P = [{
      0x0: 0x808200,
      0x10000000: 0x8000,
      0x20000000: 0x808002,
      0x30000000: 0x2,
      0x40000000: 0x200,
      0x50000000: 0x808202,
      0x60000000: 0x800202,
      0x70000000: 0x800000,
      0x80000000: 0x202,
      0x90000000: 0x800200,
      0xa0000000: 0x8200,
      0xb0000000: 0x808000,
      0xc0000000: 0x8002,
      0xd0000000: 0x800002,
      0xe0000000: 0x0,
      0xf0000000: 0x8202,
      0x8000000: 0x0,
      0x18000000: 0x808202,
      0x28000000: 0x8202,
      0x38000000: 0x8000,
      0x48000000: 0x808200,
      0x58000000: 0x200,
      0x68000000: 0x808002,
      0x78000000: 0x2,
      0x88000000: 0x800200,
      0x98000000: 0x8200,
      0xa8000000: 0x808000,
      0xb8000000: 0x800202,
      0xc8000000: 0x800002,
      0xd8000000: 0x8002,
      0xe8000000: 0x202,
      0xf8000000: 0x800000,
      0x1: 0x8000,
      0x10000001: 0x2,
      0x20000001: 0x808200,
      0x30000001: 0x800000,
      0x40000001: 0x808002,
      0x50000001: 0x8200,
      0x60000001: 0x200,
      0x70000001: 0x800202,
      0x80000001: 0x808202,
      0x90000001: 0x808000,
      0xa0000001: 0x800002,
      0xb0000001: 0x8202,
      0xc0000001: 0x202,
      0xd0000001: 0x800200,
      0xe0000001: 0x8002,
      0xf0000001: 0x0,
      0x8000001: 0x808202,
      0x18000001: 0x808000,
      0x28000001: 0x800000,
      0x38000001: 0x200,
      0x48000001: 0x8000,
      0x58000001: 0x800002,
      0x68000001: 0x2,
      0x78000001: 0x8202,
      0x88000001: 0x8002,
      0x98000001: 0x800202,
      0xa8000001: 0x202,
      0xb8000001: 0x808200,
      0xc8000001: 0x800200,
      0xd8000001: 0x0,
      0xe8000001: 0x8200,
      0xf8000001: 0x808002
    }, {
      0x0: 0x40084010,
      0x1000000: 0x4000,
      0x2000000: 0x80000,
      0x3000000: 0x40080010,
      0x4000000: 0x40000010,
      0x5000000: 0x40084000,
      0x6000000: 0x40004000,
      0x7000000: 0x10,
      0x8000000: 0x84000,
      0x9000000: 0x40004010,
      0xa000000: 0x40000000,
      0xb000000: 0x84010,
      0xc000000: 0x80010,
      0xd000000: 0x0,
      0xe000000: 0x4010,
      0xf000000: 0x40080000,
      0x800000: 0x40004000,
      0x1800000: 0x84010,
      0x2800000: 0x10,
      0x3800000: 0x40004010,
      0x4800000: 0x40084010,
      0x5800000: 0x40000000,
      0x6800000: 0x80000,
      0x7800000: 0x40080010,
      0x8800000: 0x80010,
      0x9800000: 0x0,
      0xa800000: 0x4000,
      0xb800000: 0x40080000,
      0xc800000: 0x40000010,
      0xd800000: 0x84000,
      0xe800000: 0x40084000,
      0xf800000: 0x4010,
      0x10000000: 0x0,
      0x11000000: 0x40080010,
      0x12000000: 0x40004010,
      0x13000000: 0x40084000,
      0x14000000: 0x40080000,
      0x15000000: 0x10,
      0x16000000: 0x84010,
      0x17000000: 0x4000,
      0x18000000: 0x4010,
      0x19000000: 0x80000,
      0x1a000000: 0x80010,
      0x1b000000: 0x40000010,
      0x1c000000: 0x84000,
      0x1d000000: 0x40004000,
      0x1e000000: 0x40000000,
      0x1f000000: 0x40084010,
      0x10800000: 0x84010,
      0x11800000: 0x80000,
      0x12800000: 0x40080000,
      0x13800000: 0x4000,
      0x14800000: 0x40004000,
      0x15800000: 0x40084010,
      0x16800000: 0x10,
      0x17800000: 0x40000000,
      0x18800000: 0x40084000,
      0x19800000: 0x40000010,
      0x1a800000: 0x40004010,
      0x1b800000: 0x80010,
      0x1c800000: 0x0,
      0x1d800000: 0x4010,
      0x1e800000: 0x40080010,
      0x1f800000: 0x84000
    }, {
      0x0: 0x104,
      0x100000: 0x0,
      0x200000: 0x4000100,
      0x300000: 0x10104,
      0x400000: 0x10004,
      0x500000: 0x4000004,
      0x600000: 0x4010104,
      0x700000: 0x4010000,
      0x800000: 0x4000000,
      0x900000: 0x4010100,
      0xa00000: 0x10100,
      0xb00000: 0x4010004,
      0xc00000: 0x4000104,
      0xd00000: 0x10000,
      0xe00000: 0x4,
      0xf00000: 0x100,
      0x80000: 0x4010100,
      0x180000: 0x4010004,
      0x280000: 0x0,
      0x380000: 0x4000100,
      0x480000: 0x4000004,
      0x580000: 0x10000,
      0x680000: 0x10004,
      0x780000: 0x104,
      0x880000: 0x4,
      0x980000: 0x100,
      0xa80000: 0x4010000,
      0xb80000: 0x10104,
      0xc80000: 0x10100,
      0xd80000: 0x4000104,
      0xe80000: 0x4010104,
      0xf80000: 0x4000000,
      0x1000000: 0x4010100,
      0x1100000: 0x10004,
      0x1200000: 0x10000,
      0x1300000: 0x4000100,
      0x1400000: 0x100,
      0x1500000: 0x4010104,
      0x1600000: 0x4000004,
      0x1700000: 0x0,
      0x1800000: 0x4000104,
      0x1900000: 0x4000000,
      0x1a00000: 0x4,
      0x1b00000: 0x10100,
      0x1c00000: 0x4010000,
      0x1d00000: 0x104,
      0x1e00000: 0x10104,
      0x1f00000: 0x4010004,
      0x1080000: 0x4000000,
      0x1180000: 0x104,
      0x1280000: 0x4010100,
      0x1380000: 0x0,
      0x1480000: 0x10004,
      0x1580000: 0x4000100,
      0x1680000: 0x100,
      0x1780000: 0x4010004,
      0x1880000: 0x10000,
      0x1980000: 0x4010104,
      0x1a80000: 0x10104,
      0x1b80000: 0x4000004,
      0x1c80000: 0x4000104,
      0x1d80000: 0x4010000,
      0x1e80000: 0x4,
      0x1f80000: 0x10100
    }, {
      0x0: 0x80401000,
      0x10000: 0x80001040,
      0x20000: 0x401040,
      0x30000: 0x80400000,
      0x40000: 0x0,
      0x50000: 0x401000,
      0x60000: 0x80000040,
      0x70000: 0x400040,
      0x80000: 0x80000000,
      0x90000: 0x400000,
      0xa0000: 0x40,
      0xb0000: 0x80001000,
      0xc0000: 0x80400040,
      0xd0000: 0x1040,
      0xe0000: 0x1000,
      0xf0000: 0x80401040,
      0x8000: 0x80001040,
      0x18000: 0x40,
      0x28000: 0x80400040,
      0x38000: 0x80001000,
      0x48000: 0x401000,
      0x58000: 0x80401040,
      0x68000: 0x0,
      0x78000: 0x80400000,
      0x88000: 0x1000,
      0x98000: 0x80401000,
      0xa8000: 0x400000,
      0xb8000: 0x1040,
      0xc8000: 0x80000000,
      0xd8000: 0x400040,
      0xe8000: 0x401040,
      0xf8000: 0x80000040,
      0x100000: 0x400040,
      0x110000: 0x401000,
      0x120000: 0x80000040,
      0x130000: 0x0,
      0x140000: 0x1040,
      0x150000: 0x80400040,
      0x160000: 0x80401000,
      0x170000: 0x80001040,
      0x180000: 0x80401040,
      0x190000: 0x80000000,
      0x1a0000: 0x80400000,
      0x1b0000: 0x401040,
      0x1c0000: 0x80001000,
      0x1d0000: 0x400000,
      0x1e0000: 0x40,
      0x1f0000: 0x1000,
      0x108000: 0x80400000,
      0x118000: 0x80401040,
      0x128000: 0x0,
      0x138000: 0x401000,
      0x148000: 0x400040,
      0x158000: 0x80000000,
      0x168000: 0x80001040,
      0x178000: 0x40,
      0x188000: 0x80000040,
      0x198000: 0x1000,
      0x1a8000: 0x80001000,
      0x1b8000: 0x80400040,
      0x1c8000: 0x1040,
      0x1d8000: 0x80401000,
      0x1e8000: 0x400000,
      0x1f8000: 0x401040
    }, {
      0x0: 0x80,
      0x1000: 0x1040000,
      0x2000: 0x40000,
      0x3000: 0x20000000,
      0x4000: 0x20040080,
      0x5000: 0x1000080,
      0x6000: 0x21000080,
      0x7000: 0x40080,
      0x8000: 0x1000000,
      0x9000: 0x20040000,
      0xa000: 0x20000080,
      0xb000: 0x21040080,
      0xc000: 0x21040000,
      0xd000: 0x0,
      0xe000: 0x1040080,
      0xf000: 0x21000000,
      0x800: 0x1040080,
      0x1800: 0x21000080,
      0x2800: 0x80,
      0x3800: 0x1040000,
      0x4800: 0x40000,
      0x5800: 0x20040080,
      0x6800: 0x21040000,
      0x7800: 0x20000000,
      0x8800: 0x20040000,
      0x9800: 0x0,
      0xa800: 0x21040080,
      0xb800: 0x1000080,
      0xc800: 0x20000080,
      0xd800: 0x21000000,
      0xe800: 0x1000000,
      0xf800: 0x40080,
      0x10000: 0x40000,
      0x11000: 0x80,
      0x12000: 0x20000000,
      0x13000: 0x21000080,
      0x14000: 0x1000080,
      0x15000: 0x21040000,
      0x16000: 0x20040080,
      0x17000: 0x1000000,
      0x18000: 0x21040080,
      0x19000: 0x21000000,
      0x1a000: 0x1040000,
      0x1b000: 0x20040000,
      0x1c000: 0x40080,
      0x1d000: 0x20000080,
      0x1e000: 0x0,
      0x1f000: 0x1040080,
      0x10800: 0x21000080,
      0x11800: 0x1000000,
      0x12800: 0x1040000,
      0x13800: 0x20040080,
      0x14800: 0x20000000,
      0x15800: 0x1040080,
      0x16800: 0x80,
      0x17800: 0x21040000,
      0x18800: 0x40080,
      0x19800: 0x21040080,
      0x1a800: 0x0,
      0x1b800: 0x21000000,
      0x1c800: 0x1000080,
      0x1d800: 0x40000,
      0x1e800: 0x20040000,
      0x1f800: 0x20000080
    }, {
      0x0: 0x10000008,
      0x100: 0x2000,
      0x200: 0x10200000,
      0x300: 0x10202008,
      0x400: 0x10002000,
      0x500: 0x200000,
      0x600: 0x200008,
      0x700: 0x10000000,
      0x800: 0x0,
      0x900: 0x10002008,
      0xa00: 0x202000,
      0xb00: 0x8,
      0xc00: 0x10200008,
      0xd00: 0x202008,
      0xe00: 0x2008,
      0xf00: 0x10202000,
      0x80: 0x10200000,
      0x180: 0x10202008,
      0x280: 0x8,
      0x380: 0x200000,
      0x480: 0x202008,
      0x580: 0x10000008,
      0x680: 0x10002000,
      0x780: 0x2008,
      0x880: 0x200008,
      0x980: 0x2000,
      0xa80: 0x10002008,
      0xb80: 0x10200008,
      0xc80: 0x0,
      0xd80: 0x10202000,
      0xe80: 0x202000,
      0xf80: 0x10000000,
      0x1000: 0x10002000,
      0x1100: 0x10200008,
      0x1200: 0x10202008,
      0x1300: 0x2008,
      0x1400: 0x200000,
      0x1500: 0x10000000,
      0x1600: 0x10000008,
      0x1700: 0x202000,
      0x1800: 0x202008,
      0x1900: 0x0,
      0x1a00: 0x8,
      0x1b00: 0x10200000,
      0x1c00: 0x2000,
      0x1d00: 0x10002008,
      0x1e00: 0x10202000,
      0x1f00: 0x200008,
      0x1080: 0x8,
      0x1180: 0x202000,
      0x1280: 0x200000,
      0x1380: 0x10000008,
      0x1480: 0x10002000,
      0x1580: 0x2008,
      0x1680: 0x10202008,
      0x1780: 0x10200000,
      0x1880: 0x10202000,
      0x1980: 0x10200008,
      0x1a80: 0x2000,
      0x1b80: 0x202008,
      0x1c80: 0x200008,
      0x1d80: 0x0,
      0x1e80: 0x10000000,
      0x1f80: 0x10002008
    }, {
      0x0: 0x100000,
      0x10: 0x2000401,
      0x20: 0x400,
      0x30: 0x100401,
      0x40: 0x2100401,
      0x50: 0x0,
      0x60: 0x1,
      0x70: 0x2100001,
      0x80: 0x2000400,
      0x90: 0x100001,
      0xa0: 0x2000001,
      0xb0: 0x2100400,
      0xc0: 0x2100000,
      0xd0: 0x401,
      0xe0: 0x100400,
      0xf0: 0x2000000,
      0x8: 0x2100001,
      0x18: 0x0,
      0x28: 0x2000401,
      0x38: 0x2100400,
      0x48: 0x100000,
      0x58: 0x2000001,
      0x68: 0x2000000,
      0x78: 0x401,
      0x88: 0x100401,
      0x98: 0x2000400,
      0xa8: 0x2100000,
      0xb8: 0x100001,
      0xc8: 0x400,
      0xd8: 0x2100401,
      0xe8: 0x1,
      0xf8: 0x100400,
      0x100: 0x2000000,
      0x110: 0x100000,
      0x120: 0x2000401,
      0x130: 0x2100001,
      0x140: 0x100001,
      0x150: 0x2000400,
      0x160: 0x2100400,
      0x170: 0x100401,
      0x180: 0x401,
      0x190: 0x2100401,
      0x1a0: 0x100400,
      0x1b0: 0x1,
      0x1c0: 0x0,
      0x1d0: 0x2100000,
      0x1e0: 0x2000001,
      0x1f0: 0x400,
      0x108: 0x100400,
      0x118: 0x2000401,
      0x128: 0x2100001,
      0x138: 0x1,
      0x148: 0x2000000,
      0x158: 0x100000,
      0x168: 0x401,
      0x178: 0x2100400,
      0x188: 0x2000001,
      0x198: 0x2100000,
      0x1a8: 0x0,
      0x1b8: 0x2100401,
      0x1c8: 0x100401,
      0x1d8: 0x400,
      0x1e8: 0x2000400,
      0x1f8: 0x100001
    }, {
      0x0: 0x8000820,
      0x1: 0x20000,
      0x2: 0x8000000,
      0x3: 0x20,
      0x4: 0x20020,
      0x5: 0x8020820,
      0x6: 0x8020800,
      0x7: 0x800,
      0x8: 0x8020000,
      0x9: 0x8000800,
      0xa: 0x20800,
      0xb: 0x8020020,
      0xc: 0x820,
      0xd: 0x0,
      0xe: 0x8000020,
      0xf: 0x20820,
      0x80000000: 0x800,
      0x80000001: 0x8020820,
      0x80000002: 0x8000820,
      0x80000003: 0x8000000,
      0x80000004: 0x8020000,
      0x80000005: 0x20800,
      0x80000006: 0x20820,
      0x80000007: 0x20,
      0x80000008: 0x8000020,
      0x80000009: 0x820,
      0x8000000a: 0x20020,
      0x8000000b: 0x8020800,
      0x8000000c: 0x0,
      0x8000000d: 0x8020020,
      0x8000000e: 0x8000800,
      0x8000000f: 0x20000,
      0x10: 0x20820,
      0x11: 0x8020800,
      0x12: 0x20,
      0x13: 0x800,
      0x14: 0x8000800,
      0x15: 0x8000020,
      0x16: 0x8020020,
      0x17: 0x20000,
      0x18: 0x0,
      0x19: 0x20020,
      0x1a: 0x8020000,
      0x1b: 0x8000820,
      0x1c: 0x8020820,
      0x1d: 0x20800,
      0x1e: 0x820,
      0x1f: 0x8000000,
      0x80000010: 0x20000,
      0x80000011: 0x800,
      0x80000012: 0x8020020,
      0x80000013: 0x20820,
      0x80000014: 0x20,
      0x80000015: 0x8020000,
      0x80000016: 0x8000000,
      0x80000017: 0x8000820,
      0x80000018: 0x8020820,
      0x80000019: 0x8000020,
      0x8000001a: 0x8000800,
      0x8000001b: 0x0,
      0x8000001c: 0x20800,
      0x8000001d: 0x820,
      0x8000001e: 0x20020,
      0x8000001f: 0x8020800
    }];

    // Masks that select the SBOX input
    var SBOX_MASK = [0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f];

    /**
     * DES block cipher algorithm.
     */
    var DES = C_algo.DES = BlockCipher.extend({
      _doReset: function () {
        // Shortcuts
        var key = this._key;
        var keyWords = key.words;

        // Select 56 bits according to PC1
        var keyBits = [];
        for (var i = 0; i < 56; i++) {
          var keyBitPos = PC1[i] - 1;
          keyBits[i] = keyWords[keyBitPos >>> 5] >>> 31 - keyBitPos % 32 & 1;
        }

        // Assemble 16 subkeys
        var subKeys = this._subKeys = [];
        for (var nSubKey = 0; nSubKey < 16; nSubKey++) {
          // Create subkey
          var subKey = subKeys[nSubKey] = [];

          // Shortcut
          var bitShift = BIT_SHIFTS[nSubKey];

          // Select 48 bits according to PC2
          for (var i = 0; i < 24; i++) {
            // Select from the left 28 key bits
            subKey[i / 6 | 0] |= keyBits[(PC2[i] - 1 + bitShift) % 28] << 31 - i % 6;

            // Select from the right 28 key bits
            subKey[4 + (i / 6 | 0)] |= keyBits[28 + (PC2[i + 24] - 1 + bitShift) % 28] << 31 - i % 6;
          }

          // Since each subkey is applied to an expanded 32-bit input,
          // the subkey can be broken into 8 values scaled to 32-bits,
          // which allows the key to be used without expansion
          subKey[0] = subKey[0] << 1 | subKey[0] >>> 31;
          for (var i = 1; i < 7; i++) {
            subKey[i] = subKey[i] >>> (i - 1) * 4 + 3;
          }
          subKey[7] = subKey[7] << 5 | subKey[7] >>> 27;
        }

        // Compute inverse subkeys
        var invSubKeys = this._invSubKeys = [];
        for (var i = 0; i < 16; i++) {
          invSubKeys[i] = subKeys[15 - i];
        }
      },
      encryptBlock: function (M, offset) {
        this._doCryptBlock(M, offset, this._subKeys);
      },
      decryptBlock: function (M, offset) {
        this._doCryptBlock(M, offset, this._invSubKeys);
      },
      _doCryptBlock: function (M, offset, subKeys) {
        // Get input
        this._lBlock = M[offset];
        this._rBlock = M[offset + 1];

        // Initial permutation
        exchangeLR.call(this, 4, 0x0f0f0f0f);
        exchangeLR.call(this, 16, 0x0000ffff);
        exchangeRL.call(this, 2, 0x33333333);
        exchangeRL.call(this, 8, 0x00ff00ff);
        exchangeLR.call(this, 1, 0x55555555);

        // Rounds
        for (var round = 0; round < 16; round++) {
          // Shortcuts
          var subKey = subKeys[round];
          var lBlock = this._lBlock;
          var rBlock = this._rBlock;

          // Feistel function
          var f = 0;
          for (var i = 0; i < 8; i++) {
            f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];
          }
          this._lBlock = rBlock;
          this._rBlock = lBlock ^ f;
        }

        // Undo swap from last round
        var t = this._lBlock;
        this._lBlock = this._rBlock;
        this._rBlock = t;

        // Final permutation
        exchangeLR.call(this, 1, 0x55555555);
        exchangeRL.call(this, 8, 0x00ff00ff);
        exchangeRL.call(this, 2, 0x33333333);
        exchangeLR.call(this, 16, 0x0000ffff);
        exchangeLR.call(this, 4, 0x0f0f0f0f);

        // Set output
        M[offset] = this._lBlock;
        M[offset + 1] = this._rBlock;
      },
      keySize: 64 / 32,
      ivSize: 64 / 32,
      blockSize: 64 / 32
    });

    // Swap bits across the left and right words
    function exchangeLR(offset, mask) {
      var t = (this._lBlock >>> offset ^ this._rBlock) & mask;
      this._rBlock ^= t;
      this._lBlock ^= t << offset;
    }
    function exchangeRL(offset, mask) {
      var t = (this._rBlock >>> offset ^ this._lBlock) & mask;
      this._lBlock ^= t;
      this._rBlock ^= t << offset;
    }

    /**
     * Shortcut functions to the cipher's object interface.
     *
     * @example
     *
     *     var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);
     *     var plaintext  = CryptoJS.DES.decrypt(ciphertext, key, cfg);
     */
    C.DES = BlockCipher._createHelper(DES);

    /**
     * Triple-DES block cipher algorithm.
     */
    var TripleDES = C_algo.TripleDES = BlockCipher.extend({
      _doReset: function () {
        // Shortcuts
        var key = this._key;
        var keyWords = key.words;
        // Make sure the key length is valid (64, 128 or >= 192 bit)
        if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) {
          throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.');
        }

        // Extend the key according to the keying options defined in 3DES standard
        var key1 = keyWords.slice(0, 2);
        var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4);
        var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6);

        // Create DES instances
        this._des1 = DES.createEncryptor(WordArray.create(key1));
        this._des2 = DES.createEncryptor(WordArray.create(key2));
        this._des3 = DES.createEncryptor(WordArray.create(key3));
      },
      encryptBlock: function (M, offset) {
        this._des1.encryptBlock(M, offset);
        this._des2.decryptBlock(M, offset);
        this._des3.encryptBlock(M, offset);
      },
      decryptBlock: function (M, offset) {
        this._des3.decryptBlock(M, offset);
        this._des2.encryptBlock(M, offset);
        this._des1.decryptBlock(M, offset);
      },
      keySize: 192 / 32,
      ivSize: 64 / 32,
      blockSize: 64 / 32
    });

    /**
     * Shortcut functions to the cipher's object interface.
     *
     * @example
     *
     *     var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);
     *     var plaintext  = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);
     */
    C.TripleDES = BlockCipher._createHelper(TripleDES);
  })();
  return CryptoJS.TripleDES;
});
});

var rc4 = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, encBase64, md5, evpkdf, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var StreamCipher = C_lib.StreamCipher;
    var C_algo = C.algo;

    /**
     * RC4 stream cipher algorithm.
     */
    var RC4 = C_algo.RC4 = StreamCipher.extend({
      _doReset: function () {
        // Shortcuts
        var key = this._key;
        var keyWords = key.words;
        var keySigBytes = key.sigBytes;

        // Init sbox
        var S = this._S = [];
        for (var i = 0; i < 256; i++) {
          S[i] = i;
        }

        // Key setup
        for (var i = 0, j = 0; i < 256; i++) {
          var keyByteIndex = i % keySigBytes;
          var keyByte = keyWords[keyByteIndex >>> 2] >>> 24 - keyByteIndex % 4 * 8 & 0xff;
          j = (j + S[i] + keyByte) % 256;

          // Swap
          var t = S[i];
          S[i] = S[j];
          S[j] = t;
        }

        // Counters
        this._i = this._j = 0;
      },
      _doProcessBlock: function (M, offset) {
        M[offset] ^= generateKeystreamWord.call(this);
      },
      keySize: 256 / 32,
      ivSize: 0
    });
    function generateKeystreamWord() {
      // Shortcuts
      var S = this._S;
      var i = this._i;
      var j = this._j;

      // Generate keystream word
      var keystreamWord = 0;
      for (var n = 0; n < 4; n++) {
        i = (i + 1) % 256;
        j = (j + S[i]) % 256;

        // Swap
        var t = S[i];
        S[i] = S[j];
        S[j] = t;
        keystreamWord |= S[(S[i] + S[j]) % 256] << 24 - n * 8;
      }

      // Update counters
      this._i = i;
      this._j = j;
      return keystreamWord;
    }

    /**
     * Shortcut functions to the cipher's object interface.
     *
     * @example
     *
     *     var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);
     *     var plaintext  = CryptoJS.RC4.decrypt(ciphertext, key, cfg);
     */
    C.RC4 = StreamCipher._createHelper(RC4);

    /**
     * Modified RC4 stream cipher algorithm.
     */
    var RC4Drop = C_algo.RC4Drop = RC4.extend({
      /**
       * Configuration options.
       *
       * @property {number} drop The number of keystream words to drop. Default 192
       */
      cfg: RC4.cfg.extend({
        drop: 192
      }),
      _doReset: function () {
        RC4._doReset.call(this);

        // Drop
        for (var i = this.cfg.drop; i > 0; i--) {
          generateKeystreamWord.call(this);
        }
      }
    });

    /**
     * Shortcut functions to the cipher's object interface.
     *
     * @example
     *
     *     var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);
     *     var plaintext  = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);
     */
    C.RC4Drop = StreamCipher._createHelper(RC4Drop);
  })();
  return CryptoJS.RC4;
});
});

var rabbit = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, encBase64, md5, evpkdf, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var StreamCipher = C_lib.StreamCipher;
    var C_algo = C.algo;

    // Reusable objects
    var S = [];
    var C_ = [];
    var G = [];

    /**
     * Rabbit stream cipher algorithm
     */
    var Rabbit = C_algo.Rabbit = StreamCipher.extend({
      _doReset: function () {
        // Shortcuts
        var K = this._key.words;
        var iv = this.cfg.iv;

        // Swap endian
        for (var i = 0; i < 4; i++) {
          K[i] = (K[i] << 8 | K[i] >>> 24) & 0x00ff00ff | (K[i] << 24 | K[i] >>> 8) & 0xff00ff00;
        }

        // Generate initial state values
        var X = this._X = [K[0], K[3] << 16 | K[2] >>> 16, K[1], K[0] << 16 | K[3] >>> 16, K[2], K[1] << 16 | K[0] >>> 16, K[3], K[2] << 16 | K[1] >>> 16];

        // Generate initial counter values
        var C = this._C = [K[2] << 16 | K[2] >>> 16, K[0] & 0xffff0000 | K[1] & 0x0000ffff, K[3] << 16 | K[3] >>> 16, K[1] & 0xffff0000 | K[2] & 0x0000ffff, K[0] << 16 | K[0] >>> 16, K[2] & 0xffff0000 | K[3] & 0x0000ffff, K[1] << 16 | K[1] >>> 16, K[3] & 0xffff0000 | K[0] & 0x0000ffff];

        // Carry bit
        this._b = 0;

        // Iterate the system four times
        for (var i = 0; i < 4; i++) {
          nextState.call(this);
        }

        // Modify the counters
        for (var i = 0; i < 8; i++) {
          C[i] ^= X[i + 4 & 7];
        }

        // IV setup
        if (iv) {
          // Shortcuts
          var IV = iv.words;
          var IV_0 = IV[0];
          var IV_1 = IV[1];

          // Generate four subvectors
          var i0 = (IV_0 << 8 | IV_0 >>> 24) & 0x00ff00ff | (IV_0 << 24 | IV_0 >>> 8) & 0xff00ff00;
          var i2 = (IV_1 << 8 | IV_1 >>> 24) & 0x00ff00ff | (IV_1 << 24 | IV_1 >>> 8) & 0xff00ff00;
          var i1 = i0 >>> 16 | i2 & 0xffff0000;
          var i3 = i2 << 16 | i0 & 0x0000ffff;

          // Modify counter values
          C[0] ^= i0;
          C[1] ^= i1;
          C[2] ^= i2;
          C[3] ^= i3;
          C[4] ^= i0;
          C[5] ^= i1;
          C[6] ^= i2;
          C[7] ^= i3;

          // Iterate the system four times
          for (var i = 0; i < 4; i++) {
            nextState.call(this);
          }
        }
      },
      _doProcessBlock: function (M, offset) {
        // Shortcut
        var X = this._X;

        // Iterate the system
        nextState.call(this);

        // Generate four keystream words
        S[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16;
        S[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16;
        S[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16;
        S[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16;
        for (var i = 0; i < 4; i++) {
          // Swap endian
          S[i] = (S[i] << 8 | S[i] >>> 24) & 0x00ff00ff | (S[i] << 24 | S[i] >>> 8) & 0xff00ff00;

          // Encrypt
          M[offset + i] ^= S[i];
        }
      },
      blockSize: 128 / 32,
      ivSize: 64 / 32
    });
    function nextState() {
      // Shortcuts
      var X = this._X;
      var C = this._C;

      // Save old counter values
      for (var i = 0; i < 8; i++) {
        C_[i] = C[i];
      }

      // Calculate new counter values
      C[0] = C[0] + 0x4d34d34d + this._b | 0;
      C[1] = C[1] + 0xd34d34d3 + (C[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0;
      C[2] = C[2] + 0x34d34d34 + (C[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0;
      C[3] = C[3] + 0x4d34d34d + (C[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0;
      C[4] = C[4] + 0xd34d34d3 + (C[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0;
      C[5] = C[5] + 0x34d34d34 + (C[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0;
      C[6] = C[6] + 0x4d34d34d + (C[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0;
      C[7] = C[7] + 0xd34d34d3 + (C[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0;
      this._b = C[7] >>> 0 < C_[7] >>> 0 ? 1 : 0;

      // Calculate the g-values
      for (var i = 0; i < 8; i++) {
        var gx = X[i] + C[i];

        // Construct high and low argument for squaring
        var ga = gx & 0xffff;
        var gb = gx >>> 16;

        // Calculate high and low result of squaring
        var gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb;
        var gl = ((gx & 0xffff0000) * gx | 0) + ((gx & 0x0000ffff) * gx | 0);

        // High XOR low
        G[i] = gh ^ gl;
      }

      // Calculate new state values
      X[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0;
      X[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0;
      X[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0;
      X[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0;
      X[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0;
      X[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0;
      X[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0;
      X[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0;
    }

    /**
     * Shortcut functions to the cipher's object interface.
     *
     * @example
     *
     *     var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);
     *     var plaintext  = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);
     */
    C.Rabbit = StreamCipher._createHelper(Rabbit);
  })();
  return CryptoJS.Rabbit;
});
});

var rabbitLegacy = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, encBase64, md5, evpkdf, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var StreamCipher = C_lib.StreamCipher;
    var C_algo = C.algo;

    // Reusable objects
    var S = [];
    var C_ = [];
    var G = [];

    /**
     * Rabbit stream cipher algorithm.
     *
     * This is a legacy version that neglected to convert the key to little-endian.
     * This error doesn't affect the cipher's security,
     * but it does affect its compatibility with other implementations.
     */
    var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({
      _doReset: function () {
        // Shortcuts
        var K = this._key.words;
        var iv = this.cfg.iv;

        // Generate initial state values
        var X = this._X = [K[0], K[3] << 16 | K[2] >>> 16, K[1], K[0] << 16 | K[3] >>> 16, K[2], K[1] << 16 | K[0] >>> 16, K[3], K[2] << 16 | K[1] >>> 16];

        // Generate initial counter values
        var C = this._C = [K[2] << 16 | K[2] >>> 16, K[0] & 0xffff0000 | K[1] & 0x0000ffff, K[3] << 16 | K[3] >>> 16, K[1] & 0xffff0000 | K[2] & 0x0000ffff, K[0] << 16 | K[0] >>> 16, K[2] & 0xffff0000 | K[3] & 0x0000ffff, K[1] << 16 | K[1] >>> 16, K[3] & 0xffff0000 | K[0] & 0x0000ffff];

        // Carry bit
        this._b = 0;

        // Iterate the system four times
        for (var i = 0; i < 4; i++) {
          nextState.call(this);
        }

        // Modify the counters
        for (var i = 0; i < 8; i++) {
          C[i] ^= X[i + 4 & 7];
        }

        // IV setup
        if (iv) {
          // Shortcuts
          var IV = iv.words;
          var IV_0 = IV[0];
          var IV_1 = IV[1];

          // Generate four subvectors
          var i0 = (IV_0 << 8 | IV_0 >>> 24) & 0x00ff00ff | (IV_0 << 24 | IV_0 >>> 8) & 0xff00ff00;
          var i2 = (IV_1 << 8 | IV_1 >>> 24) & 0x00ff00ff | (IV_1 << 24 | IV_1 >>> 8) & 0xff00ff00;
          var i1 = i0 >>> 16 | i2 & 0xffff0000;
          var i3 = i2 << 16 | i0 & 0x0000ffff;

          // Modify counter values
          C[0] ^= i0;
          C[1] ^= i1;
          C[2] ^= i2;
          C[3] ^= i3;
          C[4] ^= i0;
          C[5] ^= i1;
          C[6] ^= i2;
          C[7] ^= i3;

          // Iterate the system four times
          for (var i = 0; i < 4; i++) {
            nextState.call(this);
          }
        }
      },
      _doProcessBlock: function (M, offset) {
        // Shortcut
        var X = this._X;

        // Iterate the system
        nextState.call(this);

        // Generate four keystream words
        S[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16;
        S[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16;
        S[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16;
        S[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16;
        for (var i = 0; i < 4; i++) {
          // Swap endian
          S[i] = (S[i] << 8 | S[i] >>> 24) & 0x00ff00ff | (S[i] << 24 | S[i] >>> 8) & 0xff00ff00;

          // Encrypt
          M[offset + i] ^= S[i];
        }
      },
      blockSize: 128 / 32,
      ivSize: 64 / 32
    });
    function nextState() {
      // Shortcuts
      var X = this._X;
      var C = this._C;

      // Save old counter values
      for (var i = 0; i < 8; i++) {
        C_[i] = C[i];
      }

      // Calculate new counter values
      C[0] = C[0] + 0x4d34d34d + this._b | 0;
      C[1] = C[1] + 0xd34d34d3 + (C[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0;
      C[2] = C[2] + 0x34d34d34 + (C[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0;
      C[3] = C[3] + 0x4d34d34d + (C[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0;
      C[4] = C[4] + 0xd34d34d3 + (C[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0;
      C[5] = C[5] + 0x34d34d34 + (C[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0;
      C[6] = C[6] + 0x4d34d34d + (C[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0;
      C[7] = C[7] + 0xd34d34d3 + (C[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0;
      this._b = C[7] >>> 0 < C_[7] >>> 0 ? 1 : 0;

      // Calculate the g-values
      for (var i = 0; i < 8; i++) {
        var gx = X[i] + C[i];

        // Construct high and low argument for squaring
        var ga = gx & 0xffff;
        var gb = gx >>> 16;

        // Calculate high and low result of squaring
        var gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb;
        var gl = ((gx & 0xffff0000) * gx | 0) + ((gx & 0x0000ffff) * gx | 0);

        // High XOR low
        G[i] = gh ^ gl;
      }

      // Calculate new state values
      X[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0;
      X[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0;
      X[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0;
      X[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0;
      X[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0;
      X[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0;
      X[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0;
      X[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0;
    }

    /**
     * Shortcut functions to the cipher's object interface.
     *
     * @example
     *
     *     var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);
     *     var plaintext  = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);
     */
    C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);
  })();
  return CryptoJS.RabbitLegacy;
});
});

var blowfish = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, encBase64, md5, evpkdf, cipherCore);
  }
})(commonjsGlobal, function (CryptoJS) {
  (function () {
    // Shortcuts
    var C = CryptoJS;
    var C_lib = C.lib;
    var BlockCipher = C_lib.BlockCipher;
    var C_algo = C.algo;
    const N = 16;

    //Origin pbox and sbox, derived from PI
    const ORIG_P = [0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C, 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917, 0x9216D5D9, 0x8979FB1B];
    const ORIG_S = [[0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7, 0xB8E1AFED, 0x6A267E96, 0xBA7C9045, 0xF12C7F99, 0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16, 0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E, 0x0D95748F, 0x728EB658, 0x718BCD58, 0x82154AEE, 0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013, 0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF, 0x8E79DCB0, 0x603A180E, 0x6C9E0E8B, 0xB01E8A3E, 0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60, 0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440, 0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE, 0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A, 0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E, 0xAFD6BA33, 0x6C24CF5C, 0x7A325381, 0x28958677, 0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193, 0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032, 0xEF845D5D, 0xE98575B1, 0xDC262302, 0xEB651B88, 0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239, 0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E, 0x21C66842, 0xF6E96C9A, 0x670C9C61, 0xABD388F0, 0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3, 0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98, 0xA1F1651D, 0x39AF0176, 0x66CA593E, 0x82430E88, 0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE, 0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6, 0x4ED3AA62, 0x363F7706, 0x1BFEDF72, 0x429B023D, 0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B, 0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7, 0xE3FE501A, 0xB6794C3B, 0x976CE0BD, 0x04C006BA, 0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463, 0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F, 0x6DFC511F, 0x9B30952C, 0xCC814544, 0xAF5EBD09, 0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3, 0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB, 0x5579C0BD, 0x1A60320A, 0xD6A100C6, 0x402C7279, 0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8, 0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB, 0x323DB5FA, 0xFD238760, 0x53317B48, 0x3E00DF82, 0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB, 0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573, 0x695B27B0, 0xBBCA58C8, 0xE1FFA35D, 0xB8F011A0, 0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B, 0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790, 0xE1DDF2DA, 0xA4CB7E33, 0x62FB1341, 0xCEE4C6E8, 0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4, 0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0, 0xD08ED1D0, 0xAFC725E0, 0x8E3C5B2F, 0x8E7594B7, 0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C, 0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD, 0x2F2F2218, 0xBE0E1777, 0xEA752DFE, 0x8B021FA1, 0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299, 0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9, 0x165FA266, 0x80957705, 0x93CC7314, 0x211A1477, 0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF, 0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49, 0x00250E2D, 0x2071B35E, 0x226800BB, 0x57B8E0AF, 0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA, 0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5, 0x83260376, 0x6295CFA9, 0x11C81968, 0x4E734A41, 0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915, 0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400, 0x08BA6FB5, 0x571BE91F, 0xF296EC6B, 0x2A0DD915, 0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664, 0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A], [0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623, 0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266, 0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1, 0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E, 0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6, 0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1, 0x4CDD2086, 0x8470EB26, 0x6382E9C6, 0x021ECC5E, 0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1, 0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737, 0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8, 0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF, 0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD, 0xD19113F9, 0x7CA92FF6, 0x94324773, 0x22F54701, 0x3AE5E581, 0x37C2DADC, 0xC8B57634, 0x9AF3DDA7, 0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41, 0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331, 0x4E548B38, 0x4F6DB908, 0x6F420D03, 0xF60A04BF, 0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF, 0xDE9A771F, 0xD9930810, 0xB38BAE12, 0xDCCF3F2E, 0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87, 0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C, 0xEC7AEC3A, 0xDB851DFA, 0x63094366, 0xC464C3D2, 0xEF1C1847, 0x3215D908, 0xDD433B37, 0x24C2BA16, 0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD, 0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B, 0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509, 0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E, 0x86E34570, 0xEAE96FB1, 0x860E5E0A, 0x5A3E2AB3, 0x771FE71C, 0x4E3D06FA, 0x2965DCB9, 0x99E71D0F, 0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A, 0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4, 0xF2F74EA7, 0x361D2B3D, 0x1939260F, 0x19C27960, 0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66, 0xE3BC4595, 0xA67BC883, 0xB17F37D1, 0x018CFF28, 0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802, 0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84, 0x1521B628, 0x29076170, 0xECDD4775, 0x619F1510, 0x13CCA830, 0xEB61BD96, 0x0334FE1E, 0xAA0363CF, 0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14, 0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E, 0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50, 0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7, 0x9B540B19, 0x875FA099, 0x95F7997E, 0x623D7DA8, 0xF837889A, 0x97E32D77, 0x11ED935F, 0x16681281, 0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99, 0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696, 0xCDB30AEB, 0x532E3054, 0x8FD948E4, 0x6DBC3128, 0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73, 0x5D4A14D9, 0xE864B7E3, 0x42105D14, 0x203E13E0, 0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0, 0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105, 0xD81E799E, 0x86854DC7, 0xE44B476A, 0x3D816250, 0xCF62A1F2, 0x5B8D2646, 0xFC8883A0, 0xC1C7B6A3, 0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285, 0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00, 0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061, 0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB, 0x7CDE3759, 0xCBEE7460, 0x4085F2A7, 0xCE77326E, 0xA6078084, 0x19F8509E, 0xE8EFD855, 0x61D99735, 0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC, 0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9, 0xDB73DBD3, 0x105588CD, 0x675FDA79, 0xE3674340, 0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20, 0x153E21E7, 0x8FB03D4A, 0xE6E39F2B, 0xDB83ADF7], [0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934, 0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068, 0xD4082471, 0x3320F46A, 0x43B7D4B7, 0x500061AF, 0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840, 0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45, 0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504, 0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A, 0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB, 0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE, 0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6, 0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42, 0x20FE9E35, 0xD9F385B9, 0xEE39D7AB, 0x3B124E8B, 0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2, 0x3A6EFA74, 0xDD5B4332, 0x6841E7F7, 0xCA7820FB, 0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527, 0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B, 0x55A867BC, 0xA1159A58, 0xCCA92963, 0x99E1DB33, 0xA62A4A56, 0x3F3125F9, 0x5EF47E1C, 0x9029317C, 0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3, 0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC, 0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17, 0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564, 0x257B7834, 0x602A9C60, 0xDFF8E8A3, 0x1F636C1B, 0x0E12B4C2, 0x02E1329E, 0xAF664FD1, 0xCAD18115, 0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922, 0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728, 0xD0127845, 0x95B794FD, 0x647D0862, 0xE7CCF5F0, 0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E, 0x0A476341, 0x992EFF74, 0x3A6F6EAB, 0xF4F8FD37, 0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D, 0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804, 0xF1290DC7, 0xCC00FFA3, 0xB5390F92, 0x690FED0B, 0x667B9FFB, 0xCEDB7D9C, 0xA091CF0B, 0xD9155EA3, 0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB, 0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D, 0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C, 0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350, 0x1A6B1018, 0x11CAEDFA, 0x3D25BDD8, 0xE2E1C3C9, 0x44421659, 0x0A121386, 0xD90CEC6E, 0xD5ABEA2A, 0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE, 0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D, 0xD1FD8346, 0xF6381FB0, 0x7745AE04, 0xD736FCCC, 0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F, 0x77A057BE, 0xBDE8AE24, 0x55464299, 0xBF582E61, 0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2, 0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9, 0x7AEB2661, 0x8B1DDF84, 0x846A0E79, 0x915F95E2, 0x466E598E, 0x20B45770, 0x8CD55591, 0xC902DE4C, 0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E, 0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633, 0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10, 0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169, 0xDCB7DA83, 0x573906FE, 0xA1E2CE9B, 0x4FCD7F52, 0x50115E01, 0xA70683FA, 0xA002B5C4, 0x0DE6D027, 0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5, 0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62, 0x11E69ED7, 0x2338EA63, 0x53C2DD94, 0xC2C21634, 0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76, 0x6F05E409, 0x4B7C0188, 0x39720A3D, 0x7C927C24, 0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC, 0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4, 0x1E50EF5E, 0xB161E6F8, 0xA28514D9, 0x6C51133C, 0x6FD5C7E7, 0x56E14EC4, 0x362ABFCE, 0xDDC6C837, 0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0], [0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B, 0x5CB0679E, 0x4FA33742, 0xD3822740, 0x99BC9BBE, 0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B, 0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4, 0x5748AB2F, 0xBC946E79, 0xC6A376D2, 0x6549C2C8, 0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6, 0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304, 0xA1FAD5F0, 0x6A2D519A, 0x63EF8CE2, 0x9A86EE22, 0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4, 0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6, 0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9, 0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59, 0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593, 0xE990FD5A, 0x9E34D797, 0x2CF0B7D9, 0x022B8B51, 0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28, 0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C, 0xE029AC71, 0xE019A5E6, 0x47B0ACFD, 0xED93FA9B, 0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28, 0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C, 0x15056DD4, 0x88F46DBA, 0x03A16125, 0x0564F0BD, 0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A, 0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319, 0x7533D928, 0xB155FDF5, 0x03563482, 0x8ABA3CBB, 0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F, 0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991, 0xEA7A90C2, 0xFB3E7BCE, 0x5121CE64, 0x774FBE32, 0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680, 0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166, 0xB39A460A, 0x6445C0DD, 0x586CDECF, 0x1C20C8AE, 0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB, 0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5, 0x72EACEA8, 0xFA6484BB, 0x8D6612AE, 0xBF3C6F47, 0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370, 0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D, 0x4040CB08, 0x4EB4E2CC, 0x34D2466A, 0x0115AF84, 0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048, 0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8, 0x611560B1, 0xE7933FDC, 0xBB3A792B, 0x344525BD, 0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9, 0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7, 0x1A908749, 0xD44FBD9A, 0xD0DADECB, 0xD50ADA38, 0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F, 0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C, 0xBF97222C, 0x15E6FC2A, 0x0F91FC71, 0x9B941525, 0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1, 0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442, 0xE0EC6E0E, 0x1698DB3B, 0x4C98A0BE, 0x3278E964, 0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E, 0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8, 0xDF359F8D, 0x9B992F2E, 0xE60B6F47, 0x0FE3F11D, 0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F, 0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299, 0xF523F357, 0xA6327623, 0x93A83531, 0x56CCCD02, 0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC, 0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614, 0xE6C6C7BD, 0x327A140A, 0x45E1D006, 0xC3F27B9A, 0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6, 0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B, 0x53113EC0, 0x1640E3D3, 0x38ABBD60, 0x2547ADF0, 0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060, 0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E, 0x1948C25C, 0x02FB8A8C, 0x01C36AE4, 0xD6EBE1F9, 0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F, 0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6]];
    var BLOWFISH_CTX = {
      pbox: [],
      sbox: []
    };
    function F(ctx, x) {
      let a = x >> 24 & 0xFF;
      let b = x >> 16 & 0xFF;
      let c = x >> 8 & 0xFF;
      let d = x & 0xFF;
      let y = ctx.sbox[0][a] + ctx.sbox[1][b];
      y = y ^ ctx.sbox[2][c];
      y = y + ctx.sbox[3][d];
      return y;
    }
    function BlowFish_Encrypt(ctx, left, right) {
      let Xl = left;
      let Xr = right;
      let temp;
      for (let i = 0; i < N; ++i) {
        Xl = Xl ^ ctx.pbox[i];
        Xr = F(ctx, Xl) ^ Xr;
        temp = Xl;
        Xl = Xr;
        Xr = temp;
      }
      temp = Xl;
      Xl = Xr;
      Xr = temp;
      Xr = Xr ^ ctx.pbox[N];
      Xl = Xl ^ ctx.pbox[N + 1];
      return {
        left: Xl,
        right: Xr
      };
    }
    function BlowFish_Decrypt(ctx, left, right) {
      let Xl = left;
      let Xr = right;
      let temp;
      for (let i = N + 1; i > 1; --i) {
        Xl = Xl ^ ctx.pbox[i];
        Xr = F(ctx, Xl) ^ Xr;
        temp = Xl;
        Xl = Xr;
        Xr = temp;
      }
      temp = Xl;
      Xl = Xr;
      Xr = temp;
      Xr = Xr ^ ctx.pbox[1];
      Xl = Xl ^ ctx.pbox[0];
      return {
        left: Xl,
        right: Xr
      };
    }

    /**
     * Initialization ctx's pbox and sbox.
     *
     * @param {Object} ctx The object has pbox and sbox.
     * @param {Array} key An array of 32-bit words.
     * @param {int} keysize The length of the key.
     *
     * @example
     *
     *     BlowFishInit(BLOWFISH_CTX, key, 128/32);
     */
    function BlowFishInit(ctx, key, keysize) {
      for (let Row = 0; Row < 4; Row++) {
        ctx.sbox[Row] = [];
        for (let Col = 0; Col < 256; Col++) {
          ctx.sbox[Row][Col] = ORIG_S[Row][Col];
        }
      }
      let keyIndex = 0;
      for (let index = 0; index < N + 2; index++) {
        ctx.pbox[index] = ORIG_P[index] ^ key[keyIndex];
        keyIndex++;
        if (keyIndex >= keysize) {
          keyIndex = 0;
        }
      }
      let Data1 = 0;
      let Data2 = 0;
      let res = 0;
      for (let i = 0; i < N + 2; i += 2) {
        res = BlowFish_Encrypt(ctx, Data1, Data2);
        Data1 = res.left;
        Data2 = res.right;
        ctx.pbox[i] = Data1;
        ctx.pbox[i + 1] = Data2;
      }
      for (let i = 0; i < 4; i++) {
        for (let j = 0; j < 256; j += 2) {
          res = BlowFish_Encrypt(ctx, Data1, Data2);
          Data1 = res.left;
          Data2 = res.right;
          ctx.sbox[i][j] = Data1;
          ctx.sbox[i][j + 1] = Data2;
        }
      }
      return true;
    }

    /**
     * Blowfish block cipher algorithm.
     */
    var Blowfish = C_algo.Blowfish = BlockCipher.extend({
      _doReset: function () {
        // Skip reset of nRounds has been set before and key did not change
        if (this._keyPriorReset === this._key) {
          return;
        }

        // Shortcuts
        var key = this._keyPriorReset = this._key;
        var keyWords = key.words;
        var keySize = key.sigBytes / 4;

        //Initialization pbox and sbox
        BlowFishInit(BLOWFISH_CTX, keyWords, keySize);
      },
      encryptBlock: function (M, offset) {
        var res = BlowFish_Encrypt(BLOWFISH_CTX, M[offset], M[offset + 1]);
        M[offset] = res.left;
        M[offset + 1] = res.right;
      },
      decryptBlock: function (M, offset) {
        var res = BlowFish_Decrypt(BLOWFISH_CTX, M[offset], M[offset + 1]);
        M[offset] = res.left;
        M[offset + 1] = res.right;
      },
      blockSize: 64 / 32,
      keySize: 128 / 32,
      ivSize: 64 / 32
    });

    /**
     * Shortcut functions to the cipher's object interface.
     *
     * @example
     *
     *     var ciphertext = CryptoJS.Blowfish.encrypt(message, key, cfg);
     *     var plaintext  = CryptoJS.Blowfish.decrypt(ciphertext, key, cfg);
     */
    C.Blowfish = BlockCipher._createHelper(Blowfish);
  })();
  return CryptoJS.Blowfish;
});
});

var cryptoJs = createCommonjsModule(function (module, exports) {
(function (root, factory, undef) {
  {
    // CommonJS
    module.exports = factory(core, x64Core, libTypedarrays, encUtf16, encBase64, encBase64url, md5, sha1, sha256, sha224, sha512, sha384, sha3, ripemd160, hmac, pbkdf2, evpkdf, cipherCore, modeCfb, modeCtr, modeCtrGladman, modeOfb, modeEcb, padAnsix923, padIso10126, padIso97971, padZeropadding, padNopadding, formatHex, aes, tripledes, rc4, rabbit, rabbitLegacy, blowfish);
  }
})(commonjsGlobal, function (CryptoJS) {
  return CryptoJS;
});
});

//
const uuid = prefix => {
  const s = [];
  const hexDigits = '0123456789abcdef';
  for (let i = 0; i < 36; i += 1) {
    s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
  }
  s[14] = '4';
  s[19] = hexDigits.substr(s[19] & 0x3 | 0x8, 1);
  const id = s.join('');
  return prefix ? prefix + '__' + id : id;
};

// import CryptoJS from 'crypto-js'
// import RecorderManager from '../processor.worker'
// let Base64 = require('js-base64').Base64
// import parser from 'fast-xml-parser'

// let transWorker = new RecorderManager()
//APPID，APISecret，APIKey在控制台-我的应用-语音评测（流式版）页面获取
const APPID$1 = '98fcf4d6';
const API_SECRET$1 = 'Y2FkN2Y1MGZjN2U0M2I1MTU4Y2FlZjA0';
const API_KEY$1 = 'b7e405d6af09050e4a6976f31ec37640';

// const recorder = new RecorderManager('/audio/recorder')

var script$4p = {
  name: 'VoicePlayer',
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    playStyle: {
      type: String,
      default: 'yuan-wen'
    },
    styleMode: {
      type: String,
      default: 'A'
    },
    url: {
      type: String,
      default: '',
      require: true
    },
    title: {
      type: String,
      default: '音频文件'
    },
    content: {
      type: String,
      default: '暂无简介'
    },
    coverImageUrl: {
      type: String,
      default: ''
    },
    //进度是否能控制
    scheduleControl: {
      type: String,
      default: ''
    },
    loop: {
      type: Boolean,
      default: true
    },
    playMode: {
      type: String,
      default: 'xun-huan'
    },
    targerLink: {
      type: String,
      default: ''
    },
    playerIndex: {
      type: Number,
      default: -1
    }
  },
  data() {
    return {
      textarea: '语音评测',
      playIcon,
      pauseIcon,
      audioIcon,
      coverLocal: coverLocal$1,
      recStartIcon,
      recStopIcon,
      recDelete,
      recMockWave,
      isPlay: false,
      playTime: 0,
      playDuration: '00:00',
      playCurrentTime: '00:00',
      totalDuration: 0,
      link: {
        type: String,
        default: ''
      },
      //链接地址
      lastOperateTimeStamp: '',
      recordAudio: null,
      permissionDialogVisible: false,
      Rec: recorder_mp3_min,
      type: 'mp3',
      bitRate: 16,
      sampleRate: 16000,
      testSampleRate: 16000,
      rec: null,
      recDuration: 0,
      powerLevel: 0,
      logs: [],
      recBolb: null,
      isRecing: false,
      hasInitSuccess: false,
      waveStore: {
        selected: 'Histogram2',
        WaveView: {},
        Histogram2: {},
        Histogram3: {}
      },
      recordDataUrl: '',
      lastAudioStamp: null,
      lastPlayStamp: null,
      waveBoxKey: uuid('wave'),
      recTimestamp: null,
      iseWS: null,
      SendFrameSize: 1280,
      realTimeSendTryNumber: null,
      transferUploadNumberMax: null,
      realTimeSendTryChunk: null,
      realTimeSendTryChunks: null,
      buffersArr: [],
      audioData: [],
      status: '',
      //
      webSocket: null,
      total: '0',
      accuracy: '0',
      fluency: '0',
      integrity: '0',
      phone: '0',
      tone: '0',
      emotion: '0',
      voicedata: {}
    };
  },
  computed: {
    videoAndMusicStop() {
      let playState = sessionStorage.getItem('SET_PLAY_STATE');
      return playState;
    },
    playModeIconSrc() {
      let srcMap = {
        'xun-huan': playRepeat$1,
        'dan-ci': playOnce$1
      };
      return srcMap[this.playMode];
    },
    controlStatusText() {
      let text = '';
      if (this.recBolb) {
        text = this.isPlay ? '' : '';
      } else {
        text = this.isRecing ? '结束录音' : '开始录音';
      }
      return text;
    }
  },
  watch: {
    url: {
      handler(newVal) {
        let _this = this;
        this.isPlay = false;
        let ua = navigator.userAgent;
        console.log('浏览器 UA', ua);
        /micromessenger/.test(ua.toLowerCase());
        let isIOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        // isWeixin && isIOS && newVal && this.$message({
        //   message: `当前UA为${ua}`,
        //   duration: 3000
        // })
        if (isIOS && newVal) {
          try {
            this.$nextTick(() => {
              _this.$refs.recordAudio.muted = true;
              const playPromise = _this.$refs.recordAudio.play();
              _this.$refs.recordAudio.muted = false;
              if (playPromise) {
                playPromise.then(() => {
                  _this.$refs.recordAudio.pause();
                }).catch(error => {
                  _this.$refs.recordAudio.pause();
                  console.log(error);
                });
              }
            });
          } catch (error) {
            console.log(error);
            this.$message({
              type: 'warning',
              message: error,
              duration: 5000
            });
          }
        }
      },
      immediate: true
    },
    videoAndMusicStop(val) {
      console.log('watch', val);
      let currentPlayStamp = val || '--';
      if (`${this.url}__playTimeStamp__${this.lastOperateTimeStamp}` !== currentPlayStamp) {
        this.recordAudio.pause();
      }
    }
  },
  mounted() {
    console.log(recorder);
    // 加载完毕后，先获取<video>标签DOM对象
    this.recordAudio = this.$refs.recordAudio;
    // let _this = this;
    // if(!this.recBolb && !this.isRecing) {
    //   let rec = this.rec = Recorder({
    //       type:_this.type,
    //       bitRate:_this.bitRate,
    //       sampleRate:_this.sampleRate,
    //       onProcess:function(buffers,powerLevel,duration,sampleRate){
    //           _this.recDuration = duration;
    //           _this.powerLevel = powerLevel;
    //           // _this.wave.input(buffers[buffers.length-1],powerLevel,sampleRate);
    //           //可视化图形绘制
    //           $(".recwave").html("").append(_this.waveStore[_this.waveStore.selected].elem);
    //           _this.waveStore[_this.waveStore.selected].input(buffers[buffers.length-1],powerLevel,sampleRate);
    //       }
    //   });

    //   _this.dialogInt=setTimeout(function(){//定时8秒后打开弹窗，用于监测浏览器没有发起权限请求的情况
    //       _this.showDialog();
    //   },8000);

    //   rec.open(function(){
    //       _this.dialogCancel();
    //       // _this.reclog("已打开:"+_this.type+" "+_this.sampleRate+"hz "+_this.bitRate+"kbps",2);

    //       _this.initWaveStore(".recwave");
    //       // rec.start();
    //       _this.hasInitSuccess = true
    //       // _this.isRecing = true
    //   },function(msg,isUserNotAllow){
    //       _this.dialogCancel();
    //       isUserNotAllow && _this.$message.error('启动录音失败，用户拒绝了授权')
    //       // _this.reclog((isUserNotAllow?"UserNotAllow，":"")+"打开失败："+msg,1);
    //   });

    //   _this.waitDialogClickFn=function(){
    //       _this.dialogCancel();
    //       _this.$message.error('启动录音失败，用户忽略了权限请求')
    //       // _this.reclog("打开失败：权限请求被忽略，用户主动点击的弹窗",1);
    //   };
    // }
  },
  methods: {
    ontrolBtn() {
      if (!this.isRecing) {
        this.connectWebSocket();
        this.isRecing = true;
        recorder.onFrameRecorded = ({
          isLastFrame,
          frameBuffer
        }) => {
          this.buffersArr.push(frameBuffer);
          this.webSocket.send(JSON.stringify({
            business: {
              aue: 'raw',
              cmd: 'auw',
              aus: isLastFrame ? 4 : 2
            },
            data: {
              status: isLastFrame ? 2 : 1,
              data: this.toBase64(frameBuffer),
              data_type: 1
            }
          }));
          if (isLastFrame) {
            this.isRecing = false;
          }
        };
      } else {
        recorder.stop();
        let _this = this;
        _this.isRecing = false;
        recorder.onStop = function (res) {
          console.log(res);
          const blob = new Blob(_this.buffersArr, {
            type: 'audio/mp3'
          });
          // _this.recBolb = blob
          console.log(blob);
          console.log(URL.createObjectURL(blob));

          // this.recordedAudio = URL.createObjectURL(blob);
          // this.$refs.audioPlayer.src = this.recordedAudio;
        };
        console.log('结束');
      }
    },
    /**
     * 获取websocket url
     * 该接口需要后端提供，这里为了方便前端处理
     */
    getWebSocketUrl() {
      return new Promise((resolve, reject) => {
        // 请求地址根据语种不同变化
        var url = 'wss://ise-api.xfyun.cn/v2/open-ise';
        var host = 'ise-api.xfyun.cn';
        var apiKey = API_KEY$1;
        var apiSecret = API_SECRET$1;
        var date = new Date().toGMTString();
        var algorithm = 'hmac-sha256';
        var headers = 'host date request-line';
        var signatureOrigin = `host: ${host}\ndate: ${date}\nGET /v2/open-ise HTTP/1.1`;
        var signatureSha = cryptoJs.HmacSHA256(signatureOrigin, apiSecret);
        var signature = cryptoJs.enc.Base64.stringify(signatureSha);
        var authorizationOrigin = `api_key="${apiKey}", algorithm="${algorithm}", headers="${headers}", signature="${signature}"`;
        var authorization = btoa(authorizationOrigin);
        url = `${url}?authorization=${authorization}&date=${date}&host=${host}`;
        resolve(url);
      });
    },
    // 修改录音评测状态
    setStatus(status) {
      this.onWillStatusChange && this.status !== status && this.onWillStatusChange(this.status, status);
      this.status = status;
    },
    // 连接websocket
    connectWebSocket() {
      return this.getWebSocketUrl().then(url => {
        let iseWS;
        if ('WebSocket' in window) {
          iseWS = new WebSocket(url);
        } else if ('MozWebSocket' in window) {
          iseWS = new MozWebSocket(url);
        } else {
          alert('浏览器不支持WebSocket');
          return;
        }
        this.webSocket = iseWS;
        this.setStatus('init');
        iseWS.onopen = e => {
          this.setStatus('ing');
          // 重新开始录音

          recorder.start({
            sampleRate: 16000,
            frameSize: 1280
          });
          var params = {
            common: {
              app_id: APPID$1
            },
            business: {
              category: 'read_sentence',
              // read_syllable/单字朗读，汉语专有 read_word/词语朗读  read_sentence/句子朗读 https://www.xfyun.cn/doc/Ise/IseAPI.html#%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E6%B5%81%E7%A8%8B
              rstcd: 'utf8',
              group: 'pupil',
              sub: 'ise',
              tte: 'utf-8',
              cmd: 'ssb',
              auf: 'audio/L16;rate=16000',
              ent: 'cn_vip',
              aus: 1,
              aue: 'raw',
              text: '\uFEFF' + (this.textarea || 'where are you')
            },
            data: {
              status: 0
              // data_type: 1,
              // encoding: "raw",
            }
          };
          iseWS.send(JSON.stringify(params));
        };
        iseWS.onmessage = e => {
          this.result(e.data);
        };
        iseWS.onerror = e => {
          // this.recorderStop()
        };
        iseWS.onclose = e => {
          // this.recorderStop()
        };
      });
    },
    // 对处理后的音频数据进行base64编码
    toBase64(buffer) {
      var binary = '';
      var bytes = new Uint8Array(buffer);
      var len = bytes.byteLength;
      for (var i = 0; i < len; i++) {
        binary += String.fromCharCode(bytes[i]);
      }
      return window.btoa(binary);
    },
    // 向webSocket发送数据
    webSocketSend(audioDatajson) {
      if (this.webSocket.readyState !== 1) {
        return;
      }
      // let audioDatajson = this.audioData.splice(0, 1280)
      var params = {
        common: {
          app_id: APPID$1
        },
        business: {
          category: 'read_sentence',
          // read_syllable/单字朗读，汉语专有 read_word/词语朗读  read_sentence/句子朗读 https://www.xfyun.cn/doc/Ise/IseAPI.html#%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E6%B5%81%E7%A8%8B
          rstcd: 'utf8',
          group: 'pupil',
          sub: 'ise',
          tte: 'utf-8',
          cmd: 'ssb',
          auf: 'audio/L16;rate=16000',
          ent: 'cn_vip',
          aus: 1,
          aue: 'lame',
          text: '\uFEFF' + '测试语音' ,
          ise_unite: '1',
          rst: 'entirety',
          extra_ability: 'multi_dimension'
        },
        data: {
          status: 0,
          encoding: 'lame',
          data_type: 1,
          data: this.toBase64(audioDatajson)
        }
      };
      this.webSocket.send(JSON.stringify(params));
      this.handlerInterval = setInterval(() => {
        // websocket未连接
        if (this.webSocket.readyState !== 1) {
          this.audioData = [];
          clearInterval(this.handlerInterval);
          return;
        }
        // 最后一帧
        if (this.audioData.length === 0) {
          if (this.status === 'end') {
            console.log('最后一帧并结束');
            this.webSocket.send(JSON.stringify({
              business: {
                cmd: 'auw',
                aus: 4,
                aue: 'lame'
              },
              data: {
                status: 2,
                data_type: 1,
                data: ''
              }
            }));
            this.audioData = [];
            clearInterval(this.handlerInterval);
          }
          return false;
        }
        this.audioData.splice(0, 1280);

        // 中间帧
        this.webSocket.send(JSON.stringify({
          business: {
            cmd: 'auw',
            aus: 2,
            aue: 'lame'
          },
          data: {
            status: 1,
            encoding: 'lame',
            data_type: 1,
            data: this.toBase64(audioDatajson)
          }
        }));
      }, 40);
    },
    result(resultData) {
      // 识别结束
      let jsonData = JSON.parse(resultData);
      console.log(jsonData);
      if (jsonData.data && jsonData.data.data) {
        // console.log(jsonData.data.data,'jsonData.data.data');
        let data = Base64.decode(jsonData.data.data);
        // console.log(data, 'dasdsadasdasdasdasdasdasdas');
        let grade = parser.parse(data, {
          attributeNamePrefix: '',
          ignoreAttributes: false
        });
        console.log(grade, 'grade结束的这一次');
        grade?.xml_result?.read_sentence?.rec_paper?.read_sentence;
        this.voicedata = grade?.xml_result?.read_sentence?.rec_paper?.read_sentence;
        console.log(this.voicedata);

        // this.accuracy = readSentence?.accuracy_score;
        // this.fluency= readSentence?.fluency_score;
        // this.integrity= readSentence?.integrity_score;
        // this.phone= readSentence?.phone_score;
        // this.tone= readSentence?.tone_score;
        // this.emotion= readSentence?.emotion_score;
      }
      if (jsonData.code === 0 && jsonData.data.status === 2) {
        this.webSocket.close();
      }
      if (jsonData.code !== 0) {
        this.webSocket.close();
      }
    },
    changeDuration() {
      this.$nextTick(() => {
        this.playDuration = this.timeFormat(this.$refs.recordAudio.duration);
        this.totalDuration = this.$refs.recordAudio.duration;
      });
    },
    //将单位为秒的的时间转换成mm:ss的形式
    timeFormat(num) {
      let minute = parseInt(num / 60);
      let second = parseInt(num % 60);
      minute = minute >= 10 ? minute : `0${minute}`;
      second = second >= 10 ? second : `0${second}`;
      return `${minute}:${second}`;
    },
    resetRecorder() {
      let audio = this.$refs.recordAudio;
      if (!audio.paused) {
        audio.pause();
      }
      this.recBolb = null;
      this.isPlay = false;
      this.isRecing = false;
      this.playTime = 0;
      this.playDuration = '00:00';
      this.playCurrentTime = '00:00';
      this.totalDuration = 0;
      this.recDuration = 0;
      this.recordDataUrl = '';
      this.lastAudioStamp = null;
      this.lastPlayStamp = null;
    },
    setRecedDuration(ms) {
      this.playDuration = this.timeFormat(ms / 1000);
      this.totalDuration = ms / 1000;
    },
    initWaveStore(elem) {
      this.waveStore.WaveView = recorder_mp3_min.WaveView({
        elem: elem,
        width: 300,
        height: 100
      });
      this.waveStore.Histogram2 = recorder_mp3_min.FrequencyHistogramView({
        elem: elem,
        lineCount: 30,
        position: 0,
        minHeight: 12,
        mirrorEnable: true,
        stripeEnable: false,
        linear: [0, '#8FC1FD', 1, '#8FC1FD']
      });
      this.waveStore.Histogram3 = recorder_mp3_min.FrequencyHistogramView({
        elem: elem,
        lineCount: 20,
        position: 0,
        minHeight: 1,
        fallDuration: 400,
        stripeEnable: false,
        mirrorEnable: true,
        linear: [0, '#0ac', 1, '#0ac']
      });
    },
    toggleRec() {
      let _this = this;
      // if(!this.hasInitSuccess) {
      //   this.$message.warning('当前浏览器不支持或用户未进行授权，组件功能暂无法使用')
      //   return
      // }
      let waveBoxSelector = '#' + _this.waveBoxKey;
      if (!this.recBolb && !this.isRecing) {
        // _this.rec.start();
        // _this.isRecing = true
        if (recorder_mp3_min.IsOpen()) {
          _this.$message.warning('当前存在进行中的录制任务');
          return;
        }
        let rec = this.rec = recorder_mp3_min({
          type: _this.type,
          bitRate: _this.bitRate,
          sampleRate: _this.sampleRate,
          onProcess: function (buffers, powerLevel, duration, sampleRate) {
            _this.recDuration = duration;
            _this.powerLevel = powerLevel;
            // _this.wave.input(buffers[buffers.length-1],powerLevel,sampleRate);
            //可视化图形绘制
            jquery(waveBoxSelector).html('').append(_this.waveStore[_this.waveStore.selected].elem);
            _this.waveStore[_this.waveStore.selected].input(buffers[buffers.length - 1], powerLevel, sampleRate);

            // _this.audioData.push(buffers)
            // window.btoa(String.fromCharCode(...new Uint8Array(buffers[buffers.length - 1])))
            // _this.webSocketSend(buffers)
          }
        });
        var t = setTimeout(function () {
          // Runtime.Log("无法录音：权限请求被忽略（超时假装手动点击了确认对话框）",1);
        }, 8000);
        rec.open(function () {
          //打开麦克风授权获得相关资源
          clearTimeout(t);
          _this.dialogCancel();
          _this.initWaveStore(waveBoxSelector);
          rec.start();
          _this.isRecing = true;
          _this.recTimestamp = new Date().getTime();
        }, function (msg, isUserNotAllow) {
          clearTimeout(t);
          // Runtime.Log((isUserNotAllow?"UserNotAllow，":"")+"无法录音:"+msg, 1);
        });
      } else {
        if (!(_this.rec && recorder_mp3_min.IsOpen())) {
          _this.$message.error('录音未启动');
          return;
        }
        let doneTimestamp = new Date().getTime();
        if (!_this.recTimestamp || doneTimestamp - _this.recTimestamp < 5000) {
          _this.$message.warning('至少录制 5s 方可进行保存，请稍候');
          return;
        }
        let rec = _this.rec;
        rec.stop(function (blob, duration) {
          _this.$message.success('录制完成');
          _this.recDuration = duration;
          _this.setRecedDuration(duration);
          jquery(waveBoxSelector).html('');
          _this.$nextTick(() => {
            _this.recBolb = blob;
            _this.isRecing = false;
            _this.lastAudioStamp = new Date().getTime();
            _this.recTimestamp = null;
          });
          _this.setStatus('end');

          //_this.$emit('resData',{blob:blob,duration:duration})
        }, function (msg) {
          _this.recTimestamp = null;
          _this.$message.error(`录音失败：${msg}`);
        }, true); //录音结束时自动调用rec.close方法丢弃所有数据
      }
    },
    play() {
      // if(!this.recBolb) {
      //   // this.toggleRec()
      //   this.ontrolBtn()
      // }else {
      //   // if (this.playStyle === 'yuan-wen') {
      //   //   this.doPlay()
      //   // }
      //   // if (this.playStyle === 'tan-chuang') {
      //   //   this.$emit('showDialog', { url: this.url, title: this.title, coverFileUrl: this.coverImageUrl, content: this.content, playerIndex: this.playerIndex })
      //   // }
      //   this.togglePlay()
      // }
      this.$emit('showDialog');
    },
    togglePlay() {
      let _this = this;
      let audios = document.querySelectorAll('audio');
      audios.forEach(i => i.pause());
      let video = document.querySelectorAll('video');
      if (video && video.length) {
        video.forEach(i => i.pause());
      }
      let audio = this.$refs.recordAudio;
      if (this.isPlay) {
        !(audio.ended || audio.paused) && audio.pause();
      } else {
        if (!this.lastPlayStamp || this.lastPlayStamp !== this.lastAudioStamp) {
          audio.onerror = function (e) {
            _this.$message.error(audio.error.message);
          };
          audio.currentTime = 0;
          audio.src = (window.URL || webkitURL).createObjectURL(_this.recBolb);
          console.log((window.URL || webkitURL).createObjectURL(_this.recBolb));
          audio.play();
          this.lastPlayStamp = this.lastAudioStamp;
        } else {
          audio.paused && audio.play();
        }
      }
      this.isPlay = !this.isPlay;
    },
    doPlay() {
      let _this = this;
      let rec = this.rec;
      let audio = this.$refs.LogAudioPlayer;
      audio.controls = true;
      if (!(audio.ended || audio.paused)) {
        audio.pause();
      }
      audio.onerror = function (e) {
        _this.$message.error(audio.error.message);
      };
      audio.src = (window.URL || webkitURL).createObjectURL(rec.blob);
      audio.play();
      // console.log('暂停')
      // let audio = document.querySelectorAll('audio')
      // audio.forEach((i) => i.pause())
      // let video = document.querySelectorAll('video')
      // if (video && video.length) {
      //   video.forEach((i) => i.pause())
      // }

      // this.isPlay ? this.$refs.recordAudio.pause() : this.$refs.recordAudio.play()
      // this.isPlay = !this.isPlay
      // let timeStamp = new Date().getTime()
      // this.lastOperateTimeStamp = timeStamp
      // let playStamp = `${this.url}__playTimeStamp__${timeStamp}`
      // // !this.isPlay && this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // // this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // sessionStorage.setItem('SET_PLAY_STATE', playStamp) //存储
    },
    updateTime(e) {
      this.playTime = this.$refs.recordAudio.currentTime;
      this.playCurrentTime = this.timeFormat(this.$refs.recordAudio.currentTime);
      if (!this.loop && this.playTime >= this.totalDuration) {
        this.isPlay = false;
      }
      // this.$emit('timeUpdate', {event:e, time: this.$refs.recordAudio.currentTime })
    },
    changeTime(val) {
      this.$refs.recordAudio.currentTime = val;
    },
    showDialog: function () {
      //选择性的弹一个对话框：为了防止移动端浏览器存在第三种情况：用户忽略，并且（或者国产系统UC系）浏览器没有任何回调
      if (!/mobile/i.test(navigator.userAgent)) {
        return; //只在移动端开启没有权限请求的检测
      }
      this.permissionDialogVisible = true;
    },
    dialogCancel: function () {
      clearTimeout(this.dialogInt);
      this.permissionDialogVisible = false;
    },
    waitDialogClick: function () {
      this.dialogCancel();
      this.waitDialogClickFn();
    }
  }
};

/* script */
const __vue_script__$4p = script$4p;

/* template */
var __vue_render__$4p = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { staticClass: "xml-voice-player", class: ["xml-audio-player", _vm.mode] },
    [
      _vm.recBolb
        ? _c("div", { staticClass: "play-mode-wrap" }, [
            _c("img", {
              staticClass: "play-control-image",
              attrs: { src: _vm.recDelete },
              on: { click: _vm.resetRecorder },
            }),
          ])
        : _vm._e(),
      _vm._v(" "),
      _vm.styleMode !== "C"
        ? _c("div", { staticClass: "audio-cover" }, [
            _c("img", {
              attrs: {
                src: _vm.coverImageUrl ? _vm.coverImageUrl : _vm.coverLocal,
                alt: "",
              },
            }),
            _vm._v(" "),
            _vm.styleMode === "A"
              ? _c("div", { staticClass: "play-button style-a" }, [
                  _c("img", {
                    staticClass: "button-image",
                    attrs: {
                      src: _vm.recBolb
                        ? _vm.isPlay
                          ? _vm.pauseIcon
                          : _vm.playIcon
                        : _vm.isRecing
                        ? _vm.recStopIcon
                        : _vm.recStartIcon,
                    },
                    on: {
                      click: function ($event) {
                        $event.stopPropagation();
                        return _vm.play.apply(null, arguments)
                      },
                    },
                  }),
                ])
              : _vm._e(),
            _vm._v(" "),
            _vm.controlStatusText
              ? _c("div", { staticClass: "play-text" }, [
                  _vm._v(_vm._s(_vm.controlStatusText)),
                ])
              : _vm._e(),
          ])
        : _vm._e(),
      _vm._v(" "),
      !_vm.recBolb
        ? _c("div", { staticClass: "record-player-control" }, [
            !_vm.recBolb
              ? _c("div", {
                  staticClass: "recwave",
                  staticStyle: { height: "75%", width: "100%" },
                  attrs: { id: _vm.waveBoxKey },
                })
              : _vm._e(),
            _vm._v(" "),
            !_vm.isRecing
              ? _c("div", { staticClass: "mock-wave" }, [
                  _c("img", {
                    staticClass: "button-image",
                    attrs: { src: _vm.recMockWave },
                  }),
                ])
              : _vm._e(),
          ])
        : _c("div", { staticClass: "audio-player-control" }, [
            _c("div", { staticClass: "audio-controls" }, [
              _vm.styleMode !== "A"
                ? _c(
                    "div",
                    { staticClass: "audio-controls__play-button-wrapper" },
                    [
                      _c("div", { staticClass: "play-button" }, [
                        _c("img", {
                          staticClass: "button-image",
                          attrs: {
                            src: _vm.isPlay ? _vm.pauseIcon : _vm.playIcon,
                          },
                          on: {
                            click: function ($event) {
                              $event.stopPropagation();
                              return _vm.play.apply(null, arguments)
                            },
                          },
                        }),
                      ]),
                    ]
                  )
                : _vm._e(),
              _vm._v(" "),
              _c("div", { staticClass: "audio-controls__handler" }, [
                _c(
                  "div",
                  { staticClass: "progress" },
                  [
                    _c("el-slider", {
                      attrs: {
                        max: _vm.totalDuration,
                        disabled: _vm.scheduleControl !== "yes",
                        "show-tooltip": false,
                      },
                      on: { change: _vm.changeTime },
                      model: {
                        value: _vm.playTime,
                        callback: function ($$v) {
                          _vm.playTime = $$v;
                        },
                        expression: "playTime",
                      },
                    }),
                  ],
                  1
                ),
                _vm._v(" "),
                _c("div", { staticClass: "play-times" }, [
                  _c("div", { staticClass: "current-time" }, [
                    _vm._v(_vm._s(_vm.playCurrentTime)),
                  ]),
                  _vm._v(" "),
                  _c("div", { staticClass: "total-time" }, [
                    _vm._v(_vm._s(_vm.playDuration)),
                  ]),
                ]),
              ]),
            ]),
          ]),
    ]
  )
};
var __vue_staticRenderFns__$4p = [];
__vue_render__$4p._withStripped = true;

  /* style */
  const __vue_inject_styles__$4p = undefined;
  /* scoped */
  const __vue_scope_id__$4p = undefined;
  /* module identifier */
  const __vue_module_identifier__$4p = undefined;
  /* functional template */
  const __vue_is_functional_template__$4p = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4p = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4p, staticRenderFns: __vue_staticRenderFns__$4p },
    __vue_inject_styles__$4p,
    __vue_script__$4p,
    __vue_scope_id__$4p,
    __vue_is_functional_template__$4p,
    __vue_module_identifier__$4p,
    false,
    undefined,
    undefined,
    undefined
  );

var audioplay = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB8AAAAjCAYAAABsFtHvAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Nzg2N0EwMkRCOTk2MTFFRTkyODY5NjkyNzIzQkJCMjUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6Nzg2N0EwMkVCOTk2MTFFRTkyODY5NjkyNzIzQkJCMjUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3ODY3QTAyQkI5OTYxMUVFOTI4Njk2OTI3MjNCQkIyNSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3ODY3QTAyQ0I5OTYxMUVFOTI4Njk2OTI3MjNCQkIyNSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqQzfXsAAABxSURBVHja7NfLDYAgEIThhS60I+vQ1gW7WCHhpEiYk5d/kk0Ij/nORHffyiSfS2r3rTNyT6gLM1tsPrnM2tmXeyrupid09uSeaD8GHBwcHBwcHBwcHBwcHPyFZ/HNNfi3Sz0VPwaFz5xl9o8zuecWYABkIYg317fc8QAAAABJRU5ErkJggg==";

var audiopluse = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAtCAYAAAA6GuKaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NjVGNTA1NTBCOTk2MTFFRUJEN0NCMzZBQzlFRTc5ODciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NjVGNTA1NTFCOTk2MTFFRUJEN0NCMzZBQzlFRTc5ODciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2NUY1MDU0RUI5OTYxMUVFQkQ3Q0IzNkFDOUVFNzk4NyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo2NUY1MDU0RkI5OTYxMUVFQkQ3Q0IzNkFDOUVFNzk4NyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvUcl+EAAALBSURBVHja7JlBSBRRGMed3RKUapf0oChGrUmtEkZghHuQDoGBYJfYkySYdfDeJSQCha6CYNChc9RFyMAy99BNLFsSBSlIrKBATGvNdJn+I9+Dz+ebZWac2X3BPPjB7Nv33vebN2/mvTdjmKZZ9r+lQz60cQpcBZdAMzgBYsAAm2ANLIIsyIDXYP1AEa2e9kAF6Aezpvu0DZ6BTmB4ie+2QhTcAl9Nf9I70O1W2nAxps+Ax+Ci4r8F8ALM0PEq+EPDpA60gBS4Ao4r6r8Ct8FHP4fHdfBbcZkfgVaXV6oLPFf0utV+j1/D444iwDho9Hg/CC6AaUXbo3RynqXvSg3mQO8BZTkGtbcuxXkKyr1I35QaWgHnfRTmnAZZhXjUjXQ7+CsJNwYkLIiBjGKoOJI+Cj6ximvgbMDCgkqFeI8T6RGpUmeRhHmPZ6WnSqKQdBLssAojRRbmY5zfnC8LST9hBa1Z70iJpC1uSFe8WyV9Uurl3hIKi8fhtDTlG7L0ECuwDA6XWFpMQPvurwib0dPseAxsa7B0ngUT7HcfX3u0SGfUoEEvC7qk9c4x0dMd7Gzeg2WNNioTtGoUm5bLQrqNFcpotrvKg0n2u0NIN7HMtxpuC9+w43MRts8TaUlD6Q98MyKkYyzzm4bSX9hxXEiXs8xfGkr/ZMcVEUWBHQ2l98wZkQIFq8ADMAUegkQR5BIUa4piVxXa2PIUp/ca81L+D1Af4CRSTzF4mieXOM+06+lrICnlVYOBAHt5gGLwlCSXMifDw24o1AQoXePUxU46qtFNGHUqrXUKpUNpB9J58dgGWxp6bpHbrquQHgQr4D69vdctbZKb5TgoPl8MEzqne0R4I4bSobTO0t9t8nMBuuQcu9gsyGvBhrQgz9MXgqA2Ae0Ug6cNcnH8zSUF5qjyZ5AuwiuwNMUyKXZKVe6fAAMABGTajLpD+ggAAAAASUVORK5CYII=";

var statr = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAARCAYAAADtyJ2fAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MEI5NTc1MUNCOUJEMTFFRTkwRUJDMDQwM0I2NDI4OUQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MEI5NTc1MURCOUJEMTFFRTkwRUJDMDQwM0I2NDI4OUQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowQjk1NzUxQUI5QkQxMUVFOTBFQkMwNDAzQjY0Mjg5RCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowQjk1NzUxQkI5QkQxMUVFOTBFQkMwNDAzQjY0Mjg5RCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PnfCIgEAAADUSURBVHjaYvz//z8DEHABsREQXwTizwzEAKBGbiC++R8CXgJxDMgwQhhEOP/HBLuBWAWfRiagpRxYHOICxJeAuAaI2XA51fs/fnAViG2x2UgIaAHxQSCeA8RCMEEmBuIAIxAnA/F1II4FCbAwkAbEgHgREGszMZAHwsnVuJpUp74H4gognk2KxuVAXAjEL4kNnHtAnAXEO5EF8fnxNxB3ArEOuiaYjT+xaDoOxOlAfBlf7uAF4gfQ5PUeiDOBmIlQ7mCE5kcBIDYH4rNA/IaYkAIIMABItNd0UvL9QAAAAABJRU5ErkJggg==";

//
const APPID = '98fcf4d6';
const API_SECRET = 'Y2FkN2Y1MGZjN2U0M2I1MTU4Y2FlZjA0';
const API_KEY = 'b7e405d6af09050e4a6976f31ec37640';
var script$4o = {
  name: 'XmlVoiceRender',
  components: {
    VoicePlayer: __vue_component__$4p
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    //属性中传递过来的块儿数据
    pBlockData: {},
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //评测数据
    voicedata: {},
    sourcedata: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  watch: {
    pBlockData: {
      handler(newValue) {
        this.$nextTick(() => {
          console.log('新data', newValue);
          this.blockData = Object.assign({}, this.blockData, newValue);
        });
      },
      deep: true,
      immediate: true
    },
    sourcedata: {
      handler(newval) {
        if (newval) {
          this.ratingData = newval;
        }
      },
      deep: true,
      immediate: true
    }
  },
  data() {
    return {
      blockId: 'blockId' + Math.random(),
      //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
      blockData: {
        playMode: 'xun-huan',
        scheduleControl: 'yes',
        playStyle: 'yuan-wen',
        styleMode: 'A'
      },
      //属性组件名
      propertyComponentsName: 'xml-recorder-property',
      dialogShow: false,
      curRecordUrl: '',
      curRecordTitle: '',
      curCoverFileUrl: '',
      curRecordContent: '',
      currentPlayer: {},
      modalPlayerKey: 'mpk' + new Date().getTime(),
      isRecing: false,
      playIcon: playIcon$1,
      pauseIcon: pauseIcon$1,
      checkbox,
      chackboxactive,
      buffersArr: [],
      webSocket: null,
      ratingData: {},
      //测评数据
      showresult: false,
      //成绩弹窗
      countdown: 300,
      //倒计时长
      timer: null,
      //定时器
      loading: false,
      playTime: 0,
      playDuration: '00:00',
      playCurrentTime: '00:00',
      totalDuration: 0,
      audioplay,
      audiopluse,
      statr,
      isPlay: false,
      recordAudio: null,
      lastAudioStamp: null
    };
  },
  methods: {
    updateTime(e) {
      this.playTime = this.$refs.recordAudio.currentTime;
      this.playCurrentTime = this.timeFormat(this.$refs.recordAudio.currentTime);
      if (this.voicedata.model != '1' && this.playTime >= this.totalDuration) {
        this.isPlay = false;
      }
    },
    //将单位为秒的的时间转换成mm:ss的形式
    timeFormat(num) {
      let minute = parseInt(num / 60);
      let second = parseInt(num % 60);
      minute = minute >= 10 ? minute : `0${minute}`;
      second = second >= 10 ? second : `0${second}`;
      return `${minute}:${second}`;
    },
    changeDuration() {
      this.$nextTick(() => {
        this.playDuration = this.timeFormat(this.$refs.recordAudio.duration);
        this.totalDuration = this.$refs.recordAudio.duration;
      });
    },
    togglePlay() {
      let _this = this;
      let audios = document.querySelectorAll('audio');
      audios.forEach(i => i.pause());
      let video = document.querySelectorAll('video');
      if (video && video.length) {
        video.forEach(i => i.pause());
      }
      let audio = this.$refs.recordAudio;
      if (this.isPlay) {
        !(audio.ended || audio.paused) && audio.pause();
      } else {
        if (!this.lastPlayStamp || this.lastPlayStamp !== this.lastAudioStamp) {
          audio.onerror = function (e) {
            _this.$message.error(audio.error.message);
          };
          audio.currentTime = 0;
          audio.src = this.voicedata.recordDataUrl;
          audio.play();
          this.lastPlayStamp = this.lastAudioStamp;
        } else {
          audio.paused && audio.play();
        }
      }
      this.isPlay = !this.isPlay;
    },
    changeTime(val) {},
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    showDialog() {
      this.$nextTick(() => {
        this.dialogShow = true;
      });
    },
    timeUpdate({
      event,
      time
    }, data) {
      // console.log({event, time, data});
      this.$EventBus.$emit('audioTimeUpdate', {
        event,
        time,
        data
      });
    },
    getresdata({
      blob,
      duration
    }) {
      this.$emit('getresdata', {
        blob,
        duration
      });
    },
    getTime(time) {
      let m = parseInt(time / 60 % 60);
      m = m < 10 ? '0' + m : m;
      let s = parseInt(time % 60);
      s = s < 10 ? '0' + s : s;
      // 作为返回值返回
      return m + ':' + s;
    },
    /**
     * 获取websocket url
     * 该接口需要后端提供，这里为了方便前端处理
     */
    getWebSocketUrl() {
      return new Promise((resolve, reject) => {
        // 请求地址根据语种不同变化
        var url = 'wss://ise-api.xfyun.cn/v2/open-ise';
        var host = 'ise-api.xfyun.cn';
        var apiKey = API_KEY;
        var apiSecret = API_SECRET;
        var date = new Date().toGMTString();
        var algorithm = 'hmac-sha256';
        var headers = 'host date request-line';
        var signatureOrigin = `host: ${host}\ndate: ${date}\nGET /v2/open-ise HTTP/1.1`;
        var signatureSha = cryptoJs.HmacSHA256(signatureOrigin, apiSecret);
        var signature = cryptoJs.enc.Base64.stringify(signatureSha);
        var authorizationOrigin = `api_key="${apiKey}", algorithm="${algorithm}", headers="${headers}", signature="${signature}"`;
        var authorization = btoa(authorizationOrigin);
        url = `${url}?authorization=${authorization}&date=${date}&host=${host}`;
        resolve(url);
      });
    },
    ontrolBtn() {
      if (!this.isRecing) {
        this.connectWebSocket();
        this.isRecing = true;
        recorder.onFrameRecorded = ({
          isLastFrame,
          frameBuffer
        }) => {
          this.buffersArr.push(frameBuffer);
          this.webSocket.send(JSON.stringify({
            business: {
              aue: 'raw',
              cmd: 'auw',
              aus: isLastFrame ? 4 : 2
            },
            data: {
              status: isLastFrame ? 2 : 1,
              data: this.toBase64(frameBuffer),
              data_type: 1
            }
          }));
          if (isLastFrame) {
            this.isRecing = false;
          }
        };
        this.timer = setInterval(() => {
          if (this.countdown > 0) {
            this.countdown--;
          } else {
            clearInterval(this.timer);
            this.countdown = 300;
            recorder.stop();
          }
        }, 1000);
      } else {
        recorder.stop();
        let _this = this;
        _this.loading = true;
        _this.isRecing = false;
        clearInterval(this.timer);
        this.countdown = 300;
        recorder.onStop = function (res) {
          console.log(res);
          console.log(recorder);
          // const audioContext = new AudioContext();
          // const audioSource = audioContext.createBufferSource()
          // console.log(audioContext,audioSource);
          // audioContext.decodeAudioData(res[1], (buffer) => {
          //   console.log(buffer);
          //   audioSource.buffer = buffer;
          //   audioSource.connect(audioContext.destination);
          // })

          // const blob = new Blob(res, { type: 'audio/mp3' });
          // console.log(blob);
          // console.log((window.URL||webkitURL).createObjectURL(blob));

          // this.recordedAudio = URL.createObjectURL(blob);
          // this.$refs.audioPlayer.src = this.recordedAudio;
        };
        console.log('结束');
      }
    },
    // 连接websocket
    connectWebSocket() {
      return this.getWebSocketUrl().then(url => {
        let iseWS;
        if ('WebSocket' in window) {
          iseWS = new WebSocket(url);
        } else if ('MozWebSocket' in window) {
          iseWS = new MozWebSocket(url);
        } else {
          alert('浏览器不支持WebSocket');
          return;
        }
        this.webSocket = iseWS;
        this.webSocket.onopen = e => {
          // 重新开始录音

          recorder.start({
            sampleRate: 16000,
            frameSize: 1280
          });
          var params = {
            common: {
              app_id: APPID
            },
            business: {
              category: 'read_sentence',
              // read_syllable/单字朗读，汉语专有 read_word/词语朗读  read_sentence/句子朗读 https://www.xfyun.cn/doc/Ise/IseAPI.html#%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E6%B5%81%E7%A8%8B
              rstcd: 'utf8',
              group: 'pupil',
              sub: 'ise',
              tte: 'utf-8',
              cmd: 'ssb',
              auf: 'audio/L16;rate=16000',
              ent: this.voicedata.language == 'cn' ? 'cn_vip' : 'en_vip',
              aus: 1,
              aue: 'raw',
              text: '\uFEFF' + this.voicedata.content
            },
            data: {
              status: 0
              // data_type: 1,
              // encoding: "raw",
            }
          };
          this.webSocket.send(JSON.stringify(params));
        };
        this.webSocket.onmessage = e => {
          this.result(e.data);
        };
        this.webSocket.onerror = e => {
          // this.recorderStop()
        };
        this.webSocket.onclose = e => {
          // this.recorderStop()
        };
      });
    },
    // 对处理后的音频数据进行base64编码
    toBase64(buffer) {
      var binary = '';
      var bytes = new Uint8Array(buffer);
      var len = bytes.byteLength;
      for (var i = 0; i < len; i++) {
        binary += String.fromCharCode(bytes[i]);
      }
      return window.btoa(binary);
    },
    result(resultData) {

      // 识别结束
      let jsonData = JSON.parse(resultData);
      if (jsonData.data && jsonData.data.data) {
        // console.log(jsonData.data.data,'jsonData.data.data');
        let data = Base64.decode(jsonData.data.data);
        // console.log(data, 'dasdsadasdasdasdasdasdasdas');
        let grade = parser.parse(data, {
          attributeNamePrefix: '',
          ignoreAttributes: false
        });
        console.log(grade, 'grade结束的这一次');
        if (this.voicedata.language == 'en') {
          this.ratingData = grade?.xml_result?.read_sentence?.rec_paper?.read_chapter;
        } else {
          this.ratingData = grade?.xml_result?.read_sentence?.rec_paper?.read_sentence;
        }
        this.showresult = true;
        // this.blockData.ratingData = this.ratingData
        this.$emit('ratedata', {
          ratingData: this.ratingData,
          ruleIndex: this.ruleIndex,
          dataName: this.blockDataName
        });
        this.loading = false;
        // this.accuracy = readSentence?.accuracy_score;
        // this.fluency= readSentence?.fluency_score;
        // this.integrity= readSentence?.integrity_score;
        // this.phone= readSentence?.phone_score;
        // this.tone= readSentence?.tone_score;
        // this.emotion= readSentence?.emotion_score;
      }
      if (jsonData.code === 0 && jsonData.data.status === 2) {
        this.webSocket.close();
      }
      if (jsonData.code !== 0) {
        this.webSocket.close();
      }
    }
  },
  created() {},
  computed: {
    isEmpty() {
      return !(this.blockData.recordSetList && this.blockData.recordSetList.length);
    }
  }
};

var __$_require_images_voice_icon5_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAiCAYAAAAKyxrjAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUU3NDIwMTdCOTk2MTFFRUI1NTZDRTIwQjAwNDdFQkUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUU3NDIwMThCOTk2MTFFRUI1NTZDRTIwQjAwNDdFQkUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBRTc0MjAxNUI5OTYxMUVFQjU1NkNFMjBCMDA0N0VCRSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBRTc0MjAxNkI5OTYxMUVFQjU1NkNFMjBCMDA0N0VCRSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PhLzVf8AAARHSURBVHja1JhXaFRREIZ3jYrd2LvGFksSa7ArdiyggiiIoIgFBCsoCII+6IsECyqKoIgP+uBDFJRgFDUWRGzYYjf2ltiSaDRqsv4H5so4nLbGkOzAx925c3bOnVvmzJxwJBIJOaQDaMD0e+CrZXxtMBx0Bk1BLrgALgPnZEx6E+3AL5r3BPgcikZUgBbag4LI39LKMLY+2AwKI3q5BLo45lNMArcNPpTvJR4+/mAz1gPXxQQfDGO7g5yIW96B5gYfcWB7xE+WljXAeHBW4zhLM1Zd8GtxE6aDmqAGWC987DTMuVmM2wMSyJYK3jBbEWj4rwEmgWzDndsmxobBSWYvBn3EmCrgGRtTQE+Lj5kMStmY3ZrrWiiuZX60Aao7vprujkkWCAdThX2DYaK9YlwSs1UDj5ktjz4P3WfAZZdPgFWQZ+LAYnAfrAc1Kf/cBFdETrol9LXs90+w0ZDLcoXekv2eRZk6kB2gQOPjrdBb+SRRFWB3sBW0oXPZYA7oC8I84YLbTO8HUph+TBOISaqz33OFbZ/lWrnU9ZmoKq1X50AWSAfXyRZHwQfyFBQyfYbwlWGZJ17oxXRMAAPEGptj8NFQ6IW+AaYTUjqx11X3eo4S+inLPG2FnkfH0eItsfnoaPDhfEVNkmL5/hqBZKar6uKhxVdXoT+l4zBx/rLFR6LQn5RngD3Fnb9lKcPqiCf4GuSzcozLDcv1JAv9TnkG2EHYHlj8pIp5eGZuH4WfvkK/+D8DLBaTNxZjX1j8DBX6GTrWosI8kHxLEa+K/R5MfwZeliXA2uIp3aWKnr92IXFxJhkv9KN0rCbO27qEMZTVAznk20yYAkwSNplB5UJcasl8fBm4xN6E71E0PTOFfqCsAaY4KpjnnlXFMpGMNonX/iPTmxiuR2XgCUzPcmRbr35wi6j7xgl7giiO72h89AI/2JiLVJzzMYfFPEM0xXwms/8CAx31p+pgOrrapZMeTW6mGLOCdQljwStm+wwSNT4mCh9XQAuyNQMHhX2NR4GdQTdftWVxpkG5Hk1uIl247Ljzxbk8x12XQfykxrhU06mEHcHNFv/pEjI0sK4mNyDF0Bgr+Up9XWPHRamnvg58Mfi5pvlEdDSjhxHIaXVDwppNJ5WO6zH9h2OTSUk3WojVJtMn8AqcB0VRZEo152BanlSyeUdFQY7n/w+CafT7G62bj0LRbOBUYqaIp74ysIU9tg0ru8RTDxs00VdBf1DiKtViRdJYcGpXYV4QXCwEqErGVdSU62SE2BFIYw2718ZvRXOcvqkXoJOwqU2yR+y7u0uLvPfGb0Wj8sN7FsAT0JrZ05itRFMFVfoAFYNoPQ3kIVU6qVS2BbLd5CMWsuhIcIT6xxDb2UtmhX+yaRMqVpaJCdQDVtfYJtp29GJlmcigbcoScX6/Y7sy5hb65aynLKJ91TzXvmgsyVaqXNRivshnb/S3AAMAp9T1voGemc8AAAAASUVORK5CYII=";

/* script */
const __vue_script__$4o = script$4o;
var __vue_render__$4o = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "xml-recorder-container",
      class: "xml-recorder-container-" + _vm.pageType,
      style: [
        {
          "--themecolor": _vm.voicedata.ThemeColor
            ? _vm.voicedata.ThemeColor
            : "#2D5DD8",
        },
      ],
      attrs: { id: _vm.blockId },
      on: { click: _vm.blockClick },
    },
    [
      [
        _c("div", { staticClass: "fixed-voice-container" }, [
          _c(
            "div",
            {
              class: [
                "xml-voice__wrapper",
                "style-mode--" + _vm.blockData.styleMode,
                _vm.mode,
              ],
            },
            [
              _c(
                "div",
                { staticClass: "xml-recorder-player-box xml-group-item" },
                [
                  _c("div", { staticClass: "voice-image-con" }, [
                    _vm.voicedata.imgurl
                      ? _c("img", {
                          style: { width: _vm.voicedata.imgWidth + "%" },
                          attrs: { src: _vm.voicedata.imgurl, alt: "" },
                        })
                      : _c("div", [_vm._v(_vm._s(_vm.voicedata.content))]),
                  ]),
                  _vm._v(" "),
                  _c("div", { staticClass: "btn-group" }, [
                    _c("div", { on: { click: _vm.togglePlay } }, [
                      _c(
                        "div",
                        {
                          staticClass: "icon-box",
                          staticStyle: {
                            "background-color": "var(--themecolor)",
                          },
                        },
                        [
                          _c("img", {
                            staticClass: "img1",
                            attrs: {
                              src: _vm.isPlay ? _vm.audioplay : _vm.audiopluse,
                              alt: "",
                            },
                          }),
                        ]
                      ),
                      _vm._v(" "),
                      _c("span", { staticClass: "text" }, [
                        _vm._v(
                          _vm._s(
                            _vm.voicedata.btntype == "en"
                              ? "listen"
                              : "原音试听"
                          )
                        ),
                      ]),
                    ]),
                    _vm._v(" "),
                    _c(
                      "div",
                      {
                        on: {
                          click: function ($event) {
                            $event.stopPropagation();
                            return _vm.ontrolBtn.apply(null, arguments)
                          },
                        },
                      },
                      [
                        _c(
                          "div",
                          {
                            staticClass: "icon-box",
                            staticStyle: {
                              "background-color": "var(--themecolor)",
                            },
                          },
                          [
                            !_vm.isRecing
                              ? _c("img", {
                                  staticClass: "img4",
                                  attrs: { src: _vm.playIcon, alt: "" },
                                })
                              : _c("img", {
                                  staticClass: "img2",
                                  attrs: { src: _vm.pauseIcon, alt: "" },
                                }),
                          ]
                        ),
                        _vm._v(" "),
                        _c("span", { staticClass: "text" }, [
                          _vm._v(
                            _vm._s(
                              _vm.voicedata.btntype == "en"
                                ? "record"
                                : "点击话筒，录音测验"
                            )
                          ),
                        ]),
                      ]
                    ),
                    _vm._v(" "),
                    _c(
                      "div",
                      {
                        on: {
                          click: function ($event) {
                            _vm.ratingData.total_score
                              ? (_vm.showresult = true)
                              : "";
                          },
                        },
                      },
                      [
                        _vm._m(0),
                        _vm._v(" "),
                        _c("span", { staticClass: "text" }, [
                          _vm._v(
                            _vm._s(
                              _vm.voicedata.btntype == "en"
                                ? "check out"
                                : "评分查看"
                            )
                          ),
                        ]),
                      ]
                    ),
                  ]),
                  _vm._v(" "),
                  _vm.voicedata.isProgress != "none"
                    ? _c(
                        "div",
                        {
                          staticClass: "play-box",
                          staticStyle: {
                            "background-color": "var(--themecolor)",
                          },
                        },
                        [
                          _c(
                            "div",
                            {
                              staticClass: "play-icon",
                              on: { click: _vm.togglePlay },
                            },
                            [
                              _c("img", {
                                attrs: {
                                  src: _vm.isPlay ? _vm.audioplay : _vm.statr,
                                  alt: "",
                                },
                              }),
                            ]
                          ),
                          _vm._v(" "),
                          _c("div", { staticClass: "text" }, [
                            _vm._v(
                              "\n                " +
                                _vm._s(_vm.playCurrentTime) +
                                " / " +
                                _vm._s(_vm.playDuration) +
                                "\n              "
                            ),
                          ]),
                          _vm._v(" "),
                          _c(
                            "div",
                            { staticClass: "slider-box" },
                            [
                              _c("el-slider", {
                                attrs: {
                                  max: _vm.totalDuration,
                                  disabled: _vm.voicedata.progress !== "1",
                                  "show-tooltip": false,
                                },
                                on: { change: _vm.changeTime },
                                model: {
                                  value: _vm.playTime,
                                  callback: function ($$v) {
                                    _vm.playTime = $$v;
                                  },
                                  expression: "playTime",
                                },
                              }),
                            ],
                            1
                          ),
                          _vm._v(" "),
                          _c("div", { staticClass: "text" }, [
                            _vm._v("原音试听"),
                          ]),
                        ]
                      )
                    : _vm._e(),
                ]
              ),
            ]
          ),
        ]),
      ],
      _vm._v(" "),
      _c(
        "el-dialog",
        {
          style: [
            {
              "--themecolor": _vm.voicedata.ThemeColor
                ? _vm.voicedata.ThemeColor
                : "#2D5DD8",
            },
          ],
          attrs: {
            title: "查看分数",
            visible: _vm.showresult,
            width:
              _vm.pageType != "pc" && _vm.mode != "editor" ? "80vw" : "456px",
            top: "50vh",
            modal: false,
            "show-close": true,
            "append-to-body": "",
            "close-on-click-modal": true,
            "custom-class": "xml-voice-container",
          },
          on: {
            "update:visible": function ($event) {
              _vm.showresult = $event;
            },
          },
        },
        [
          _c("div", { staticClass: "xml-result-con" }, [
            _c(
              "div",
              { staticClass: "total" },
              [
                _c("div", { staticClass: "number-box" }, [
                  _c("div", [_vm._v("满分100分")]),
                  _vm._v(" "),
                  _c("div", [
                    _c("span", [
                      _vm._v(
                        _vm._s(Number(_vm.ratingData.total_score).toFixed(0))
                      ),
                    ]),
                    _vm._v("分\n          "),
                  ]),
                ]),
                _vm._v(" "),
                _c("el-progress", {
                  attrs: {
                    type: "circle",
                    percentage: Number(_vm.ratingData.total_score),
                    "stroke-width": 8,
                    color: _vm.voicedata.ThemeColor,
                    "show-text": false,
                  },
                }),
                _vm._v(" "),
                _c(
                  "div",
                  {
                    staticClass: "comprehensive",
                    style: { background: _vm.voicedata.ThemeColor },
                  },
                  [_vm._v("综合评分")]
                ),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "score-item-box" }, [
              _c("div", [
                _c("div", [
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      attrs: {
                        t: "1705998006086",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "11718",
                        width: "16",
                        height: "16",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M450.484288 840.399261L160.887246 543.231054l49.212569-70.033272 236.598891 181.707948L946.395564 246.062847C857.434381 100.31793 694.654344 1.892791 511.053604 1.892791 229.027726 1.892791 0 230.920518 0 512.946396s229.027726 511.053604 511.053604 511.053604 511.053604-229.027726 511.053605-511.053604c0-70.033272-13.249538-136.280961-39.748614-196.850278L450.484288 840.399261z",
                          fill: _vm.voicedata.ThemeColor,
                          "p-id": "11719",
                        },
                      }),
                    ]
                  ),
                  _vm._v(" "),
                  _c("span", [_vm._v("准确度分")]),
                ]),
                _vm._v(" "),
                _c("span", [
                  _vm._v(
                    _vm._s(Number(_vm.ratingData.accuracy_score).toFixed(2))
                  ),
                ]),
              ]),
              _vm._v(" "),
              _c("div", [
                _c("div", [
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      attrs: {
                        t: "1705998006086",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "11718",
                        width: "16",
                        height: "16",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M450.484288 840.399261L160.887246 543.231054l49.212569-70.033272 236.598891 181.707948L946.395564 246.062847C857.434381 100.31793 694.654344 1.892791 511.053604 1.892791 229.027726 1.892791 0 230.920518 0 512.946396s229.027726 511.053604 511.053604 511.053604 511.053604-229.027726 511.053605-511.053604c0-70.033272-13.249538-136.280961-39.748614-196.850278L450.484288 840.399261z",
                          fill: _vm.voicedata.ThemeColor,
                          "p-id": "11719",
                        },
                      }),
                    ]
                  ),
                  _vm._v(" "),
                  _c("span", [_vm._v("流畅度分")]),
                ]),
                _vm._v(" "),
                _c("span", [
                  _vm._v(
                    _vm._s(Number(_vm.ratingData.fluency_score).toFixed(2))
                  ),
                ]),
              ]),
              _vm._v(" "),
              _c("div", [
                _c("div", [
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      attrs: {
                        t: "1705998006086",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "11718",
                        width: "16",
                        height: "16",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M450.484288 840.399261L160.887246 543.231054l49.212569-70.033272 236.598891 181.707948L946.395564 246.062847C857.434381 100.31793 694.654344 1.892791 511.053604 1.892791 229.027726 1.892791 0 230.920518 0 512.946396s229.027726 511.053604 511.053604 511.053604 511.053604-229.027726 511.053605-511.053604c0-70.033272-13.249538-136.280961-39.748614-196.850278L450.484288 840.399261z",
                          fill: _vm.voicedata.ThemeColor,
                          "p-id": "11719",
                        },
                      }),
                    ]
                  ),
                  _vm._v(" "),
                  _c("span", [_vm._v("完整度分")]),
                ]),
                _vm._v(" "),
                _c("span", [
                  _vm._v(
                    _vm._s(Number(_vm.ratingData.integrity_score).toFixed(2))
                  ),
                ]),
              ]),
              _vm._v(" "),
              _c(
                "div",
                { class: _vm.voicedata.language == "cn" ? "" : "Gray" },
                [
                  _c("div", [
                    _c(
                      "svg",
                      {
                        staticClass: "icon",
                        attrs: {
                          t: "1705998006086",
                          viewBox: "0 0 1024 1024",
                          version: "1.1",
                          xmlns: "http://www.w3.org/2000/svg",
                          "p-id": "11718",
                          width: "16",
                          height: "16",
                        },
                      },
                      [
                        _c("path", {
                          attrs: {
                            d: "M450.484288 840.399261L160.887246 543.231054l49.212569-70.033272 236.598891 181.707948L946.395564 246.062847C857.434381 100.31793 694.654344 1.892791 511.053604 1.892791 229.027726 1.892791 0 230.920518 0 512.946396s229.027726 511.053604 511.053604 511.053604 511.053604-229.027726 511.053605-511.053604c0-70.033272-13.249538-136.280961-39.748614-196.850278L450.484288 840.399261z",
                            fill:
                              _vm.voicedata.language == "cn"
                                ? _vm.voicedata.ThemeColor
                                : "#ccc",
                            "p-id": "11719",
                          },
                        }),
                      ]
                    ),
                    _vm._v(" "),
                    _c("span", [_vm._v("声韵分")]),
                  ]),
                  _vm._v(" "),
                  _c("span", [
                    _vm._v(
                      _vm._s(
                        _vm.voicedata.language == "cn"
                          ? Number(_vm.ratingData.phone_score).toFixed(2)
                          : "-"
                      )
                    ),
                  ]),
                ]
              ),
              _vm._v(" "),
              _c(
                "div",
                { class: _vm.voicedata.language == "cn" ? "" : "Gray" },
                [
                  _c("div", [
                    _c(
                      "svg",
                      {
                        staticClass: "icon",
                        attrs: {
                          t: "1705998006086",
                          viewBox: "0 0 1024 1024",
                          version: "1.1",
                          xmlns: "http://www.w3.org/2000/svg",
                          "p-id": "11718",
                          width: "16",
                          height: "16",
                        },
                      },
                      [
                        _c("path", {
                          attrs: {
                            d: "M450.484288 840.399261L160.887246 543.231054l49.212569-70.033272 236.598891 181.707948L946.395564 246.062847C857.434381 100.31793 694.654344 1.892791 511.053604 1.892791 229.027726 1.892791 0 230.920518 0 512.946396s229.027726 511.053604 511.053604 511.053604 511.053604-229.027726 511.053605-511.053604c0-70.033272-13.249538-136.280961-39.748614-196.850278L450.484288 840.399261z",
                            fill:
                              _vm.voicedata.language == "cn"
                                ? _vm.voicedata.ThemeColor
                                : "#ccc",
                            "p-id": "11719",
                          },
                        }),
                      ]
                    ),
                    _vm._v(" "),
                    _c("span", [_vm._v("调型分")]),
                  ]),
                  _vm._v(" "),
                  _c("span", [
                    _vm._v(
                      _vm._s(
                        _vm.voicedata.language == "cn"
                          ? Number(_vm.ratingData.tone_score).toFixed(2)
                          : "-"
                      )
                    ),
                  ]),
                ]
              ),
              _vm._v(" "),
              _c(
                "div",
                { class: _vm.voicedata.language == "cn" ? "" : "Gray" },
                [
                  _c("div", [
                    _c(
                      "svg",
                      {
                        staticClass: "icon",
                        attrs: {
                          t: "1705998006086",
                          viewBox: "0 0 1024 1024",
                          version: "1.1",
                          xmlns: "http://www.w3.org/2000/svg",
                          "p-id": "11718",
                          width: "16",
                          height: "16",
                        },
                      },
                      [
                        _c("path", {
                          attrs: {
                            d: "M450.484288 840.399261L160.887246 543.231054l49.212569-70.033272 236.598891 181.707948L946.395564 246.062847C857.434381 100.31793 694.654344 1.892791 511.053604 1.892791 229.027726 1.892791 0 230.920518 0 512.946396s229.027726 511.053604 511.053604 511.053604 511.053604-229.027726 511.053605-511.053604c0-70.033272-13.249538-136.280961-39.748614-196.850278L450.484288 840.399261z",
                            fill:
                              _vm.voicedata.language == "cn"
                                ? _vm.voicedata.ThemeColor
                                : "#ccc",
                            "p-id": "11719",
                          },
                        }),
                      ]
                    ),
                    _vm._v(" "),
                    _c("span", [_vm._v("整体印象分")]),
                  ]),
                  _vm._v(" "),
                  _c("span", [
                    _vm._v(
                      _vm._s(
                        _vm.voicedata.language == "cn"
                          ? Number(_vm.ratingData.emotion_score).toFixed(2)
                          : "-"
                      )
                    ),
                  ]),
                ]
              ),
            ]),
          ]),
        ]
      ),
      _vm._v(" "),
      _c("audio", {
        ref: "recordAudio",
        staticClass: "audio-component",
        attrs: {
          controls: "",
          preload: "auto",
          src: _vm.voicedata.recordDataUrl,
          loop: _vm.voicedata.model == "1" ? true : false,
        },
        on: {
          canplay: _vm.changeDuration,
          timeupdate: _vm.updateTime,
          pause: function ($event) {
            _vm.isPlay = false;
          },
        },
      }),
    ],
    2
  )
};
var __vue_staticRenderFns__$4o = [
  function () {
    var _vm = this;
    var _h = _vm.$createElement;
    var _c = _vm._self._c || _h;
    return _c(
      "div",
      {
        staticClass: "icon-box",
        staticStyle: { "background-color": "var(--themecolor)" },
      },
      [
        _c("img", {
          staticClass: "img3",
          attrs: { src: __$_require_images_voice_icon5_png__, alt: "" },
        }),
      ]
    )
  },
];
__vue_render__$4o._withStripped = true;

  /* style */
  const __vue_inject_styles__$4o = undefined;
  /* scoped */
  const __vue_scope_id__$4o = undefined;
  /* module identifier */
  const __vue_module_identifier__$4o = undefined;
  /* functional template */
  const __vue_is_functional_template__$4o = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4o = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4o, staticRenderFns: __vue_staticRenderFns__$4o },
    __vue_inject_styles__$4o,
    __vue_script__$4o,
    __vue_scope_id__$4o,
    __vue_is_functional_template__$4o,
    __vue_module_identifier__$4o,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$4o.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('single-recorder-group-render', {
    prefix: options.prefix
  }), __vue_component__$4o);
};

class DomUtils {
  static config = {
    MIN_LIMIT: 20,
    // Min size of zone
    DECIMAL_PLACES: 4 // Hotzone positioning decimal point limit number of digits
  };

  /**
   * Get a power result of 10 for the power of the constant
   * @return {Number}
   */
  static getMultiple = (decimalPlaces = this.config.DECIMAL_PLACES) => 10 ** decimalPlaces;

  /**
   * Limit decimal places
   * @param  {Number} num
   * @return {Number}
   */
  static decimalPoint = (val = 0) => Math.round(val * this.getMultiple()) / this.getMultiple() || 0;

  /**
   * Get element width and height
   * @param  {Object} elem
   * @return {Object}
   */
  static getOffset = (elem = {}) => ({
    width: elem.clientWidth || 0,
    height: elem.clientHeight || 0
  });

  /**
   * Get pageX
   * @param  {Object} e
   * @return {Number}
   */
  static getPageX = e => 'pageX' in e ? e.pageX : e.touches[0].pageX;

  /**
   * Get pageY
   * @param  {Object} e
   * @return {Number}
   */
  static getPageY = e => 'pageY' in e ? e.pageY : e.touches[0].pageY;

  /**
   * Gets the abscissa value of the mouse click relative to the target node
   * @param  {Object} e
   * @param  {Object} container
   * @return {Number}
   */
  static getDistanceX = (e, container) => this.getPageX(e) - (container.getBoundingClientRect().left + window.pageXOffset);

  /**
   * Gets the ordinate value of the mouse click relative to the target node
   * @param  {Object} e
   * @param  {Object} container
   * @return {Number}
   */
  static getDistanceY = (e, container) => this.getPageY(e) - (container.getBoundingClientRect().top + window.pageYOffset);

  /**
   * Treatment of boundary conditions when changing the size of the hotzone
   * @param {Object} itemInfo
   * @param {Object} styleInfo
   * @param {Object} container
   */
  static dealEdgeValue = (itemInfo, styleInfo, container) => {
    if (styleInfo.hasOwnProperty('left') && styleInfo.left < 0) {
      styleInfo.left = 0;
      styleInfo.width = itemInfo.width + itemInfo.left;
    }
    if (styleInfo.hasOwnProperty('top') && styleInfo.top < 0) {
      styleInfo.top = 0;
      styleInfo.height = itemInfo.height + itemInfo.top;
    }
    if (!styleInfo.hasOwnProperty('left') && styleInfo.hasOwnProperty('width')) {
      if (itemInfo.left + styleInfo.width > container.width) {
        styleInfo.width = container.width - itemInfo.left;
      }
    }
    if (!styleInfo.hasOwnProperty('top') && styleInfo.hasOwnProperty('height')) {
      if (itemInfo.top + styleInfo.height > container.height) {
        styleInfo.height = container.height - itemInfo.top;
      }
    }
    return Object.assign(itemInfo, styleInfo);
  };

  /**
   * Handle different drag points, capital letters mean: T-top，L-left，C-center，R-right，B-bottom
   * @param  {Object} itemInfo
   * @param  {Number} moveX
   * @param  {Number} moveY
   * @return {Object}
   */
  static dealTL = (itemInfo, moveX, moveY, minLimit = this.config.MIN_LIMIT) => {
    const styleInfo = {};
    const width = itemInfo.width - moveX;
    const height = itemInfo.height - moveY;
    if (width >= Math.min(minLimit, itemInfo.width)) {
      Object.assign(styleInfo, {
        width,
        left: itemInfo.left + moveX
      });
    }
    if (height >= Math.min(minLimit, itemInfo.height)) {
      Object.assign(styleInfo, {
        height,
        top: itemInfo.top + moveY
      });
    }
    return styleInfo;
  };
  static dealTC = (itemInfo, moveX, moveY, minLimit = this.config.MIN_LIMIT) => {
    let styleInfo = {};
    const height = itemInfo.height - moveY;
    if (height >= Math.min(minLimit, itemInfo.height)) {
      styleInfo = {
        height,
        top: itemInfo.top + moveY
      };
    }
    return styleInfo;
  };
  static dealTR = (itemInfo, moveX, moveY, minLimit = this.config.MIN_LIMIT) => {
    const styleInfo = {};
    const width = itemInfo.width + moveX;
    const height = itemInfo.height - moveY;
    if (width >= Math.min(minLimit, itemInfo.width)) {
      Object.assign(styleInfo, {
        width
      });
    }
    if (height >= Math.min(minLimit, itemInfo.height)) {
      Object.assign(styleInfo, {
        height,
        top: itemInfo.top + moveY
      });
    }
    return styleInfo;
  };
  static dealCL = (itemInfo, moveX, moveY, minLimit = this.config.MIN_LIMIT) => {
    const styleInfo = {};
    const width = itemInfo.width - moveX;
    if (width >= Math.min(minLimit, itemInfo.width)) {
      Object.assign(styleInfo, {
        width,
        left: itemInfo.left + moveX
      });
    }
    return styleInfo;
  };
  static dealCR = (itemInfo, moveX, moveY, minLimit = this.config.MIN_LIMIT) => {
    const styleInfo = {};
    const width = itemInfo.width + moveX;
    if (width >= Math.min(minLimit, itemInfo.width)) {
      Object.assign(styleInfo, {
        width
      });
    }
    return styleInfo;
  };
  static dealBL = (itemInfo, moveX, moveY, minLimit = this.config.MIN_LIMIT) => {
    const styleInfo = {};
    const width = itemInfo.width - moveX;
    const height = itemInfo.height + moveY;
    if (width >= Math.min(minLimit, itemInfo.width)) {
      Object.assign(styleInfo, {
        width,
        left: itemInfo.left + moveX
      });
    }
    if (height >= Math.min(minLimit, itemInfo.height)) {
      Object.assign(styleInfo, {
        height
      });
    }
    return styleInfo;
  };
  static dealBC = (itemInfo, moveX, moveY, minLimit = this.config.MIN_LIMIT) => {
    const styleInfo = {};
    const height = itemInfo.height + moveY;
    if (height >= Math.min(minLimit, itemInfo.height)) {
      Object.assign(styleInfo, {
        height
      });
    }
    return styleInfo;
  };
  static dealBR = (itemInfo, moveX, moveY, minLimit = this.config.MIN_LIMIT) => {
    const styleInfo = {};
    const width = itemInfo.width + moveX;
    const height = itemInfo.height + moveY;
    if (width >= Math.min(minLimit, itemInfo.width)) {
      Object.assign(styleInfo, {
        width
      });
    }
    if (height >= Math.min(minLimit, itemInfo.height)) {
      Object.assign(styleInfo, {
        height
      });
    }
    return styleInfo;
  };
}

var changeSize = {
  bind(el, binding, vnode) {
    if (!vnode.context.isInCreater) {
      return;
    }
    el.addEventListener('mousedown', handleMouseDown);
    function handleMouseDown(e) {
      const pointer = e.target.dataset.pointer;
      if (!pointer) {
        return;
      }
      e.stopPropagation();
      const zone = el.parentNode;
      const setting = vnode.context.setting;
      const container = DomUtils.getOffset(zone.parentNode);
      let itemInfo = {
        width: DomUtils.getOffset(zone).width || 0,
        height: DomUtils.getOffset(zone).height || 0,
        top: setting.topPer * container.height || 0,
        left: setting.leftPer * container.width || 0
      };
      let preX = DomUtils.getPageX(e);
      let preY = DomUtils.getPageY(e);
      let flag;

      // Hide the info displayed by hover
      vnode.context.handlehideZone(true);
      window.addEventListener('mousemove', handleChange);
      window.addEventListener('mouseup', handleMouseUp);

      // eslint-disable-next-line no-shadow
      function handleChange(e) {
        e.preventDefault();
        flag = true;
        const moveX = DomUtils.getPageX(e) - preX;
        const moveY = DomUtils.getPageY(e) - preY;
        preX = DomUtils.getPageX(e);
        preY = DomUtils.getPageY(e);

        // Handling the situation when different dragging points are selected
        const styleInfo = DomUtils[pointer](itemInfo, moveX, moveY);

        // Boundary value processing
        itemInfo = DomUtils.dealEdgeValue(itemInfo, styleInfo, container);
        Object.assign(zone.style, {
          top: `${itemInfo.top}px`,
          left: `${itemInfo.left}px`,
          width: `${itemInfo.width}px`,
          height: `${itemInfo.height}px`
        });
      }
      function handleMouseUp() {
        if (flag) {
          flag = false;
          const perInfo = {
            topPer: DomUtils.decimalPoint(itemInfo.top / container.height),
            leftPer: DomUtils.decimalPoint(itemInfo.left / container.width),
            widthPer: DomUtils.decimalPoint(itemInfo.width / container.width),
            heightPer: DomUtils.decimalPoint(itemInfo.height / container.height)
          };
          vnode.context.changeInfo(perInfo);

          // 兼容数据无变更情况下导致 computed 不更新，数据仍为 px 时 resize 出现的问题
          Object.assign(zone.style, {
            top: `${itemInfo.top}px`,
            left: `${itemInfo.left}px`,
            width: `${itemInfo.width}px`,
            height: `${itemInfo.height}px`
          });
        }
        // Show the info
        vnode.context.handlehideZone(false);
        window.removeEventListener('mousemove', handleChange);
        window.removeEventListener('mouseup', handleMouseUp);
      }
    }
    el.$destroy = () => el.removeEventListener('mousedown', handleMouseDown);
  },
  unbind(el) {
    el && el.$destroy && el.$destroy();
  }
};

console.log('工具函数集', DomUtils);
var dragItem = {
  bind(el, binding, vnode) {
    if (!vnode.context.isInCreater) {
      return;
    }
    el.addEventListener('mousedown', handleMouseDown);
    function handleMouseDown(e) {
      e.stopPropagation();
      const container = DomUtils.getOffset(el.parentNode);
      const preX = DomUtils.getPageX(e);
      const preY = DomUtils.getPageY(e);
      let topPer;
      let leftPer;
      let flag;
      window.addEventListener('mousemove', handleChange);
      window.addEventListener('mouseup', handleMouseUp);

      // eslint-disable-next-line no-shadow
      function handleChange(e) {
        e.preventDefault();
        flag = true;

        // Hide the info displayed by hover
        vnode.context.handlehideZone(true);
        const setting = vnode.context.setting;
        let moveX = DomUtils.getPageX(e) - preX;
        let moveY = DomUtils.getPageY(e) - preY;
        setting.topPer = setting.topPer || 0;
        setting.leftPer = setting.leftPer || 0;
        topPer = DomUtils.decimalPoint(moveY / container.height + setting.topPer);
        leftPer = DomUtils.decimalPoint(moveX / container.width + setting.leftPer);

        // Hotzone moving boundary processing
        if (topPer < 0) {
          topPer = 0;
          moveY = -container.height * setting.topPer;
        }
        if (leftPer < 0) {
          leftPer = 0;
          moveX = -container.width * setting.leftPer;
        }
        if (topPer + setting.heightPer > 1) {
          topPer = 1 - setting.heightPer;
          moveY = container.height * (topPer - setting.topPer);
        }
        if (leftPer + setting.widthPer > 1) {
          leftPer = 1 - setting.widthPer;
          moveX = container.width * (leftPer - setting.leftPer);
        }
        el.style.transform = `translate(${moveX}px, ${moveY}px)`;
      }
      function handleMouseUp() {
        if (flag) {
          flag = false;
          el.style.transform = 'translate(0, 0)';
          vnode.context.changeInfo({
            topPer,
            leftPer
          });
        }

        // Show the info
        vnode.context.handlehideZone(false);
        window.removeEventListener('mousemove', handleChange);
        window.removeEventListener('mouseup', handleMouseUp);
      }
    }
    el.$destroy = () => el.removeEventListener('mousedown', handleMouseDown);
  },
  unbind(el) {
    el && el.$destroy && el.$destroy();
  }
};

//
var script$4n = {
  name: 'Zone',
  directives: {
    changeSize,
    dragItem
  },
  props: {
    index: {
      type: [Number, String],
      default: ''
    },
    setting: {
      type: [Object],
      default: () => ({})
    },
    isInCreater: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      zoneTop: '',
      zoneLeft: '',
      zoneWidth: '',
      zoneHeight: '',
      hideZone: false,
      tooSmall: false
    };
  },
  computed: {
    hoverTitle() {
      let {
        hotTarget
      } = this.setting;
      let text = '';
      if (hotTarget) {
        switch (hotTarget.type) {
          case 'link':
            text = '链接';
            break;
          case 'looseleaf':
            text = '活页';
            break;
          case 'chapter':
            text = '章节';
            break;
        }
      }
      return text;
    }
  },
  watch: {
    setting: {
      handler(val) {
        this.setZoneInfo(val);
      },
      deep: true
    }
  },
  mounted() {
    this.setZoneInfo(this.setting);
  },
  methods: {
    setZoneInfo(val) {
      this.zoneTop = this.getZoneStyle(val.topPer);
      this.zoneLeft = this.getZoneStyle(val.leftPer);
      this.zoneWidth = this.getZoneStyle(val.widthPer);
      this.zoneHeight = this.getZoneStyle(val.heightPer);
      this.tooSmall = val.widthPer < 0.01 && val.heightPer < 0.01;
    },
    handlehideZone(isHide = true) {
      if (this.hideZone === isHide) {
        return;
      }
      this.hideZone = isHide;
    },
    changeInfo(info = {}) {
      const {
        index
      } = this;
      this.$emit('changeInfo', {
        info,
        index
      });
    },
    delItem(index) {
      this.$emit('delItem', index);
    },
    getZoneStyle(val) {
      return `${(val || 0) * 100}%`;
    }
  }
};

/* script */
const __vue_script__$4n = script$4n;

/* template */
var __vue_render__$4n = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      directives: [{ name: "drag-item", rawName: "v-drag-item" }],
      style: {
        top: _vm.zoneTop,
        left: _vm.zoneLeft,
        width: _vm.zoneWidth,
        height: _vm.zoneHeight,
      },
      attrs: { title: _vm.hoverTitle },
    },
    [
      _c(
        "ul",
        {
          directives: [{ name: "change-size", rawName: "v-change-size" }],
          staticClass: "hz-m-box",
          class: {
            "hz-z-hidden": _vm.tooSmall,
            "hz-m-hoverbox": !_vm.hideZone,
          },
        },
        [
          _c(
            "li",
            {
              staticClass: "hz-u-index",
              attrs: { title: "热区" + (_vm.index + 1) },
            },
            [_vm._v(_vm._s(_vm.isInCreater ? "热区" + (_vm.index + 1) : ""))]
          ),
          _vm._v(" "),
          _c(
            "li",
            {
              directives: [
                {
                  name: "show",
                  rawName: "v-show",
                  value: !_vm.hideZone && _vm.isInCreater,
                  expression: "!hideZone && isInCreater",
                },
              ],
              staticClass: "hz-u-close",
              attrs: { title: "删除该热区" },
              on: {
                click: function ($event) {
                  $event.stopPropagation();
                  return _vm.delItem(_vm.index)
                },
              },
            },
            [
              _c(
                "svg",
                {
                  staticClass: "hz-u-close-icon",
                  attrs: {
                    xmlns: "http://www.w3.org/2000/svg",
                    viewBox: "0 0 1024 1024",
                  },
                },
                [
                  _c("path", {
                    attrs: {
                      d: "M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1\n          191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0\n          0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z",
                    },
                  }),
                ]
              ),
            ]
          ),
          _vm._v(" "),
          _c("li", {
            directives: [
              {
                name: "show",
                rawName: "v-show",
                value: _vm.isInCreater,
                expression: "isInCreater",
              },
            ],
            staticClass: "hz-u-square hz-u-square-tl",
            attrs: { "data-pointer": "dealTL" },
          }),
          _vm._v(" "),
          _c("li", {
            directives: [
              {
                name: "show",
                rawName: "v-show",
                value: _vm.isInCreater,
                expression: "isInCreater",
              },
            ],
            staticClass: "hz-u-square hz-u-square-tc",
            attrs: { "data-pointer": "dealTC" },
          }),
          _vm._v(" "),
          _c("li", {
            directives: [
              {
                name: "show",
                rawName: "v-show",
                value: _vm.isInCreater,
                expression: "isInCreater",
              },
            ],
            staticClass: "hz-u-square hz-u-square-tr",
            attrs: { "data-pointer": "dealTR" },
          }),
          _vm._v(" "),
          _c("li", {
            directives: [
              {
                name: "show",
                rawName: "v-show",
                value: _vm.isInCreater,
                expression: "isInCreater",
              },
            ],
            staticClass: "hz-u-square hz-u-square-cl",
            attrs: { "data-pointer": "dealCL" },
          }),
          _vm._v(" "),
          _c("li", {
            directives: [
              {
                name: "show",
                rawName: "v-show",
                value: _vm.isInCreater,
                expression: "isInCreater",
              },
            ],
            staticClass: "hz-u-square hz-u-square-cr",
            attrs: { "data-pointer": "dealCR" },
          }),
          _vm._v(" "),
          _c("li", {
            directives: [
              {
                name: "show",
                rawName: "v-show",
                value: _vm.isInCreater,
                expression: "isInCreater",
              },
            ],
            staticClass: "hz-u-square hz-u-square-bl",
            attrs: { "data-pointer": "dealBL" },
          }),
          _vm._v(" "),
          _c("li", {
            directives: [
              {
                name: "show",
                rawName: "v-show",
                value: _vm.isInCreater,
                expression: "isInCreater",
              },
            ],
            staticClass: "hz-u-square hz-u-square-bc",
            attrs: { "data-pointer": "dealBC" },
          }),
          _vm._v(" "),
          _c("li", {
            directives: [
              {
                name: "show",
                rawName: "v-show",
                value: _vm.isInCreater,
                expression: "isInCreater",
              },
            ],
            staticClass: "hz-u-square hz-u-square-br",
            attrs: { "data-pointer": "dealBR" },
          }),
        ]
      ),
    ]
  )
};
var __vue_staticRenderFns__$4n = [];
__vue_render__$4n._withStripped = true;

  /* style */
  const __vue_inject_styles__$4n = undefined;
  /* scoped */
  const __vue_scope_id__$4n = undefined;
  /* module identifier */
  const __vue_module_identifier__$4n = undefined;
  /* functional template */
  const __vue_is_functional_template__$4n = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4n = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4n, staticRenderFns: __vue_staticRenderFns__$4n },
    __vue_inject_styles__$4n,
    __vue_script__$4n,
    __vue_scope_id__$4n,
    __vue_is_functional_template__$4n,
    __vue_module_identifier__$4n,
    false,
    undefined,
    undefined,
    undefined
  );

var addItem = {
  bind(el, binding, vnode) {
    const MIN_LIMIT = DomUtils.config.MIN_LIMIT;
    if (!vnode.context.isInCreater) {
      return;
    }
    el.addEventListener('mousedown', handleMouseDown);
    function handleMouseDown(e) {
      e.preventDefault();
      if (vnode.context?.zones?.length >= vnode.context.max) {
        vnode.context.onMaxCount();
        return;
      }
      let itemInfo = {
        top: DomUtils.getDistanceY(e, el),
        left: DomUtils.getDistanceX(e, el),
        width: 0,
        height: 0
      };
      const container = DomUtils.getOffset(el);

      // Only used once at the beginning of init
      const setting = {
        topPer: DomUtils.decimalPoint(itemInfo.top / container.height),
        leftPer: DomUtils.decimalPoint(itemInfo.left / container.width),
        widthPer: 0,
        heightPer: 0,
        hotTarget: {
          type: null,
          value: ''
        }
      };
      let preX = DomUtils.getPageX(e);
      let preY = DomUtils.getPageY(e);
      vnode.context.addItem(setting);
      window.addEventListener('mousemove', handleChange);
      window.addEventListener('mouseup', handleMouseUp);

      // eslint-disable-next-line no-shadow
      function handleChange(e) {
        e.preventDefault();
        const moveX = DomUtils.getPageX(e) - preX;
        const moveY = DomUtils.getPageY(e) - preY;
        preX = DomUtils.getPageX(e);
        preY = DomUtils.getPageY(e);

        // Not consider the direction of movement first, consider only the lower right drag point
        const minLimit = 0;
        const styleInfo = DomUtils.dealBR(itemInfo, moveX, moveY, minLimit);

        // Boundary value processing
        itemInfo = DomUtils.dealEdgeValue(itemInfo, styleInfo, container);
        Object.assign(el.lastElementChild.style, {
          top: `${itemInfo.top}px`,
          left: `${itemInfo.left}px`,
          width: `${itemInfo.width}px`,
          height: `${itemInfo.height}px`
        });
      }
      function handleMouseUp() {
        const perInfo = {
          topPer: DomUtils.decimalPoint(itemInfo.top / container.height),
          leftPer: DomUtils.decimalPoint(itemInfo.left / container.width),
          widthPer: DomUtils.decimalPoint(itemInfo.width / container.width),
          heightPer: DomUtils.decimalPoint(itemInfo.height / container.height),
          hotTarget: {
            type: null,
            value: ''
          }
        };
        if (vnode.context.isOverRange()) {
          console.log('isOverRange!!!!!!!!!!');
          vnode.context.overRange();
        } else if (container.height < MIN_LIMIT && itemInfo.width > MIN_LIMIT) {
          vnode.context.changeItem(Object.assign(perInfo, {
            topPer: 0,
            heightPer: 1
          }));
        } else if (container.width < MIN_LIMIT && itemInfo.height > MIN_LIMIT) {
          vnode.context.changeItem(Object.assign(perInfo, {
            leftper: 0,
            widthPer: 1
          }));
        } else if (itemInfo.width > MIN_LIMIT && itemInfo.height > MIN_LIMIT) {
          vnode.context.changeItem(perInfo);
        } else {
          console.log('eraseItem!!!!!!!!!!');
          vnode.context.eraseItem();
        }
        window.removeEventListener('mousemove', handleChange);
        window.removeEventListener('mouseup', handleMouseUp);
      }
    }
    el.$destroy = () => el.removeEventListener('mousedown', handleMouseDown);
  },
  unbind(el) {
    el && el.$destroy && el.$destroy();
  }
};

//
var script$4m = {
  name: 'HotZone',
  directives: {
    addItem
  },
  components: {
    Zone: __vue_component__$4n
  },
  inject: {
    getCurrentRuleIndex: {
      value: 'getCurrentRuleIndex',
      default: null
    },
    getSelfRuleIndex: {
      value: 'getSelfRuleIndex',
      default: null
    }
  },
  props: {
    image: {
      type: String,
      required: true
    },
    value: {
      type: Array,
      default: () => []
    },
    max: {
      type: Number,
      default: Infinity
    },
    isInCreater: {
      type: Boolean,
      default: false
    },
    zoneVisible: {
      type: Boolean,
      default: true
    },
    mode: {
      type: String,
      default: 'editor'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  computed: {
    zones: {
      get() {
        return this.value;
      },
      set(value) {
        this.$emit('input', value);
      }
    },
    isInEditor() {
      return !this.isInCreater && this.mode === 'editor';
    }
  },
  methods: {
    findCurSelect() {
      return this.value.find(item => item.selected);
    },
    onSelect(zone, by) {
      console.log('热区zone选择', this.isInCreater, by);
      if (!this.isInCreater && by === 'addItem') {
        this.$emit('wrap-click');
      }
      if (this.isInCreater || by === 'wrap') {
        const curZone = this.findCurSelect();
        if (curZone) curZone.selected = 0;
        if (zone) {
          this.$set(zone, 'selected', 1);
        }
        this.$emit('select-zone', zone);
        this.hasChange();
      } else {
        if (by === 'click') {
          const curZone = this.findCurSelect();
          if (curZone) curZone.selected = 0;
          if (zone) {
            this.$set(zone, 'selected', 1);
          }
          let {
            type,
            value,
            label,
            desc,
            cover
          } = zone.hotTarget || {};
          console.log('zone点击', type);
          this.$EventBus.$emit('hotzoneClick', {
            type,
            value,
            label,
            desc,
            cover
          });
          if (this.isInEditor) {
            this.$emit('wrap-click');
          }
        }
      }
    },
    changeInfo(res) {
      const {
        info,
        index
      } = res;
      this.changeItem(info, index, 1);
    },
    addItem(setting) {
      this.zones.push(setting);
      this.hasChange();
      this.$emit('add', setting);
      this.onSelect(setting, 'addItem');
    },
    onMaxCount() {
      this.$message.warning(`最多可创建${this.max}个热区`);
    },
    eraseItem(index = this.zones.length - 1) {
      this.removeItem(index);
      this.$emit('erase', index);
    },
    isOverRange() {
      const {
        max,
        zones
      } = this;
      return max && zones.length > max;
    },
    overRange() {
      const index = this.zones.length - 1;
      this.removeItem(index);
      this.$emit('overRange', index);
    },
    removeItem(index = this.zones.length - 1) {
      const curZone = this.zones[index];
      // 移除当前选中的
      if (curZone === this.findCurSelect()) {
        this.onSelect(null);
      }

      //  移除当前项
      this.zones.splice(index, 1);
      this.hasChange();
      this.$emit('remove', curZone, index);
    },
    changeItem(info, index = this.zones.length - 1, isChangeInfo) {
      Object.assign(this.zones[index], info);
      this.hasChange();
      this.onSelect(this.zones[index], isChangeInfo ? 'changeItem' : 'changeItem');
    },
    hasChange() {
      this.$emit('change', this.zones);
    },
    setZoneTarget(data) {
      const curZone = this.findCurSelect();
      let isOperating = this.getCurrentRuleIndex && this.getCurrentRuleIndex() === this.getSelfRuleIndex();
      if (curZone && (isOperating || this.isInCreater)) {
        curZone.hotTarget = {
          ...data
        };
        this.hasChange();
      }
    }
  },
  mounted() {
    let _this = this;
    this.$EventBus.$on('setZoneTarget', data => {
      _this.setZoneTarget(data);
    });
    // this.$EventBus.$on('setInitZones', (data) => {
    //   console.log('热区数据更新', data);
    //   try {
    //     let current = data.find(item => item.selected)
    //   if(!current) {
    //     data[0].selected = true
    //   }
    //   data.forEach((item,index) => {
    //     _this.zones.splice(index,1,item)
    //   })
    //   // setTimeout(() => {
    //   //   _this.zones = [...data]
    //   // },500)
    //   console.log('没更新????',this.zones);
    //   } catch (error) {
    //     console.log('出错了',error);
    //   }

    // })
  },
  destroyed() {
    this.$EventBus.$off('setZoneTarget');
    // this.$EventBus.$off('setInitZones')
  }
};

/* script */
const __vue_script__$4m = script$4m;

/* template */
var __vue_render__$4m = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      ref: "content",
      class: ["hz-m-wrap", _vm.isInCreater ? "editing" : ""],
      on: {
        click: function ($event) {
          if ($event.target !== $event.currentTarget) {
            return null
          }
          return _vm.onSelect(null, "wrap")
        },
      },
    },
    [
      _c("img", {
        staticClass: "hz-u-img",
        attrs: {
          src: _vm.resourceBasisPath
            ? _vm.resourceBasisPath + _vm.image.split("./")[1]
            : _vm.image,
          alt: "",
        },
      }),
      _vm._v(" "),
      _c(
        "div",
        {
          directives: [{ name: "add-item", rawName: "v-add-item" }],
          staticClass: "hz-m-area",
        },
        _vm._l(_vm.zones, function (zone, index) {
          return _c("zone", {
            key: index,
            staticClass: "hz-m-item",
            class: {
              "hz-m-item-selected": zone.selected,
              "in-editor": _vm.mode === "editor" && !_vm.isInCreater,
              "is-transparent": !_vm.isInCreater && !_vm.zoneVisible,
            },
            attrs: {
              index: index,
              setting: zone,
              isInCreater: _vm.isInCreater,
              resourceBasisPath: _vm.resourceBasisPath,
            },
            on: {
              delItem: function ($event) {
                return _vm.removeItem($event)
              },
              changeInfo: function ($event) {
                return _vm.changeInfo($event)
              },
            },
            nativeOn: {
              click: function ($event) {
                $event.stopPropagation();
                return _vm.onSelect(zone, "click")
              },
            },
          })
        }),
        1
      ),
    ]
  )
};
var __vue_staticRenderFns__$4m = [];
__vue_render__$4m._withStripped = true;

  /* style */
  const __vue_inject_styles__$4m = undefined;
  /* scoped */
  const __vue_scope_id__$4m = undefined;
  /* module identifier */
  const __vue_module_identifier__$4m = undefined;
  /* functional template */
  const __vue_is_functional_template__$4m = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4m = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4m, staticRenderFns: __vue_staticRenderFns__$4m },
    __vue_inject_styles__$4m,
    __vue_script__$4m,
    __vue_scope_id__$4m,
    __vue_is_functional_template__$4m,
    __vue_module_identifier__$4m,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4l = {
  name: 'XmlHotzoneRender',
  components: {
    HotZone: __vue_component__$4m
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    //属性中传递过来的块儿数据
    pBlockData: {},
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    max: {
      type: Number,
      default: Infinity
    }
  },
  data() {
    return {
      blockId: 'blockId' + Math.random(),
      //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
      blockData: {
        titleVisible: 'yes',
        titlePosition: 'under',
        titleAlign: 'left',
        zoneVisible: 'yes',
        imageList: [{
          source: 'upload',
          //来源：上传，素材
          uploadFileUrl: '',
          title: '图片名称',
          content: '',
          hotzoneSetList: [{
            widthPer: 0.25,
            heightPer: 0.25,
            topPer: 0.25,
            leftPer: 0.25,
            selected: 0,
            hotTarget: {
              type: 'link',
              value: '',
              label: ''
            }
          }]
        }]
      },
      zones: [{
        widthPer: 0.25,
        heightPer: 0.25,
        topPer: 0.25,
        leftPer: 0.25,
        selected: 0,
        hotTarget: {
          type: 'link',
          value: '',
          label: ''
        }
      }],
      //属性组件名
      propertyComponentsName: 'xml-hotzone-property',
      dialogShow: false,
      curRecordUrl: '',
      curRecordTitle: '',
      curCoverFileUrl: '',
      curRecordContent: '',
      currentPlayer: {},
      modalPlayerKey: 'mpk' + new Date().getTime(),
      hasInitSet: false
    };
  },
  computed: {
    isEmpty() {
      return !(this.blockData.recordSetList && this.blockData.recordSetList.length);
    },
    zoneImageModel() {
      return this.blockData.imageList ? this.blockData.imageList[0] : {};
    }
  },
  watch: {
    pBlockData: {
      handler(newValue) {
        this.$nextTick(() => {
          console.log('新data', newValue);
          this.blockData = Object.assign({}, this.blockData, newValue);
        });
      },
      deep: true,
      immediate: true
    },
    blockData: {
      handler(newValue) {
        if (!this.extendParams.isInCreater || this.extendParams.isEditMode && !this.hasInitSet) {
          if (this.extendParams.isEditMode) {
            this.hasInitSet = true;
          }
          this.$nextTick(() => {
            let newZones = this.zoneImageModel.hotzoneSetList || [];
            this.zones = [...newZones];
          });
        }
      },
      deep: true,
      immediate: true
    }
  },
  methods: {
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    showDialog(param) {
      this.curRecordUrl = param.url;
      this.curRecordTitle = param.title;
      this.curCoverFileUrl = param.coverFileUrl;
      this.curRecordContent = param.content;
      this.currentPlayer = this.blockData.recordSetList[param.playerIndex];
      this.modalPlayerKey = 'mpk' + new Date().getTime();
      this.$nextTick(() => {
        this.dialogShow = true;
      });
    },
    onSelect(zone) {
      // console.log('当前选择热区', zone, this.zones);
    },
    updateZones(zones) {
      this.$EventBus.$emit('updateZoneInfo', {
        zones
      });
    },
    remove(curZone, index) {
      this.$emit('remove', curZone, index);
    },
    addZone(zone) {
      // console.log('添加了', zone);
    },
    wrapClick() {
      this.$emit('wrap-click', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    }
  },
  created() {},
  mounted() {
    if (!this.extendParams.isInCreater) {
      this.zones = [...this.zoneImageModel.hotzoneSetList];
    }
  }
  // destroyed() {
  //   this.$EventBus.$off('setInitZones')
  // }
};

/* script */
const __vue_script__$4l = script$4l;

/* template */
var __vue_render__$4l = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "xml-hotzone-container xml-group-item",
      class: "xml-hotzone-container-" + _vm.pageType,
      attrs: { id: _vm.blockId },
      on: { click: _vm.blockClick },
    },
    [
      [
        _c("div", { staticClass: "fixed-ratio-container" }, [
          _c(
            "div",
            {
              class: [
                "xml-hotzone__wrapper",
                "style-mode--" + _vm.blockData.styleMode,
                _vm.mode,
              ],
            },
            [
              _c(
                "div",
                { staticClass: "xml-hotzone-box" },
                [
                  _c("hot-zone", {
                    staticStyle: { width: "100%", height: "100%" },
                    attrs: {
                      image:
                        _vm.zoneImageModel.uploadFileUrl ||
                        _vm.extendParams.emptyImage ||
                        "",
                      mode: _vm.mode,
                      max: _vm.max,
                      resourceBasisPath: _vm.resourceBasisPath,
                      isInCreater: _vm.extendParams.isInCreater,
                      zoneVisible: _vm.blockData.zoneVisible === "yes",
                    },
                    on: {
                      "wrap-click": _vm.wrapClick,
                      "select-zone": _vm.onSelect,
                      add: _vm.addZone,
                      change: _vm.updateZones,
                      remove: _vm.remove,
                    },
                    model: {
                      value: _vm.zones,
                      callback: function ($$v) {
                        _vm.zones = $$v;
                      },
                      expression: "zones",
                    },
                  }),
                  _vm._v(" "),
                  _vm.zoneImageModel.title &&
                  _vm.blockData.titleVisible !== "no" &&
                  _vm.blockData.titlePosition === "bottom"
                    ? _c(
                        "div",
                        {
                          staticClass: "xml-hot-zone-title image-title--bottom",
                          style: {
                            textAlign: _vm.blockData.titleAlign || "left",
                          },
                        },
                        [
                          _vm._v(
                            "\n            " +
                              _vm._s(_vm.zoneImageModel.title) +
                              "\n          "
                          ),
                        ]
                      )
                    : _vm._e(),
                ],
                1
              ),
            ]
          ),
        ]),
        _vm._v(" "),
        _vm.zoneImageModel.title &&
        _vm.blockData.titleVisible !== "no" &&
        _vm.blockData.titlePosition === "under"
          ? _c(
              "div",
              {
                staticClass: "xml-hot-zone-title image-title--under",
                style: { textAlign: _vm.blockData.titleAlign || "left" },
              },
              [_vm._v("\n      " + _vm._s(_vm.zoneImageModel.title) + "\n    ")]
            )
          : _vm._e(),
      ],
      _vm._v(" "),
      _c(
        "el-dialog",
        {
          staticClass: "resource-preview player-dialog",
          attrs: {
            title: "",
            visible: _vm.dialogShow,
            "destroy-on-close": true,
            width: "100%",
            modal: false,
            "show-close": false,
            "append-to-body": "",
            "custom-class": "preview-modal-hotzone",
            "close-on-click-modal": true,
          },
          on: {
            "update:visible": function ($event) {
              _vm.dialogShow = $event;
            },
          },
        },
        [_c("div", { staticClass: "xml-modal-player__wrapper" })]
      ),
    ],
    2
  )
};
var __vue_staticRenderFns__$4l = [];
__vue_render__$4l._withStripped = true;

  /* style */
  const __vue_inject_styles__$4l = undefined;
  /* scoped */
  const __vue_scope_id__$4l = undefined;
  /* module identifier */
  const __vue_module_identifier__$4l = undefined;
  /* functional template */
  const __vue_is_functional_template__$4l = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4l = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4l, staticRenderFns: __vue_staticRenderFns__$4l },
    __vue_inject_styles__$4l,
    __vue_script__$4l,
    __vue_scope_id__$4l,
    __vue_is_functional_template__$4l,
    __vue_module_identifier__$4l,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4k = {
  name: 'XmlHotTargetModalViewer',
  components: {
    XmlAudioModalPlayer: __vue_component__$4K,
    XmlVideoModalPlayer: __vue_component__$4u,
    XmlTextDialog: __vue_component__$4P
  },
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    data: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      playIcon: playIcon$2,
      titleLeftIcon,
      titleRightIcon,
      modalPlayerKey: 'mpk' + new Date().getTime()
    };
  },
  computed: {
    dialogVisible: {
      get() {
        return this.visible;
      },
      set(value) {
        this.$emit('update:visible', value);
      }
    },
    isMaterialType() {
      const dict = ['image', 'audio', 'video'];
      return dict.includes(this.data.type);
    }
  },
  mounted() {},
  watch: {
    visible: {
      handler(n, o) {
        if (n) {
          this.modalPlayerKey = 'mpk' + new Date().getTime();
        }
      },
      immediate: true
    }
  },
  methods: {
    timeUpdate(e) {},
    resetTimeUpdate() {}
  }
};

/* script */
const __vue_script__$4k = script$4k;

/* template */
var __vue_render__$4k = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "el-dialog",
    {
      staticClass: "xml-custom-modal player-dialog",
      attrs: {
        title: "",
        visible: _vm.dialogVisible,
        "destroy-on-close": true,
        width: "100%",
        modal: false,
        "show-close": false,
        "append-to-body": "",
        "custom-class": "xml-modal-viewer xml-modal-viewer--hotzone",
        "close-on-click-modal": true,
      },
      on: {
        "update:visible": function ($event) {
          _vm.dialogVisible = $event;
        },
      },
    },
    [
      _c(
        "div",
        { staticClass: "xml-modal-viewer__wrapper" },
        [
          _vm.isMaterialType
            ? [
                _vm.data.type === "audio"
                  ? _c("xml-audio-modal-player", {
                      key: _vm.modalPlayerKey,
                      attrs: {
                        mode: "preview",
                        "play-style": "yuan-wen",
                        loop: false,
                        scheduleControl: "yes",
                        url: _vm.data.value,
                        title: _vm.data.label,
                        content: _vm.data.desc,
                        "cover-image-url": _vm.data.cover,
                        styleMode: "A",
                        "play-mode": "dan-ci",
                      },
                      on: {
                        timeUpdate: function (e) {
                          return _vm.timeUpdate(e)
                        },
                        resetTimeUpdate: function ($event) {
                          return _vm.resetTimeUpdate()
                        },
                      },
                    })
                  : _vm._e(),
                _vm._v(" "),
                _vm.data.type === "video"
                  ? _c("xml-video-modal-player", {
                      key: _vm.modalPlayerKey,
                      attrs: {
                        mode: "preview",
                        playStyle: "yuan-wen",
                        loop: false,
                        canSkip: true,
                        src: _vm.data.value,
                        title: _vm.data.label,
                        content: _vm.data.desc,
                        poster: _vm.data.cover,
                      },
                      on: {
                        timeUpdate: function (e) {
                          return _vm.timeUpdate(e)
                        },
                        resetTimeUpdate: function ($event) {
                          return _vm.resetTimeUpdate()
                        },
                      },
                    })
                  : _vm._e(),
                _vm._v(" "),
                _vm.data.type === "image"
                  ? _c("div", { staticClass: "xml-modal-viewer__image" }, [
                      _vm.data.label
                        ? _c("div", { staticClass: "title-block" }, [
                            _c("div", { staticClass: "title-adorn" }, [
                              _c("img", { attrs: { src: _vm.titleLeftIcon } }),
                            ]),
                            _vm._v(" "),
                            _c("div", { staticClass: "title" }, [
                              _vm._v(_vm._s(_vm.data.label)),
                            ]),
                            _vm._v(" "),
                            _c("div", { staticClass: "title-adorn" }, [
                              _c("img", { attrs: { src: _vm.titleRightIcon } }),
                            ]),
                          ])
                        : _vm._e(),
                      _vm._v(" "),
                      _c(
                        "div",
                        { staticClass: "xml-modal-viewer__scroll-wrapper" },
                        [
                          _c(
                            "div",
                            {
                              class: [
                                "xml-image-container",
                                "xml-image-container--aspect-fit",
                              ],
                            },
                            [
                              _c("el-image", {
                                attrs: { src: _vm.data.value },
                              }),
                            ],
                            1
                          ),
                          _vm._v(" "),
                          _vm.data.desc
                            ? _c("div", { staticClass: "content-block" }, [
                                _c("div", { staticClass: "label" }, [
                                  _c("span", [_vm._v("简介")]),
                                ]),
                                _vm._v(" "),
                                _c("div", { staticClass: "content" }, [
                                  _vm._v(_vm._s(_vm.data.desc || "暂无")),
                                ]),
                              ])
                            : _vm._e(),
                        ]
                      ),
                    ])
                  : _vm._e(),
              ]
            : void 0,
        ],
        2
      ),
    ]
  )
};
var __vue_staticRenderFns__$4k = [];
__vue_render__$4k._withStripped = true;

  /* style */
  const __vue_inject_styles__$4k = undefined;
  /* scoped */
  const __vue_scope_id__$4k = undefined;
  /* module identifier */
  const __vue_module_identifier__$4k = undefined;
  /* functional template */
  const __vue_is_functional_template__$4k = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4k = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4k, staticRenderFns: __vue_staticRenderFns__$4k },
    __vue_inject_styles__$4k,
    __vue_script__$4k,
    __vue_scope_id__$4k,
    __vue_is_functional_template__$4k,
    __vue_module_identifier__$4k,
    false,
    undefined,
    undefined,
    undefined
  );

const components$2 = [__vue_component__$4l, __vue_component__$4k];
var XmlHotzone = {
  ...components$2
};

const presetBgColors = ['#ede3fc', '#ffe4d2', '#ecebb4', '#fcdff6', '#d9f0b3', '#ccf1d9', '#bef1fe', '#fee6b4', '#cdedfc', '#dce8fa'];

//
var script$4j = {
  name: 'XmlLayoutRender',
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    //属性中传递过来的块儿数据
    pBlockData: {},
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    bindingComponents: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      blockId: 'blockId' + Math.random(),
      blockData: {
        //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
        height: 'auto',
        rows: [1],
        columns: [1, 1],
        rowsUnit: 'fr',
        columnsUnit: 'fr',
        rowGap: 0,
        columnGap: 0,
        autoFlow: ['row', 'dense'],
        padding: [2, 2, 2, 2],
        areaBoxes: []
      },
      propertyComponentsName: 'xml-layout-property',
      //属性组件名
      presetBgColors,
      refreshKey: 'mpk' + new Date().getTime()
    };
  },
  computed: {
    containerStyle() {
      let {
        height,
        padding,
        rows,
        columns,
        rowsUnit,
        columnsUnit,
        rowGap,
        columnGap,
        autoFlow
      } = this.blockData;
      let stringPadding = padding.map(item => item + 'px');
      let gridTemplateRows = rows.map(item => item + rowsUnit).join(' ');
      let gridTemplateColumns = columns.map(item => item + columnsUnit).join(' ');
      return {
        display: 'grid',
        height: height === 'auto' ? 'auto' : `${height}px`,
        padding: stringPadding.join(' '),
        gridAutoFlow: autoFlow.join(' '),
        gridTemplateRows,
        gridTemplateColumns,
        gap: `${rowGap}px ${columnGap}px`
      };
    },
    injectedAreaBoxes() {
      return this.blockData.areaBoxes.filter(item => !!item.injectComponent?.data);
    },
    spareAreaBoxes() {
      return this.blockData.areaBoxes.filter(item => !item.injectComponent?.data);
    },
    isEmpty() {
      return !(this.blockData.recordSetList && this.blockData.recordSetList.length);
    }
  },
  watch: {
    pBlockData: {
      handler(newValue) {
        this.$nextTick(() => {
          console.log('新data', newValue);
          this.blockData = Object.assign({}, this.blockData, newValue);
        });
      },
      deep: true,
      immediate: true
    }
  },
  provide() {
    return {
      getCatalogList: () => ({
        data: this.catalogList
      }),
      getCurrentRuleIndex: () => this.currentRuLeIndex,
      getXmlLayoutInstance: () => this
    };
  },
  methods: {
    // getAreaBoxMainIndex(uuid) {
    //   return this.blockData.areaBoxes.findIndex(item => item.uuid === uuid)
    // },
    // genAreaBoxStyle(areaBox,index) {
    //   let { rowStart, rowEnd, columnStart, columnEnd } = areaBox
    //   let target = index % this.presetBgColors.length

    //   return {
    //     '--areabox-color': this.presetBgColors[target],
    //     gridRow: `${rowStart} / ${rowEnd}`,
    //     gridColumn: `${columnStart} / ${columnEnd}`,
    //     backgroundColor: `${this.presetBgColors[target]}66`, // 66透明度
    //   }
    // },
    // spareAreaBoxClick(event, item) {
    //   let rect = event.target.getBoundingClientRect()
    //   this.$EventBus.$emit('areaBoxClick', { ...item, type: 'spare', rect }, { blockId: this.blockId, ruleIndex: this.ruleIndex})
    // },
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    }
  },
  created() {}
};

/* script */
const __vue_script__$4j = script$4j;

/* template */
var __vue_render__$4j = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "xml-layout-container",
      class: "xml-layout-container-" + _vm.pageType,
      attrs: { id: _vm.blockId },
      on: {
        "!click": function ($event) {
          return _vm.blockClick.apply(null, arguments)
        },
      },
    },
    [
      _c("div", { class: ["xml-layout__wrapper", _vm.mode] }, [
        _c(
          "div",
          {
            staticClass: "xml-grid-layout xml-grid-layout__container",
            style: _vm.containerStyle,
          },
          [
            _vm._t("default"),
            _vm._v(" "),
            _vm._l(_vm.blockData.areaBoxes, function (item, index) {
              return _c("XmlAreaBox", {
                key: item.uuid,
                attrs: {
                  injected: _vm.bindingComponents.indexOf(item.uuid) !== -1,
                  data: item,
                  ruleIndex: _vm.ruleIndex,
                  boxIndex: index,
                  mode: _vm.mode,
                  sign: _vm.currentRule.sign,
                },
              })
            }),
          ],
          2
        ),
      ]),
    ]
  )
};
var __vue_staticRenderFns__$4j = [];
__vue_render__$4j._withStripped = true;

  /* style */
  const __vue_inject_styles__$4j = undefined;
  /* scoped */
  const __vue_scope_id__$4j = undefined;
  /* module identifier */
  const __vue_module_identifier__$4j = undefined;
  /* functional template */
  const __vue_is_functional_template__$4j = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4j = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4j, staticRenderFns: __vue_staticRenderFns__$4j },
    __vue_inject_styles__$4j,
    __vue_script__$4j,
    __vue_scope_id__$4j,
    __vue_is_functional_template__$4j,
    __vue_module_identifier__$4j,
    false,
    undefined,
    undefined,
    undefined
  );

/*! 
 * portal-vue © Thorsten Lünborg, 2019 
 * 
 * Version: 2.1.7
 * 
 * LICENCE: MIT 
 * 
 * https://github.com/linusborg/portal-vue
 * 
*/
function _typeof$1(obj) {
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof$1 = function (obj) {
      return typeof obj;
    };
  } else {
    _typeof$1 = function (obj) {
      return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
    };
  }
  return _typeof$1(obj);
}
function _toConsumableArray(arr) {
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
}
function _arrayWithoutHoles(arr) {
  if (Array.isArray(arr)) {
    for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
    return arr2;
  }
}
function _iterableToArray(iter) {
  if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
}
function _nonIterableSpread() {
  throw new TypeError("Invalid attempt to spread non-iterable instance");
}
var inBrowser$1 = typeof window !== 'undefined';
function freeze(item) {
  if (Array.isArray(item) || _typeof$1(item) === 'object') {
    return Object.freeze(item);
  }
  return item;
}
function combinePassengers(transports) {
  var slotProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  return transports.reduce(function (passengers, transport) {
    var temp = transport.passengers[0];
    var newPassengers = typeof temp === 'function' ? temp(slotProps) : transport.passengers;
    return passengers.concat(newPassengers);
  }, []);
}
function stableSort(array, compareFn) {
  return array.map(function (v, idx) {
    return [idx, v];
  }).sort(function (a, b) {
    return compareFn(a[1], b[1]) || a[0] - b[0];
  }).map(function (c) {
    return c[1];
  });
}
function pick(obj, keys) {
  return keys.reduce(function (acc, key) {
    if (obj.hasOwnProperty(key)) {
      acc[key] = obj[key];
    }
    return acc;
  }, {});
}
var transports = {};
var targets = {};
var sources = {};
var Wormhole = Vue.extend({
  data: function data() {
    return {
      transports: transports,
      targets: targets,
      sources: sources,
      trackInstances: inBrowser$1
    };
  },
  methods: {
    open: function open(transport) {
      if (!inBrowser$1) return;
      var to = transport.to,
        from = transport.from,
        passengers = transport.passengers,
        _transport$order = transport.order,
        order = _transport$order === void 0 ? Infinity : _transport$order;
      if (!to || !from || !passengers) return;
      var newTransport = {
        to: to,
        from: from,
        passengers: freeze(passengers),
        order: order
      };
      var keys = Object.keys(this.transports);
      if (keys.indexOf(to) === -1) {
        Vue.set(this.transports, to, []);
      }
      var currentIndex = this.$_getTransportIndex(newTransport); // Copying the array here so that the PortalTarget change event will actually contain two distinct arrays

      var newTransports = this.transports[to].slice(0);
      if (currentIndex === -1) {
        newTransports.push(newTransport);
      } else {
        newTransports[currentIndex] = newTransport;
      }
      this.transports[to] = stableSort(newTransports, function (a, b) {
        return a.order - b.order;
      });
    },
    close: function close(transport) {
      var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
      var to = transport.to,
        from = transport.from;
      if (!to || !from && force === false) return;
      if (!this.transports[to]) {
        return;
      }
      if (force) {
        this.transports[to] = [];
      } else {
        var index = this.$_getTransportIndex(transport);
        if (index >= 0) {
          // Copying the array here so that the PortalTarget change event will actually contain two distinct arrays
          var newTransports = this.transports[to].slice(0);
          newTransports.splice(index, 1);
          this.transports[to] = newTransports;
        }
      }
    },
    registerTarget: function registerTarget(target, vm, force) {
      if (!inBrowser$1) return;
      if (this.trackInstances && !force && this.targets[target]) {
        console.warn("[portal-vue]: Target ".concat(target, " already exists"));
      }
      this.$set(this.targets, target, Object.freeze([vm]));
    },
    unregisterTarget: function unregisterTarget(target) {
      this.$delete(this.targets, target);
    },
    registerSource: function registerSource(source, vm, force) {
      if (!inBrowser$1) return;
      if (this.trackInstances && !force && this.sources[source]) {
        console.warn("[portal-vue]: source ".concat(source, " already exists"));
      }
      this.$set(this.sources, source, Object.freeze([vm]));
    },
    unregisterSource: function unregisterSource(source) {
      this.$delete(this.sources, source);
    },
    hasTarget: function hasTarget(to) {
      return !!(this.targets[to] && this.targets[to][0]);
    },
    hasSource: function hasSource(to) {
      return !!(this.sources[to] && this.sources[to][0]);
    },
    hasContentFor: function hasContentFor(to) {
      return !!this.transports[to] && !!this.transports[to].length;
    },
    // Internal
    $_getTransportIndex: function $_getTransportIndex(_ref) {
      var to = _ref.to,
        from = _ref.from;
      for (var i in this.transports[to]) {
        if (this.transports[to][i].from === from) {
          return +i;
        }
      }
      return -1;
    }
  }
});
var wormhole = new Wormhole(transports);
var _id = 1;
var Portal = Vue.extend({
  name: 'portal',
  props: {
    disabled: {
      type: Boolean
    },
    name: {
      type: String,
      default: function _default() {
        return String(_id++);
      }
    },
    order: {
      type: Number,
      default: 0
    },
    slim: {
      type: Boolean
    },
    slotProps: {
      type: Object,
      default: function _default() {
        return {};
      }
    },
    tag: {
      type: String,
      default: 'DIV'
    },
    to: {
      type: String,
      default: function _default() {
        return String(Math.round(Math.random() * 10000000));
      }
    }
  },
  created: function created() {
    var _this = this;
    this.$nextTick(function () {
      wormhole.registerSource(_this.name, _this);
    });
  },
  mounted: function mounted() {
    if (!this.disabled) {
      this.sendUpdate();
    }
  },
  updated: function updated() {
    if (this.disabled) {
      this.clear();
    } else {
      this.sendUpdate();
    }
  },
  beforeDestroy: function beforeDestroy() {
    wormhole.unregisterSource(this.name);
    this.clear();
  },
  watch: {
    to: function to(newValue, oldValue) {
      oldValue && oldValue !== newValue && this.clear(oldValue);
      this.sendUpdate();
    }
  },
  methods: {
    clear: function clear(target) {
      var closer = {
        from: this.name,
        to: target || this.to
      };
      wormhole.close(closer);
    },
    normalizeSlots: function normalizeSlots() {
      return this.$scopedSlots.default ? [this.$scopedSlots.default] : this.$slots.default;
    },
    normalizeOwnChildren: function normalizeOwnChildren(children) {
      return typeof children === 'function' ? children(this.slotProps) : children;
    },
    sendUpdate: function sendUpdate() {
      var slotContent = this.normalizeSlots();
      if (slotContent) {
        var transport = {
          from: this.name,
          to: this.to,
          passengers: _toConsumableArray(slotContent),
          order: this.order
        };
        wormhole.open(transport);
      } else {
        this.clear();
      }
    }
  },
  render: function render(h) {
    var children = this.$slots.default || this.$scopedSlots.default || [];
    var Tag = this.tag;
    if (children && this.disabled) {
      return children.length <= 1 && this.slim ? this.normalizeOwnChildren(children)[0] : h(Tag, [this.normalizeOwnChildren(children)]);
    } else {
      return this.slim ? h() : h(Tag, {
        class: {
          'v-portal': true
        },
        style: {
          display: 'none'
        },
        key: 'v-portal-placeholder'
      });
    }
  }
});
var PortalTarget = Vue.extend({
  name: 'portalTarget',
  props: {
    multiple: {
      type: Boolean,
      default: false
    },
    name: {
      type: String,
      required: true
    },
    slim: {
      type: Boolean,
      default: false
    },
    slotProps: {
      type: Object,
      default: function _default() {
        return {};
      }
    },
    tag: {
      type: String,
      default: 'div'
    },
    transition: {
      type: [String, Object, Function]
    }
  },
  data: function data() {
    return {
      transports: wormhole.transports,
      firstRender: true
    };
  },
  created: function created() {
    var _this = this;
    this.$nextTick(function () {
      wormhole.registerTarget(_this.name, _this);
    });
  },
  watch: {
    ownTransports: function ownTransports() {
      this.$emit('change', this.children().length > 0);
    },
    name: function name(newVal, oldVal) {
      /**
       * TODO
       * This should warn as well ...
       */
      wormhole.unregisterTarget(oldVal);
      wormhole.registerTarget(newVal, this);
    }
  },
  mounted: function mounted() {
    var _this2 = this;
    if (this.transition) {
      this.$nextTick(function () {
        // only when we have a transition, because it causes a re-render
        _this2.firstRender = false;
      });
    }
  },
  beforeDestroy: function beforeDestroy() {
    wormhole.unregisterTarget(this.name);
  },
  computed: {
    ownTransports: function ownTransports() {
      var transports = this.transports[this.name] || [];
      if (this.multiple) {
        return transports;
      }
      return transports.length === 0 ? [] : [transports[transports.length - 1]];
    },
    passengers: function passengers() {
      return combinePassengers(this.ownTransports, this.slotProps);
    }
  },
  methods: {
    // can't be a computed prop because it has to "react" to $slot changes.
    children: function children() {
      return this.passengers.length !== 0 ? this.passengers : this.$scopedSlots.default ? this.$scopedSlots.default(this.slotProps) : this.$slots.default || [];
    },
    // can't be a computed prop because it has to "react" to this.children().
    noWrapper: function noWrapper() {
      var noWrapper = this.slim && !this.transition;
      if (noWrapper && this.children().length > 1) {
        console.warn('[portal-vue]: PortalTarget with `slim` option received more than one child element.');
      }
      return noWrapper;
    }
  },
  render: function render(h) {
    var noWrapper = this.noWrapper();
    var children = this.children();
    var Tag = this.transition || this.tag;
    return noWrapper ? children[0] : this.slim && !Tag ? h() : h(Tag, {
      props: {
        // if we have a transition component, pass the tag if it exists
        tag: this.transition && this.tag ? this.tag : undefined
      },
      class: {
        'vue-portal-target': true
      }
    }, children);
  }
});
var _id$1 = 0;
var portalProps = ['disabled', 'name', 'order', 'slim', 'slotProps', 'tag', 'to'];
var targetProps = ['multiple', 'transition'];
Vue.extend({
  name: 'MountingPortal',
  inheritAttrs: false,
  props: {
    append: {
      type: [Boolean, String]
    },
    bail: {
      type: Boolean
    },
    mountTo: {
      type: String,
      required: true
    },
    // Portal
    disabled: {
      type: Boolean
    },
    // name for the portal
    name: {
      type: String,
      default: function _default() {
        return 'mounted_' + String(_id$1++);
      }
    },
    order: {
      type: Number,
      default: 0
    },
    slim: {
      type: Boolean
    },
    slotProps: {
      type: Object,
      default: function _default() {
        return {};
      }
    },
    tag: {
      type: String,
      default: 'DIV'
    },
    // name for the target
    to: {
      type: String,
      default: function _default() {
        return String(Math.round(Math.random() * 10000000));
      }
    },
    // Target
    multiple: {
      type: Boolean,
      default: false
    },
    targetSlim: {
      type: Boolean
    },
    targetSlotProps: {
      type: Object,
      default: function _default() {
        return {};
      }
    },
    targetTag: {
      type: String,
      default: 'div'
    },
    transition: {
      type: [String, Object, Function]
    }
  },
  created: function created() {
    if (typeof document === 'undefined') return;
    var el = document.querySelector(this.mountTo);
    if (!el) {
      console.error("[portal-vue]: Mount Point '".concat(this.mountTo, "' not found in document"));
      return;
    }
    var props = this.$props; // Target already exists

    if (wormhole.targets[props.name]) {
      if (props.bail) {
        console.warn("[portal-vue]: Target ".concat(props.name, " is already mounted.\n        Aborting because 'bail: true' is set"));
      } else {
        this.portalTarget = wormhole.targets[props.name];
      }
      return;
    }
    var append = props.append;
    if (append) {
      var type = typeof append === 'string' ? append : 'DIV';
      var mountEl = document.createElement(type);
      el.appendChild(mountEl);
      el = mountEl;
    } // get props for target from $props
    // we have to rename a few of them

    var _props = pick(this.$props, targetProps);
    _props.slim = this.targetSlim;
    _props.tag = this.targetTag;
    _props.slotProps = this.targetSlotProps;
    _props.name = this.to;
    this.portalTarget = new PortalTarget({
      el: el,
      parent: this.$parent || this,
      propsData: _props
    });
  },
  beforeDestroy: function beforeDestroy() {
    var target = this.portalTarget;
    if (this.append) {
      var el = target.$el;
      el.parentNode.removeChild(el);
    }
    target.$destroy();
  },
  render: function render(h) {
    if (!this.portalTarget) {
      console.warn("[portal-vue] Target wasn't mounted");
      return h();
    } // if there's no "manual" scoped slot, so we create a <Portal> ourselves

    if (!this.$scopedSlots.manual) {
      var props = pick(this.$props, portalProps);
      return h(Portal, {
        props: props,
        attrs: this.$attrs,
        on: this.$listeners,
        scopedSlots: this.$scopedSlots
      }, this.$slots.default);
    } // else, we render the scoped slot

    var content = this.$scopedSlots.manual({
      to: this.to
    }); // if user used <template> for the scoped slot
    // content will be an array

    if (Array.isArray(content)) {
      content = content[0];
    }
    if (!content) return h();
    return content;
  }
});

var iconReplace = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA2hJREFUWEe9l19oU2cYxn9vojNxCKMwRXexghPRZMw/DVpvZnGOaXGjbmNXgyJeiG2KvRJB0F7ohbKbtI6JF4JXA3WIjioq2ru4NWGMxgrqRfFCBUXc1DYpzXnlnJNzenIakxyb9tzl+97n+Z68/773E81yFqWTYN8YQlI28qcDW73n2ZKFHy65bP4W5W8DbhVkUfphv/xfjVo0gwY7u2St9EmCow52bXKiM4Sc9XFNCNwoGsbx0VOL/6p0jl/AUA0xW919n4BYrzbJVOEiMG3jJVPtyw1EXcHOllfAkLTQVk2ADrMV4bZl4xPg4D7vGm9FQptVaAV+LOMTLuZSkR+8aw0X4CWPd+W3E+YEyjpn3TCMzd5wzKkA59B4T+ECqt/bntN0biC6Zc5CUCmEaw7o8nCx8Hg6f6bzYV48YB4c7544isiRUv4M5gYi7XbJTpdhQ5LwXUlcXqb6fPKDyJr7v8jzeRMQ681/JlM8cGMvtI+kIoNzLuCLfeOfFBeE94IhbgjsZOzzh8Cq7aqNSDBrOFatD1TCx7vGOwiF/pixJ/Q0rBXX6KDEuwvHET3k2Clcvdsf2WkKuANsqkVQYb9LWvg1CC6WzN8U2GZiDNFPR1PRR6JpmllAcxAiirzA4IFsYSIILtb7X5NMLRoDDuf6IykrB4IQNMI21pP/5m4qcs2tBi+pZvhaWrjeiIPq5XA9oBnr5jpDmGZZz8t6CUy71l6Nvsq/WUU43BQElxuIDlkCdIRlFHhaKq8rkuDbIESx7vx+EU4FwZRss7aADGeAvS6BcFg2cqxewrI+Xy+oZCc6zM8I52bglHZJMFgPn09AFlV3VqyIdy4l6zIaLs11gn1TWS4pdUThtLTwpJaI8ptO28zYVsPEk3lzqrJGNzsEw3yHcMkDWlHPwY797AX8y1ImuYdgZ7Gwyztyz7kHLC9kuYHylRMC78g9PwLMXPDmQYiYbGC01uHm/qxD4OZehofAypIXMpIgMb8CsvyE8runH1xhkoPSyr2qWV02771HFXjJNWO996yB0fOdR0gzxR3ZRNovpmEhcEORpQNl5gRjG2QJsUM28KxiGdqLdT/x3nkda8bKhZPADiDi+9dlw8isWnGtJNN/+Iii9Sb80n1ivWKXtPHa9UCysBuM30A+rsXn2x96C4xUoavxY8kaAAAAAElFTkSuQmCC";

var iconSetup = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA7NJREFUWEftl2tsVEUUx/9nku7ei2AkPEQCGlSg6b3bUiuPoCGCJVGTkihUwgdIUEBt9y4hqIkfUB6+osbEvatGTfmICV1C4AspjwR5JFBeoZ0SEjQhtDXAyhdM9t4t6T1m2t2lu92227ut8YPz6U7m3Pn/zpk5M3MI/0Kbt+X+1DItWAvunUGe6JDfa8cyspSvH4o4Gz0WywSwkMHGSHzM+Lkjpr0zlF2llVrjgT8FMP+hDe2VdvBt1c8BMC13P4D6kURzxpl3yZi+s9A/ZmPydQgRByBem3sMj0+8C5mocC50VetM/GVHVP8oC2CGnZ0g+gTAHYAaUBa4IL+lzlHBDDA2LLeOCHEwAu8tbELDor19o8kHOjYf+g5tdwyAeEMfgBlJLgWLswDapK1V+RXN/BcKu68yURzgCQPFM+NHf1+B7S17VLe5D8AIuz8RYQuReL49GrhUCoC51V0JDwcATCokrua+lijH2v1NIPCv/RGw3IsApklbe6oUcSPsrKA+zzF5KHE1v/JeRQHMuzIADOCktLXlfgFCjc4yFogDNG048R9a38Kl7gUHznfX3FPZMyYAZuTBUnCv8vyJ4cS/OLUN+9rXKM+Xy5h+MpuGpuX6jkBFY3KxEKIZwOzhxD87tR3ybvkJebvimoxpkZyDyC9AKNJTw+wp8TlFrvkmGdObBi6z7yUwrJ4qYi8OwrNFiQPN0tbezN9jvgAqIynTY1ael5ci7nsPmFbqMMB1pYr7Api1rVOf4k1JzHns5iMH160vmLXZPB8i7CXtgYpG52Uh6Hi9cQgfv/TVIIBixNP3zgRpax+Oeg8YYWcHEe3+vHY36ua35AAUI54+eVXaQ9oajR7Aco8Q8ErLhtWYOek27qceRWt3NY7cqO0/XosIezrt/QGEIsm/zenXJ9Y+/Rtau57DxT8XcKo3mLnWC6Za/jqVBmA5+xi0Ljsp4zIIZ0B0VkaD6kEzYisNIJyqZ3gGSLSVIXD6ik2JERXzDEoCGK1YIfv/Af6LEXA6QfSXjGrVY7HGw82hipRAMJAAuEva+uzMQaTSZ6W0tcnjDWCEky8QiTOZA6sf4GFN8KO0tYbxhDAt9zSAF9WDVBU02cIkZLndDMwE0RsyGjw4HhBm2P0ahPeJ6Hx7NLgkex2rj/Tb7lxa+DhAt8Ce78pooAMsMJeYVG1YA+ZOGdOfzHkTZjqV7/J0Luv5hcGrxiMCYHwjY9oHg94Dgy6LralKsFcFD8+MCYgQV8Gsyr4/8uf7B8Tx9p9D/L0VAAAAAElFTkSuQmCC";

var iconRemove = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAAAAXNSR0IArs4c6QAAAtdJREFUWEftmM1LFHEYxz/Pau1YSpfq0AtIdIhaJdC9GFhePHgUBEtouwSGStHLWf0DpHLWgqiQjKhDRYfyEqmHCHPUYmeVwugShHkpFXxJfWq3dl213FlnJA8NDMww3+f5feY7v3me+Y3gYAvUTzUh0uhA6kwivBHlVsQ0wssDxEmGQMO0OtFlqlGR49FW//3UOGdAXjuUJJBXtukvyRgo0ztPp0913DaNJaY4cijdAJleTwt04NxUfta8r1HQ/EyTp9Wr9tjhnKZU3apABQ0zNYreTZvYpUCRQ1HTPxRLsypQoGH6IVDpcrz04arNCafSAa3LK/0Hwm7bNMqcOPQfaAM8Mh0FGf6nj0zRdhFeCFlDs5Pf3r+7vWMiMa8KG3SP6kyVilStqNTr0adUtSYazrmnXeSylUJ8FKKUIPiAXuaJMoctR/iyorl6CiQMb9LvRwfNvDG1OAtcAPauUhNapJiLS3qZh0DjtmlsiyXXfnpQStMXp7jiI0K5FDESOxGvgESpiISNTrX4AOxzCLMomyBPypj0BEiFy9FW47xa1ALXM4aJ28oDCVLtAZCO2WbOTn1NCT5erglmMeiMB0DEW4Ja3ABOuwSy3QMJ1+xWo077GEQ47BLI/aRWpc6uNjowGE+B6UZpdgTnI4RyKqF175BqWSSUA0JXEkApkyDdjoBi89ki2eBdAylywg75nwFfN4ZDcNE2jRbt5y1KoVNX/qZz7RDKYztsVKpF+8+qG3IJNOIe6BfB/shJ4xjCTVdASps3QL+/l9XiKVCxRqjPUswuCdRPfUJk9xqTJMJmFxYWSofatvSmvjEZ5VQqJEhnDMiTHwkKT4wZu8qqLT7IAs+B7Y6BlJAEuRPv9imLxGRxcpxopXAA31yFfTV3VPtoQlj9j4nQwWYuSQGjycKYOIiBZc/hzco12zdqX/EPq0U5ShAhCPE9tnQfRBnEx4AU8Wj5Pf0AgUJM93Ow4uMAAAAASUVORK5CYII=";

//
var script$4i = {
  name: 'XmlAreaBox',
  components: {
    PortalTarget
  },
  props: {
    data: {
      type: Object,
      default: () => {}
    },
    boxIndex: Number,
    // mainIndex: Number,
    injected: {
      type: Boolean,
      default: false
    },
    sign: {
      type: String,
      default: ''
    },
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    //属性中传递过来的块儿数据
    pBlockData: {
      type: Object,
      default: () => {}
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: () => {}
    },
    ruleIndex: Number
  },
  data() {
    return {
      presetBgColors,
      images: {
        iconReplace,
        iconSetup,
        iconRemove
      },
      clickInside: false,
      refreshKey: 'apk' + new Date().getTime()
    };
  },
  directives: {
    clickInside: {
      bind(el, binding, vnode) {
        function clickHandler(e) {
          let isInside = false;
          if (el.contains(e.target)) {
            isInside = true;
          }
          if (binding.expression) {
            binding.value(isInside);
          }
        }
        el.__vueClickOutside__ = clickHandler;
        document.addEventListener('click', clickHandler);
      },
      update() {},
      unbind(el, binding) {
        document.removeEventListener('click', el.__vueClickOutside__);
        delete el.__vueClickOutside__;
      }
    }
  },
  computed: {
    activeInjectId() {
      return this.getActiveInjectId();
    },
    activeInjectedBoxId() {
      return this.getActiveInjectedBoxId();
    },
    isInActive() {
      return this.activeInjectId && this.activeInjectId === this.data.uuid || this.activeInjectedBoxId && this.activeInjectedBoxId === this.data.uuid;
    }
  },
  provide() {
    return {
      getAreaBoxProvider: () => ({
        injected: this.injected,
        data: this.data,
        boxIndex: this.boxIndex,
        mainIndex: this.mainIndex
      })
    };
  },
  inject: {
    getActiveInjectId: {
      from: 'getActiveInjectId',
      default: () => ''
    },
    getActiveInjectedBoxId: {
      from: 'getActiveInjectedBoxId',
      default: () => ''
    }
  },
  methods: {
    setClickInside(isInside) {
      this.clickInside = isInside;
    },
    setupInjectComponent() {
      this.$emit('injectSetup', {
        ...this.data,
        type: 'injected',
        ruleIndex: this.ruleIndex,
        mainIndex: this.mainIndex
      });
    },
    replaceInjectComponent() {
      let rect = this.$el.getBoundingClientRect();
      this.$EventBus.$emit('injectComponentReplace', {
        ...this.data,
        type: 'injected',
        rect,
        ruleIndex: this.ruleIndex,
        boxIndex: this.boxIndex,
        sign: this.sign
      });
    },
    removeInjectComponent() {
      this.$EventBus.$emit('injectComponentRemove', {
        ...this.data,
        type: 'injected',
        ruleIndex: this.ruleIndex,
        boxIndex: this.boxIndex
      });
    },
    genAreaBoxStyle() {
      let {
        rowStart,
        rowEnd,
        columnStart,
        columnEnd
      } = this.data;
      let baseStyle = {
        gridRow: `${rowStart} / ${rowEnd}`,
        gridColumn: `${columnStart} / ${columnEnd}`
      };
      if (!this.injected) {
        let target = this.boxIndex % this.presetBgColors.length;
        baseStyle['--areabox-color'] = this.presetBgColors[target];
        baseStyle.backgroundColor = `${this.presetBgColors[target]}99`; // 66透明度
      }
      return baseStyle;
    },
    spareAreaBoxClick(event) {
      if (this.injected) {
        // this.$EventBus.$emit('injectedGroupProxy', { ...this.data, type: 'injected', ruleIndex: this.ruleIndex, mainIndex: this.mainIndex })
        // this.$emit('areaBoxClick', { ...this.data, type: 'injected' })
        this.$EventBus.$emit('areaBoxClick', {
          ...this.data,
          type: 'injected'
        }, {
          ruleIndex: this.ruleIndex,
          sign: this.sign
        });
      } else {
        let rect = event.target.getBoundingClientRect();
        this.$EventBus.$emit('areaBoxClick', {
          ...this.data,
          type: 'spare',
          rect
        }, {
          ruleIndex: this.ruleIndex,
          sign: this.sign
        });
      }
    }
  },
  created() {}
};

/* script */
const __vue_script__$4i = script$4i;

/* template */
var __vue_render__$4i = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "section",
    {
      directives: [
        {
          name: "click-inside",
          rawName: "v-click-inside",
          value: _vm.setClickInside,
          expression: "setClickInside",
        },
      ],
      class: [
        "xml-grid-layout__area-box",
        "xml-grid-layout__area-box" + (_vm.injected ? "--injected" : "--spare"),
        _vm.mode === "editor" && "is-in-editor",
        _vm.isInActive && "inject-active",
      ],
      style: _vm.genAreaBoxStyle(),
      on: { click: _vm.spareAreaBoxClick },
    },
    [
      _vm.injected
        ? [
            _c("div", { staticClass: "xml-grid-layout__control" }, [
              _c("div", { staticClass: "xml-grid-layout__control-wrap" }, [
                _c(
                  "div",
                  {
                    staticClass: "xml-grid-layout__button",
                    on: {
                      click: function ($event) {
                        $event.stopPropagation();
                        return _vm.replaceInjectComponent.apply(null, arguments)
                      },
                    },
                  },
                  [
                    _c(
                      "el-tooltip",
                      {
                        staticClass: "item",
                        attrs: {
                          effect: "dark",
                          content: "替换组件",
                          placement: "top",
                        },
                      },
                      [
                        _c("el-image", {
                          attrs: { src: _vm.images.iconReplace },
                        }),
                      ],
                      1
                    ),
                  ],
                  1
                ),
                _vm._v(" "),
                _c(
                  "div",
                  {
                    staticClass: "xml-grid-layout__button",
                    on: {
                      click: function ($event) {
                        $event.stopPropagation();
                        return _vm.removeInjectComponent.apply(null, arguments)
                      },
                    },
                  },
                  [
                    _c(
                      "el-tooltip",
                      {
                        staticClass: "item",
                        attrs: {
                          effect: "dark",
                          content: "移除组件",
                          placement: "top",
                        },
                      },
                      [
                        _c("el-image", {
                          attrs: { src: _vm.images.iconRemove },
                        }),
                      ],
                      1
                    ),
                  ],
                  1
                ),
              ]),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "xml-grid-layout__inject-wrap" },
              [_c("PortalTarget", { attrs: { name: _vm.data.uuid } })],
              1
            ),
          ]
        : _vm._e(),
    ],
    2
  )
};
var __vue_staticRenderFns__$4i = [];
__vue_render__$4i._withStripped = true;

  /* style */
  const __vue_inject_styles__$4i = undefined;
  /* scoped */
  const __vue_scope_id__$4i = undefined;
  /* module identifier */
  const __vue_module_identifier__$4i = undefined;
  /* functional template */
  const __vue_is_functional_template__$4i = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4i = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4i, staticRenderFns: __vue_staticRenderFns__$4i },
    __vue_inject_styles__$4i,
    __vue_script__$4i,
    __vue_scope_id__$4i,
    __vue_is_functional_template__$4i,
    __vue_module_identifier__$4i,
    false,
    undefined,
    undefined,
    undefined
  );

const components$1 = [__vue_component__$4j, __vue_component__$4i];
var XmlLayout = {
  ...components$1
};

var singleGroupMixin = {
  props: {
    activeIndex: {
      type: Number,
      default: -1
    },
    location: {
      type: String,
      default: ''
    },
    islast: {
      type: Boolean,
      default: false
    }
  },
  provide() {
    return {
      getSingleGroupLocation: () => this.location
    };
  },
  computed: {
    groupIsActive() {
      return this.ruleIndex === this.activeIndex;
    }
  },
  watch: {
    pGroupData: {
      handler() {
        if (this.pGroupData.options?.marginTop !== undefined && this.pGroupData.options.marginTop !== -1) {
          this.$nextTick(() => {
            this.$el && this.$el.style.setProperty('--book-marginTop', this.pGroupData.options.marginTop + 'px');
          });
        }
      },
      deep: true,
      immediate: true
    }
  },
  created() {
    if (this.pGroupData.options?.marginTop === undefined) {
      let options = this.pGroupData.options ? {
        ...this.pGroupData.options,
        marginTop: -1
      } : {
        marginTop: -1
      };
      this.$emit('updateModel', {
        key: 'pGroupData',
        value: {
          ...this.pGroupData,
          options
        }
      });
    }
  },
  mounted() {
    if (this.islast) {
      this.$nextTick(() => {
        this.$EventBus.$emit('mounted_success');
      });
    }
  },
  methods: {
    emitClick(e) {
      this.$emit('click', e, this.ruleIndex, this.currentRule);
    }
  }
};

//
var script$4h = {
  mixins: [singleGroupMixin],
  name: 'titleFifthRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$4h = script$4h;
/* template */
var __vue_render__$4h = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-fifth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-bottom" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$4h = [];
__vue_render__$4h._withStripped = true;

  /* style */
  const __vue_inject_styles__$4h = undefined;
  /* scoped */
  const __vue_scope_id__$4h = "data-v-56a198fa";
  /* module identifier */
  const __vue_module_identifier__$4h = undefined;
  /* functional template */
  const __vue_is_functional_template__$4h = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4h = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4h, staticRenderFns: __vue_staticRenderFns__$4h },
    __vue_inject_styles__$4h,
    __vue_script__$4h,
    __vue_scope_id__$4h,
    __vue_is_functional_template__$4h,
    __vue_module_identifier__$4h,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4g = {
  mixins: [singleGroupMixin],
  name: 'titleFirstRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$4g = script$4g;
/* template */
var __vue_render__$4g = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-first-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-left-img" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$4g = [];
__vue_render__$4g._withStripped = true;

  /* style */
  const __vue_inject_styles__$4g = undefined;
  /* scoped */
  const __vue_scope_id__$4g = "data-v-2a582ff5";
  /* module identifier */
  const __vue_module_identifier__$4g = undefined;
  /* functional template */
  const __vue_is_functional_template__$4g = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4g = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4g, staticRenderFns: __vue_staticRenderFns__$4g },
    __vue_inject_styles__$4g,
    __vue_script__$4g,
    __vue_scope_id__$4g,
    __vue_is_functional_template__$4g,
    __vue_module_identifier__$4g,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4f = {
  mixins: [singleGroupMixin],
  name: 'titleHexagonRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$4f = script$4f;
/* template */
var __vue_render__$4f = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-hexagon-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-left-img" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$4f = [];
__vue_render__$4f._withStripped = true;

  /* style */
  const __vue_inject_styles__$4f = undefined;
  /* scoped */
  const __vue_scope_id__$4f = "data-v-13c4d2ec";
  /* module identifier */
  const __vue_module_identifier__$4f = undefined;
  /* functional template */
  const __vue_is_functional_template__$4f = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4f = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4f, staticRenderFns: __vue_staticRenderFns__$4f },
    __vue_inject_styles__$4f,
    __vue_script__$4f,
    __vue_scope_id__$4f,
    __vue_is_functional_template__$4f,
    __vue_module_identifier__$4f,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4e = {
  mixins: [singleGroupMixin],
  name: 'titleRectangleRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

var __$_require_assets_images_title_rectangle_left_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACcAAAAlCAYAAADBa/A+AAACaklEQVRYhcWXu24TQRSGvzVxuAjEJQVSiFAuDRUIJIoYIZQGiSIhT0BHi8SL8AoUPAGXhgIaRAqEAwkgEJGJYickGBwwSSD2rnfRbDzG8p69RPLs/oWnODPWp3POnn/GmrpXI07P757yHBduP6hz8WyeO1NHAidWf7W4db8e+1/7US7p3ndrNiubLTbqLTFeXHH6CsZ+4F6WbH8tTAyK8WLZ7iPWnhLDzZWaWBZMjuUDMdeDN5WM4ErfW2z8djl3eoCho8EjH9cddhpeNnBzX5r+WpgIZk3ptYGSkhQurt/mM4QbWfrmMHwix9jQgUDwT9Pzy5oV3LTqpishWXtbsVEz0ISSwM2qn8nxkH4zMN+04uCOA9eOHbI4f0aGMzHftOLgrgMHC+OD5KxgsLrlUvkpO0YacDElNZc1YuAU0Q2gcXlUhjM1QrSi4K4CJ4Fnh/PBmnqe2X4jBu5me30oBZeqDvW//besbkXBzagEAU+kYLFsboRohcFdAEaBV8BXGc5sSYmAm2mvj6Rgw/H8y6dphcHpfhPhFlYdbHPjrSMJbgS4pK5xwHvpkOkREgU3DVhhXykpDF8tCW62vT6WDmzuuCz/SKGmApxv9IoBeCEdUCPE7HT7r1443+jbs01MT1olRYDTJRW/UqV5A6+sMHXDdYweeCrtX661qG0buvYK6obrGD2wLW0uplhSeuAijZ6U+40euEijV46wuGbe7Lul4WKN/sO6za6d1hDZk4aLNHoMv7LCpOEijZ4MPgbacLFGv7Xr8bmaTea00YdnrWz7b4a0lUviCmnceiUNAJ+A4TCj9+Ey6DeAfxBN203Xb87aAAAAAElFTkSuQmCC";

var __$_require_assets_images_title_rectangle_right_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAlCAYAAAC+uuLPAAAA/0lEQVRYhb3W3QqCQBAF4Bl3s0iKKEIklW6iKEh0n6AX7E17hmK2IPP3pjl7E159jMc9Dd/ujycBT7wIKECCclxu8WiZGSzKLCh40sPW0HLGWLTKrf+Foi4zWHRqmc4JeNLrztDkPSgOdZ88oahcFSi6jpj2my8FQavMEteeIWg9TwgqE5YpGJUsJVMoWjVeLQbNwKg0kDQRFL0k1ncuFK3y9pT6aEeeqqhsCLIpQFEpeG7HqYs2qw+CyqoJRdNV4Dd5KNpVferoUJ4qqAmIio7qU0VPsaF52HNXtNCxPFVQ11N9amgUMh3j4Tz/jhap8R8SFB27Kipo31/ZzyGiFwxgDupQsmgnAAAAAElFTkSuQmCC";

/* script */
const __vue_script__$4e = script$4e;
var __vue_render__$4e = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-rectangle-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-left-img" }, [
                _c("img", {
                  attrs: {
                    src: __$_require_assets_images_title_rectangle_left_png__,
                    alt: "",
                  },
                }),
              ]),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }, [
                _c("img", {
                  attrs: {
                    src: __$_require_assets_images_title_rectangle_right_png__,
                    alt: "",
                  },
                }),
              ]),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$4e = [];
__vue_render__$4e._withStripped = true;

  /* style */
  const __vue_inject_styles__$4e = undefined;
  /* scoped */
  const __vue_scope_id__$4e = "data-v-566f2eb9";
  /* module identifier */
  const __vue_module_identifier__$4e = undefined;
  /* functional template */
  const __vue_is_functional_template__$4e = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4e = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4e, staticRenderFns: __vue_staticRenderFns__$4e },
    __vue_inject_styles__$4e,
    __vue_script__$4e,
    __vue_scope_id__$4e,
    __vue_is_functional_template__$4e,
    __vue_module_identifier__$4e,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4d = {
  mixins: [singleGroupMixin],
  name: 'titleRotundityRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$4d = script$4d;
/* template */
var __vue_render__$4d = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-rotundity-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-left-img" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$4d = [];
__vue_render__$4d._withStripped = true;

  /* style */
  const __vue_inject_styles__$4d = undefined;
  /* scoped */
  const __vue_scope_id__$4d = "data-v-0dc66d52";
  /* module identifier */
  const __vue_module_identifier__$4d = undefined;
  /* functional template */
  const __vue_is_functional_template__$4d = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4d = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4d, staticRenderFns: __vue_staticRenderFns__$4d },
    __vue_inject_styles__$4d,
    __vue_script__$4d,
    __vue_scope_id__$4d,
    __vue_is_functional_template__$4d,
    __vue_module_identifier__$4d,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4c = {
  mixins: [singleGroupMixin],
  name: 'titleSecondRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$4c = script$4c;
/* template */
var __vue_render__$4c = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-second-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$4c = [];
__vue_render__$4c._withStripped = true;

  /* style */
  const __vue_inject_styles__$4c = undefined;
  /* scoped */
  const __vue_scope_id__$4c = "data-v-22bcf379";
  /* module identifier */
  const __vue_module_identifier__$4c = undefined;
  /* functional template */
  const __vue_is_functional_template__$4c = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4c = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4c, staticRenderFns: __vue_staticRenderFns__$4c },
    __vue_inject_styles__$4c,
    __vue_script__$4c,
    __vue_scope_id__$4c,
    __vue_is_functional_template__$4c,
    __vue_module_identifier__$4c,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4b = {
  mixins: [singleGroupMixin],
  name: 'titleSemicircleRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$4b = script$4b;
/* template */
var __vue_render__$4b = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-semicircle-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-left-img" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$4b = [];
__vue_render__$4b._withStripped = true;

  /* style */
  const __vue_inject_styles__$4b = undefined;
  /* scoped */
  const __vue_scope_id__$4b = "data-v-0fe46bcc";
  /* module identifier */
  const __vue_module_identifier__$4b = undefined;
  /* functional template */
  const __vue_is_functional_template__$4b = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4b = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4b, staticRenderFns: __vue_staticRenderFns__$4b },
    __vue_inject_styles__$4b,
    __vue_script__$4b,
    __vue_scope_id__$4b,
    __vue_is_functional_template__$4b,
    __vue_module_identifier__$4b,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$4a = {
  mixins: [singleGroupMixin],
  name: 'titleSixthRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      numberTextDataName: 'numberTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$4a = script$4a;
/* template */
var __vue_render__$4a = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-sixth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c("div", { staticClass: "title-left-div" }, [
              _c(
                "div",
                { staticClass: "title-number" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.numberTextDataName],
                      "block-data-name": _vm.numberTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container-left",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c("div", { staticClass: "title-left-line" }),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "title-right-div" },
              [
                _c("div", { staticClass: "title-right-line1" }),
                _vm._v(" "),
                _c("div", { staticClass: "title-right-line2" }),
                _vm._v(" "),
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container-right",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
                _vm._v(" "),
                _c("div", { staticClass: "title-right-line3" }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$4a = [];
__vue_render__$4a._withStripped = true;

  /* style */
  const __vue_inject_styles__$4a = undefined;
  /* scoped */
  const __vue_scope_id__$4a = "data-v-1457d9f5";
  /* module identifier */
  const __vue_module_identifier__$4a = undefined;
  /* functional template */
  const __vue_is_functional_template__$4a = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4a = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4a, staticRenderFns: __vue_staticRenderFns__$4a },
    __vue_inject_styles__$4a,
    __vue_script__$4a,
    __vue_scope_id__$4a,
    __vue_is_functional_template__$4a,
    __vue_module_identifier__$4a,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$49 = {
  mixins: [singleGroupMixin],
  name: 'titleSquareRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$49 = script$49;
/* template */
var __vue_render__$49 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-square-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-left-img" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$49 = [];
__vue_render__$49._withStripped = true;

  /* style */
  const __vue_inject_styles__$49 = undefined;
  /* scoped */
  const __vue_scope_id__$49 = "data-v-fb782c6a";
  /* module identifier */
  const __vue_module_identifier__$49 = undefined;
  /* functional template */
  const __vue_is_functional_template__$49 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$49 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$49, staticRenderFns: __vue_staticRenderFns__$49 },
    __vue_inject_styles__$49,
    __vue_script__$49,
    __vue_scope_id__$49,
    __vue_is_functional_template__$49,
    __vue_module_identifier__$49,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$48 = {
  mixins: [singleGroupMixin],
  name: 'titleThirdRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      numberTextDataName: 'numberTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    /**
     * 更新块数据
     * @param dataName  数据name
     * @param blockData 数据值
     */
    updateBlockData(dataName, blockData) {
      this.groupData[dataName] = blockData;
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$48 = script$48;
/* template */
var __vue_render__$48 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-third-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c("div", { staticClass: "title-left" }, [
              _c(
                "span",
                { staticClass: "title-number" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.numberTextDataName],
                      "block-data-name": _vm.numberTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      "rule-index": _vm.ruleIndex,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "title-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$48 = [];
__vue_render__$48._withStripped = true;

  /* style */
  const __vue_inject_styles__$48 = undefined;
  /* scoped */
  const __vue_scope_id__$48 = "data-v-3f81e96d";
  /* module identifier */
  const __vue_module_identifier__$48 = undefined;
  /* functional template */
  const __vue_is_functional_template__$48 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$48 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$48, staticRenderFns: __vue_staticRenderFns__$48 },
    __vue_inject_styles__$48,
    __vue_script__$48,
    __vue_scope_id__$48,
    __vue_is_functional_template__$48,
    __vue_module_identifier__$48,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$47 = {
  mixins: [singleGroupMixin],
  name: 'titleTriangleRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$47 = script$47;
/* template */
var __vue_render__$47 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-triangle-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-left-img" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$47 = [];
__vue_render__$47._withStripped = true;

  /* style */
  const __vue_inject_styles__$47 = undefined;
  /* scoped */
  const __vue_scope_id__$47 = "data-v-44b9aa96";
  /* module identifier */
  const __vue_module_identifier__$47 = undefined;
  /* functional template */
  const __vue_is_functional_template__$47 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$47 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$47, staticRenderFns: __vue_staticRenderFns__$47 },
    __vue_inject_styles__$47,
    __vue_script__$47,
    __vue_scope_id__$47,
    __vue_is_functional_template__$47,
    __vue_module_identifier__$47,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$46 = {
  mixins: [singleGroupMixin],
  name: 'titleTwelfthRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      numberTextDataName: 'numberTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    /**
     * 更新块数据
     * @param dataName  数据name
     * @param blockData 数据值
     */
    updateBlockData(dataName, blockData) {
      this.groupData[dataName] = blockData;
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$46 = script$46;
/* template */
var __vue_render__$46 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-twelfth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c("div", { staticClass: "title-left" }, [
              _c(
                "span",
                { staticClass: "title-number" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.numberTextDataName],
                      "block-data-name": _vm.numberTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      "rule-index": _vm.ruleIndex,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "title-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$46 = [];
__vue_render__$46._withStripped = true;

  /* style */
  const __vue_inject_styles__$46 = undefined;
  /* scoped */
  const __vue_scope_id__$46 = "data-v-7b2e45e4";
  /* module identifier */
  const __vue_module_identifier__$46 = undefined;
  /* functional template */
  const __vue_is_functional_template__$46 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$46 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$46, staticRenderFns: __vue_staticRenderFns__$46 },
    __vue_inject_styles__$46,
    __vue_script__$46,
    __vue_scope_id__$46,
    __vue_is_functional_template__$46,
    __vue_module_identifier__$46,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$45 = {
  mixins: [singleGroupMixin],
  name: 'titlethirteenthRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$45 = script$45;
/* template */
var __vue_render__$45 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-thirteenth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "topleft" }),
              _vm._v(" "),
              _c("div", { staticClass: "topborder" }, [
                _c("div", { staticClass: "topborder-left" }, [
                  _c("div", { staticClass: "Line1" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "Line2" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "block" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "block" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "block" }),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "topborder-right" }, [
                  _c("div", { staticClass: "Line3" }),
                ]),
              ]),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "bottomborder" }, [
                _c("div", { staticClass: "Line1" }),
                _vm._v(" "),
                _c("div", { staticClass: "block" }),
                _vm._v(" "),
                _c("div", { staticClass: "block" }),
                _vm._v(" "),
                _c("div", { staticClass: "Line2" }),
                _vm._v(" "),
                _c("div", { staticClass: "Line3" }),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "rightbottom" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$45 = [];
__vue_render__$45._withStripped = true;

  /* style */
  const __vue_inject_styles__$45 = undefined;
  /* scoped */
  const __vue_scope_id__$45 = "data-v-57857574";
  /* module identifier */
  const __vue_module_identifier__$45 = undefined;
  /* functional template */
  const __vue_is_functional_template__$45 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$45 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$45, staticRenderFns: __vue_staticRenderFns__$45 },
    __vue_inject_styles__$45,
    __vue_script__$45,
    __vue_scope_id__$45,
    __vue_is_functional_template__$45,
    __vue_module_identifier__$45,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$44 = {
  mixins: [singleGroupMixin],
  name: 'titlefourteenRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$44 = script$44;
/* template */
var __vue_render__$44 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-fourteen-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "cont-box" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$44 = [];
__vue_render__$44._withStripped = true;

  /* style */
  const __vue_inject_styles__$44 = undefined;
  /* scoped */
  const __vue_scope_id__$44 = "data-v-58b154c2";
  /* module identifier */
  const __vue_module_identifier__$44 = undefined;
  /* functional template */
  const __vue_is_functional_template__$44 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$44 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$44, staticRenderFns: __vue_staticRenderFns__$44 },
    __vue_inject_styles__$44,
    __vue_script__$44,
    __vue_scope_id__$44,
    __vue_is_functional_template__$44,
    __vue_module_identifier__$44,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$43 = {
  mixins: [singleGroupMixin],
  name: 'titleFifteenRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  isUnPrefix: true,
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$43 = script$43;
/* template */
var __vue_render__$43 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-fifteen-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "left-image" },
              [
                _c("xml-image-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                    "block-data-name": _vm.imageBlockDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "show-title": false,
                    "container-class": "image-container",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                  },
                  on: { blockclick: _vm.handleBlockClick },
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$43 = [];
__vue_render__$43._withStripped = true;

  /* style */
  const __vue_inject_styles__$43 = undefined;
  /* scoped */
  const __vue_scope_id__$43 = "data-v-30ad8667";
  /* module identifier */
  const __vue_module_identifier__$43 = undefined;
  /* functional template */
  const __vue_is_functional_template__$43 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$43 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$43, staticRenderFns: __vue_staticRenderFns__$43 },
    __vue_inject_styles__$43,
    __vue_script__$43,
    __vue_scope_id__$43,
    __vue_is_functional_template__$43,
    __vue_module_identifier__$43,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$42 = {
  mixins: [singleGroupMixin],
  name: 'titleSixteenRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$42 = script$42;
/* template */
var __vue_render__$42 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-sixteen-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "left-image" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "right-icon" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$42 = [];
__vue_render__$42._withStripped = true;

  /* style */
  const __vue_inject_styles__$42 = undefined;
  /* scoped */
  const __vue_scope_id__$42 = "data-v-57360cee";
  /* module identifier */
  const __vue_module_identifier__$42 = undefined;
  /* functional template */
  const __vue_is_functional_template__$42 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$42 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$42, staticRenderFns: __vue_staticRenderFns__$42 },
    __vue_inject_styles__$42,
    __vue_script__$42,
    __vue_scope_id__$42,
    __vue_is_functional_template__$42,
    __vue_module_identifier__$42,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$41 = {
  mixins: [singleGroupMixin],
  name: 'titleSeventeenRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$41 = script$41;
/* template */
var __vue_render__$41 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-seventeen-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "left-image" },
              [
                _c("xml-image-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                    "block-data-name": _vm.imageBlockDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "show-title": false,
                    "container-class": "image-container",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                  },
                  on: { blockclick: _vm.handleBlockClick },
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("div", { staticClass: "zhuanshi" }, [
                  _c("div", { staticClass: "line1" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "line2" }),
                ]),
                _vm._v(" "),
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$41 = [];
__vue_render__$41._withStripped = true;

  /* style */
  const __vue_inject_styles__$41 = undefined;
  /* scoped */
  const __vue_scope_id__$41 = "data-v-05b67824";
  /* module identifier */
  const __vue_module_identifier__$41 = undefined;
  /* functional template */
  const __vue_is_functional_template__$41 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$41 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$41, staticRenderFns: __vue_staticRenderFns__$41 },
    __vue_inject_styles__$41,
    __vue_script__$41,
    __vue_scope_id__$41,
    __vue_is_functional_template__$41,
    __vue_module_identifier__$41,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$40 = {
  mixins: [singleGroupMixin],
  name: 'titleeighteenRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$40 = script$40;
/* template */
var __vue_render__$40 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-eighteen-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container-box" }, [
            _c(
              "div",
              { staticClass: "title-container" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "linebox" }, [
              _c("div", { staticClass: "line1" }),
              _vm._v(" "),
              _c("div", { staticClass: "line2" }),
            ]),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$40 = [];
__vue_render__$40._withStripped = true;

  /* style */
  const __vue_inject_styles__$40 = undefined;
  /* scoped */
  const __vue_scope_id__$40 = "data-v-6d98bf1e";
  /* module identifier */
  const __vue_module_identifier__$40 = undefined;
  /* functional template */
  const __vue_is_functional_template__$40 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$40 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$40, staticRenderFns: __vue_staticRenderFns__$40 },
    __vue_inject_styles__$40,
    __vue_script__$40,
    __vue_scope_id__$40,
    __vue_is_functional_template__$40,
    __vue_module_identifier__$40,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3$ = {
  mixins: [singleGroupMixin],
  name: 'titleEighteenRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3$ = script$3$;
/* template */
var __vue_render__$3$ = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-eighteen-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container-box" }, [
            _c(
              "div",
              { staticClass: "title-container" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "linebox" }, [
              _c("div", { staticClass: "line1" }),
              _vm._v(" "),
              _c("div", { staticClass: "line2" }),
            ]),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3$ = [];
__vue_render__$3$._withStripped = true;

  /* style */
  const __vue_inject_styles__$3$ = undefined;
  /* scoped */
  const __vue_scope_id__$3$ = "data-v-f6617d46";
  /* module identifier */
  const __vue_module_identifier__$3$ = undefined;
  /* functional template */
  const __vue_is_functional_template__$3$ = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3$ = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3$, staticRenderFns: __vue_staticRenderFns__$3$ },
    __vue_inject_styles__$3$,
    __vue_script__$3$,
    __vue_scope_id__$3$,
    __vue_is_functional_template__$3$,
    __vue_module_identifier__$3$,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3_ = {
  mixins: [singleGroupMixin],
  name: 'titleNineteenRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3_ = script$3_;
/* template */
var __vue_render__$3_ = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-nineteen-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container-box" }, [
            _c(
              "div",
              { staticClass: "title-container" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3_ = [];
__vue_render__$3_._withStripped = true;

  /* style */
  const __vue_inject_styles__$3_ = undefined;
  /* scoped */
  const __vue_scope_id__$3_ = "data-v-5d3475c2";
  /* module identifier */
  const __vue_module_identifier__$3_ = undefined;
  /* functional template */
  const __vue_is_functional_template__$3_ = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3_ = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3_, staticRenderFns: __vue_staticRenderFns__$3_ },
    __vue_inject_styles__$3_,
    __vue_script__$3_,
    __vue_scope_id__$3_,
    __vue_is_functional_template__$3_,
    __vue_module_identifier__$3_,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3Z = {
  mixins: [singleGroupMixin],
  name: 'titleGreentheme1Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3Z = script$3Z;
/* template */
var __vue_render__$3Z = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Greentheme1-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "left-image" },
              [
                _c("xml-image-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                    "block-data-name": _vm.imageBlockDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "show-title": false,
                    "container-class": "image-container",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                  },
                  on: { blockclick: _vm.handleBlockClick },
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "right-top-bg" }, [
              _c("div", { staticClass: "zhuangshi" }, [
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
              ]),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "rigth-titlebox" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3Z = [];
__vue_render__$3Z._withStripped = true;

  /* style */
  const __vue_inject_styles__$3Z = undefined;
  /* scoped */
  const __vue_scope_id__$3Z = "data-v-51cc33ba";
  /* module identifier */
  const __vue_module_identifier__$3Z = undefined;
  /* functional template */
  const __vue_is_functional_template__$3Z = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3Z = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3Z, staticRenderFns: __vue_staticRenderFns__$3Z },
    __vue_inject_styles__$3Z,
    __vue_script__$3Z,
    __vue_scope_id__$3Z,
    __vue_is_functional_template__$3Z,
    __vue_module_identifier__$3Z,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3Y = {
  mixins: [singleGroupMixin],
  name: 'titleGreentheme2Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3Y = script$3Y;
/* template */
var __vue_render__$3Y = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Greentheme2-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "left-image" },
              [
                _c("xml-image-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                    "block-data-name": _vm.imageBlockDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "show-title": false,
                    "container-class": "image-container",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                  },
                  on: { blockclick: _vm.handleBlockClick },
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "right-top-bg" }, [
              _c("div", { staticClass: "top-zhuangshi" }, [
                _c("div", [
                  _c("div", [
                    _c("div", { staticClass: "top-jiantou" }),
                    _vm._v(" "),
                    _c("div", { staticClass: "bottom-jiantou" }),
                  ]),
                  _vm._v(" "),
                  _c("div", [
                    _c("div", { staticClass: "top-jiantou" }),
                    _vm._v(" "),
                    _c("div", { staticClass: "bottom-jiantou" }),
                  ]),
                ]),
              ]),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "rigth-titlebox" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c("div", { staticClass: "bottomzhuangshi" }),
            ]),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3Y = [];
__vue_render__$3Y._withStripped = true;

  /* style */
  const __vue_inject_styles__$3Y = undefined;
  /* scoped */
  const __vue_scope_id__$3Y = "data-v-bdb17eca";
  /* module identifier */
  const __vue_module_identifier__$3Y = undefined;
  /* functional template */
  const __vue_is_functional_template__$3Y = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3Y = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3Y, staticRenderFns: __vue_staticRenderFns__$3Y },
    __vue_inject_styles__$3Y,
    __vue_script__$3Y,
    __vue_scope_id__$3Y,
    __vue_is_functional_template__$3Y,
    __vue_module_identifier__$3Y,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3X = {
  mixins: [singleGroupMixin],
  name: 'titleGreentheme3Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3X = script$3X;
/* template */
var __vue_render__$3X = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Greentheme3-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
                _vm._v(" "),
                _c("div", { staticClass: "right-top-bg" }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3X = [];
__vue_render__$3X._withStripped = true;

  /* style */
  const __vue_inject_styles__$3X = undefined;
  /* scoped */
  const __vue_scope_id__$3X = "data-v-5e9c58b2";
  /* module identifier */
  const __vue_module_identifier__$3X = undefined;
  /* functional template */
  const __vue_is_functional_template__$3X = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3X = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3X, staticRenderFns: __vue_staticRenderFns__$3X },
    __vue_inject_styles__$3X,
    __vue_script__$3X,
    __vue_scope_id__$3X,
    __vue_is_functional_template__$3X,
    __vue_module_identifier__$3X,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3W = {
  mixins: [singleGroupMixin],
  name: 'titleGreentheme4Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3W = script$3W;
/* template */
var __vue_render__$3W = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Greentheme4-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "cont-box" }, [
            _c("div", { staticClass: "title-container" }, [
              _c("div", { staticClass: "right-top-bg" }),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3W = [];
__vue_render__$3W._withStripped = true;

  /* style */
  const __vue_inject_styles__$3W = undefined;
  /* scoped */
  const __vue_scope_id__$3W = "data-v-78c04606";
  /* module identifier */
  const __vue_module_identifier__$3W = undefined;
  /* functional template */
  const __vue_is_functional_template__$3W = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3W = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3W, staticRenderFns: __vue_staticRenderFns__$3W },
    __vue_inject_styles__$3W,
    __vue_script__$3W,
    __vue_scope_id__$3W,
    __vue_is_functional_template__$3W,
    __vue_module_identifier__$3W,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3V = {
  mixins: [singleGroupMixin],
  name: 'titleGreentheme5Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3V = script$3V;
/* template */
var __vue_render__$3V = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Greentheme5-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-left-img" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3V = [];
__vue_render__$3V._withStripped = true;

  /* style */
  const __vue_inject_styles__$3V = undefined;
  /* scoped */
  const __vue_scope_id__$3V = "data-v-55b29dbc";
  /* module identifier */
  const __vue_module_identifier__$3V = undefined;
  /* functional template */
  const __vue_is_functional_template__$3V = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3V = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3V, staticRenderFns: __vue_staticRenderFns__$3V },
    __vue_inject_styles__$3V,
    __vue_script__$3V,
    __vue_scope_id__$3V,
    __vue_is_functional_template__$3V,
    __vue_module_identifier__$3V,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3U = {
  mixins: [singleGroupMixin],
  name: 'titleGreentheme6Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3U = script$3U;
/* template */
var __vue_render__$3U = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Greentheme6-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-left-img" }, [
                _c("div", { staticClass: "line" }),
                _vm._v(" "),
                _c("div", { staticClass: "block1" }),
                _vm._v(" "),
                _c("div", { staticClass: "block1" }),
              ]),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }, [
                _c("div", { staticClass: "block1" }),
                _vm._v(" "),
                _c("div", { staticClass: "block1" }),
                _vm._v(" "),
                _c("div", { staticClass: "line" }),
              ]),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3U = [];
__vue_render__$3U._withStripped = true;

  /* style */
  const __vue_inject_styles__$3U = undefined;
  /* scoped */
  const __vue_scope_id__$3U = "data-v-9e3c96d6";
  /* module identifier */
  const __vue_module_identifier__$3U = undefined;
  /* functional template */
  const __vue_is_functional_template__$3U = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3U = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3U, staticRenderFns: __vue_staticRenderFns__$3U },
    __vue_inject_styles__$3U,
    __vue_script__$3U,
    __vue_scope_id__$3U,
    __vue_is_functional_template__$3U,
    __vue_module_identifier__$3U,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3T = {
  mixins: [singleGroupMixin],
  name: 'titleYellowtheme1Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3T = script$3T;
/* template */
var __vue_render__$3T = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Yellowtheme1-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "left-image" },
              [
                _c("xml-image-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                    "block-data-name": _vm.imageBlockDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "show-title": false,
                    "container-class": "image-container",
                    resourceBasisPath: _vm.resourceBasisPath,
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                  },
                  on: { blockclick: _vm.handleBlockClick },
                }),
                _vm._v(" "),
                _c("div", { staticClass: "jiantou1" }),
                _vm._v(" "),
                _c("div", { staticClass: "jiantou2" }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "right-top-bg" }, [
              _c("div", { staticClass: "zhuangshi" }, [
                _c("div", { staticClass: "line1" }),
                _vm._v(" "),
                _c("div", { staticClass: "line2" }),
              ]),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "rigth-titlebox" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3T = [];
__vue_render__$3T._withStripped = true;

  /* style */
  const __vue_inject_styles__$3T = undefined;
  /* scoped */
  const __vue_scope_id__$3T = "data-v-0d388e07";
  /* module identifier */
  const __vue_module_identifier__$3T = undefined;
  /* functional template */
  const __vue_is_functional_template__$3T = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3T = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3T, staticRenderFns: __vue_staticRenderFns__$3T },
    __vue_inject_styles__$3T,
    __vue_script__$3T,
    __vue_scope_id__$3T,
    __vue_is_functional_template__$3T,
    __vue_module_identifier__$3T,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3S = {
  mixins: [singleGroupMixin],
  name: 'titleYellowtheme2Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3S = script$3S;
/* template */
var __vue_render__$3S = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Yellowtheme2-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c("div", { staticClass: "left-icon" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3S = [];
__vue_render__$3S._withStripped = true;

  /* style */
  const __vue_inject_styles__$3S = undefined;
  /* scoped */
  const __vue_scope_id__$3S = "data-v-ea131be6";
  /* module identifier */
  const __vue_module_identifier__$3S = undefined;
  /* functional template */
  const __vue_is_functional_template__$3S = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3S = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3S, staticRenderFns: __vue_staticRenderFns__$3S },
    __vue_inject_styles__$3S,
    __vue_script__$3S,
    __vue_scope_id__$3S,
    __vue_is_functional_template__$3S,
    __vue_module_identifier__$3S,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3R = {
  mixins: [singleGroupMixin],
  name: 'titleYellowtheme3Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3R = script$3R;
/* template */
var __vue_render__$3R = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Yellowtheme3-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c("div", { staticClass: "left-icon" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3R = [];
__vue_render__$3R._withStripped = true;

  /* style */
  const __vue_inject_styles__$3R = undefined;
  /* scoped */
  const __vue_scope_id__$3R = "data-v-012c196e";
  /* module identifier */
  const __vue_module_identifier__$3R = undefined;
  /* functional template */
  const __vue_is_functional_template__$3R = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3R = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3R, staticRenderFns: __vue_staticRenderFns__$3R },
    __vue_inject_styles__$3R,
    __vue_script__$3R,
    __vue_scope_id__$3R,
    __vue_is_functional_template__$3R,
    __vue_module_identifier__$3R,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3Q = {
  mixins: [singleGroupMixin],
  name: 'titleYellowtheme4Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3Q = script$3Q;
/* template */
var __vue_render__$3Q = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Yellowtheme4-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3Q = [];
__vue_render__$3Q._withStripped = true;

  /* style */
  const __vue_inject_styles__$3Q = undefined;
  /* scoped */
  const __vue_scope_id__$3Q = "data-v-848fa49e";
  /* module identifier */
  const __vue_module_identifier__$3Q = undefined;
  /* functional template */
  const __vue_is_functional_template__$3Q = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3Q = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3Q, staticRenderFns: __vue_staticRenderFns__$3Q },
    __vue_inject_styles__$3Q,
    __vue_script__$3Q,
    __vue_scope_id__$3Q,
    __vue_is_functional_template__$3Q,
    __vue_module_identifier__$3Q,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3P = {
  mixins: [singleGroupMixin],
  name: 'titleYellowtheme5Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3P = script$3P;
/* template */
var __vue_render__$3P = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Yellowtheme5-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c("div", { staticClass: "left-img" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "right-img" }),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3P = [];
__vue_render__$3P._withStripped = true;

  /* style */
  const __vue_inject_styles__$3P = undefined;
  /* scoped */
  const __vue_scope_id__$3P = "data-v-40165113";
  /* module identifier */
  const __vue_module_identifier__$3P = undefined;
  /* functional template */
  const __vue_is_functional_template__$3P = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3P = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3P, staticRenderFns: __vue_staticRenderFns__$3P },
    __vue_inject_styles__$3P,
    __vue_script__$3P,
    __vue_scope_id__$3P,
    __vue_is_functional_template__$3P,
    __vue_module_identifier__$3P,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3O = {
  mixins: [singleGroupMixin],
  name: 'titleYellowtheme6Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3O = script$3O;
/* template */
var __vue_render__$3O = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Yellowtheme6-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c("div", { staticClass: "zhuangshi1" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "zhuangshi2" }),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3O = [];
__vue_render__$3O._withStripped = true;

  /* style */
  const __vue_inject_styles__$3O = undefined;
  /* scoped */
  const __vue_scope_id__$3O = "data-v-46f2f6ac";
  /* module identifier */
  const __vue_module_identifier__$3O = undefined;
  /* functional template */
  const __vue_is_functional_template__$3O = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3O = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3O, staticRenderFns: __vue_staticRenderFns__$3O },
    __vue_inject_styles__$3O,
    __vue_script__$3O,
    __vue_scope_id__$3O,
    __vue_is_functional_template__$3O,
    __vue_module_identifier__$3O,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3N = {
  mixins: [singleGroupMixin],
  name: 'titleKnowledgeRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      numberTextDataName: 'numberTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3N = script$3N;
/* template */
var __vue_render__$3N = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Knowledge-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "left-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.numberTextDataName],
                    "block-data-name": _vm.numberTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3N = [];
__vue_render__$3N._withStripped = true;

  /* style */
  const __vue_inject_styles__$3N = undefined;
  /* scoped */
  const __vue_scope_id__$3N = "data-v-01caee83";
  /* module identifier */
  const __vue_module_identifier__$3N = undefined;
  /* functional template */
  const __vue_is_functional_template__$3N = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3N = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3N, staticRenderFns: __vue_staticRenderFns__$3N },
    __vue_inject_styles__$3N,
    __vue_script__$3N,
    __vue_scope_id__$3N,
    __vue_is_functional_template__$3N,
    __vue_module_identifier__$3N,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3M = {
  mixins: [singleGroupMixin],
  name: 'titleSanQintheme1Render',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {},
      mouseHover: false
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    hover() {
      this.mouseHover = true;
    },
    leave() {
      this.mouseHover = false;
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3M = script$3M;
/* template */
var __vue_render__$3M = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group",
      class: [
        "xml-title-SanQintheme1-" + _vm.pageType,
        _vm.mouseHover ? "hovered" : "",
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick, mousemove: _vm.hover, mouseleave: _vm.leave },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3M = [];
__vue_render__$3M._withStripped = true;

  /* style */
  const __vue_inject_styles__$3M = undefined;
  /* scoped */
  const __vue_scope_id__$3M = "data-v-358b63b0";
  /* module identifier */
  const __vue_module_identifier__$3M = undefined;
  /* functional template */
  const __vue_is_functional_template__$3M = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3M = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3M, staticRenderFns: __vue_staticRenderFns__$3M },
    __vue_inject_styles__$3M,
    __vue_script__$3M,
    __vue_scope_id__$3M,
    __vue_is_functional_template__$3M,
    __vue_module_identifier__$3M,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3L = {
  mixins: [singleGroupMixin],
  name: 'titleSanQintheme2Render',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {},
      mouseHover: false
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    hover() {
      this.mouseHover = true;
    },
    leave() {
      this.mouseHover = false;
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3L = script$3L;
/* template */
var __vue_render__$3L = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group",
      class: [
        "xml-title-SanQintheme2-" + _vm.pageType,
        _vm.mouseHover ? "hovered" : "",
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick, mousemove: _vm.hover, mouseleave: _vm.leave },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3L = [];
__vue_render__$3L._withStripped = true;

  /* style */
  const __vue_inject_styles__$3L = undefined;
  /* scoped */
  const __vue_scope_id__$3L = "data-v-53595876";
  /* module identifier */
  const __vue_module_identifier__$3L = undefined;
  /* functional template */
  const __vue_is_functional_template__$3L = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3L = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3L, staticRenderFns: __vue_staticRenderFns__$3L },
    __vue_inject_styles__$3L,
    __vue_script__$3L,
    __vue_scope_id__$3L,
    __vue_is_functional_template__$3L,
    __vue_module_identifier__$3L,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3K = {
  mixins: [singleGroupMixin],
  name: 'titleSanQintheme3Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3K = script$3K;
/* template */
var __vue_render__$3K = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-SanQintheme3-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3K = [];
__vue_render__$3K._withStripped = true;

  /* style */
  const __vue_inject_styles__$3K = undefined;
  /* scoped */
  const __vue_scope_id__$3K = "data-v-60db5a12";
  /* module identifier */
  const __vue_module_identifier__$3K = undefined;
  /* functional template */
  const __vue_is_functional_template__$3K = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3K = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3K, staticRenderFns: __vue_staticRenderFns__$3K },
    __vue_inject_styles__$3K,
    __vue_script__$3K,
    __vue_scope_id__$3K,
    __vue_is_functional_template__$3K,
    __vue_module_identifier__$3K,
    false,
    undefined,
    undefined,
    undefined
  );

const TitleComponents$4 = [__vue_component__$4h, __vue_component__$4g, __vue_component__$4f, __vue_component__$4e, __vue_component__$4d, __vue_component__$4c, __vue_component__$4b, __vue_component__$4a, __vue_component__$49, __vue_component__$48, __vue_component__$47, __vue_component__$46, __vue_component__$45, __vue_component__$44, __vue_component__$43, __vue_component__$42, __vue_component__$41, __vue_component__$40, __vue_component__$3$, __vue_component__$3_, __vue_component__$3Z, __vue_component__$3Y, __vue_component__$3X, __vue_component__$3W, __vue_component__$3V, __vue_component__$3U, __vue_component__$3T, __vue_component__$3S, __vue_component__$3R, __vue_component__$3Q, __vue_component__$3P, __vue_component__$3O, __vue_component__$3N, __vue_component__$3M, __vue_component__$3L, __vue_component__$3K];
var XmlTitle = {
  // install,
  ...TitleComponents$4
};

//
var script$3J = {
  mixins: [singleGroupMixin],
  name: 'imageTextEighthRender',
  isUnPrefix: true,
  components: {
    XmlImageRender: __vue_component__$4S
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图文',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      imageBlockDataName: 'imageData',
      numberTextDataName: 'numberTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3J = script$3J;
/* template */
var __vue_render__$3J = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-text-image-eighth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "iamge-bg-box" },
            [
              _c("xml-image-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                  "block-data-name": _vm.imageBlockDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "image-container",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                },
                on: { blockclick: _vm.handleBlockClick },
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3J = [];
__vue_render__$3J._withStripped = true;

  /* style */
  const __vue_inject_styles__$3J = undefined;
  /* scoped */
  const __vue_scope_id__$3J = "data-v-3afbe29e";
  /* module identifier */
  const __vue_module_identifier__$3J = undefined;
  /* functional template */
  const __vue_is_functional_template__$3J = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3J = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3J, staticRenderFns: __vue_staticRenderFns__$3J },
    __vue_inject_styles__$3J,
    __vue_script__$3J,
    __vue_scope_id__$3J,
    __vue_is_functional_template__$3J,
    __vue_module_identifier__$3J,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3I = {
  mixins: [singleGroupMixin],
  name: 'imageTextFifthRender',
  isUnPrefix: true,
  components: {
    XmlImageRender: __vue_component__$4S,
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图文',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      imageBlockDataName: 'imageData',
      numberTextDataName: 'numberTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3I = script$3I;
/* template */
var __vue_render__$3I = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-text-image-fifth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticStyle: { "border-radius": "6px", padding: "9px 11px" } },
            [
              _c(
                "div",
                { staticClass: "iamge-bg-box" },
                [
                  _c(
                    "div",
                    { staticClass: "image-top-title" },
                    [
                      _c("xml-text-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.titleTextDataName],
                          "block-data-name": _vm.titleTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "text-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      }),
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c("xml-image-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                      "block-data-name": _vm.imageBlockDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "image-container",
                      mode: _vm.mode,
                      resourceBasisPath: _vm.resourceBasisPath,
                    },
                    on: { blockclick: _vm.handleBlockClick },
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "image-text-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                      "block-data-name": _vm.bodyTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3I = [];
__vue_render__$3I._withStripped = true;

  /* style */
  const __vue_inject_styles__$3I = undefined;
  /* scoped */
  const __vue_scope_id__$3I = "data-v-42df40de";
  /* module identifier */
  const __vue_module_identifier__$3I = undefined;
  /* functional template */
  const __vue_is_functional_template__$3I = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3I = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3I, staticRenderFns: __vue_staticRenderFns__$3I },
    __vue_inject_styles__$3I,
    __vue_script__$3I,
    __vue_scope_id__$3I,
    __vue_is_functional_template__$3I,
    __vue_module_identifier__$3I,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3H = {
  mixins: [singleGroupMixin],
  name: 'imageTextFirstRender',
  isUnPrefix: true,
  components: {
    XmlImageRender: __vue_component__$4S,
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图文',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3H = script$3H;
/* template */
var __vue_render__$3H = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-text-image-first-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticStyle: {
                background: "#4c95ee",
                "border-radius": "6px",
                padding: "9px 11px",
              },
            },
            [
              _c(
                "div",
                { staticStyle: { display: "flex", "flex-wrap": "nowrap" } },
                [
                  _c(
                    "div",
                    [
                      _c("xml-text-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.titleTextDataName],
                          "block-data-name": _vm.titleTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "text-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      }),
                      _vm._v(" "),
                      _c("xml-image-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                          "block-data-name": _vm.imageBlockDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "image-container",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                        },
                        on: { blockclick: _vm.handleBlockClick },
                      }),
                      _vm._v(" "),
                      _c("xml-text-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                          "block-data-name": _vm.bodyTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "text-body-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      }),
                    ],
                    1
                  ),
                ]
              ),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3H = [];
__vue_render__$3H._withStripped = true;

  /* style */
  const __vue_inject_styles__$3H = undefined;
  /* scoped */
  const __vue_scope_id__$3H = "data-v-01022b03";
  /* module identifier */
  const __vue_module_identifier__$3H = undefined;
  /* functional template */
  const __vue_is_functional_template__$3H = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3H = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3H, staticRenderFns: __vue_staticRenderFns__$3H },
    __vue_inject_styles__$3H,
    __vue_script__$3H,
    __vue_scope_id__$3H,
    __vue_is_functional_template__$3H,
    __vue_module_identifier__$3H,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3G = {
  mixins: [singleGroupMixin],
  name: 'imageTextFourthRender',
  isUnPrefix: true,
  components: {
    XmlImageRender: __vue_component__$4S,
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图文',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      imageBlockDataName: 'imageData',
      numberTextDataName: 'numberTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3G = script$3G;
/* template */
var __vue_render__$3G = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-text-image-fourth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticStyle: { "border-radius": "6px", padding: "9px 11px" } },
            [
              _c(
                "div",
                { staticClass: "iamge-bg-box" },
                [
                  _c("xml-image-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                      "block-data-name": _vm.imageBlockDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "image-container",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                    },
                    on: { blockclick: _vm.handleBlockClick },
                  }),
                  _vm._v(" "),
                  _c(
                    "div",
                    { staticClass: "image-text-box" },
                    [
                      _c(
                        "div",
                        { staticClass: "image-top-title" },
                        [
                          _c("xml-text-render", {
                            attrs: {
                              "p-block-data":
                                _vm.groupData[_vm.numberTextDataName],
                              "block-data-name": _vm.numberTextDataName,
                              "extend-params": _vm.extendParams,
                              "current-rule": _vm.currentRule,
                              "rule-index": _vm.ruleIndex,
                              "container-class": "text-container-number",
                              "editor-class": "editor",
                              mode: _vm.mode,
                              "page-type": _vm.pageType,
                              resourceBasisPath: _vm.resourceBasisPath,
                              scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                            },
                            on: {
                              blockclick: _vm.handleBlockClick,
                              groupDataChange: _vm.groupDataChange,
                            },
                            scopedSlots: _vm._u(
                              [
                                _vm._l(
                                  _vm.$scopedSlots,
                                  function (index, name) {
                                    return {
                                      key: name,
                                      fn: function (deliver) {
                                        return [
                                          _vm._t(name, null, null, deliver),
                                        ]
                                      },
                                    }
                                  }
                                ),
                              ],
                              null,
                              true
                            ),
                          }),
                          _vm._v(" "),
                          _c("xml-text-render", {
                            attrs: {
                              "p-block-data":
                                _vm.groupData[_vm.titleTextDataName],
                              "block-data-name": _vm.titleTextDataName,
                              "extend-params": _vm.extendParams,
                              "current-rule": _vm.currentRule,
                              "rule-index": _vm.ruleIndex,
                              "container-class": "text-container",
                              "editor-class": "editor",
                              mode: _vm.mode,
                              "page-type": _vm.pageType,
                              resourceBasisPath: _vm.resourceBasisPath,
                              scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                            },
                            on: {
                              blockclick: _vm.handleBlockClick,
                              groupDataChange: _vm.groupDataChange,
                            },
                            scopedSlots: _vm._u(
                              [
                                _vm._l(
                                  _vm.$scopedSlots,
                                  function (index, name) {
                                    return {
                                      key: name,
                                      fn: function (deliver) {
                                        return [
                                          _vm._t(name, null, null, deliver),
                                        ]
                                      },
                                    }
                                  }
                                ),
                              ],
                              null,
                              true
                            ),
                          }),
                        ],
                        1
                      ),
                      _vm._v(" "),
                      _c("xml-text-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                          "block-data-name": _vm.bodyTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "text-body-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      }),
                    ],
                    1
                  ),
                ],
                1
              ),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3G = [];
__vue_render__$3G._withStripped = true;

  /* style */
  const __vue_inject_styles__$3G = undefined;
  /* scoped */
  const __vue_scope_id__$3G = "data-v-0751fc96";
  /* module identifier */
  const __vue_module_identifier__$3G = undefined;
  /* functional template */
  const __vue_is_functional_template__$3G = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3G = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3G, staticRenderFns: __vue_staticRenderFns__$3G },
    __vue_inject_styles__$3G,
    __vue_script__$3G,
    __vue_scope_id__$3G,
    __vue_is_functional_template__$3G,
    __vue_module_identifier__$3G,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3F = {
  mixins: [singleGroupMixin],
  name: 'imageTextSecondRender',
  isUnPrefix: true,
  components: {
    XmlImageRender: __vue_component__$4S,
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图文',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3F = script$3F;
/* template */
var __vue_render__$3F = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-text-image-second-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticStyle: { display: "flex", "align-items": "center" } },
            [
              _c(
                "div",
                { staticClass: "image-box" },
                [
                  _c("xml-image-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                      "block-data-name": _vm.imageBlockDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "image-container",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "title-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: { blockclick: _vm.handleBlockClick },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]
          ),
          _vm._v(" "),
          _c("div", { staticClass: "body-box" }, [
            _c(
              "div",
              { staticClass: "body-box-inner" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3F = [];
__vue_render__$3F._withStripped = true;

  /* style */
  const __vue_inject_styles__$3F = undefined;
  /* scoped */
  const __vue_scope_id__$3F = "data-v-e03e6adc";
  /* module identifier */
  const __vue_module_identifier__$3F = undefined;
  /* functional template */
  const __vue_is_functional_template__$3F = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3F = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3F, staticRenderFns: __vue_staticRenderFns__$3F },
    __vue_inject_styles__$3F,
    __vue_script__$3F,
    __vue_scope_id__$3F,
    __vue_is_functional_template__$3F,
    __vue_module_identifier__$3F,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3E = {
  mixins: [singleGroupMixin],
  name: 'imageTextSeventhRender',
  isUnPrefix: true,
  components: {
    XmlImageRender: __vue_component__$4S,
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图文',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      imageBlockDataName: 'imageData',
      numberTextDataName: 'numberTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3E = script$3E;
/* template */
var __vue_render__$3E = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-text-image-seventh-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticStyle: { "border-radius": "6px", padding: "9px 11px" } },
            [
              _c("div", {}, [
                _c("div", { staticClass: "image-text-decorate2" }),
                _vm._v(" "),
                _c(
                  "div",
                  { staticClass: "iamge-bg-box" },
                  [
                    _c("xml-image-render", {
                      attrs: {
                        "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                        "block-data-name": _vm.imageBlockDataName,
                        "extend-params": _vm.extendParams,
                        "current-rule": _vm.currentRule,
                        "rule-index": _vm.ruleIndex,
                        "container-class": "image-container",
                        mode: _vm.mode,
                        "page-type": _vm.pageType,
                        resourceBasisPath: _vm.resourceBasisPath,
                      },
                      on: { blockclick: _vm.handleBlockClick },
                    }),
                  ],
                  1
                ),
                _vm._v(" "),
                _c(
                  "div",
                  { staticClass: "image-text-box" },
                  [
                    _c(
                      "xml-text-render",
                      {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                          "block-data-name": _vm.bodyTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "text-body-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      },
                      [_vm._v("s\n          ")]
                    ),
                  ],
                  1
                ),
                _vm._v(" "),
                _c("div", { staticClass: "image-text-decorate" }),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3E = [];
__vue_render__$3E._withStripped = true;

  /* style */
  const __vue_inject_styles__$3E = undefined;
  /* scoped */
  const __vue_scope_id__$3E = "data-v-f2f9072c";
  /* module identifier */
  const __vue_module_identifier__$3E = undefined;
  /* functional template */
  const __vue_is_functional_template__$3E = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3E = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3E, staticRenderFns: __vue_staticRenderFns__$3E },
    __vue_inject_styles__$3E,
    __vue_script__$3E,
    __vue_scope_id__$3E,
    __vue_is_functional_template__$3E,
    __vue_module_identifier__$3E,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3D = {
  mixins: [singleGroupMixin],
  name: 'imageTextSixthRender',
  isUnPrefix: true,
  components: {
    XmlImageRender: __vue_component__$4S,
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图文',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      imageBlockDataName: 'imageData',
      numberTextDataName: 'numberTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3D = script$3D;
/* template */
var __vue_render__$3D = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-text-image-sixth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticStyle: {
                "border-radius": "6px",
                padding: "9px 11px",
                display: "flex",
              },
            },
            [
              _c("div", { staticStyle: { display: "flex" } }, [
                _c(
                  "div",
                  { staticClass: "iamge-bg-box" },
                  [
                    _c(
                      "div",
                      { staticClass: "image-top-title" },
                      [
                        _c("xml-text-render", {
                          attrs: {
                            "p-block-data":
                              _vm.groupData[_vm.titleTextDataName],
                            "block-data-name": _vm.titleTextDataName,
                            "extend-params": _vm.extendParams,
                            "current-rule": _vm.currentRule,
                            "rule-index": _vm.ruleIndex,
                            "container-class": "text-container",
                            "editor-class": "editor",
                            mode: _vm.mode,
                            "page-type": _vm.pageType,
                            resourceBasisPath: _vm.resourceBasisPath,
                            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                          },
                          on: {
                            blockclick: _vm.handleBlockClick,
                            groupDataChange: _vm.groupDataChange,
                          },
                          scopedSlots: _vm._u(
                            [
                              _vm._l(_vm.$scopedSlots, function (index, name) {
                                return {
                                  key: name,
                                  fn: function (deliver) {
                                    return [_vm._t(name, null, null, deliver)]
                                  },
                                }
                              }),
                            ],
                            null,
                            true
                          ),
                        }),
                      ],
                      1
                    ),
                    _vm._v(" "),
                    _c("xml-image-render", {
                      attrs: {
                        "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                        "block-data-name": _vm.imageBlockDataName,
                        "extend-params": _vm.extendParams,
                        "current-rule": _vm.currentRule,
                        "rule-index": _vm.ruleIndex,
                        "container-class": "image-container",
                        mode: _vm.mode,
                        "page-type": _vm.pageType,
                        resourceBasisPath: _vm.resourceBasisPath,
                      },
                      on: { blockclick: _vm.handleBlockClick },
                    }),
                  ],
                  1
                ),
                _vm._v(" "),
                _c(
                  "div",
                  { staticClass: "image-text-box" },
                  [
                    _c("xml-text-render", {
                      attrs: {
                        "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                        "block-data-name": _vm.bodyTextDataName,
                        "extend-params": _vm.extendParams,
                        "current-rule": _vm.currentRule,
                        "rule-index": _vm.ruleIndex,
                        "container-class": "text-body-container",
                        "editor-class": "editor",
                        mode: _vm.mode,
                        "page-type": _vm.pageType,
                        resourceBasisPath: _vm.resourceBasisPath,
                        scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                      },
                      on: {
                        blockclick: _vm.handleBlockClick,
                        groupDataChange: _vm.groupDataChange,
                      },
                      scopedSlots: _vm._u(
                        [
                          _vm._l(_vm.$scopedSlots, function (index, name) {
                            return {
                              key: name,
                              fn: function (deliver) {
                                return [_vm._t(name, null, null, deliver)]
                              },
                            }
                          }),
                        ],
                        null,
                        true
                      ),
                    }),
                  ],
                  1
                ),
                _vm._v(" "),
                _c("div", { staticClass: "image-text-decorate" }),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3D = [];
__vue_render__$3D._withStripped = true;

  /* style */
  const __vue_inject_styles__$3D = undefined;
  /* scoped */
  const __vue_scope_id__$3D = "data-v-6c942a60";
  /* module identifier */
  const __vue_module_identifier__$3D = undefined;
  /* functional template */
  const __vue_is_functional_template__$3D = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3D = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3D, staticRenderFns: __vue_staticRenderFns__$3D },
    __vue_inject_styles__$3D,
    __vue_script__$3D,
    __vue_scope_id__$3D,
    __vue_is_functional_template__$3D,
    __vue_module_identifier__$3D,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3C = {
  mixins: [singleGroupMixin],
  name: 'imageTextThirdRender',
  isUnPrefix: true,
  components: {
    XmlImageRender: __vue_component__$4S,
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图文',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3C = script$3C;
/* template */
var __vue_render__$3C = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-text-image-third-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticStyle: { "border-radius": "6px", padding: "9px 11px" } },
            [
              _c(
                "div",
                {
                  staticStyle: {
                    display: "flex",
                    "flex-wrap": "nowrap",
                    "justify-content": "space-between",
                    "align-items": "center",
                  },
                },
                [
                  _c(
                    "div",
                    { staticStyle: { width: "48%" } },
                    [
                      _c("xml-image-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                          "block-data-name": _vm.imageBlockDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "image-container",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                        },
                        on: { blockclick: _vm.handleBlockClick },
                      }),
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c(
                    "div",
                    { staticStyle: { width: "48%" } },
                    [
                      _c("xml-text-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.titleTextDataName],
                          "block-data-name": _vm.titleTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "text-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      }),
                      _vm._v(" "),
                      _c("xml-text-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                          "block-data-name": _vm.bodyTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "text-body-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      }),
                    ],
                    1
                  ),
                ]
              ),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3C = [];
__vue_render__$3C._withStripped = true;

  /* style */
  const __vue_inject_styles__$3C = undefined;
  /* scoped */
  const __vue_scope_id__$3C = "data-v-6d42e319";
  /* module identifier */
  const __vue_module_identifier__$3C = undefined;
  /* functional template */
  const __vue_is_functional_template__$3C = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3C = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3C, staticRenderFns: __vue_staticRenderFns__$3C },
    __vue_inject_styles__$3C,
    __vue_script__$3C,
    __vue_scope_id__$3C,
    __vue_is_functional_template__$3C,
    __vue_module_identifier__$3C,
    false,
    undefined,
    undefined,
    undefined
  );

const ImageTextComponents = [__vue_component__$3J, __vue_component__$3I, __vue_component__$3H, __vue_component__$3G, __vue_component__$3F, __vue_component__$3E, __vue_component__$3D, __vue_component__$3C];
var ImageText = {
  // install,
  ...ImageTextComponents
};

//
var script$3B = {
  mixins: [singleGroupMixin],
  name: 'ParagrapheighthRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      bodyTextDataName2: 'bodyTextData2',
      bodyTextDataName3: 'bodyTextData3',
      titleTextDataName: 'titleTextData',
      titleTextDataName2: 'titleTextData2',
      titleTextDataName3: 'titleTextData3',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3B = script$3B;
/* template */
var __vue_render__$3B = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-eighth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "paragraph-row-box" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "text-body-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                      "block-data-name": _vm.bodyTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                  _vm._v(" "),
                  _c("div", { staticClass: "circle" }),
                ],
                1
              ),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3B = [];
__vue_render__$3B._withStripped = true;

  /* style */
  const __vue_inject_styles__$3B = undefined;
  /* scoped */
  const __vue_scope_id__$3B = "data-v-34720a5f";
  /* module identifier */
  const __vue_module_identifier__$3B = undefined;
  /* functional template */
  const __vue_is_functional_template__$3B = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3B = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3B, staticRenderFns: __vue_staticRenderFns__$3B },
    __vue_inject_styles__$3B,
    __vue_script__$3B,
    __vue_scope_id__$3B,
    __vue_is_functional_template__$3B,
    __vue_module_identifier__$3B,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3A = {
  mixins: [singleGroupMixin],
  name: 'paragraphFirstRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3A = script$3A;
/* template */
var __vue_render__$3A = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-first-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "rotate-container" }, [
            _c(
              "div",
              { staticClass: "rotate-container-inner" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
          _vm._v(" "),
          _c("xml-text-render", {
            attrs: {
              "p-block-data": _vm.groupData[_vm.bodyTextDataName],
              "block-data-name": _vm.bodyTextDataName,
              "extend-params": _vm.extendParams,
              "current-rule": _vm.currentRule,
              "rule-index": _vm.ruleIndex,
              "container-class": "text-body-container",
              "editor-class": "editor",
              mode: _vm.mode,
              "page-type": _vm.pageType,
              resourceBasisPath: _vm.resourceBasisPath,
              scopedSlots: { $scopedSlots: _vm.$scopedSlots },
            },
            on: {
              blockclick: _vm.handleBlockClick,
              groupDataChange: _vm.groupDataChange,
            },
            scopedSlots: _vm._u(
              [
                _vm._l(_vm.$scopedSlots, function (index, name) {
                  return {
                    key: name,
                    fn: function (deliver) {
                      return [_vm._t(name, null, null, deliver)]
                    },
                  }
                }),
              ],
              null,
              true
            ),
          }),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3A = [];
__vue_render__$3A._withStripped = true;

  /* style */
  const __vue_inject_styles__$3A = undefined;
  /* scoped */
  const __vue_scope_id__$3A = "data-v-0f442a2c";
  /* module identifier */
  const __vue_module_identifier__$3A = undefined;
  /* functional template */
  const __vue_is_functional_template__$3A = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3A = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3A, staticRenderFns: __vue_staticRenderFns__$3A },
    __vue_inject_styles__$3A,
    __vue_script__$3A,
    __vue_scope_id__$3A,
    __vue_is_functional_template__$3A,
    __vue_module_identifier__$3A,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3z = {
  mixins: [singleGroupMixin],
  name: 'paragraphIsoscelesRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3z = script$3z;
/* template */
var __vue_render__$3z = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-isosceles-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "circle" }),
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
          _vm._v(" "),
          _c("div", { staticClass: "shape" }, [
            _c("div", { staticClass: "triangle" }),
            _vm._v(" "),
            _c("div", { staticClass: "triangle2" }),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3z = [];
__vue_render__$3z._withStripped = true;

  /* style */
  const __vue_inject_styles__$3z = undefined;
  /* scoped */
  const __vue_scope_id__$3z = "data-v-47af8c80";
  /* module identifier */
  const __vue_module_identifier__$3z = undefined;
  /* functional template */
  const __vue_is_functional_template__$3z = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3z = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3z, staticRenderFns: __vue_staticRenderFns__$3z },
    __vue_inject_styles__$3z,
    __vue_script__$3z,
    __vue_scope_id__$3z,
    __vue_is_functional_template__$3z,
    __vue_module_identifier__$3z,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3y = {
  mixins: [singleGroupMixin],
  name: 'paragraphninthRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。

      bodyTextDataName2: 'bodyTextData2',
      titleTextDataName2: 'titleTextData2',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3y = script$3y;
/* template */
var __vue_render__$3y = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-ninth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "paragraph-row-box" },
            [
              _c(
                "div",
                { staticClass: "text-body-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName2],
                      "block-data-name": _vm.bodyTextDataName2,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                  _vm._v(" "),
                  _c("div", { staticClass: "circle2" }),
                ],
                1
              ),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName2],
                  "block-data-name": _vm.titleTextDataName2,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3y = [];
__vue_render__$3y._withStripped = true;

  /* style */
  const __vue_inject_styles__$3y = undefined;
  /* scoped */
  const __vue_scope_id__$3y = "data-v-0b406fd2";
  /* module identifier */
  const __vue_module_identifier__$3y = undefined;
  /* functional template */
  const __vue_is_functional_template__$3y = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3y = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3y, staticRenderFns: __vue_staticRenderFns__$3y },
    __vue_inject_styles__$3y,
    __vue_script__$3y,
    __vue_scope_id__$3y,
    __vue_is_functional_template__$3y,
    __vue_module_identifier__$3y,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3x = {
  mixins: [singleGroupMixin],
  name: 'paragraphQuadrangleRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3x = script$3x;
/* template */
var __vue_render__$3x = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-quadrangle-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin1" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin2" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin3" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin4" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin5" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin6" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin7" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin8" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3x = [];
__vue_render__$3x._withStripped = true;

  /* style */
  const __vue_inject_styles__$3x = undefined;
  /* scoped */
  const __vue_scope_id__$3x = "data-v-533fdd02";
  /* module identifier */
  const __vue_module_identifier__$3x = undefined;
  /* functional template */
  const __vue_is_functional_template__$3x = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3x = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3x, staticRenderFns: __vue_staticRenderFns__$3x },
    __vue_inject_styles__$3x,
    __vue_script__$3x,
    __vue_scope_id__$3x,
    __vue_is_functional_template__$3x,
    __vue_module_identifier__$3x,
    false,
    undefined,
    undefined,
    undefined
  );

var Left$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAkCAYAAABSSLCCAAAAAXNSR0IArs4c6QAAARVJREFUSEvtlbtOw0AQRe9dFAsTbEtIPCr+wTX0ES8FgahIfoeKBhMeSiq+jD/YQOOV7MSD1thSgpGXksLbn5md0ehcDhL90ffgLZZAIXA+ITJevujs/jrohZsKS7EUXWDO4bNOZ+PI391WsAydDAwvnnQ6G0X+XlhBq31+KUBYyHa6jfz9GvpTpw6yu+22V11Yt4huEetS+/8XUcsy+GFY67/a7SsuLGV59fpt2J2+aji8VLu1+7pADW+mOr0bBn7oKxRVALRKljAcJDrb8tCzFevKjtgwPJ3M3/OFHBYiqkwZmxwtlNiZTh710YbiAyGxAM3BmgUMAeH55DMGZQpIDAcoQF79RHiWzI+p8AbioG0mAbIvFBoA7XBwjR8AAAAASUVORK5CYII=";

var Right = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAkCAYAAACJ8xqgAAAAAXNSR0IArs4c6QAAAf9JREFUSEvtljtv01AcR8+182jUJg4gxMTCgPgI7IipDKxQqqA27YQCAx8Bda2EFPEYiICoCo+9dEAsSIyRmAEhnqmSJo5bOyGx70XXBBQ2O80E8Wrp3P/j6v6OWCy3baFIEfFTQMoEw4CDHzSAwk7pyGsQ+hfiezcYAMmIPECRMgVtT3Lz+b5subK+kEms71yz6hoqlFIekIkKVAqEgF0nYK3q0BsiFaqeSJghNASqqEAFGqjb/dDy2XjhUjibofKmL981/fqcIa5PXOH7ps/Gtsv9KxafOz63X3ny7dfg08TAb3ZA6anDw0Ke+bTg415A6YkzjA/UmwQ6nmS50mVrxSKXMWjuS1Yfd3vxgaOlaOBSxaa2mic3Z9BwJMV/FDg2w+m0PAMe/trMZjib4QTP19SvzX/4Ho63/MCmVpxiBCxXbLZW8mFI/ZUpkYI+NBeQSmEagtaBpFjt8uiqdbiQ+q0sOjZvPHO4ezlHdjz1Gk7goWK4DYqkKfjSkWy+dClfyjGfEmHL69VuT1y8044lS7pC09BBr8hnRLgUfcAf4LnNPU9ElaUxRev0JaeOJagVLQwh2HVG5nChHL9CrSLeQLKQNri3ZHE8a9BxJWu65cVyeyBiCedo2/LXxk+fSHL+TIqTRw1ubbtDDbQF0ZV4XEwDqej7YAjIpgU9n8FPuCBZn/dscCMAAAAASUVORK5CYII=";

//
var script$3w = {
  mixins: [singleGroupMixin],
  name: 'paragraphSecondRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      groupData: {},
      Left: Left$1,
      Right
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3w = script$3w;
/* template */
var __vue_render__$3w = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-second-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "paragraph-second-title" },
            [
              _c("el-image", {
                staticClass: "left-image",
                attrs: { src: _vm.Left },
              }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("el-image", {
                staticClass: "right-image",
                attrs: { src: _vm.Right },
              }),
            ],
            1
          ),
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3w = [];
__vue_render__$3w._withStripped = true;

  /* style */
  const __vue_inject_styles__$3w = undefined;
  /* scoped */
  const __vue_scope_id__$3w = "data-v-09b4a172";
  /* module identifier */
  const __vue_module_identifier__$3w = undefined;
  /* functional template */
  const __vue_is_functional_template__$3w = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3w = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3w, staticRenderFns: __vue_staticRenderFns__$3w },
    __vue_inject_styles__$3w,
    __vue_script__$3w,
    __vue_scope_id__$3w,
    __vue_is_functional_template__$3w,
    __vue_module_identifier__$3w,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3v = {
  mixins: [singleGroupMixin],
  name: 'paragraphSeventhRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      numberTextDataName: 'numberTextData',
      bodyTextDataName: 'bodyTextData',
      bodyTextDataName2: 'bodyTextData2',
      bodyTextDataName3: 'bodyTextData3',
      titleTextDataName: 'titleTextData',
      titleTextDataName2: 'titleTextData2',
      titleTextDataName3: 'titleTextData3',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3v = script$3v;
/* template */
var __vue_render__$3v = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-seventh-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "paragraph-suptitle-box" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.numberTextDataName],
                  "block-data-name": _vm.numberTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container-left",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
          _vm._v(" "),
          _c("div", { staticClass: "paragraph-row-box" }, [
            _c(
              "div",
              { staticClass: "paragraph-subtitle-box" },
              [
                _c("div", { staticClass: "subtitle-left-dec" }),
                _vm._v(" "),
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName2],
                    "block-data-name": _vm.titleTextDataName2,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "text-body-box" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "paragraph-subtitle-box" },
              [
                _c("div", { staticClass: "subtitle-left-dec" }),
                _vm._v(" "),
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName3],
                    "block-data-name": _vm.titleTextDataName3,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "text-body-box" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName2],
                    "block-data-name": _vm.bodyTextDataName2,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3v = [];
__vue_render__$3v._withStripped = true;

  /* style */
  const __vue_inject_styles__$3v = undefined;
  /* scoped */
  const __vue_scope_id__$3v = "data-v-2bb6d1f4";
  /* module identifier */
  const __vue_module_identifier__$3v = undefined;
  /* functional template */
  const __vue_is_functional_template__$3v = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3v = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3v, staticRenderFns: __vue_staticRenderFns__$3v },
    __vue_inject_styles__$3v,
    __vue_script__$3v,
    __vue_scope_id__$3v,
    __vue_is_functional_template__$3v,
    __vue_module_identifier__$3v,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3u = {
  mixins: [singleGroupMixin],
  name: 'paragraphtenthRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      numberTextDataName: 'numberTextData',
      bodyTextDataName: 'bodyTextData',
      bodyTextDataName2: 'bodyTextData2',
      bodyTextDataName3: 'bodyTextData3',
      titleTextDataName: 'titleTextData',
      titleTextDataName2: 'titleTextData2',
      titleTextDataName3: 'titleTextData3',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3u = script$3u;
/* template */
var __vue_render__$3u = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-tenth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "paragraph-suptitle-box" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.numberTextDataName],
                  "block-data-name": _vm.numberTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container-left",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
          _vm._v(" "),
          _c("div", { staticClass: "paragraph-row-box" }, [
            _c(
              "div",
              { staticClass: "paragraph-subtitle-box" },
              [
                _c("div", { staticClass: "subtitle-left-dec" }),
                _vm._v(" "),
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName2],
                    "block-data-name": _vm.titleTextDataName2,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "text-body-box" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3u = [];
__vue_render__$3u._withStripped = true;

  /* style */
  const __vue_inject_styles__$3u = undefined;
  /* scoped */
  const __vue_scope_id__$3u = "data-v-3edf16f6";
  /* module identifier */
  const __vue_module_identifier__$3u = undefined;
  /* functional template */
  const __vue_is_functional_template__$3u = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3u = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3u, staticRenderFns: __vue_staticRenderFns__$3u },
    __vue_inject_styles__$3u,
    __vue_script__$3u,
    __vue_scope_id__$3u,
    __vue_is_functional_template__$3u,
    __vue_module_identifier__$3u,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3t = {
  mixins: [singleGroupMixin],
  name: 'paragraphThirdRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3t = script$3t;
/* template */
var __vue_render__$3t = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-third-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3t = [];
__vue_render__$3t._withStripped = true;

  /* style */
  const __vue_inject_styles__$3t = undefined;
  /* scoped */
  const __vue_scope_id__$3t = "data-v-5fa06695";
  /* module identifier */
  const __vue_module_identifier__$3t = undefined;
  /* functional template */
  const __vue_is_functional_template__$3t = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3t = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3t, staticRenderFns: __vue_staticRenderFns__$3t },
    __vue_inject_styles__$3t,
    __vue_script__$3t,
    __vue_scope_id__$3t,
    __vue_is_functional_template__$3t,
    __vue_module_identifier__$3t,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3s = {
  mixins: [singleGroupMixin],
  name: 'paragraphWaveRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      bodyTextDataName2: 'bodyTextData2',
      bodyTextDataName3: 'bodyTextData3',
      titleTextDataName: 'titleTextData',
      titleTextDataName2: 'titleTextData2',
      titleTextDataName3: 'titleTextData3',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$3s = script$3s;
/* template */
var __vue_render__$3s = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-wave-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick, mousemove: _vm.hover, mouseleave: _vm.leave },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "paragraph-row-box" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "text-body-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                      "block-data-name": _vm.bodyTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                  _vm._v(" "),
                  _c("div", { staticClass: "circle" }),
                ],
                1
              ),
            ],
            1
          ),
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "paragraph-row-box" },
            [
              _c(
                "div",
                { staticClass: "text-body-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName2],
                      "block-data-name": _vm.bodyTextDataName2,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                  _vm._v(" "),
                  _c("div", { staticClass: "circle2" }),
                ],
                1
              ),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName2],
                  "block-data-name": _vm.titleTextDataName2,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "paragraph-row-box" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName3],
                  "block-data-name": _vm.titleTextDataName3,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "text-body-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName3],
                      "block-data-name": _vm.bodyTextDataName3,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                  _vm._v(" "),
                  _c("div", { staticClass: "circle" }),
                ],
                1
              ),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3s = [];
__vue_render__$3s._withStripped = true;

  /* style */
  const __vue_inject_styles__$3s = undefined;
  /* scoped */
  const __vue_scope_id__$3s = "data-v-e9bc3152";
  /* module identifier */
  const __vue_module_identifier__$3s = undefined;
  /* functional template */
  const __vue_is_functional_template__$3s = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3s = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3s, staticRenderFns: __vue_staticRenderFns__$3s },
    __vue_inject_styles__$3s,
    __vue_script__$3s,
    __vue_scope_id__$3s,
    __vue_is_functional_template__$3s,
    __vue_module_identifier__$3s,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3r = {
  mixins: [singleGroupMixin],
  name: 'paragraphElevenRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3r = script$3r;
/* template */
var __vue_render__$3r = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-eleven-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text" }, [
            _c("div", { staticClass: "boder-top" }, [
              _c("div", { staticClass: "boder-top-line1" }),
              _vm._v(" "),
              _c("div", { staticClass: "boder-top-line2" }),
            ]),
            _vm._v(" "),
            _c("div", { staticClass: "boder-bottom" }, [
              _c("div", { staticClass: "boder-bottom-line1" }),
              _vm._v(" "),
              _c("div", { staticClass: "boder-bottom-line2" }),
            ]),
            _vm._v(" "),
            _c("div", { staticClass: "boder-left" }, [
              _c("div", { staticClass: "boder-left-line1" }),
              _vm._v(" "),
              _c("div", { staticClass: "boder-left-line2" }),
            ]),
            _vm._v(" "),
            _c("div", { staticClass: "boder-right" }, [
              _c("div", { staticClass: "boder-right-line1" }),
              _vm._v(" "),
              _c("div", { staticClass: "boder-right-line2" }),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "text-container" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3r = [];
__vue_render__$3r._withStripped = true;

  /* style */
  const __vue_inject_styles__$3r = undefined;
  /* scoped */
  const __vue_scope_id__$3r = "data-v-7d1ea5cc";
  /* module identifier */
  const __vue_module_identifier__$3r = undefined;
  /* functional template */
  const __vue_is_functional_template__$3r = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3r = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3r, staticRenderFns: __vue_staticRenderFns__$3r },
    __vue_inject_styles__$3r,
    __vue_script__$3r,
    __vue_scope_id__$3r,
    __vue_is_functional_template__$3r,
    __vue_module_identifier__$3r,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3q = {
  mixins: [singleGroupMixin],
  name: 'paragraphTwelveRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

var __$_require_static_images_leaflet_resource_enter_paragraph_tweleve_bg_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAxCAYAAACs0jsDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QTQ0NEJDQjZBQ0Q5MTFFREI5RDRDMjIyNEY3MEMwRjUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QTQ0NEJDQjdBQ0Q5MTFFREI5RDRDMjIyNEY3MEMwRjUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBNDQ0QkNCNEFDRDkxMUVEQjlENEMyMjI0RjcwQzBGNSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBNDQ0QkNCNUFDRDkxMUVEQjlENEMyMjI0RjcwQzBGNSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pqfr0oYAAAHtSURBVHja7JlLKERRGMdnNPIo71JSFiIrC1FKbAYpVkpmKUrKQs1CsVFWNpqRhc3IQhYspBQWYmPJRh6xmw0pzGxclOf/q6vG15lJc+fMfKNz6tftfPfW/XXu+c7rur2BR1cmy4G//Fe9Mxj5YvfddM1xZUkxokbUiBpRI2pEjej/FvVIkMCKiTxqQYNU0XZIDuDqBfUgX5ooyU2ADqmfvhnMgW7JfXQSzIKCBM+8glsQBRY4TKdoEQgBX5z7JLUHdsAxiWL7YaW7RSvBJiVNHMElsAyxcCY/fQXYBq2Ke1tgGlzzzV26RWmYWVdIfoApMC8lmRZBF4tRvxuyu4KImWkYjCqy2WcnjIi5vg4EFPExJ5I6RBdAKYvRAL8qaVHSD/pY7AjMqB7+a7anukXz7FkntryAcfAuaZk3CBpZLAjOk21BHS2aC/wsdpPMWKlblNaSTYpxNCpNdITV78GKk8TRIVoFelhsAzxI29yRZElM/ROsSdyF9rL6GTiRJkoL4jYW27VXSKJEadysZrF9iQcQLYpsP5UoysfOCxCRKMpPNbS1phPRYlDDYlcJjmwyJkobtzIWC0tsUTpEKIyp02/BO52iHvslToulM5FSuXB+thEvSnP8WzaIXoInrX3053+405KKIShR+RZgACQqX9Suk5GsAAAAAElFTkSuQmCC";

var __$_require_static_images_leaflet_resource_enter_clover_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAASCAYAAAC9+TVUAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Mjg4QTIyRUVBQ0QzMTFFREI2MTJFMUY2MkYzNTBCNkIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6Mjg4QTIyRUZBQ0QzMTFFREI2MTJFMUY2MkYzNTBCNkIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyODhBMjJFQ0FDRDMxMUVEQjYxMkUxRjYyRjM1MEI2QiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoyODhBMjJFREFDRDMxMUVEQjYxMkUxRjYyRjM1MEI2QiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PnzdDxEAAAGQSURBVHjajJJNKIRRFIa/GZM0SX5mY2GDkI2aEiXUzIYSyUIpGwthNZIaspAVkslCVrKxkZ2lECkyopGNGVmSyM9uhDGeq6O+7txpvree5s75zn3vveccVzqdtpSCkVdLUxlUQiGk4BkS++OlKT3RbWVKxabgGqJwAEcQg1MO8zsx8cEslGvxfGiEUX2Dx/CMd7iSDSZFndzkE2ayGJzBZsZNwAVz0AY7sAq7EIZ5W+49DFLYJLdvYD0BFTCtTJpsJyujHpUMC1AsZgnox+AWgyHWESiSPYtuMbGrVW7SDNUSO8QghkGI9brNQKneI/OgqwaO5blKwxhUqXEy5Ba4pSYmebT/wSx5f915McRvYEk6pfQILRAy5H4ok3NDG7tgUrr1Pztx6rLC7xgkbflxZXIip15IlwJwBwPQKYl1sEddfBitSfG3ZfDCrsCy6TWWXwrr1eLqZr0Y/eSa2DwZMq/hWzf0ORl71fJ2K7s6nJi8wQZ8G749wFauWVD6ghFQBayFEokpg0vq8aRv+BVgAPdmZWgTmMj6AAAAAElFTkSuQmCC";

/* script */
const __vue_script__$3q = script$3q;
var __vue_render__$3q = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-twelve-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("div", { staticClass: "left-top-img" }, [
                _c("img", {
                  attrs: {
                    src: __$_require_static_images_leaflet_resource_enter_paragraph_tweleve_bg_png__,
                    alt: "",
                  },
                }),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "left-top-clover" }, [
                _c("img", {
                  attrs: {
                    src: __$_require_static_images_leaflet_resource_enter_clover_png__,
                    alt: "",
                  },
                }),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "right-bottom-clover" }, [
                _c("img", {
                  attrs: {
                    src: __$_require_static_images_leaflet_resource_enter_clover_png__,
                    alt: "",
                  },
                }),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "right-bottom-img" }, [
                _c("img", {
                  attrs: {
                    src: __$_require_static_images_leaflet_resource_enter_paragraph_tweleve_bg_png__,
                    alt: "",
                  },
                }),
              ]),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3q = [];
__vue_render__$3q._withStripped = true;

  /* style */
  const __vue_inject_styles__$3q = undefined;
  /* scoped */
  const __vue_scope_id__$3q = "data-v-068fd504";
  /* module identifier */
  const __vue_module_identifier__$3q = undefined;
  /* functional template */
  const __vue_is_functional_template__$3q = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3q = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3q, staticRenderFns: __vue_staticRenderFns__$3q },
    __vue_inject_styles__$3q,
    __vue_script__$3q,
    __vue_scope_id__$3q,
    __vue_is_functional_template__$3q,
    __vue_module_identifier__$3q,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3p = {
  mixins: [singleGroupMixin],
  name: 'paragraphThirteenRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3p = script$3p;
/* template */
var __vue_render__$3p = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-thirteen-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("div", { staticClass: "text-border-top" }),
              _vm._v(" "),
              _c("div", { staticClass: "text-border-bottom" }),
              _vm._v(" "),
              _c("div", { staticClass: "text-border-left" }),
              _vm._v(" "),
              _c("div", { staticClass: "text-border-right" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3p = [];
__vue_render__$3p._withStripped = true;

  /* style */
  const __vue_inject_styles__$3p = undefined;
  /* scoped */
  const __vue_scope_id__$3p = "data-v-065da6db";
  /* module identifier */
  const __vue_module_identifier__$3p = undefined;
  /* functional template */
  const __vue_is_functional_template__$3p = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3p = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3p, staticRenderFns: __vue_staticRenderFns__$3p },
    __vue_inject_styles__$3p,
    __vue_script__$3p,
    __vue_scope_id__$3p,
    __vue_is_functional_template__$3p,
    __vue_module_identifier__$3p,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3o = {
  mixins: [singleGroupMixin],
  name: 'paragraphFourteenRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3o = script$3o;
/* template */
var __vue_render__$3o = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-fourteen-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("div", { staticClass: "right-image" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3o = [];
__vue_render__$3o._withStripped = true;

  /* style */
  const __vue_inject_styles__$3o = undefined;
  /* scoped */
  const __vue_scope_id__$3o = "data-v-3509e8fc";
  /* module identifier */
  const __vue_module_identifier__$3o = undefined;
  /* functional template */
  const __vue_is_functional_template__$3o = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3o = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3o, staticRenderFns: __vue_staticRenderFns__$3o },
    __vue_inject_styles__$3o,
    __vue_script__$3o,
    __vue_scope_id__$3o,
    __vue_is_functional_template__$3o,
    __vue_module_identifier__$3o,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3n = {
  mixins: [singleGroupMixin],
  name: 'paragraphFifteenRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3n = script$3n;
/* template */
var __vue_render__$3n = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-fifteen-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("div", { staticClass: "top" }),
              _vm._v(" "),
              _c("div", { staticClass: "left" }),
              _vm._v(" "),
              _c("div", { staticClass: "bottom" }),
              _vm._v(" "),
              _c("div", { staticClass: "right" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3n = [];
__vue_render__$3n._withStripped = true;

  /* style */
  const __vue_inject_styles__$3n = undefined;
  /* scoped */
  const __vue_scope_id__$3n = "data-v-2308cfc7";
  /* module identifier */
  const __vue_module_identifier__$3n = undefined;
  /* functional template */
  const __vue_is_functional_template__$3n = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3n = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3n, staticRenderFns: __vue_staticRenderFns__$3n },
    __vue_inject_styles__$3n,
    __vue_script__$3n,
    __vue_scope_id__$3n,
    __vue_is_functional_template__$3n,
    __vue_module_identifier__$3n,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3m = {
  mixins: [singleGroupMixin],
  name: 'paragraphGreentheme2Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3m = script$3m;
/* template */
var __vue_render__$3m = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Greentheme2-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("div", { staticClass: "border-top" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-bg" }),
              _vm._v(" "),
              _c("div", { staticClass: "border-bottom" }),
              _vm._v(" "),
              _c("div", { staticClass: "border-right" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3m = [];
__vue_render__$3m._withStripped = true;

  /* style */
  const __vue_inject_styles__$3m = undefined;
  /* scoped */
  const __vue_scope_id__$3m = "data-v-5889c61c";
  /* module identifier */
  const __vue_module_identifier__$3m = undefined;
  /* functional template */
  const __vue_is_functional_template__$3m = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3m = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3m, staticRenderFns: __vue_staticRenderFns__$3m },
    __vue_inject_styles__$3m,
    __vue_script__$3m,
    __vue_scope_id__$3m,
    __vue_is_functional_template__$3m,
    __vue_module_identifier__$3m,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3l = {
  mixins: [singleGroupMixin],
  name: 'paragraphGreentheme3Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3l = script$3l;
/* template */
var __vue_render__$3l = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Greentheme3-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-bg" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3l = [];
__vue_render__$3l._withStripped = true;

  /* style */
  const __vue_inject_styles__$3l = undefined;
  /* scoped */
  const __vue_scope_id__$3l = "data-v-3583e8d1";
  /* module identifier */
  const __vue_module_identifier__$3l = undefined;
  /* functional template */
  const __vue_is_functional_template__$3l = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3l = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3l, staticRenderFns: __vue_staticRenderFns__$3l },
    __vue_inject_styles__$3l,
    __vue_script__$3l,
    __vue_scope_id__$3l,
    __vue_is_functional_template__$3l,
    __vue_module_identifier__$3l,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3k = {
  mixins: [singleGroupMixin],
  name: 'paragraphGreentheme4Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3k = script$3k;
/* template */
var __vue_render__$3k = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Greentheme4-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("div", { staticClass: "body-text-bg1" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-bg2" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3k = [];
__vue_render__$3k._withStripped = true;

  /* style */
  const __vue_inject_styles__$3k = undefined;
  /* scoped */
  const __vue_scope_id__$3k = "data-v-e15e2ebc";
  /* module identifier */
  const __vue_module_identifier__$3k = undefined;
  /* functional template */
  const __vue_is_functional_template__$3k = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3k = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3k, staticRenderFns: __vue_staticRenderFns__$3k },
    __vue_inject_styles__$3k,
    __vue_script__$3k,
    __vue_scope_id__$3k,
    __vue_is_functional_template__$3k,
    __vue_module_identifier__$3k,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3j = {
  mixins: [singleGroupMixin],
  name: 'paragraphGreentheme5Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3j = script$3j;
/* template */
var __vue_render__$3j = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Greentheme5-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("div", { staticClass: "body-text-bg1" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "border-top" }),
              _vm._v(" "),
              _c("div", { staticClass: "border-bottom" }),
              _vm._v(" "),
              _c("div", { staticClass: "border-left" }),
              _vm._v(" "),
              _c("div", { staticClass: "border-right" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-bg2" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3j = [];
__vue_render__$3j._withStripped = true;

  /* style */
  const __vue_inject_styles__$3j = undefined;
  /* scoped */
  const __vue_scope_id__$3j = "data-v-00744ec4";
  /* module identifier */
  const __vue_module_identifier__$3j = undefined;
  /* functional template */
  const __vue_is_functional_template__$3j = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3j = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3j, staticRenderFns: __vue_staticRenderFns__$3j },
    __vue_inject_styles__$3j,
    __vue_script__$3j,
    __vue_scope_id__$3j,
    __vue_is_functional_template__$3j,
    __vue_module_identifier__$3j,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3i = {
  mixins: [singleGroupMixin],
  name: 'paragraphYellowtheme1Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3i = script$3i;
/* template */
var __vue_render__$3i = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Yellowtheme1-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "border-top" }, [
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
            ]),
            _vm._v(" "),
            _c("div", { staticClass: "border-bottom" }, [
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3i = [];
__vue_render__$3i._withStripped = true;

  /* style */
  const __vue_inject_styles__$3i = undefined;
  /* scoped */
  const __vue_scope_id__$3i = "data-v-b271bf5e";
  /* module identifier */
  const __vue_module_identifier__$3i = undefined;
  /* functional template */
  const __vue_is_functional_template__$3i = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3i = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3i, staticRenderFns: __vue_staticRenderFns__$3i },
    __vue_inject_styles__$3i,
    __vue_script__$3i,
    __vue_scope_id__$3i,
    __vue_is_functional_template__$3i,
    __vue_module_identifier__$3i,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3h = {
  mixins: [singleGroupMixin],
  name: 'paragraphYellowtheme2Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3h = script$3h;
/* template */
var __vue_render__$3h = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Yellowtheme2-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "block1" }),
            _vm._v(" "),
            _c("div", { staticClass: "block2" }),
            _vm._v(" "),
            _c("div", { staticClass: "block3" }),
            _vm._v(" "),
            _c("div", { staticClass: "block4" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3h = [];
__vue_render__$3h._withStripped = true;

  /* style */
  const __vue_inject_styles__$3h = undefined;
  /* scoped */
  const __vue_scope_id__$3h = "data-v-9d718864";
  /* module identifier */
  const __vue_module_identifier__$3h = undefined;
  /* functional template */
  const __vue_is_functional_template__$3h = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3h = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3h, staticRenderFns: __vue_staticRenderFns__$3h },
    __vue_inject_styles__$3h,
    __vue_script__$3h,
    __vue_scope_id__$3h,
    __vue_is_functional_template__$3h,
    __vue_module_identifier__$3h,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3g = {
  mixins: [singleGroupMixin],
  name: 'paragraphYellowtheme3Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3g = script$3g;
/* template */
var __vue_render__$3g = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Yellowtheme3-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "right-img" }, [_c("div")]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3g = [];
__vue_render__$3g._withStripped = true;

  /* style */
  const __vue_inject_styles__$3g = undefined;
  /* scoped */
  const __vue_scope_id__$3g = "data-v-366de105";
  /* module identifier */
  const __vue_module_identifier__$3g = undefined;
  /* functional template */
  const __vue_is_functional_template__$3g = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3g = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3g, staticRenderFns: __vue_staticRenderFns__$3g },
    __vue_inject_styles__$3g,
    __vue_script__$3g,
    __vue_scope_id__$3g,
    __vue_is_functional_template__$3g,
    __vue_module_identifier__$3g,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3f = {
  mixins: [singleGroupMixin],
  name: 'paragraphYellowtheme4Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3f = script$3f;
/* template */
var __vue_render__$3f = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Yellowtheme4-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "block1" }),
            _vm._v(" "),
            _c("div", { staticClass: "block2" }),
            _vm._v(" "),
            _c("div", { staticClass: "block3" }),
            _vm._v(" "),
            _c("div", { staticClass: "block4" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3f = [];
__vue_render__$3f._withStripped = true;

  /* style */
  const __vue_inject_styles__$3f = undefined;
  /* scoped */
  const __vue_scope_id__$3f = "data-v-737c08cc";
  /* module identifier */
  const __vue_module_identifier__$3f = undefined;
  /* functional template */
  const __vue_is_functional_template__$3f = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3f = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3f, staticRenderFns: __vue_staticRenderFns__$3f },
    __vue_inject_styles__$3f,
    __vue_script__$3f,
    __vue_scope_id__$3f,
    __vue_is_functional_template__$3f,
    __vue_module_identifier__$3f,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3e = {
  mixins: [singleGroupMixin],
  name: 'paragraphYellowtheme5Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3e = script$3e;
/* template */
var __vue_render__$3e = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Yellowtheme5-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "left-img" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "right-img" }),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3e = [];
__vue_render__$3e._withStripped = true;

  /* style */
  const __vue_inject_styles__$3e = undefined;
  /* scoped */
  const __vue_scope_id__$3e = "data-v-9c512fa4";
  /* module identifier */
  const __vue_module_identifier__$3e = undefined;
  /* functional template */
  const __vue_is_functional_template__$3e = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3e = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3e, staticRenderFns: __vue_staticRenderFns__$3e },
    __vue_inject_styles__$3e,
    __vue_script__$3e,
    __vue_scope_id__$3e,
    __vue_is_functional_template__$3e,
    __vue_module_identifier__$3e,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3d = {
  mixins: [singleGroupMixin],
  name: 'paragraphRedtheme1Render',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3d = script$3d;
/* template */
var __vue_render__$3d = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Redtheme1-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3d = [];
__vue_render__$3d._withStripped = true;

  /* style */
  const __vue_inject_styles__$3d = undefined;
  /* scoped */
  const __vue_scope_id__$3d = "data-v-44762fcc";
  /* module identifier */
  const __vue_module_identifier__$3d = undefined;
  /* functional template */
  const __vue_is_functional_template__$3d = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3d = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3d, staticRenderFns: __vue_staticRenderFns__$3d },
    __vue_inject_styles__$3d,
    __vue_script__$3d,
    __vue_scope_id__$3d,
    __vue_is_functional_template__$3d,
    __vue_module_identifier__$3d,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3c = {
  mixins: [singleGroupMixin],
  name: 'paragraphRedtheme2Render',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3c = script$3c;
/* template */
var __vue_render__$3c = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Redtheme2-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "left-line" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "right-line" }),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3c = [];
__vue_render__$3c._withStripped = true;

  /* style */
  const __vue_inject_styles__$3c = undefined;
  /* scoped */
  const __vue_scope_id__$3c = "data-v-59f586a0";
  /* module identifier */
  const __vue_module_identifier__$3c = undefined;
  /* functional template */
  const __vue_is_functional_template__$3c = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3c = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3c, staticRenderFns: __vue_staticRenderFns__$3c },
    __vue_inject_styles__$3c,
    __vue_script__$3c,
    __vue_scope_id__$3c,
    __vue_is_functional_template__$3c,
    __vue_module_identifier__$3c,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3b = {
  mixins: [singleGroupMixin],
  name: 'paragraphRedtheme3Render',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3b = script$3b;
/* template */
var __vue_render__$3b = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Redtheme3-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "top-line" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "bottom-line" }),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3b = [];
__vue_render__$3b._withStripped = true;

  /* style */
  const __vue_inject_styles__$3b = undefined;
  /* scoped */
  const __vue_scope_id__$3b = "data-v-c22c0580";
  /* module identifier */
  const __vue_module_identifier__$3b = undefined;
  /* functional template */
  const __vue_is_functional_template__$3b = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3b = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3b, staticRenderFns: __vue_staticRenderFns__$3b },
    __vue_inject_styles__$3b,
    __vue_script__$3b,
    __vue_scope_id__$3b,
    __vue_is_functional_template__$3b,
    __vue_module_identifier__$3b,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$3a = {
  mixins: [singleGroupMixin],
  name: 'paragraphRedtheme4Render',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$3a = script$3a;
/* template */
var __vue_render__$3a = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Redtheme4-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c(
              "div",
              { staticClass: "body-title" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$3a = [];
__vue_render__$3a._withStripped = true;

  /* style */
  const __vue_inject_styles__$3a = undefined;
  /* scoped */
  const __vue_scope_id__$3a = "data-v-5ec0ce56";
  /* module identifier */
  const __vue_module_identifier__$3a = undefined;
  /* functional template */
  const __vue_is_functional_template__$3a = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3a = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3a, staticRenderFns: __vue_staticRenderFns__$3a },
    __vue_inject_styles__$3a,
    __vue_script__$3a,
    __vue_scope_id__$3a,
    __vue_is_functional_template__$3a,
    __vue_module_identifier__$3a,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$39 = {
  mixins: [singleGroupMixin],
  name: 'paragraphRedtheme5Render',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$39 = script$39;
/* template */
var __vue_render__$39 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Redtheme5-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-box" }, [
            _c(
              "div",
              { staticClass: "body-text-bg" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$39 = [];
__vue_render__$39._withStripped = true;

  /* style */
  const __vue_inject_styles__$39 = undefined;
  /* scoped */
  const __vue_scope_id__$39 = "data-v-2b65e80a";
  /* module identifier */
  const __vue_module_identifier__$39 = undefined;
  /* functional template */
  const __vue_is_functional_template__$39 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$39 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$39, staticRenderFns: __vue_staticRenderFns__$39 },
    __vue_inject_styles__$39,
    __vue_script__$39,
    __vue_scope_id__$39,
    __vue_is_functional_template__$39,
    __vue_module_identifier__$39,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$38 = {
  mixins: [singleGroupMixin],
  name: 'paragraphRedtheme6Render',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$38 = script$38;
/* template */
var __vue_render__$38 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Redtheme6-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$38 = [];
__vue_render__$38._withStripped = true;

  /* style */
  const __vue_inject_styles__$38 = undefined;
  /* scoped */
  const __vue_scope_id__$38 = "data-v-8f1046d6";
  /* module identifier */
  const __vue_module_identifier__$38 = undefined;
  /* functional template */
  const __vue_is_functional_template__$38 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$38 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$38, staticRenderFns: __vue_staticRenderFns__$38 },
    __vue_inject_styles__$38,
    __vue_script__$38,
    __vue_scope_id__$38,
    __vue_is_functional_template__$38,
    __vue_module_identifier__$38,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$37 = {
  mixins: [singleGroupMixin],
  name: 'paragraphSixteenRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      numberTextDataName: 'numberTextData',
      bodyTextDataName: 'bodyTextData',
      bodyTextDataName2: 'bodyTextData2',
      bodyTextDataName3: 'bodyTextData3',
      titleTextDataName: 'titleTextData',
      titleTextDataName2: 'titleTextData2',
      titleTextDataName3: 'titleTextData3',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$37 = script$37;
/* template */
var __vue_render__$37 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-sixteen-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "paragraph-row-box" }, [
            _c(
              "div",
              { staticClass: "paragraph-subtitle-box" },
              [
                _c("div", { staticClass: "subtitle-left-dec" }),
                _vm._v(" "),
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName3],
                    "block-data-name": _vm.titleTextDataName3,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "text-body-box" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName2],
                    "block-data-name": _vm.bodyTextDataName2,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$37 = [];
__vue_render__$37._withStripped = true;

  /* style */
  const __vue_inject_styles__$37 = undefined;
  /* scoped */
  const __vue_scope_id__$37 = "data-v-7f1062f6";
  /* module identifier */
  const __vue_module_identifier__$37 = undefined;
  /* functional template */
  const __vue_is_functional_template__$37 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$37 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$37, staticRenderFns: __vue_staticRenderFns__$37 },
    __vue_inject_styles__$37,
    __vue_script__$37,
    __vue_scope_id__$37,
    __vue_is_functional_template__$37,
    __vue_module_identifier__$37,
    false,
    undefined,
    undefined,
    undefined
  );

var Left = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAbCAYAAACJISRoAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OEZERjBFNTUxMzJCMTFFRThFM0M5RDlDNDZFMDJEQjAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OEZERjBFNTYxMzJCMTFFRThFM0M5RDlDNDZFMDJEQjAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4RkRGMEU1MzEzMkIxMUVFOEUzQzlEOUM0NkUwMkRCMCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4RkRGMEU1NDEzMkIxMUVFOEUzQzlEOUM0NkUwMkRCMCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Plhysp0AAAIfSURBVHjatJU7T1VBEMd3D/deeXmNhbw1hIRPYImaKEhpY6GJUFD7AWjUCKGgNSaQEBKMjYWJMXY0JBCgsbEyUBiNhdKY8BS4Isf/mP8Jw3oeey7XSX7Ze2d2d3ZnZufYxbG2S8aYXnBk/KQObIGP8ufGk+9/lUvj7Q8xPAcWOqsXFMAdMGvyySroc3SWfHEnF2gQ+QTWQJCwcQia5fBqjWs3cQcuKOMLMJFxgx4exua5duA4zJKixxyb5sRHfnL8HWM74HgYF6646hkBUnXHSi+/W/n7MhhlVRlW5nXaBqA7VnvbJCePwZWUG4ltMsE2SDLzIFevgEdgk2GVEHWCp+CzciI5+AVug/vgHXgLSllOAi6cAntK30Un38CM8xgtnSxDN+ebeFl03tE1q5C6Us/xXFp1RVVRYZLl/ew483c9qsukVddVcI9voUzbMHMSSQfHFoYmqi4T02ZOOYke2F2iZTphnTTUV74PVpx84GZHKt4PQBN4ycRbhu8iGAIb4LXzwkM6WPknuWj1cadZZ7m2qTxEj/ArN7qmq8u3d0VSot6qaoqkKaW6cjmpqM6879j2TRUiObmpelTImzTyALfAD95K5nQ73w5vJwsp9jcJ+oa8Tgw/me8Za6GfG80zRIHTjdfyOLFheHJz9bDW2adEsZ22QbXVVVT6BlMDCTI+n/Z/Oam5JDkpqzI+s8R9tKSNPwMXYlp9VfJHgAEAjWxw8vlaPHgAAAAASUVORK5CYII=";

//
var script$36 = {
  mixins: [singleGroupMixin],
  name: 'paragraphSanQintheme1Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      groupData: {},
      Left: Left
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$36 = script$36;
/* template */
var __vue_render__$36 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-SanQintheme1-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "paragraph-SanQintheme1-title" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("el-image", {
                staticClass: "left-top-image",
                attrs: { src: _vm.Left },
              }),
              _vm._v(" "),
              _c("el-image", {
                staticClass: "left-bottom-image",
                attrs: { src: _vm.Left },
              }),
              _vm._v(" "),
              _c("el-image", {
                staticClass: "right-top-image",
                attrs: { src: _vm.Left },
              }),
              _vm._v(" "),
              _c("el-image", {
                staticClass: "right-bottom-image",
                attrs: { src: _vm.Left },
              }),
              _vm._v(" "),
              _c("div", { staticClass: "top-line" }),
              _vm._v(" "),
              _c("div", { staticClass: "bottom-line" }),
              _vm._v(" "),
              _c("div", { staticClass: "right-line" }),
              _vm._v(" "),
              _c("div", { staticClass: "left-line" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$36 = [];
__vue_render__$36._withStripped = true;

  /* style */
  const __vue_inject_styles__$36 = undefined;
  /* scoped */
  const __vue_scope_id__$36 = "data-v-0f688b55";
  /* module identifier */
  const __vue_module_identifier__$36 = undefined;
  /* functional template */
  const __vue_is_functional_template__$36 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$36 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$36, staticRenderFns: __vue_staticRenderFns__$36 },
    __vue_inject_styles__$36,
    __vue_script__$36,
    __vue_scope_id__$36,
    __vue_is_functional_template__$36,
    __vue_module_identifier__$36,
    false,
    undefined,
    undefined,
    undefined
  );

var Icon$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAA8CAYAAABb5PswAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RTUyQjM3NjQxMzM5MTFFRTkxRENFOTE0MUZCRUI2MDEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RTUyQjM3NjUxMzM5MTFFRTkxRENFOTE0MUZCRUI2MDEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpFNTJCMzc2MjEzMzkxMUVFOTFEQ0U5MTQxRkJFQjYwMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpFNTJCMzc2MzEzMzkxMUVFOTFEQ0U5MTQxRkJFQjYwMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkiCyOIAAAP4SURBVHjaVFVNjxtFEK2q7rExTvAuKwIRYDYKHwpIgRxClr9Abkj8iRy5gEDiB/AbIJE4QiQUThEScOAUIRACbUQ2WQTZiAV2cSDYY9kzXU1Vdfc4sXe84+nq915VvS67y598AK9tvQTffb/76Hg8fmc4HF4YjdbatdHRnY8vvRs95NdkMnnr8PDgPb0nojdOn37uTFX5nwiRe8ePr8OJzWPDEszMdP71c33nK/BVj/zGxujI2bMnNyqPMBx4mNYNPLZRPe/cct8v/528fXP79ptbTw+e3XryFBAgRESE33+7OFkbfOrrOzffP/hlHwgj6FtfMUZol21/ePDni37ZBHAOwDvdy8C6GBQFoGkXlYfIohqhXxFU5CAww2zRQGiDYIWalE4+oBIE5yNIVrKHZbcEcJhSzJyyIndoFIEjNEGeBW4o4kqYvYU8yGIIgtQwmAaFZA6aoOxkEZlQYghCr5kTgWbI8hAFiWWTIQgfOdcHFYqEqcxgsek/R6TqyLqmI0GULwQniJq6cAo+B8gqbTHdl7Yh+MCtFSVUWkkw7ja02lGhCNGTxqFCkm11LlEYmlSQVEzJAqUmlJCtbrIcPYoGVhqWTKLepwgjlKp5dF7gvUA720WeV931LlI2WecF9UVqoNBVhJ4jdmmy9ScRWEpgmoQ3sJXZ+qKBnL/LE7J8Y0zVMeVo2WjpJTuk1Ac7C6nMUIISNUVrdzQUtQYbRdKkyomgOy5mVLKGxdQPBeeyHrHzQoG3ymJM+Su0oWYLEhUNmEubTWMCs4QUCKmLXRbFE5Y2iWnLouzWViuVc7n9+sfm1mipQszYud1qTNKTo7XQb6p6VdQs0sqYTaIoRQEnlTqCZKdyaotVskspGoVLrjPliK7jdpTSlkKL6dAmSq5a2hm7hsnJoqIhm6Q0LtcJqRjUPACZOztMT7pkybkx6ailUZEDOaZSF1siZOOUekXVJZYvHU1IkLKyLxwpNLW1DLNRtCd2CJKjkJbzqW0z68UsgnNbIDmsgzar2VDAVE2bPzEdXEN8QAtaKwkfOM3YBSVfytFbjRNKQdq88kiGaq4v2ISF+9GyAyiZ5X4Nq4bpWfI6F2z8t9EGqc6oUFY1i4dHR+9Sv7Ipr9O15RVV1fMLakbj80+9eu7CHvd++Gb3ELb/quWawhOnnrl8bPz4R77X4+uPrPe2f7w1OfPl1zuvDAZ9WC4afuHlkx/2Hqq+9cLT3v17Ptvbm9TzOkDbLKCRX6F7/7X3msb94+/c9vPJZAo/39g3cl1Uidd36nbzxDrTbAa8c+sPWCya7kdW/Xz1i2u0++sB+Gk9g8+uXNWHl+TalGss17W6nt+48vlX8L8AAwDOGiR0ANbDwwAAAABJRU5ErkJggg==";

//
var script$35 = {
  mixins: [singleGroupMixin],
  name: 'paragraphSanQintheme2Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      groupData: {},
      Icon: Icon$1
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$35 = script$35;
/* template */
var __vue_render__$35 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-SanQintheme2-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "paragraph-SanQintheme2-title" },
            [
              _c("el-image", {
                staticClass: "left-image",
                attrs: { src: _vm.Icon },
              }),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "text-container-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c("el-image", {
                staticClass: "right-image",
                attrs: { src: _vm.Icon },
              }),
            ],
            1
          ),
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$35 = [];
__vue_render__$35._withStripped = true;

  /* style */
  const __vue_inject_styles__$35 = undefined;
  /* scoped */
  const __vue_scope_id__$35 = "data-v-0be464c4";
  /* module identifier */
  const __vue_module_identifier__$35 = undefined;
  /* functional template */
  const __vue_is_functional_template__$35 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$35 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$35, staticRenderFns: __vue_staticRenderFns__$35 },
    __vue_inject_styles__$35,
    __vue_script__$35,
    __vue_scope_id__$35,
    __vue_is_functional_template__$35,
    __vue_module_identifier__$35,
    false,
    undefined,
    undefined,
    undefined
  );

var Icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAA3CAYAAACYV8NnAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDkwQ0JBM0QxMzM1MTFFRUJFQURCMzkxQzE4OTQ5RjAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDkwQ0JBM0UxMzM1MTFFRUJFQURCMzkxQzE4OTQ5RjAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpEOTBDQkEzQjEzMzUxMUVFQkVBREIzOTFDMTg5NDlGMCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpEOTBDQkEzQzEzMzUxMUVFQkVBREIzOTFDMTg5NDlGMCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgCsdJgAAAOLSURBVHja1JpJaBNRGMffvKRat2prVRTqVlxQsdQFlYJxuYioSMFDD+LdgwpeFEEqFrxJr4IXL4IIBRdED0KLaKEutUVUPAgiilvVurdZxv+X/McMkrSZ5E3C++DHJM2bN/+8fPMtb+oMdR8+q5RaBqrBKIgAF6SIvHZAAlSBOJjAo/aN8cZr3xg5JwqSKmP+sUnffN4x11jvtcz3HfTLoBhYo+yxW7IqX8CIJYJlpYc1f3pbLK1V04dtES4+ntB0fNcS0embXXO1bXKRlP4vtNjg045tq+za6B6iU2tll8lKu95KWyVcM9/b5B6OCJ7IgkUxpQ+Ct3w/D6wFU8ss7gl4Q3eYA1ZQpyTCiIi+DxpAN7jEEz7y5FlgJdgP9pZBbC+4SE0fKHomRe8DW+VvDkrTJXixHPSB93kmky91DBwMUXAXOFUX6xzM9eHnniPzcdgCXovoQiedAS6D7YbvAVnNftAKwa8KOSFI5PgKTtLvTdpP0FGo4KCiPZ97ZjDtyzzPwbUgJxUTo/vZRpkwae9uY5UTYYt+xyLLlOiBoCcVI/q3QfdI+cJrqKLrDKZ+19d9hyp6FTOTCYsweYQquhasNihaUnNL2KIlnc81GKNlA2Ynsl19WKLFLQ5xdUxao6TvoKKlwmsCs8cYJ6n7PC9guowVVzuA1T4DJuUbhM9qQU26PkXt0Y7jboafe+ARS1O5sxeBTWAzBYdpsst1F9xgAhvmr7oYbATrwUvQLqXpLpXdy2sGQ+AXRU8D9ao8JgK3gXXgk8pucNawRNb8An1RukfSK7DHcZNyWA3JZw3etqwtJvdT1Ma9vLhtO0zK1h2mpI370442WBuXdaUjlq22dVti/25EbaN7aMs8o0pzE8YW4ZNBtdQeR8FCCnd9XUlUZZ+mprxw4xuTYEPQxi8exHrAQ87rBQLvV/eeDI+wSUj6SmhpqntFWBcF5oqJ7jiRJc52aXqBEUjGXwDHwR/fdfL5r5NDT9xbzWKLpraAjYFc5zpLz0xrH+ssa8iTLuMEmBKwS2mqZJxuYWcTxMQvd1RSdHOee2G86y0FCyolerTIklYiQl2lRA8UKdoptUgrRbR0zk+LED7ErroioiV8dQQULYnjisr8s0nFqryrFF6oPQi6mxSGaEmxp1XmcdnjMcb9AOfAHtksKlV0VJVuCZYCN8EG7gQ1cu5v9Ps74IUy9NjjrwADAJTZ3NG+K85NAAAAAElFTkSuQmCC";

//
var script$34 = {
  mixins: [singleGroupMixin],
  name: 'paragraphSanQintheme3Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      groupData: {},
      Icon: Icon
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$34 = script$34;
/* template */
var __vue_render__$34 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-SanQintheme3-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "top-image" },
            [_c("el-image", { attrs: { src: _vm.Icon } })],
            1
          ),
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$34 = [];
__vue_render__$34._withStripped = true;

  /* style */
  const __vue_inject_styles__$34 = undefined;
  /* scoped */
  const __vue_scope_id__$34 = "data-v-a9c15308";
  /* module identifier */
  const __vue_module_identifier__$34 = undefined;
  /* functional template */
  const __vue_is_functional_template__$34 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$34 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$34, staticRenderFns: __vue_staticRenderFns__$34 },
    __vue_inject_styles__$34,
    __vue_script__$34,
    __vue_scope_id__$34,
    __vue_is_functional_template__$34,
    __vue_module_identifier__$34,
    false,
    undefined,
    undefined,
    undefined
  );

const ParagraphComponents = [__vue_component__$3B, __vue_component__$3A, __vue_component__$3z, __vue_component__$3y, __vue_component__$3x, __vue_component__$3w, __vue_component__$3v, __vue_component__$3u, __vue_component__$3t, __vue_component__$3s, __vue_component__$3r, __vue_component__$3q, __vue_component__$3p, __vue_component__$3o, __vue_component__$3n, __vue_component__$3m, __vue_component__$3l, __vue_component__$3k, __vue_component__$3j, __vue_component__$3i, __vue_component__$3h, __vue_component__$3g, __vue_component__$3f, __vue_component__$3e, __vue_component__$3d, __vue_component__$3c, __vue_component__$3b, __vue_component__$3a, __vue_component__$39, __vue_component__$38, __vue_component__$37, __vue_component__$36, __vue_component__$35, __vue_component__$34];
var paragraph = {
  // install,
  ...ParagraphComponents
};

//
var script$33 = {
  mixins: [singleGroupMixin],
  name: 'splitlineFirstRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'SplitlineData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex: this.ruleIndex,
        dataName: this.titleTextDataName,
        data: this.pGroupData
      });
    }
  }
};

/* script */
const __vue_script__$33 = script$33;
/* template */
var __vue_render__$33 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-first-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c("xml-group-render", {
        ref: "xmlGroup",
        attrs: {
          "page-type": _vm.pageType,
          mode: _vm.mode,
          "type-text": _vm.typeText,
          showLine: false,
          "rule-index": _vm.ruleIndex,
          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
        },
        scopedSlots: _vm._u(
          [
            _vm._l(_vm.$scopedSlots, function (index, name) {
              return {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t(name)]
                },
                proxy: true,
              }
            }),
          ],
          null,
          true
        ),
      }),
      _vm._v(" "),
      _c(
        "div",
        {
          staticClass: "title-container",
          attrs: { id: _vm.blockId },
          on: { click: _vm.handleBlockClick },
        },
        [
          _c("div", { staticClass: "line" }),
          _vm._v(" "),
          _c("div", { staticClass: "centerimg" }),
          _vm._v(" "),
          _c("div", { staticClass: "line" }),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$33 = [];
__vue_render__$33._withStripped = true;

  /* style */
  const __vue_inject_styles__$33 = undefined;
  /* scoped */
  const __vue_scope_id__$33 = "data-v-2bc4bb7c";
  /* module identifier */
  const __vue_module_identifier__$33 = undefined;
  /* functional template */
  const __vue_is_functional_template__$33 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$33 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$33, staticRenderFns: __vue_staticRenderFns__$33 },
    __vue_inject_styles__$33,
    __vue_script__$33,
    __vue_scope_id__$33,
    __vue_is_functional_template__$33,
    __vue_module_identifier__$33,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$32 = {
  mixins: [singleGroupMixin],
  name: 'splitlineSecondRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$32 = script$32;
/* template */
var __vue_render__$32 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-second-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "line1" }, [_c("div")]),
              _vm._v(" "),
              _c("div", { staticClass: "line2" }, [_c("div")]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$32 = [];
__vue_render__$32._withStripped = true;

  /* style */
  const __vue_inject_styles__$32 = undefined;
  /* scoped */
  const __vue_scope_id__$32 = "data-v-6f11c332";
  /* module identifier */
  const __vue_module_identifier__$32 = undefined;
  /* functional template */
  const __vue_is_functional_template__$32 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$32 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$32, staticRenderFns: __vue_staticRenderFns__$32 },
    __vue_inject_styles__$32,
    __vue_script__$32,
    __vue_scope_id__$32,
    __vue_is_functional_template__$32,
    __vue_module_identifier__$32,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$31 = {
  mixins: [singleGroupMixin],
  name: 'splitlineThirdRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$31 = script$31;
/* template */
var __vue_render__$31 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-third-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$31 = [];
__vue_render__$31._withStripped = true;

  /* style */
  const __vue_inject_styles__$31 = undefined;
  /* scoped */
  const __vue_scope_id__$31 = "data-v-64b07e51";
  /* module identifier */
  const __vue_module_identifier__$31 = undefined;
  /* functional template */
  const __vue_is_functional_template__$31 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$31 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$31, staticRenderFns: __vue_staticRenderFns__$31 },
    __vue_inject_styles__$31,
    __vue_script__$31,
    __vue_scope_id__$31,
    __vue_is_functional_template__$31,
    __vue_module_identifier__$31,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$30 = {
  mixins: [singleGroupMixin],
  name: 'splitlineFourthRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$30 = script$30;
/* template */
var __vue_render__$30 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-fourth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "line" }),
              _vm._v(" "),
              _c("div", { staticClass: "centerimg" }),
              _vm._v(" "),
              _c("div", { staticClass: "line" }),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$30 = [];
__vue_render__$30._withStripped = true;

  /* style */
  const __vue_inject_styles__$30 = undefined;
  /* scoped */
  const __vue_scope_id__$30 = "data-v-701026d2";
  /* module identifier */
  const __vue_module_identifier__$30 = undefined;
  /* functional template */
  const __vue_is_functional_template__$30 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$30 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$30, staticRenderFns: __vue_staticRenderFns__$30 },
    __vue_inject_styles__$30,
    __vue_script__$30,
    __vue_scope_id__$30,
    __vue_is_functional_template__$30,
    __vue_module_identifier__$30,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2$ = {
  mixins: [singleGroupMixin],
  name: 'splitlineFifthRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2$ = script$2$;
/* template */
var __vue_render__$2$ = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-fifth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "line" }),
              _vm._v(" "),
              _c("div", { staticClass: "centerimg" }, [_c("div")]),
              _vm._v(" "),
              _c("div", { staticClass: "line" }),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2$ = [];
__vue_render__$2$._withStripped = true;

  /* style */
  const __vue_inject_styles__$2$ = undefined;
  /* scoped */
  const __vue_scope_id__$2$ = "data-v-ca50cd36";
  /* module identifier */
  const __vue_module_identifier__$2$ = undefined;
  /* functional template */
  const __vue_is_functional_template__$2$ = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2$ = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2$, staticRenderFns: __vue_staticRenderFns__$2$ },
    __vue_inject_styles__$2$,
    __vue_script__$2$,
    __vue_scope_id__$2$,
    __vue_is_functional_template__$2$,
    __vue_module_identifier__$2$,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2_ = {
  mixins: [singleGroupMixin],
  name: 'splitlineSixthRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2_ = script$2_;
/* template */
var __vue_render__$2_ = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-sixth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "line1" }),
              _vm._v(" "),
              _c("div", { staticClass: "centerimg" }, [
                _c("div", { staticClass: "block1" }),
                _vm._v(" "),
                _c("div", { staticClass: "block2" }),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "line2" }),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2_ = [];
__vue_render__$2_._withStripped = true;

  /* style */
  const __vue_inject_styles__$2_ = undefined;
  /* scoped */
  const __vue_scope_id__$2_ = "data-v-ebd7fe48";
  /* module identifier */
  const __vue_module_identifier__$2_ = undefined;
  /* functional template */
  const __vue_is_functional_template__$2_ = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2_ = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2_, staticRenderFns: __vue_staticRenderFns__$2_ },
    __vue_inject_styles__$2_,
    __vue_script__$2_,
    __vue_scope_id__$2_,
    __vue_is_functional_template__$2_,
    __vue_module_identifier__$2_,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2Z = {
  mixins: [singleGroupMixin],
  name: 'splitlineSeventhRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2Z = script$2Z;
/* template */
var __vue_render__$2Z = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-seventh-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "dotted" }, [
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "centerimg" }),
              _vm._v(" "),
              _c("div", { staticClass: "dotted" }, [
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2Z = [];
__vue_render__$2Z._withStripped = true;

  /* style */
  const __vue_inject_styles__$2Z = undefined;
  /* scoped */
  const __vue_scope_id__$2Z = "data-v-6c00036e";
  /* module identifier */
  const __vue_module_identifier__$2Z = undefined;
  /* functional template */
  const __vue_is_functional_template__$2Z = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2Z = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2Z, staticRenderFns: __vue_staticRenderFns__$2Z },
    __vue_inject_styles__$2Z,
    __vue_script__$2Z,
    __vue_scope_id__$2Z,
    __vue_is_functional_template__$2Z,
    __vue_module_identifier__$2Z,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2Y = {
  mixins: [singleGroupMixin],
  name: 'splitlineEighthRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2Y = script$2Y;
/* template */
var __vue_render__$2Y = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-eighth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "centerimg" }, [
                _c("div", { staticClass: "line1" }),
                _vm._v(" "),
                _c("div", { staticClass: "line2" }),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2Y = [];
__vue_render__$2Y._withStripped = true;

  /* style */
  const __vue_inject_styles__$2Y = undefined;
  /* scoped */
  const __vue_scope_id__$2Y = "data-v-1888461c";
  /* module identifier */
  const __vue_module_identifier__$2Y = undefined;
  /* functional template */
  const __vue_is_functional_template__$2Y = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2Y = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2Y, staticRenderFns: __vue_staticRenderFns__$2Y },
    __vue_inject_styles__$2Y,
    __vue_script__$2Y,
    __vue_scope_id__$2Y,
    __vue_is_functional_template__$2Y,
    __vue_module_identifier__$2Y,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2X = {
  mixins: [singleGroupMixin],
  name: 'splitlineNinthRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2X = script$2X;
/* template */
var __vue_render__$2X = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-ninth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "centerimg" }, [
                _c("div", { staticClass: "skeybox" }),
                _vm._v(" "),
                _c("div", { staticClass: "line" }),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2X = [];
__vue_render__$2X._withStripped = true;

  /* style */
  const __vue_inject_styles__$2X = undefined;
  /* scoped */
  const __vue_scope_id__$2X = "data-v-43776a56";
  /* module identifier */
  const __vue_module_identifier__$2X = undefined;
  /* functional template */
  const __vue_is_functional_template__$2X = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2X = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2X, staticRenderFns: __vue_staticRenderFns__$2X },
    __vue_inject_styles__$2X,
    __vue_script__$2X,
    __vue_scope_id__$2X,
    __vue_is_functional_template__$2X,
    __vue_module_identifier__$2X,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2W = {
  mixins: [singleGroupMixin],
  name: 'splitlineTenthRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2W = script$2W;
/* template */
var __vue_render__$2W = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-tenth-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", [
                _c("div", { staticClass: "centerimg" }),
                _vm._v(" "),
                _c("div", { staticClass: "line" }),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2W = [];
__vue_render__$2W._withStripped = true;

  /* style */
  const __vue_inject_styles__$2W = undefined;
  /* scoped */
  const __vue_scope_id__$2W = "data-v-1d7ec26a";
  /* module identifier */
  const __vue_module_identifier__$2W = undefined;
  /* functional template */
  const __vue_is_functional_template__$2W = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2W = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2W, staticRenderFns: __vue_staticRenderFns__$2W },
    __vue_inject_styles__$2W,
    __vue_script__$2W,
    __vue_scope_id__$2W,
    __vue_is_functional_template__$2W,
    __vue_module_identifier__$2W,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2V = {
  mixins: [singleGroupMixin],
  name: 'splitlineEleventhRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2V = script$2V;
/* template */
var __vue_render__$2V = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-eleventh-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", [
                _c("div", { staticClass: "line1" }),
                _vm._v(" "),
                _c("div", { staticClass: "line2" }),
                _vm._v(" "),
                _c("div", { staticClass: "centerimg" }),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2V = [];
__vue_render__$2V._withStripped = true;

  /* style */
  const __vue_inject_styles__$2V = undefined;
  /* scoped */
  const __vue_scope_id__$2V = "data-v-390efcba";
  /* module identifier */
  const __vue_module_identifier__$2V = undefined;
  /* functional template */
  const __vue_is_functional_template__$2V = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2V = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2V, staticRenderFns: __vue_staticRenderFns__$2V },
    __vue_inject_styles__$2V,
    __vue_script__$2V,
    __vue_scope_id__$2V,
    __vue_is_functional_template__$2V,
    __vue_module_identifier__$2V,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2U = {
  mixins: [singleGroupMixin],
  name: 'splitlineGreytheme1Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

var __$_require_static_images_leaflet_resource_enter_reytheme1_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAcCAYAAAC+lOV/AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NkVEQjlDNkFFNDEzMTFFRDk3MjZDM0M4NDc0N0Y2M0QiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NkVEQjlDNkJFNDEzMTFFRDk3MjZDM0M4NDc0N0Y2M0QiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2RURCOUM2OEU0MTMxMUVEOTcyNkMzQzg0NzQ3RjYzRCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo2RURCOUM2OUU0MTMxMUVEOTcyNkMzQzg0NzQ3RjYzRCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PnHmU/UAAACvSURBVHjaYnx7MJ+HgYGBlYF08JMFSKwAYm8yNE9nYqAAjGoe1TyqeVBpBhUGC4D4MBl6z4M0XwbiCUDMRYLGv0DsC9J8E4hLgXgZCZqLgPgEzM/LgbiPSI1LgbgfPcDKgHgPIX8CcRq20Ab5IxKI7+PQ+BqIA4H4G66oegPEQcgKkAyOAOKHhOL5AhAno4mBAnQfsYkEVBH0QtlLYAGELZHgAuVAzAjEtbgUAAQYADfpIG4AZtNeAAAAAElFTkSuQmCC";

/* script */
const __vue_script__$2U = script$2U;
var __vue_render__$2U = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Greytheme1-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "left-icon" }, [
                  _c("img", {
                    attrs: {
                      src: __$_require_static_images_leaflet_resource_enter_reytheme1_png__,
                      alt: "",
                    },
                  }),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "right-icon" }, [
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2U = [];
__vue_render__$2U._withStripped = true;

  /* style */
  const __vue_inject_styles__$2U = undefined;
  /* scoped */
  const __vue_scope_id__$2U = "data-v-cc50973a";
  /* module identifier */
  const __vue_module_identifier__$2U = undefined;
  /* functional template */
  const __vue_is_functional_template__$2U = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2U = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2U, staticRenderFns: __vue_staticRenderFns__$2U },
    __vue_inject_styles__$2U,
    __vue_script__$2U,
    __vue_scope_id__$2U,
    __vue_is_functional_template__$2U,
    __vue_module_identifier__$2U,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2T = {
  mixins: [singleGroupMixin],
  name: 'splitlineGreytheme2Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

var __$_require_static_images_leaflet_resource_enter_reytheme2_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAYCAYAAADkgu3FAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODBENkQyRjlFNDEzMTFFREI0QzA4RUJBQTYzQUY4QTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODBENkQyRkFFNDEzMTFFREI0QzA4RUJBQTYzQUY4QTMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4MEQ2RDJGN0U0MTMxMUVEQjRDMDhFQkFBNjNBRjhBMyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4MEQ2RDJGOEU0MTMxMUVEQjRDMDhFQkFBNjNBRjhBMyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pmq84K4AAAGmSURBVHjavNXPKwRhGAfwd8YmUgoHKeFA+RlFnIVcrLObhNrkpITk4Lqb/wDlwk3JRVws5WbXQbkoRKg5rMKBjfV96pl6m3Zmn9HOPPU57Ls7+33nfWee17BiyypPVUETvMCrklU5lMBHvi9Nx+deOAYLUhx0DRMuf07XT0MaPuEdnmEDqt2CxuECRnhmdnXAHmw6xivhiMd7wODxOljg8GZnUAvsQqnH0tDM17Xr9nlSbtUAB1CmByWgQrAPtKF9MAdDgt+3w7wdVA9R4YbT0sVhVcmLgowI377p48JB5a8aoY0COlXw1UpBtSEE1ZgqnIpQ0GMIQQ8UlAw4hLpF0uSWcxNg0A61Jwr6hRh8BxByC2t6ZziDKfgpYsg9DMObs6lSrxuDTBFCTqGfHgK3Y4K6cTec/DPgC5a4D1pe55Hix30UZuzbFlaaG26c910VCqLKwRZ0wbkghM6kAT4kleSEddYTL8O2x4RoqWYh69kaBLPN8jIa/GTqtcjHdsGS9rocz/pQG0tIQ6R3ZBe9Y5NwBXew4qur+nx8M3ycX/p9uf8EGACIV0806+7CtAAAAABJRU5ErkJggg==";

/* script */
const __vue_script__$2T = script$2T;
var __vue_render__$2T = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Greytheme2-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "left-icon" }, [
                  _c("img", {
                    attrs: {
                      src: __$_require_static_images_leaflet_resource_enter_reytheme2_png__,
                      alt: "",
                    },
                  }),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "right-icon" }, [
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2T = [];
__vue_render__$2T._withStripped = true;

  /* style */
  const __vue_inject_styles__$2T = undefined;
  /* scoped */
  const __vue_scope_id__$2T = "data-v-acfeac7c";
  /* module identifier */
  const __vue_module_identifier__$2T = undefined;
  /* functional template */
  const __vue_is_functional_template__$2T = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2T = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2T, staticRenderFns: __vue_staticRenderFns__$2T },
    __vue_inject_styles__$2T,
    __vue_script__$2T,
    __vue_scope_id__$2T,
    __vue_is_functional_template__$2T,
    __vue_module_identifier__$2T,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2S = {
  mixins: [singleGroupMixin],
  name: 'splitlineGreytheme3Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

var __$_require_static_images_leaflet_resource_enter_reytheme3_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAZCAYAAADaILXQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTAyNjJBQTlFNDEzMTFFRDk2NjdEMTQ0QjA1QzE1NUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTAyNjJBQUFFNDEzMTFFRDk2NjdEMTQ0QjA1QzE1NUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5MDI2MkFBN0U0MTMxMUVEOTY2N0QxNDRCMDVDMTU1QiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5MDI2MkFBOEU0MTMxMUVEOTY2N0QxNDRCMDVDMTU1QiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ppo2R5QAAAF5SURBVHjatNbNKwVRGMfxmesl7yIl5Y66iYWIYmEhC2s7edtZSDd5ibJgYesf0BXlH5AFydKa3KQUW2QjlvKWt++p52pMM/eec2ec+tR05s5vnnPmnJlrPybbLINWgSfdH8cMgqtwaHKNSfg8+jASdXgNFuR4FYVRhi+iWo5bMR5VeB1mPX1a1euEL6HS05fARNjwekwHnFtBcbaLvUNT89ojutGLsoBrm3CFY6RxijM8u8Mn0S9hLbANlmdCZB7wBy7lRgcq/B6jKLDCN5XXgWZsqTnfx5wVXfvEGE4yD3QdqYjCZ6TgP6vltzNEW3MXGfMbTp7BqrDlbOtcLaNB3BoGp6Ww71yb6AHXhuHn7vWda4fGDcMd3e2v+hoNw+O64Q0o+q/KnYCANxzhy+dcOWp1wr1DfMeGbOkBtGPH5yaOSeUqdFNeZkncSb96MQ2jE7uu5efozvm2fM6mcBMwTRcYQhf2/B6q7fO/pRQveezQEry6O34EGACZzD919vhTGQAAAABJRU5ErkJggg==";

/* script */
const __vue_script__$2S = script$2S;
var __vue_render__$2S = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Greytheme3-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "left-icon" }, [
                  _c("img", {
                    attrs: {
                      src: __$_require_static_images_leaflet_resource_enter_reytheme3_png__,
                      alt: "",
                    },
                  }),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "right-icon" }, [
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2S = [];
__vue_render__$2S._withStripped = true;

  /* style */
  const __vue_inject_styles__$2S = undefined;
  /* scoped */
  const __vue_scope_id__$2S = "data-v-3fb693db";
  /* module identifier */
  const __vue_module_identifier__$2S = undefined;
  /* functional template */
  const __vue_is_functional_template__$2S = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2S = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2S, staticRenderFns: __vue_staticRenderFns__$2S },
    __vue_inject_styles__$2S,
    __vue_script__$2S,
    __vue_scope_id__$2S,
    __vue_is_functional_template__$2S,
    __vue_module_identifier__$2S,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2R = {
  mixins: [singleGroupMixin],
  name: 'splitlineGreytheme4Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

var __$_require_static_images_leaflet_resource_enter_reytheme4_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAXCAYAAADk3wSdAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUVGMjNFQThFNDEzMTFFREFEM0VENTk1ODYyNDhCRTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUVGMjNFQTlFNDEzMTFFREFEM0VENTk1ODYyNDhCRTMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5RUYyM0VBNkU0MTMxMUVEQUQzRUQ1OTU4NjI0OEJFMyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5RUYyM0VBN0U0MTMxMUVEQUQzRUQ1OTU4NjI0OEJFMyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsVWod0AAAHgSURBVHjarJVJKIVRFMd5pkRYiY1nLBuJDLFSyhhRlpShlKQMRYaiZIEiUTYkZWHMQmFhKCIWyoJeFoaQMqYMCwn/W/+n4+t93sd7p3517v3O+X/3O/fc+7m2b1S5GLQcsAQ+7QWaDAqquAGQYTTYiBWASFDnLFFX0EY/EyQ4QzQXxIlxqzNEGzTjfJbi36JRIM1GToUjonE684l/EQ0EPmL8qJP3IHwP5nlpRdWKLOAaPNMvBxvgzoboLIgGC+CJeSquUT10B35gEQSJJJUwyg0ZAh3i2Sk4AzvAX8z7gm5wqVZapBGU1gyuwKuYGwFTGkFpNSZ77QFrAjP0X0AACP0lPkR9/oVm8gBscsMKQQSY5LNVkEV/HRwCM8hmKZWdK2cZfHDThkG1uIm6wC5453gf5HH1PWIhqXyJJ1gxsfDjTGzRXG1qQ7ZAGHgDwWL3pW2DeXAPBq0tVQ+mbfRlL09VuDhhyvr4Iq1wMbgxiSYv0QSZee6PQT9vqzE2fjW/zEPED7KUP07Uh/BTKKb6LhncUiCeibXgiD1ste+yueu0RQxwY1k6xWcngTJunrfe3aAnOs3L2MLfSKzYfbXCdNXkYOIvoqrGlWKsxE7AHMd7oNTRf9Qnb/w1I8FfAgwA7f9kYofT4PIAAAAASUVORK5CYII=";

/* script */
const __vue_script__$2R = script$2R;
var __vue_render__$2R = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Greytheme4-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "left-icon" }, [
                  _c("img", {
                    attrs: {
                      src: __$_require_static_images_leaflet_resource_enter_reytheme4_png__,
                      alt: "",
                    },
                  }),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "right-icon" }, [
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2R = [];
__vue_render__$2R._withStripped = true;

  /* style */
  const __vue_inject_styles__$2R = undefined;
  /* scoped */
  const __vue_scope_id__$2R = "data-v-12a60397";
  /* module identifier */
  const __vue_module_identifier__$2R = undefined;
  /* functional template */
  const __vue_is_functional_template__$2R = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2R = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2R, staticRenderFns: __vue_staticRenderFns__$2R },
    __vue_inject_styles__$2R,
    __vue_script__$2R,
    __vue_scope_id__$2R,
    __vue_is_functional_template__$2R,
    __vue_module_identifier__$2R,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2Q = {
  mixins: [singleGroupMixin],
  name: 'splitlineGreytheme5Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

var __$_require_static_images_leaflet_resource_enter_reytheme5_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAXCAYAAAARIY8tAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QjA0QzIwODRFNDEzMTFFREEzRkZDRjE5OUYyRjk4RkUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QjA0QzIwODVFNDEzMTFFREEzRkZDRjE5OUYyRjk4RkUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpCMDRDMjA4MkU0MTMxMUVEQTNGRkNGMTk5RjJGOThGRSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpCMDRDMjA4M0U0MTMxMUVEQTNGRkNGMTk5RjJGOThGRSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PiMgT5kAAAK/SURBVHjatJZraM5xFMef59nIZeWWNt56QSYUy2UvaLJ4MaYolFbCUm4lGnPPZS9opoiaMfECLxStNF6Y3K9hLjWZiAxhRhh5fE59/+t4/P96vHDq0/O7/c/5/c45v/N74rGDr2Ihkgn74C5UQQZMg1vwEorgCjyHfFgKm5Il2Y1hisJkPMyFb3BS/Ro4Bydk1MaLYQeMAtvpknQNmKJHMAgqYIzGHwqTKbBdyn/C/jBF8QgXmUyH467/GQZAC5yFCW7uMO6Zk66BGh09Dj3d+BZYo/ZIuKY1gfF2eAfDMfYp+Cjxh8FYrAB6pSg3Oe/a9+G963fXN3bCgX+LwVBYBP3dWAmMhQ1Qr7HF0BvaYKViEJwkFq9tyQpO4Q2MU3BPw2Q3fh1uKtBTdZIyzVWiaG/H8WtbSvm5oSxbFuYik0lyUyC34ZjaW2G13PFaWRQo78bPenWTYTFogDqnKO7myuE7DIblbk2bW2OXrR98VEJ0ZJFlxDb1bUGu2hfhi1OQBz1Sgt7u+qMhC97AHY2dMgM7Zf1/SLMFeRd01UCuaovJIfjqFs+Q7wM5Cq2ubwmQDS+cq+vNwBMolc+vaqJO6endM19tM9oFHtvFI4uCINvFq4a+Vl4Yb04NcrEUWU6vSjlqhTZwQQGPKQ1z3Jpa1a/OsDEsi5qk/Ajcc+MTXdrapdoDz3R71wWL2PEPpXDMFcTfLlqj6v5MvQWBBMqtPF9W2/L9AMzDNZku760WJTCWjCp2cT0oORFvRIPaGaqqfULW5WPgUlQtMsuVcksnlY9AZjsDhSnKH2hjraqyab0HC+XvpE5mPh6iWNnTOczNnWHXhWFKEhHKLYBr1a5SfOy0m2GWlJvBBUEiEIuCfzGQp7LRqrpS5tYnXFpWu0tVFPXvIepNLldev5WSEfAUPsjnTVq7QifcHabolwADAMmYvYIeJigVAAAAAElFTkSuQmCC";

/* script */
const __vue_script__$2Q = script$2Q;
var __vue_render__$2Q = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Greytheme5-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "left-icon" }, [
                  _c("img", {
                    attrs: {
                      src: __$_require_static_images_leaflet_resource_enter_reytheme5_png__,
                      alt: "",
                    },
                  }),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "right-icon" }, [
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2Q = [];
__vue_render__$2Q._withStripped = true;

  /* style */
  const __vue_inject_styles__$2Q = undefined;
  /* scoped */
  const __vue_scope_id__$2Q = "data-v-34d5195a";
  /* module identifier */
  const __vue_module_identifier__$2Q = undefined;
  /* functional template */
  const __vue_is_functional_template__$2Q = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2Q = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2Q, staticRenderFns: __vue_staticRenderFns__$2Q },
    __vue_inject_styles__$2Q,
    __vue_script__$2Q,
    __vue_scope_id__$2Q,
    __vue_is_functional_template__$2Q,
    __vue_module_identifier__$2Q,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2P = {
  mixins: [singleGroupMixin],
  name: 'splitlineGreytheme6Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

var __$_require_static_images_leaflet_resource_enter_reytheme6_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAaCAYAAABYQRdDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QzhCNDAxMkRFNDEzMTFFRDk0QkVFQjNBMzJBNTY3Q0QiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QzhCNDAxMkVFNDEzMTFFRDk0QkVFQjNBMzJBNTY3Q0QiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDOEI0MDEyQkU0MTMxMUVEOTRCRUVCM0EzMkE1NjdDRCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDOEI0MDEyQ0U0MTMxMUVEOTRCRUVCM0EzMkE1NjdDRCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PuQHbIYAAAIZSURBVHjaYnzGIMhARaAExKZMVDTQDojPALEMC5UMdALizUDMBcRvqeFSHSBeBzUQBD5QaqgAEK8HYn4ksU+UGjoViFXQxBhZvAwVxIAMHlJNm/D8rYfai89RWKSEQBHVD8RRpBjIyfCfQfjHT1zSKmR5P+zrdwbhD79wSTugJ6lXQPwFn4GS//6yBNx9IwsKOyzS14C4Fd3Qwm3nHyyDskG++IdF4xwgTsYwTYr3h9azz1ZA5kdc3lcF4pNALI8mLgfEseiKL0nzMVSKC78GGQhzDToIh2Y3EyDOQpMrA2I2ZIEHYlwMLWKCDL8ZgLGH5EUwAKmc8uwVyFsrgJgPKpwEjmxEQk9ANhBoyuc2SWFgJKAGL9hQuX9/GSY8fcWg9PKbE5rLRECRDWWnADE3spm3JXiLnjAxY3gVbOhHRiaGuzycUMsxQA40ptPQxKcVSArvwhYhUEMZGXr5eRnWqop2gwoENDWgsC2GRh4M3IKGLwNOQ2FgLg/3RVDiBeIXaOrakdigZJYIxN+IMhQKQAa7wZIHFCCn55lAfAxfBsGVTi8DcRAQo+dFkA8qCWVjfHl/HzTGkUENmg9INhQEFgPxLKRgmU9MgYOe9/OA5WsAsgAPw3/mqQ9efFotIfh1CwfHCjT1XMQYag7FcADKLZVyYgzPmZitiC0aiapNn2HJNfgAo4GhoTm09KEUgNLt1vPnzjEABBgAWt12zyTTtPoAAAAASUVORK5CYII=";

/* script */
const __vue_script__$2P = script$2P;
var __vue_render__$2P = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Greytheme6-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "left-icon" }, [
                  _c("img", {
                    attrs: {
                      src: __$_require_static_images_leaflet_resource_enter_reytheme6_png__,
                      alt: "",
                    },
                  }),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "right-icon" }, [
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2P = [];
__vue_render__$2P._withStripped = true;

  /* style */
  const __vue_inject_styles__$2P = undefined;
  /* scoped */
  const __vue_scope_id__$2P = "data-v-8ef639e2";
  /* module identifier */
  const __vue_module_identifier__$2P = undefined;
  /* functional template */
  const __vue_is_functional_template__$2P = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2P = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2P, staticRenderFns: __vue_staticRenderFns__$2P },
    __vue_inject_styles__$2P,
    __vue_script__$2P,
    __vue_scope_id__$2P,
    __vue_is_functional_template__$2P,
    __vue_module_identifier__$2P,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2O = {
  mixins: [singleGroupMixin],
  name: 'splitlineYellowtheme1Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2O = script$2O;
/* template */
var __vue_render__$2O = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Yellowtheme1-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2O = [];
__vue_render__$2O._withStripped = true;

  /* style */
  const __vue_inject_styles__$2O = undefined;
  /* scoped */
  const __vue_scope_id__$2O = "data-v-1871b8e8";
  /* module identifier */
  const __vue_module_identifier__$2O = undefined;
  /* functional template */
  const __vue_is_functional_template__$2O = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2O = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2O, staticRenderFns: __vue_staticRenderFns__$2O },
    __vue_inject_styles__$2O,
    __vue_script__$2O,
    __vue_scope_id__$2O,
    __vue_is_functional_template__$2O,
    __vue_module_identifier__$2O,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2N = {
  mixins: [singleGroupMixin],
  name: 'splitlineYellowtheme2Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2N = script$2N;
/* template */
var __vue_render__$2N = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Yellowtheme2-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2N = [];
__vue_render__$2N._withStripped = true;

  /* style */
  const __vue_inject_styles__$2N = undefined;
  /* scoped */
  const __vue_scope_id__$2N = "data-v-73611cf6";
  /* module identifier */
  const __vue_module_identifier__$2N = undefined;
  /* functional template */
  const __vue_is_functional_template__$2N = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2N = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2N, staticRenderFns: __vue_staticRenderFns__$2N },
    __vue_inject_styles__$2N,
    __vue_script__$2N,
    __vue_scope_id__$2N,
    __vue_is_functional_template__$2N,
    __vue_module_identifier__$2N,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2M = {
  mixins: [singleGroupMixin],
  name: 'splitlineYellowtheme3Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2M = script$2M;
/* template */
var __vue_render__$2M = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Yellowtheme3-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2M = [];
__vue_render__$2M._withStripped = true;

  /* style */
  const __vue_inject_styles__$2M = undefined;
  /* scoped */
  const __vue_scope_id__$2M = "data-v-742d2a22";
  /* module identifier */
  const __vue_module_identifier__$2M = undefined;
  /* functional template */
  const __vue_is_functional_template__$2M = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2M = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2M, staticRenderFns: __vue_staticRenderFns__$2M },
    __vue_inject_styles__$2M,
    __vue_script__$2M,
    __vue_scope_id__$2M,
    __vue_is_functional_template__$2M,
    __vue_module_identifier__$2M,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2L = {
  mixins: [singleGroupMixin],
  name: 'splitlineYellowtheme4Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2L = script$2L;
/* template */
var __vue_render__$2L = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Yellowtheme4-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2L = [];
__vue_render__$2L._withStripped = true;

  /* style */
  const __vue_inject_styles__$2L = undefined;
  /* scoped */
  const __vue_scope_id__$2L = "data-v-220ae2bf";
  /* module identifier */
  const __vue_module_identifier__$2L = undefined;
  /* functional template */
  const __vue_is_functional_template__$2L = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2L = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2L, staticRenderFns: __vue_staticRenderFns__$2L },
    __vue_inject_styles__$2L,
    __vue_script__$2L,
    __vue_scope_id__$2L,
    __vue_is_functional_template__$2L,
    __vue_module_identifier__$2L,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2K = {
  mixins: [singleGroupMixin],
  name: 'splitlineRedtheme1Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2K = script$2K;
/* template */
var __vue_render__$2K = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Redtheme1-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2K = [];
__vue_render__$2K._withStripped = true;

  /* style */
  const __vue_inject_styles__$2K = undefined;
  /* scoped */
  const __vue_scope_id__$2K = "data-v-6f969a42";
  /* module identifier */
  const __vue_module_identifier__$2K = undefined;
  /* functional template */
  const __vue_is_functional_template__$2K = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2K = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2K, staticRenderFns: __vue_staticRenderFns__$2K },
    __vue_inject_styles__$2K,
    __vue_script__$2K,
    __vue_scope_id__$2K,
    __vue_is_functional_template__$2K,
    __vue_module_identifier__$2K,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2J = {
  mixins: [singleGroupMixin],
  name: 'splitlineRedtheme2Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2J = script$2J;
/* template */
var __vue_render__$2J = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Redtheme2-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2J = [];
__vue_render__$2J._withStripped = true;

  /* style */
  const __vue_inject_styles__$2J = undefined;
  /* scoped */
  const __vue_scope_id__$2J = "data-v-6710eb5e";
  /* module identifier */
  const __vue_module_identifier__$2J = undefined;
  /* functional template */
  const __vue_is_functional_template__$2J = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2J = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2J, staticRenderFns: __vue_staticRenderFns__$2J },
    __vue_inject_styles__$2J,
    __vue_script__$2J,
    __vue_scope_id__$2J,
    __vue_is_functional_template__$2J,
    __vue_module_identifier__$2J,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2I = {
  mixins: [singleGroupMixin],
  name: 'splitlineRedtheme3Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2I = script$2I;
/* template */
var __vue_render__$2I = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Redtheme3-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2I = [];
__vue_render__$2I._withStripped = true;

  /* style */
  const __vue_inject_styles__$2I = undefined;
  /* scoped */
  const __vue_scope_id__$2I = "data-v-05ed23dd";
  /* module identifier */
  const __vue_module_identifier__$2I = undefined;
  /* functional template */
  const __vue_is_functional_template__$2I = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2I = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2I, staticRenderFns: __vue_staticRenderFns__$2I },
    __vue_inject_styles__$2I,
    __vue_script__$2I,
    __vue_scope_id__$2I,
    __vue_is_functional_template__$2I,
    __vue_module_identifier__$2I,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2H = {
  mixins: [singleGroupMixin],
  name: 'splitlineRedtheme4Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2H = script$2H;
/* template */
var __vue_render__$2H = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Redtheme4-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2H = [];
__vue_render__$2H._withStripped = true;

  /* style */
  const __vue_inject_styles__$2H = undefined;
  /* scoped */
  const __vue_scope_id__$2H = "data-v-b66d4748";
  /* module identifier */
  const __vue_module_identifier__$2H = undefined;
  /* functional template */
  const __vue_is_functional_template__$2H = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2H = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2H, staticRenderFns: __vue_staticRenderFns__$2H },
    __vue_inject_styles__$2H,
    __vue_script__$2H,
    __vue_scope_id__$2H,
    __vue_is_functional_template__$2H,
    __vue_module_identifier__$2H,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2G = {
  mixins: [singleGroupMixin],
  name: 'splitlineGreentheme1Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2G = script$2G;
/* template */
var __vue_render__$2G = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Greentheme1-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2G = [];
__vue_render__$2G._withStripped = true;

  /* style */
  const __vue_inject_styles__$2G = undefined;
  /* scoped */
  const __vue_scope_id__$2G = "data-v-9ab9b2a6";
  /* module identifier */
  const __vue_module_identifier__$2G = undefined;
  /* functional template */
  const __vue_is_functional_template__$2G = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2G = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2G, staticRenderFns: __vue_staticRenderFns__$2G },
    __vue_inject_styles__$2G,
    __vue_script__$2G,
    __vue_scope_id__$2G,
    __vue_is_functional_template__$2G,
    __vue_module_identifier__$2G,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2F = {
  mixins: [singleGroupMixin],
  name: 'splitlineGreentheme2Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2F = script$2F;
/* template */
var __vue_render__$2F = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Greentheme2-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2F = [];
__vue_render__$2F._withStripped = true;

  /* style */
  const __vue_inject_styles__$2F = undefined;
  /* scoped */
  const __vue_scope_id__$2F = "data-v-40305b6c";
  /* module identifier */
  const __vue_module_identifier__$2F = undefined;
  /* functional template */
  const __vue_is_functional_template__$2F = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2F = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2F, staticRenderFns: __vue_staticRenderFns__$2F },
    __vue_inject_styles__$2F,
    __vue_script__$2F,
    __vue_scope_id__$2F,
    __vue_is_functional_template__$2F,
    __vue_module_identifier__$2F,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2E = {
  mixins: [singleGroupMixin],
  name: 'splitlineGreentheme3Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2E = script$2E;
/* template */
var __vue_render__$2E = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Greentheme3-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick, mousemove: _vm.hover, mouseleave: _vm.leave },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2E = [];
__vue_render__$2E._withStripped = true;

  /* style */
  const __vue_inject_styles__$2E = undefined;
  /* scoped */
  const __vue_scope_id__$2E = "data-v-4616ef5b";
  /* module identifier */
  const __vue_module_identifier__$2E = undefined;
  /* functional template */
  const __vue_is_functional_template__$2E = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2E = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2E, staticRenderFns: __vue_staticRenderFns__$2E },
    __vue_inject_styles__$2E,
    __vue_script__$2E,
    __vue_scope_id__$2E,
    __vue_is_functional_template__$2E,
    __vue_module_identifier__$2E,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2D = {
  mixins: [singleGroupMixin],
  name: 'splitlineGreentheme4Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2D = script$2D;
/* template */
var __vue_render__$2D = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Greentheme4-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2D = [];
__vue_render__$2D._withStripped = true;

  /* style */
  const __vue_inject_styles__$2D = undefined;
  /* scoped */
  const __vue_scope_id__$2D = "data-v-5b4ac4ea";
  /* module identifier */
  const __vue_module_identifier__$2D = undefined;
  /* functional template */
  const __vue_is_functional_template__$2D = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2D = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2D, staticRenderFns: __vue_staticRenderFns__$2D },
    __vue_inject_styles__$2D,
    __vue_script__$2D,
    __vue_scope_id__$2D,
    __vue_is_functional_template__$2D,
    __vue_module_identifier__$2D,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2C = {
  mixins: [singleGroupMixin],
  name: 'splitlineBluetheme1Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2C = script$2C;
/* template */
var __vue_render__$2C = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Bluetheme1-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2C = [];
__vue_render__$2C._withStripped = true;

  /* style */
  const __vue_inject_styles__$2C = undefined;
  /* scoped */
  const __vue_scope_id__$2C = "data-v-2fc4c2f6";
  /* module identifier */
  const __vue_module_identifier__$2C = undefined;
  /* functional template */
  const __vue_is_functional_template__$2C = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2C = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2C, staticRenderFns: __vue_staticRenderFns__$2C },
    __vue_inject_styles__$2C,
    __vue_script__$2C,
    __vue_scope_id__$2C,
    __vue_is_functional_template__$2C,
    __vue_module_identifier__$2C,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2B = {
  mixins: [singleGroupMixin],
  name: 'splitlineBluetheme2Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2B = script$2B;
/* template */
var __vue_render__$2B = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Bluetheme2-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2B = [];
__vue_render__$2B._withStripped = true;

  /* style */
  const __vue_inject_styles__$2B = undefined;
  /* scoped */
  const __vue_scope_id__$2B = "data-v-c19e225a";
  /* module identifier */
  const __vue_module_identifier__$2B = undefined;
  /* functional template */
  const __vue_is_functional_template__$2B = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2B = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2B, staticRenderFns: __vue_staticRenderFns__$2B },
    __vue_inject_styles__$2B,
    __vue_script__$2B,
    __vue_scope_id__$2B,
    __vue_is_functional_template__$2B,
    __vue_module_identifier__$2B,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2A = {
  mixins: [singleGroupMixin],
  name: 'splitlineBluetheme3Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2A = script$2A;
/* template */
var __vue_render__$2A = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Bluetheme3-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2A = [];
__vue_render__$2A._withStripped = true;

  /* style */
  const __vue_inject_styles__$2A = undefined;
  /* scoped */
  const __vue_scope_id__$2A = "data-v-0e9d1ab0";
  /* module identifier */
  const __vue_module_identifier__$2A = undefined;
  /* functional template */
  const __vue_is_functional_template__$2A = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2A = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2A, staticRenderFns: __vue_staticRenderFns__$2A },
    __vue_inject_styles__$2A,
    __vue_script__$2A,
    __vue_scope_id__$2A,
    __vue_is_functional_template__$2A,
    __vue_module_identifier__$2A,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2z = {
  mixins: [singleGroupMixin],
  name: 'splitlineBluetheme4Render',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2z = script$2z;
/* template */
var __vue_render__$2z = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Bluetheme4-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "linebox" })]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2z = [];
__vue_render__$2z._withStripped = true;

  /* style */
  const __vue_inject_styles__$2z = undefined;
  /* scoped */
  const __vue_scope_id__$2z = "data-v-7e09468d";
  /* module identifier */
  const __vue_module_identifier__$2z = undefined;
  /* functional template */
  const __vue_is_functional_template__$2z = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2z = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2z, staticRenderFns: __vue_staticRenderFns__$2z },
    __vue_inject_styles__$2z,
    __vue_script__$2z,
    __vue_scope_id__$2z,
    __vue_is_functional_template__$2z,
    __vue_module_identifier__$2z,
    false,
    undefined,
    undefined,
    undefined
  );

const SplitlineComponents = [__vue_component__$33, __vue_component__$32, __vue_component__$31, __vue_component__$30, __vue_component__$2$, __vue_component__$2_, __vue_component__$2Z, __vue_component__$2Y, __vue_component__$2X, __vue_component__$2W, __vue_component__$2V, __vue_component__$2U, __vue_component__$2T, __vue_component__$2S, __vue_component__$2R, __vue_component__$2Q, __vue_component__$2P, __vue_component__$2O, __vue_component__$2N, __vue_component__$2M, __vue_component__$2L, __vue_component__$2K, __vue_component__$2J, __vue_component__$2I, __vue_component__$2H, __vue_component__$2G, __vue_component__$2F, __vue_component__$2E, __vue_component__$2D, __vue_component__$2C, __vue_component__$2B, __vue_component__$2A, __vue_component__$2z];
var splitline = {
  // install,
  ...SplitlineComponents
};

//

/**
 * 单图片组合
 */
var script$2y = {
  name: 'XmlSingleImageGroupRender',
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图片',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    clickImg() {
      this.$emit('clickImg');
    }
  }
};

/* script */
const __vue_script__$2y = script$2y;

/* template */
var __vue_render__$2y = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-single-image-group",
        "xml-single-image-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            pageType: _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("xml-image-render", {
            attrs: {
              "p-block-data": _vm.groupData[_vm.imageBlockDataName],
              "current-rule": _vm.currentRule,
              "block-data-name": _vm.imageBlockDataName,
              "extend-params": _vm.extendParams,
              "rule-index": _vm.ruleIndex,
              "show-title": true,
              pageType: _vm.pageType,
              mode: _vm.mode,
              resourceBasisPath: _vm.resourceBasisPath,
            },
            on: { blockclick: _vm.handleBlockClick, clickImg: _vm.clickImg },
          }),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2y = [];
__vue_render__$2y._withStripped = true;

  /* style */
  const __vue_inject_styles__$2y = undefined;
  /* scoped */
  const __vue_scope_id__$2y = undefined;
  /* module identifier */
  const __vue_module_identifier__$2y = undefined;
  /* functional template */
  const __vue_is_functional_template__$2y = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2y = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2y, staticRenderFns: __vue_staticRenderFns__$2y },
    __vue_inject_styles__$2y,
    __vue_script__$2y,
    __vue_scope_id__$2y,
    __vue_is_functional_template__$2y,
    __vue_module_identifier__$2y,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$2y.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('single-image-group-render', {
    prefix: options.prefix
  }), __vue_component__$2y);
};

//
var script$2x = {
  name: 'XmlSingleCatalogGroupRender',
  mixins: [singleGroupMixin],
  // components: {  },
  data() {
    return {
      typeText: '目录',
      dataName: 'catalogData',
      groupData: {},
      blockId: 'blockId' + Math.random()
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex: this.ruleIndex
      });
    }
  }
};

/* script */
const __vue_script__$2x = script$2x;
/* template */
var __vue_render__$2x = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "xml-catalog-render",
            {
              attrs: {
                "p-block-data": _vm.groupData[_vm.dataName],
                "current-rule": _vm.currentRule,
                "block-data-name": _vm.dataName,
                "extend-params": _vm.extendParams,
                "rule-index": _vm.ruleIndex,
                pageType: _vm.pageType,
                mode: _vm.mode,
              },
              on: { blockclick: _vm.handleBlockClick },
            },
            [_vm._v("\n      >\n    ")]
          ),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2x = [];
__vue_render__$2x._withStripped = true;

  /* style */
  const __vue_inject_styles__$2x = undefined;
  /* scoped */
  const __vue_scope_id__$2x = "data-v-55908341";
  /* module identifier */
  const __vue_module_identifier__$2x = undefined;
  /* functional template */
  const __vue_is_functional_template__$2x = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2x = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2x, staticRenderFns: __vue_staticRenderFns__$2x },
    __vue_inject_styles__$2x,
    __vue_script__$2x,
    __vue_scope_id__$2x,
    __vue_is_functional_template__$2x,
    __vue_module_identifier__$2x,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$2x.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('single-ctalog-group-render', {
    prefix: options.prefix
  }), __vue_component__$2x);
};

//
var script$2w = {
  name: 'XmlSingleBookGroupRender',
  mixins: [singleGroupMixin],
  // components: {  },
  data() {
    return {
      typeText: '电子书',
      ebookDataName: 'ebookData',
      groupData: {},
      blockId: 'blockId' + Math.random()
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex: this.ruleIndex
      });
    },
    showFileReader(e) {
      this.$emit('showFileReader', e);
    }
  }
};

/* script */
const __vue_script__$2w = script$2w;
/* template */
var __vue_render__$2w = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-single-ebook-group",
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("xml-ebook-render", {
            attrs: {
              "p-block-data": _vm.groupData[_vm.ebookDataName],
              "current-rule": _vm.currentRule,
              "block-data-name": _vm.ebookDataName,
              "extend-params": _vm.extendParams,
              "rule-index": _vm.ruleIndex,
              mode: _vm.mode,
              resourceBasisPath: _vm.resourceBasisPath,
            },
            on: {
              blockclick: _vm.handleBlockClick,
              showFileReader: _vm.showFileReader,
            },
          }),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2w = [];
__vue_render__$2w._withStripped = true;

  /* style */
  const __vue_inject_styles__$2w = undefined;
  /* scoped */
  const __vue_scope_id__$2w = "data-v-6f767b18";
  /* module identifier */
  const __vue_module_identifier__$2w = undefined;
  /* functional template */
  const __vue_is_functional_template__$2w = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2w = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2w, staticRenderFns: __vue_staticRenderFns__$2w },
    __vue_inject_styles__$2w,
    __vue_script__$2w,
    __vue_scope_id__$2w,
    __vue_is_functional_template__$2w,
    __vue_module_identifier__$2w,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$2w.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('single-ebook-group-render', {
    prefix: options.prefix
  }), __vue_component__$2w);
};

//
var script$2v = {
  name: 'XmlSingleHtmlGroupRender',
  mixins: [singleGroupMixin],
  // components: {  },
  data() {
    return {
      typeText: 'html',
      ebookDataName: 'htmlData',
      groupData: {},
      blockId: 'blockId' + Math.random()
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    isCopyUrl: {
      type: Boolean,
      default: false
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex: this.ruleIndex
      });
    },
    openHtml(data) {
      this.$emit('openHtml', data);
    },
    copyHtmlUrl(data) {
      this.$emit('copyHtmlUrl', data);
    }
  }
};

/* script */
const __vue_script__$2v = script$2v;
/* template */
var __vue_render__$2v = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("xml-html-render", {
            attrs: {
              "p-block-data": _vm.groupData[_vm.ebookDataName],
              "current-rule": _vm.currentRule,
              "block-data-name": _vm.ebookDataName,
              "extend-params": _vm.extendParams,
              "rule-index": _vm.ruleIndex,
              "page-type": _vm.pageType,
              mode: _vm.mode,
              resourceBasisPath: _vm.resourceBasisPath,
              isCopyUrl: _vm.isCopyUrl,
            },
            on: {
              blockclick: _vm.handleBlockClick,
              copyHtmlUrl: _vm.copyHtmlUrl,
              openHtml: _vm.openHtml,
            },
          }),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2v = [];
__vue_render__$2v._withStripped = true;

  /* style */
  const __vue_inject_styles__$2v = undefined;
  /* scoped */
  const __vue_scope_id__$2v = "data-v-9937d650";
  /* module identifier */
  const __vue_module_identifier__$2v = undefined;
  /* functional template */
  const __vue_is_functional_template__$2v = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2v = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2v, staticRenderFns: __vue_staticRenderFns__$2v },
    __vue_inject_styles__$2v,
    __vue_script__$2v,
    __vue_scope_id__$2v,
    __vue_is_functional_template__$2v,
    __vue_module_identifier__$2v,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$2v.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('single-html-group-render', {
    prefix: options.prefix
  }), __vue_component__$2v);
};

//
var script$2u = {
  name: 'XmlSingleMusicGroupRender',
  mixins: [singleGroupMixin],
  // components: {  },
  data() {
    return {
      typeText: '音频',
      musicDataName: 'musicData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    }
  }
};

/* script */
const __vue_script__$2u = script$2u;
/* template */
var __vue_render__$2u = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-single-music-group",
        "xml-single-music-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("xml-music-render", {
            attrs: {
              "p-block-data": _vm.groupData[_vm.musicDataName],
              "current-rule": _vm.currentRule,
              "block-data-name": _vm.musicDataName,
              "extend-params": _vm.extendParams,
              "rule-index": _vm.ruleIndex,
              mode: _vm.mode,
              resourceBasisPath: _vm.resourceBasisPath,
            },
            on: { blockclick: _vm.handleBlockClick },
          }),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2u = [];
__vue_render__$2u._withStripped = true;

  /* style */
  const __vue_inject_styles__$2u = undefined;
  /* scoped */
  const __vue_scope_id__$2u = "data-v-272f2034";
  /* module identifier */
  const __vue_module_identifier__$2u = undefined;
  /* functional template */
  const __vue_is_functional_template__$2u = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2u = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2u, staticRenderFns: __vue_staticRenderFns__$2u },
    __vue_inject_styles__$2u,
    __vue_script__$2u,
    __vue_scope_id__$2u,
    __vue_is_functional_template__$2u,
    __vue_module_identifier__$2u,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$2u.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('single-music-group-render', {
    prefix: options.prefix
  }), __vue_component__$2u);
};

//
var script$2t = {
  name: 'XmlSingleQuestionGroupRender',
  mixins: [singleGroupMixin],
  // components: {  },
  data() {
    return {
      typeText: '题库',
      questionDataName: 'questionData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    isShowAi: {
      type: String,
      default: '1'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    changeAnswer() {
      this.$refs.xmlQuestion.changeAnswer();
    },
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    }
  }
};

/* script */
const __vue_script__$2t = script$2t;
/* template */
var __vue_render__$2t = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-single-question-group",
        "xml-single-question-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("xml-question-render", {
            ref: "xmlQuestion",
            attrs: {
              "p-block-data": _vm.groupData[_vm.questionDataName],
              "current-rule": _vm.currentRule,
              "block-data-name": _vm.questionDataName,
              "extend-params": _vm.extendParams,
              "rule-index": _vm.ruleIndex,
              mode: _vm.mode,
              isShowAi: _vm.isShowAi,
              pageType: _vm.pageType,
              isSubmit:
                _vm.groupData[_vm.questionDataName].questionMode == "false"
                  ? false
                  : true,
              resourceBasisPath: _vm.resourceBasisPath,
            },
            on: {
              blockclick: _vm.handleBlockClick,
              submitAnswer: function ($event) {
                return _vm.$emit("submitAnswer", $event)
              },
              setanalysis: function ($event) {
                return _vm.$emit("setanalysis", $event)
              },
            },
          }),
        ],
        1
      ),
      _vm._v(" "),
      _vm.groupData[_vm.questionDataName].questionMode == "false"
        ? _c(
            "div",
            {
              staticClass: "xml-submit-answer xml-submit-answer-right",
              on: {
                click: function ($event) {
                  return _vm.changeAnswer()
                },
              },
            },
            [_vm._v("\n    提交作答\n  ")]
          )
        : _vm._e(),
    ],
    1
  )
};
var __vue_staticRenderFns__$2t = [];
__vue_render__$2t._withStripped = true;

  /* style */
  const __vue_inject_styles__$2t = undefined;
  /* scoped */
  const __vue_scope_id__$2t = "data-v-77922a38";
  /* module identifier */
  const __vue_module_identifier__$2t = undefined;
  /* functional template */
  const __vue_is_functional_template__$2t = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2t = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2t, staticRenderFns: __vue_staticRenderFns__$2t },
    __vue_inject_styles__$2t,
    __vue_script__$2t,
    __vue_scope_id__$2t,
    __vue_is_functional_template__$2t,
    __vue_module_identifier__$2t,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$2t.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('single-question-group-render', {
    prefix: options.prefix
  }), __vue_component__$2t);
};

//
// import { OuchnOss } from '@/api/business/file/OuchnOss'
var script$2s = {
  name: 'XmlSingleResourceGroupRender',
  mixins: [singleGroupMixin],
  // components: {  },
  data() {
    return {
      typeText: '资源',
      resourceDataName: 'resourceData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    officePreviewPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  watch: {
    pGroupData(newVal) {
      this.groupData = this.pGroupData;
    }
  },
  computed: {
    isNotLocalView() {
      return !(process.env.VUE_APP_ENV === 'localview');
    }
  },
  created() {
    this.groupData = this.pGroupData;
    // console.log(this.pGroupData, 'pGroupData---------')
    // if (this.isNotLocalView) {
    //   this.ouchnOss = new OuchnOss(true)
    // }
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    downloadFileUrl({
      item,
      fileName,
      resourceType
    }) {
      this.$emit('downloadFileUrl', {
        item,
        fileName,
        resourceType
      });
    },
    showFileReader(e) {
      this.$emit('showFileReader', e);
    }
  }
};

/* script */
const __vue_script__$2s = script$2s;
/* template */
var __vue_render__$2s = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-single-resource-group",
        "xml-single-resource-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("xml-resource-render", {
            attrs: {
              "p-block-data": _vm.groupData[_vm.resourceDataName],
              "current-rule": _vm.currentRule,
              "block-data-name": _vm.resourceDataName,
              "extend-params": _vm.extendParams,
              "rule-index": _vm.ruleIndex,
              mode: _vm.mode,
              resourceBasisPath: _vm.resourceBasisPath,
              officePreviewPath: _vm.officePreviewPath,
              pageType: _vm.pageType,
            },
            on: {
              blockclick: _vm.handleBlockClick,
              downloadFileUrl: _vm.downloadFileUrl,
              showFileReader: _vm.showFileReader,
            },
          }),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2s = [];
__vue_render__$2s._withStripped = true;

  /* style */
  const __vue_inject_styles__$2s = undefined;
  /* scoped */
  const __vue_scope_id__$2s = "data-v-2b4774b7";
  /* module identifier */
  const __vue_module_identifier__$2s = undefined;
  /* functional template */
  const __vue_is_functional_template__$2s = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2s = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2s, staticRenderFns: __vue_staticRenderFns__$2s },
    __vue_inject_styles__$2s,
    __vue_script__$2s,
    __vue_scope_id__$2s,
    __vue_is_functional_template__$2s,
    __vue_module_identifier__$2s,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$2s.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('single-resource-group-render', {
    prefix: options.prefix
  }), __vue_component__$2s);
};

//
var script$2r = {
  name: 'XmlSingleTestPaperGroupRender',
  mixins: [singleGroupMixin],
  // components: {  },
  data() {
    return {
      typeText: '试卷',
      questionDataName: 'testPaperData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    reader: {
      type: Boolean,
      default: false
    },
    isShowAi: {
      type: String,
      default: '1'
    },
    BookName: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    openTestPaper({
      info,
      showRobot
    }) {
      console.log(showRobot);
      this.$emit('openTestPaper', {
        info: info,
        showRobot: showRobot
      });
    }
  }
};

/* script */
const __vue_script__$2r = script$2r;
/* template */
var __vue_render__$2r = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-single-test-paper-group",
        "xml-single-question-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _vm.mode === "editor"
        ? _c("span", { staticClass: "xml-group-type-text" })
        : _vm._e(),
      _vm._v(" "),
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            BookName: _vm.BookName,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("xml-test-paper-render", {
            attrs: {
              "p-block-data": _vm.groupData[_vm.questionDataName],
              "current-rule": _vm.currentRule,
              "block-data-name": _vm.questionDataName,
              "extend-params": _vm.extendParams,
              "rule-index": _vm.ruleIndex,
              mode: _vm.mode,
              reader: _vm.reader,
              pageType: _vm.pageType,
              BookName: _vm.BookName,
              isShowAi: _vm.isShowAi,
            },
            on: {
              blockclick: _vm.handleBlockClick,
              openTestPaper: _vm.openTestPaper,
            },
          }),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2r = [];
__vue_render__$2r._withStripped = true;

  /* style */
  const __vue_inject_styles__$2r = undefined;
  /* scoped */
  const __vue_scope_id__$2r = "data-v-34ba0440";
  /* module identifier */
  const __vue_module_identifier__$2r = undefined;
  /* functional template */
  const __vue_is_functional_template__$2r = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2r = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2r, staticRenderFns: __vue_staticRenderFns__$2r },
    __vue_inject_styles__$2r,
    __vue_script__$2r,
    __vue_scope_id__$2r,
    __vue_is_functional_template__$2r,
    __vue_module_identifier__$2r,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$2r.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('single-test-paper-group-render', {
    prefix: options.prefix
  }), __vue_component__$2r);
};

//
/**
 * 单文本组合
 */
var script$2q = {
  name: 'XmlSingleTextGroupRender',
  mixins: [singleGroupMixin],
  // components: {  },
  data() {
    return {
      typeText: '文本',
      textDataName: 'textData',
      showComponentButtons: false,
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    ruleIndex: Number,
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    projectId: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$2q = script$2q;
/* template */
var __vue_render__$2q = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark text-body-mark",
      class: [
        "xml-single-text-group",
        "xml-single-text-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          staticClass: "optional-text",
          attrs: {
            "page-type": _vm.pageType,
            "type-text": _vm.typeText,
            projectId: _vm.projectId,
            mode: _vm.mode,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("xml-text-render", {
            ref: "xmlText",
            attrs: {
              projectId: _vm.projectId,
              pBlockData: _vm.groupData[_vm.textDataName],
              "block-data-name": _vm.textDataName,
              "extend-params": _vm.extendParams,
              "rule-index": _vm.ruleIndex,
              currentRule: _vm.currentRule,
              "css-theme": "default",
              "container-class": "text-container",
              "text-container": "default-text-container",
              resourceBasisPath: _vm.resourceBasisPath,
              mode: _vm.mode,
              "page-type": _vm.pageType,
              scopedSlots: { $scopedSlots: _vm.$scopedSlots },
            },
            on: {
              "update:pBlockData": function ($event) {
                return _vm.$set(_vm.groupData, _vm.textDataName, $event)
              },
              "update:p-block-data": function ($event) {
                return _vm.$set(_vm.groupData, _vm.textDataName, $event)
              },
              blockclick: _vm.handleBlockClick,
              groupDataChange: _vm.groupDataChange,
            },
            scopedSlots: _vm._u(
              [
                _vm._l(_vm.$scopedSlots, function (index, name) {
                  return {
                    key: name,
                    fn: function (deliver) {
                      return [_vm._t(name, null, null, deliver)]
                    },
                  }
                }),
              ],
              null,
              true
            ),
          }),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2q = [];
__vue_render__$2q._withStripped = true;

  /* style */
  const __vue_inject_styles__$2q = undefined;
  /* scoped */
  const __vue_scope_id__$2q = "data-v-647015fa";
  /* module identifier */
  const __vue_module_identifier__$2q = undefined;
  /* functional template */
  const __vue_is_functional_template__$2q = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2q = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2q, staticRenderFns: __vue_staticRenderFns__$2q },
    __vue_inject_styles__$2q,
    __vue_script__$2q,
    __vue_scope_id__$2q,
    __vue_is_functional_template__$2q,
    __vue_module_identifier__$2q,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$2q.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('single-text-group-render', {
    prefix: options.prefix
  }), __vue_component__$2q);
};

//
var script$2p = {
  name: "XmlSingleVideoGroupRender",
  mixins: [singleGroupMixin],
  // components: {  },
  data() {
    return {
      typeText: "视频",
      videoDataName: "videoData",
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return "editor";
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: "h5"
    },
    resourceBasisPath: {
      type: String,
      default: ""
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    videoImg: {
      type: Boolean,
      default: false
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit("blockclick", {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    }
  }
};

/* script */
const __vue_script__$2p = script$2p;
/* template */
var __vue_render__$2p = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-single-video-group",
        "xml-single-video-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _vm.videoImg
            ? _c("xml-video-img-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.videoDataName],
                  "current-rule": _vm.currentRule,
                  "block-data-name": _vm.videoDataName,
                  "extend-params": _vm.extendParams,
                  "rule-index": _vm.ruleIndex,
                  resourceBasisPath: _vm.resourceBasisPath,
                  mode: _vm.mode,
                },
                on: { blockclick: _vm.handleBlockClick },
              })
            : _c("xml-video-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.videoDataName],
                  "current-rule": _vm.currentRule,
                  "block-data-name": _vm.videoDataName,
                  "extend-params": _vm.extendParams,
                  "rule-index": _vm.ruleIndex,
                  resourceBasisPath: _vm.resourceBasisPath,
                  mode: _vm.mode,
                },
                on: { blockclick: _vm.handleBlockClick },
              }),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2p = [];
__vue_render__$2p._withStripped = true;

  /* style */
  const __vue_inject_styles__$2p = undefined;
  /* scoped */
  const __vue_scope_id__$2p = "data-v-3ae74720";
  /* module identifier */
  const __vue_module_identifier__$2p = undefined;
  /* functional template */
  const __vue_is_functional_template__$2p = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2p = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2p, staticRenderFns: __vue_staticRenderFns__$2p },
    __vue_inject_styles__$2p,
    __vue_script__$2p,
    __vue_scope_id__$2p,
    __vue_is_functional_template__$2p,
    __vue_module_identifier__$2p,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$2p.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('single-video-group-render', {
    prefix: options.prefix
  }), __vue_component__$2p);
};

//
var script$2o = {
  name: 'XmlSingleRecorderGroupRender',
  mixins: [singleGroupMixin],
  // components: {  },
  data() {
    return {
      typeText: '录音',
      recorderDataName: 'recorderData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    getresdata({
      blob,
      duration
    }) {
      this.$emit('getresdata', {
        blob,
        duration
      });
    }
  }
};

/* script */
const __vue_script__$2o = script$2o;

/* template */
var __vue_render__$2o = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-single-recorder-group",
        "xml-single-recorder-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("xml-recorder-render", {
            attrs: {
              "p-block-data": _vm.groupData[_vm.recorderDataName],
              "current-rule": _vm.currentRule,
              "block-data-name": _vm.recorderDataName,
              "extend-params": _vm.extendParams,
              "rule-index": _vm.ruleIndex,
              mode: _vm.mode,
              resourceBasisPath: _vm.resourceBasisPath,
            },
            on: {
              blockclick: _vm.handleBlockClick,
              getresdata: _vm.getresdata,
            },
          }),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2o = [];
__vue_render__$2o._withStripped = true;

  /* style */
  const __vue_inject_styles__$2o = undefined;
  /* scoped */
  const __vue_scope_id__$2o = undefined;
  /* module identifier */
  const __vue_module_identifier__$2o = undefined;
  /* functional template */
  const __vue_is_functional_template__$2o = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2o = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2o, staticRenderFns: __vue_staticRenderFns__$2o },
    __vue_inject_styles__$2o,
    __vue_script__$2o,
    __vue_scope_id__$2o,
    __vue_is_functional_template__$2o,
    __vue_module_identifier__$2o,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$2o.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1(__vue_component__$2o.name, {
    prefix: options.prefix
  }), __vue_component__$2o);
};

//
var script$2n = {
  name: 'XmlSingleVoiceGroupRender',
  mixins: [singleGroupMixin],
  // components: {  },
  data() {
    return {
      typeText: '录音',
      recorderDataName: 'recorderData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    sourcedata: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  watch: {
    currentRule: {
      handler(newValue) {
        this.groupData = newValue.data.pGroupData;
      },
      deep: true,
      immediate: true
    }
  },
  created() {
    this.groupData = this.pGroupData;
    console.log(this.sourcedata, 'group页');
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    getresdata({
      blob,
      duration
    }) {
      this.$emit('getresdata', {
        blob,
        duration
      });
    },
    ratedata({
      ratingData,
      ruleIndex,
      dataName
    }) {
      this.$emit('ratedata', {
        ratingData: ratingData,
        ruleIndex: ruleIndex,
        dataName: dataName
      });
    }
  }
};

/* script */
const __vue_script__$2n = script$2n;

/* template */
var __vue_render__$2n = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-single-recorder-group",
        "xml-single-recorder-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("xml-voice-render", {
            attrs: {
              "p-block-data": _vm.groupData[_vm.recorderDataName],
              voicedata: _vm.groupData,
              sourcedata: _vm.sourcedata,
              "current-rule": _vm.currentRule,
              "block-data-name": _vm.recorderDataName,
              "extend-params": _vm.extendParams,
              "rule-index": _vm.ruleIndex,
              mode: _vm.mode,
              "page-type": _vm.pageType,
              resourceBasisPath: _vm.resourceBasisPath,
            },
            on: {
              blockclick: _vm.handleBlockClick,
              getresdata: _vm.getresdata,
              ratedata: _vm.ratedata,
            },
          }),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2n = [];
__vue_render__$2n._withStripped = true;

  /* style */
  const __vue_inject_styles__$2n = undefined;
  /* scoped */
  const __vue_scope_id__$2n = undefined;
  /* module identifier */
  const __vue_module_identifier__$2n = undefined;
  /* functional template */
  const __vue_is_functional_template__$2n = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2n = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2n, staticRenderFns: __vue_staticRenderFns__$2n },
    __vue_inject_styles__$2n,
    __vue_script__$2n,
    __vue_scope_id__$2n,
    __vue_is_functional_template__$2n,
    __vue_module_identifier__$2n,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$2n.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1(__vue_component__$2n.name, {
    prefix: options.prefix
  }), __vue_component__$2n);
};

//
/**
 * 热点组
 */
var script$2m = {
  name: 'XmlSingleHotzoneGroupRender',
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    max: {
      type: Number,
      default: 10
    }
  },
  provide() {
    return {
      getSelfRuleIndex: () => {
        return this.ruleIndex;
      }
    };
  },
  data() {
    return {
      typeText: '热区',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      blockDataKey: 'xmlBlockData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  watch: {
    pGroupData: {
      handler(newValue) {
        this.$nextTick(() => {
          this.groupData = Object.assign({}, this.groupData, newValue);
        });
      },
      deep: true,
      immediate: true
    }
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      console.log('触发');
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    remove(curZone, index) {
      this.$emit('remove', curZone, index);
    }
  }
};

/* script */
const __vue_script__$2m = script$2m;

/* template */
var __vue_render__$2m = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-single-hotzone-group",
        "xml-single-hotzone-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": "pc",
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("xml-hotzone-render", {
            attrs: {
              "p-block-data": _vm.groupData[_vm.blockDataKey],
              "current-rule": _vm.currentRule,
              "block-data-name": _vm.blockDataKey,
              "extend-params": _vm.extendParams,
              "rule-index": _vm.ruleIndex,
              "show-title": true,
              mode: _vm.mode,
              max: _vm.max,
              resourceBasisPath: _vm.resourceBasisPath,
            },
            on: {
              blockclick: _vm.handleBlockClick,
              "wrap-click": _vm.handleBlockClick,
              remove: _vm.remove,
            },
          }),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2m = [];
__vue_render__$2m._withStripped = true;

  /* style */
  const __vue_inject_styles__$2m = undefined;
  /* scoped */
  const __vue_scope_id__$2m = undefined;
  /* module identifier */
  const __vue_module_identifier__$2m = undefined;
  /* functional template */
  const __vue_is_functional_template__$2m = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2m = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2m, staticRenderFns: __vue_staticRenderFns__$2m },
    __vue_inject_styles__$2m,
    __vue_script__$2m,
    __vue_scope_id__$2m,
    __vue_is_functional_template__$2m,
    __vue_module_identifier__$2m,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$2m.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('single-hotzone-group-render', {
    prefix: options.prefix
  }), __vue_component__$2m);
};

//
/**
 * 热点组
 */
var script$2l = {
  name: 'XmlSingleLayoutGroupRender',
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    // activeIndex: {
    //   type: Number,
    //   default: -1
    // },
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    max: {
      type: Number,
      default: 10
    }
  },
  provide() {
    return {
      getSelfRuleIndex: () => {
        return this.ruleIndex;
      }
    };
  },
  data() {
    return {
      typeText: '分栏布局',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      blockDataKey: 'xmlBlockData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  // watch: {
  //   pGroupData: {
  //     handler(newValue) {
  //       this.$nextTick(() => {
  //         this.groupData = Object.assign({}, this.groupData, newValue)
  //       })
  //     },
  //     deep: true,
  //     immediate: true
  //   }
  // },

  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      console.log('触发块点击');
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    }
  }
};

/* script */
const __vue_script__$2l = script$2l;

/* template */
var __vue_render__$2l = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-single-layout-group",
        "xml-single-layout-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "xml-layout-render",
            {
              attrs: {
                "p-block-data": _vm.groupData[_vm.blockDataKey],
                "current-rule": _vm.currentRule,
                blockDataName: _vm.blockDataKey,
                "extend-params": _vm.extendParams,
                "rule-index": _vm.ruleIndex,
                "show-title": true,
                mode: _vm.mode,
                max: _vm.max,
                bindingComponents: _vm.currentRule.bindingComponents,
                resourceBasisPath: _vm.resourceBasisPath,
              },
              on: { blockclick: _vm.handleBlockClick },
            },
            [
              _vm.$slots.injectComponents
                ? [_vm._t("injectComponents")]
                : _vm._e(),
            ],
            2
          ),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2l = [];
__vue_render__$2l._withStripped = true;

  /* style */
  const __vue_inject_styles__$2l = undefined;
  /* scoped */
  const __vue_scope_id__$2l = undefined;
  /* module identifier */
  const __vue_module_identifier__$2l = undefined;
  /* functional template */
  const __vue_is_functional_template__$2l = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2l = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2l, staticRenderFns: __vue_staticRenderFns__$2l },
    __vue_inject_styles__$2l,
    __vue_script__$2l,
    __vue_scope_id__$2l,
    __vue_is_functional_template__$2l,
    __vue_module_identifier__$2l,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$2l.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('single-layout-group-render', {
    prefix: options.prefix
  }), __vue_component__$2l);
};

const needWrapComponents = ['xml-single-text-group', 'imageTextFirst', 'imageTextSecond', 'imageTextThird', 'imageTextFourth', 'imageTextFifth', 'imageTextSixth', 'imageTextSeventh', 'titleFirst', 'titleSecond', 'titleThird', 'titleHexagon', 'titleFifth', 'titleSixth', 'titleTriangle', 'titleRectangle', 'titleRotundity', 'titleSquare', 'titleSemicircle', 'titleTwelfth', 'titlethirteenth', 'titlefourteen', 'titleFifteen', 'titleSixteen', 'titleSeventeen', 'titleEighteen', 'titleNineteen', 'titleGreentheme1', 'titleGreentheme2', 'titleGreentheme3', 'titleGreentheme4', 'titleGreentheme5', 'titleGreentheme6', 'titleYellowtheme1', 'titleYellowtheme2', 'titleYellowtheme3', 'titleYellowtheme4', 'titleYellowtheme5', 'titleYellowtheme6', 'titleKnowledge', 'paragraphFirst', 'paragraphSecond', 'paragraphThird', 'paragraphQuadrangle', 'paragraphIsosceles', 'paragrapheighth', 'paragraphninth', 'paragraphtenth', 'paragraphWave', 'paragraphSeventh', 'paragraphEleven', 'paragraphTwelve', 'paragraphThirteen', 'paragraphFourteen', 'paragraphFifteen', 'paragraphGreentheme2', 'paragraphGreentheme3', 'paragraphGreentheme4', 'paragraphGreentheme5', 'paragraphYellowtheme1', 'paragraphYellowtheme2', 'paragraphYellowtheme3', 'paragraphYellowtheme4', 'paragraphYellowtheme5', 'paragraphRedtheme1', 'paragraphRedtheme2', 'paragraphRedtheme3', 'paragraphRedtheme4', 'paragraphRedtheme5', 'paragraphRedtheme6', 'paragraphSixteen', 'splitlineFirst', 'splitlineSecond', 'splitlineThird', 'splitlineFourth', 'splitlineFifth', 'splitlineSixth', 'splitlineSeventh', 'splitlineEighth', 'splitlineNinth', 'splitlineTenth', 'splitlineEleventh', 'splitlineGreytheme1', 'splitlineGreytheme2', 'splitlineGreytheme3', 'splitlineGreytheme4', 'splitlineGreytheme5', 'splitlineGreytheme6', 'splitlineYellowtheme1', 'splitlineYellowtheme2', 'splitlineYellowtheme3', 'splitlineYellowtheme4', 'splitlineRedtheme1', 'splitlineRedtheme2', 'splitlineRedtheme3', 'splitlineRedtheme4', 'splitlineGreentheme1', 'splitlineGreentheme2', 'splitlineGreentheme3', 'splitlineGreentheme4', 'splitlineBluetheme1', 'splitlineBluetheme2', 'splitlineBluetheme3', 'splitlineBluetheme4', 'titleThirdLibrary', 'titleFirstLibrary', 'titleSixthLibrary', 'titleRectangleLibrary', 'titleSemicircleLibrary', 'titleYellowtheme1Library', 'titleYellowtheme2Library', 'titleYellowtheme4Library', 'titleYellowtheme5Library', 'titleYellowtheme6Library', 'titleThirteenthLibrary', 'titleTwelfthLibrary', 'titleGreentheme1Library', 'titleGreentheme2Library', 'titleGreentheme3Library', 'titleGreentheme4Library', 'titleGreentheme6Library', 'titleNineteenLibrary', 'titleHexagonLibrary', 'titleFourteenLibrary', 'titleSeventeenLibrary', 'titleSixteenLibrary', 'titleFifteenLibrary', 'titleKnowledgeLibrary', 'titleFifthLibrary', 'titleTriangleLibrary', 'paragraphFirstLibrary', 'paragraphSecondLibrary', 'paragraphThirdLibrary', 'paragraphQuadrangleLibrary', 'paragraphIsoscelesLibrary', 'paragraphNinthLibrary', 'paragraphEighthLibrary', 'paragraphTenthLibrary', 'paragraphSixteenLibrary', 'paragraphSeventhLibrary', 'paragraphElevenLibrary', 'paragraphThirteenLibrary', 'paragraphFourteenLibrary', 'paragraphGreentheme2Library', 'paragraphGreentheme3Library', 'paragraphGreentheme4Library', 'paragraphGreentheme5Library', 'paragraphYellowtheme1Library', 'paragraphYellowtheme2Library', 'paragraphYellowtheme3Library', 'paragraphYellowtheme4Library', 'paragraphYellowtheme5Library', 'paragraphRedtheme1Library', 'paragraphRedtheme2Library', 'paragraphRedtheme3Library', 'paragraphRedtheme4Library', 'paragraphRedtheme5Library', 'imageTextFirstLibrary', 'imageTextSecondLibrary', 'imageTextThirdLibrary', 'imageTextFourthLibrary', 'imageTextFifthLibrary', 'imageTextSixthLibrary', 'imageTextSeventhLibrary', 'splitlineFirstLibrary', 'splitlineSecondLibrary', 'splitlineFourthLibrary', 'splitlineFifthLibrary', 'splitlineSixthLibrary', 'splitlineSeventhLibrary', 'splitlineEighthLibrary', 'splitlineTenthLibrary', 'splitlineEleventhLibrary', 'splitlineNinthLibrary', 'splitlineRedtheme1Library', 'splitlineGreytheme2Library', 'splitlineGreytheme3Library', 'splitlineGreytheme5Library', 'splitlineYellowtheme3Library', 'splitlineBluetheme1Library', 'splitlineBluetheme2Library', 'splitlineYellowtheme2Library', 'splitlineRedtheme4Library', 'splitlineYellowtheme1Library', 'splitlineGreytheme1Library', 'splitlineBluetheme4Library', 'titleRedtheme1Library', 'titleRedtheme2Library', 'titleRedtheme3Library', 'titleRedtheme4Library', 'paragraphRedtheme6Library', 'paragraphRedtheme7Library', 'paragraphFoldtheme1Library', 'paragraphFoldtheme2Library', 'paragraphFoldtheme3Library', 'paragraphTabstheme1Library', 'paragraphTabstheme2Library', 'paragraphTabstheme3Library', 'paragraphTabstheme4Library', 'titleSanQintheme1', 'titleSanQintheme2', 'titleSanQintheme3', 'paragraphSanQintheme1', 'paragraphSanQintheme2', 'paragraphSanQintheme3', 'paragraphSanQintheme1Library', 'paragraphTwelveLibrary', 'titleThirtyoneLibrary', 'titleThirtytwoLibrary', 'titleThirtythreeLibrary', 'titleThirtyfourLibrary', 'titleThirtyfiveLibrary', 'titleThirtysixLibrary', 'titleThirtysevenLibrary', 'titleThirtyeightLibrary', 'paragraphFoldtheme4Library', 'paragraphFoldtheme5Library', 'paragraphTabstheme5Library', 'paragraphTabstheme6Library', 'paragraphFortytwoLibrary', 'paragraphFortythreeLibrary', 'paragraphFortyfourLibrary', 'paragraphFortyfiveLibrary'];
const toKebabCase = value => {
  if (allCapital(value)) {
    return value.toLocaleLowerCase();
  }
  return value.charAt(0).toLowerCase() + value.slice(1).replace(/([A-Z])/g, '-$1').toLowerCase();
};
const isComponentNameNeedEditorWrap = name => {
  if (needWrapComponents.includes(name)) {
    let formated;
    if (name.includes('-')) {
      formated = name + '-editor';
    } else {
      formated = toKebabCase(name) + '-editor';
    }
    return formated;
  }
  return name + '-render';
};

//
/**
 * SingleGroup代理
 */
var script$2k = {
  name: 'XmlSingleAgentGroupRender',
  components: {
    Portal
  },
  props: {
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      // typeText: '分栏布局',
      // //定义此变量，是为了解决页面中有多个块儿的情况。
      // blockDataKey: 'xmlBlockData',
      // groupData: {}
    };
  },
  computed: {
    isInjectSingleGroup() {
      return !!this.currentRule.trueComponentsName && !!this.currentRule.injectTarget;
    }
  },
  // created() {
  // },
  // watch: {
  //   pGroupData: {
  //     handler(newValue) {
  //       this.$nextTick(() => {
  //         this.groupData = Object.assign({}, this.groupData, newValue)
  //       })
  //     },
  //     deep: true,
  //     immediate: true
  //   }
  // },

  mounted() {},
  methods: {
    isComponentNameNeedEditorWrap,
    forwordAreaboxInjectClick(e) {
      this.$emit('agentClick', this.currentRule);
    }
  }
};

/* script */
const __vue_script__$2k = script$2k;
/* template */
var __vue_render__$2k = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "Portal",
    {
      staticClass: "parent-group parent-group-mark xml-single-agent-group",
      attrs: { to: this.currentRule.injectTarget },
    },
    [
      _c(
        _vm.isComponentNameNeedEditorWrap(_vm.currentRule.trueComponentsName),
        _vm._g(
          _vm._b(
            {
              tag: "component",
              attrs: {
                currentRule: _vm.currentRule,
                scopedSlots: { $scopedSlots: _vm.$scopedSlots },
              },
              on: {
                click: function ($event) {
                  $event.stopPropagation();
                  return _vm.forwordAreaboxInjectClick.apply(null, arguments)
                },
              },
              scopedSlots: _vm._u(
                [
                  _vm._l(_vm.$scopedSlots, function (index, name) {
                    return {
                      key: name,
                      fn: function (deliver) {
                        return [_vm._t(name, null, null, deliver)]
                      },
                    }
                  }),
                ],
                null,
                true
              ),
            },
            "component",
            _vm.$attrs,
            false
          ),
          _vm.$listeners
        )
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$2k = [];
__vue_render__$2k._withStripped = true;

  /* style */
  const __vue_inject_styles__$2k = undefined;
  /* scoped */
  const __vue_scope_id__$2k = "data-v-9edac750";
  /* module identifier */
  const __vue_module_identifier__$2k = undefined;
  /* functional template */
  const __vue_is_functional_template__$2k = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2k = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2k, staticRenderFns: __vue_staticRenderFns__$2k },
    __vue_inject_styles__$2k,
    __vue_script__$2k,
    __vue_scope_id__$2k,
    __vue_is_functional_template__$2k,
    __vue_module_identifier__$2k,
    false,
    undefined,
    undefined,
    undefined
  );

__vue_component__$2k.install = (Vue, options = {}) => {
  Vue.component(createNamespace$1('single-agent-group-render', {
    prefix: options.prefix
  }), __vue_component__$2k);
};

// This file is autogenerated. It's used to publish ESM to npm.
function _typeof(obj) {
  "@babel/helpers - typeof";

  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
    return typeof obj;
  } : function (obj) {
    return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  }, _typeof(obj);
}

// https://github.com/bgrins/TinyColor
// Brian Grinstead, MIT License

var trimLeft = /^\s+/;
var trimRight = /\s+$/;
function tinycolor(color, opts) {
  color = color ? color : "";
  opts = opts || {};

  // If input is already a tinycolor, return itself
  if (color instanceof tinycolor) {
    return color;
  }
  // If we are called as a function, call using new instead
  if (!(this instanceof tinycolor)) {
    return new tinycolor(color, opts);
  }
  var rgb = inputToRGB(color);
  this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = Math.round(100 * this._a) / 100, this._format = opts.format || rgb.format;
  this._gradientType = opts.gradientType;

  // Don't let the range of [0,255] come back in [0,1].
  // Potentially lose a little bit of precision here, but will fix issues where
  // .5 gets interpreted as half of the total, instead of half of 1
  // If it was supposed to be 128, this was already taken care of by `inputToRgb`
  if (this._r < 1) this._r = Math.round(this._r);
  if (this._g < 1) this._g = Math.round(this._g);
  if (this._b < 1) this._b = Math.round(this._b);
  this._ok = rgb.ok;
}
tinycolor.prototype = {
  isDark: function isDark() {
    return this.getBrightness() < 128;
  },
  isLight: function isLight() {
    return !this.isDark();
  },
  isValid: function isValid() {
    return this._ok;
  },
  getOriginalInput: function getOriginalInput() {
    return this._originalInput;
  },
  getFormat: function getFormat() {
    return this._format;
  },
  getAlpha: function getAlpha() {
    return this._a;
  },
  getBrightness: function getBrightness() {
    //http://www.w3.org/TR/AERT#color-contrast
    var rgb = this.toRgb();
    return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
  },
  getLuminance: function getLuminance() {
    //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
    var rgb = this.toRgb();
    var RsRGB, GsRGB, BsRGB, R, G, B;
    RsRGB = rgb.r / 255;
    GsRGB = rgb.g / 255;
    BsRGB = rgb.b / 255;
    if (RsRGB <= 0.03928) R = RsRGB / 12.92;else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
    if (GsRGB <= 0.03928) G = GsRGB / 12.92;else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
    if (BsRGB <= 0.03928) B = BsRGB / 12.92;else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
    return 0.2126 * R + 0.7152 * G + 0.0722 * B;
  },
  setAlpha: function setAlpha(value) {
    this._a = boundAlpha(value);
    this._roundA = Math.round(100 * this._a) / 100;
    return this;
  },
  toHsv: function toHsv() {
    var hsv = rgbToHsv(this._r, this._g, this._b);
    return {
      h: hsv.h * 360,
      s: hsv.s,
      v: hsv.v,
      a: this._a
    };
  },
  toHsvString: function toHsvString() {
    var hsv = rgbToHsv(this._r, this._g, this._b);
    var h = Math.round(hsv.h * 360),
      s = Math.round(hsv.s * 100),
      v = Math.round(hsv.v * 100);
    return this._a == 1 ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")";
  },
  toHsl: function toHsl() {
    var hsl = rgbToHsl(this._r, this._g, this._b);
    return {
      h: hsl.h * 360,
      s: hsl.s,
      l: hsl.l,
      a: this._a
    };
  },
  toHslString: function toHslString() {
    var hsl = rgbToHsl(this._r, this._g, this._b);
    var h = Math.round(hsl.h * 360),
      s = Math.round(hsl.s * 100),
      l = Math.round(hsl.l * 100);
    return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
  },
  toHex: function toHex(allow3Char) {
    return rgbToHex(this._r, this._g, this._b, allow3Char);
  },
  toHexString: function toHexString(allow3Char) {
    return "#" + this.toHex(allow3Char);
  },
  toHex8: function toHex8(allow4Char) {
    return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
  },
  toHex8String: function toHex8String(allow4Char) {
    return "#" + this.toHex8(allow4Char);
  },
  toRgb: function toRgb() {
    return {
      r: Math.round(this._r),
      g: Math.round(this._g),
      b: Math.round(this._b),
      a: this._a
    };
  },
  toRgbString: function toRgbString() {
    return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
  },
  toPercentageRgb: function toPercentageRgb() {
    return {
      r: Math.round(bound01(this._r, 255) * 100) + "%",
      g: Math.round(bound01(this._g, 255) * 100) + "%",
      b: Math.round(bound01(this._b, 255) * 100) + "%",
      a: this._a
    };
  },
  toPercentageRgbString: function toPercentageRgbString() {
    return this._a == 1 ? "rgb(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
  },
  toName: function toName() {
    if (this._a === 0) {
      return "transparent";
    }
    if (this._a < 1) {
      return false;
    }
    return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
  },
  toFilter: function toFilter(secondColor) {
    var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a);
    var secondHex8String = hex8String;
    var gradientType = this._gradientType ? "GradientType = 1, " : "";
    if (secondColor) {
      var s = tinycolor(secondColor);
      secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a);
    }
    return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")";
  },
  toString: function toString(format) {
    var formatSet = !!format;
    format = format || this._format;
    var formattedString = false;
    var hasAlpha = this._a < 1 && this._a >= 0;
    var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
    if (needsAlphaFormat) {
      // Special case for "transparent", all other non-alpha formats
      // will return rgba when there is transparency.
      if (format === "name" && this._a === 0) {
        return this.toName();
      }
      return this.toRgbString();
    }
    if (format === "rgb") {
      formattedString = this.toRgbString();
    }
    if (format === "prgb") {
      formattedString = this.toPercentageRgbString();
    }
    if (format === "hex" || format === "hex6") {
      formattedString = this.toHexString();
    }
    if (format === "hex3") {
      formattedString = this.toHexString(true);
    }
    if (format === "hex4") {
      formattedString = this.toHex8String(true);
    }
    if (format === "hex8") {
      formattedString = this.toHex8String();
    }
    if (format === "name") {
      formattedString = this.toName();
    }
    if (format === "hsl") {
      formattedString = this.toHslString();
    }
    if (format === "hsv") {
      formattedString = this.toHsvString();
    }
    return formattedString || this.toHexString();
  },
  clone: function clone() {
    return tinycolor(this.toString());
  },
  _applyModification: function _applyModification(fn, args) {
    var color = fn.apply(null, [this].concat([].slice.call(args)));
    this._r = color._r;
    this._g = color._g;
    this._b = color._b;
    this.setAlpha(color._a);
    return this;
  },
  lighten: function lighten() {
    return this._applyModification(_lighten, arguments);
  },
  brighten: function brighten() {
    return this._applyModification(_brighten, arguments);
  },
  darken: function darken() {
    return this._applyModification(_darken, arguments);
  },
  desaturate: function desaturate() {
    return this._applyModification(_desaturate, arguments);
  },
  saturate: function saturate() {
    return this._applyModification(_saturate, arguments);
  },
  greyscale: function greyscale() {
    return this._applyModification(_greyscale, arguments);
  },
  spin: function spin() {
    return this._applyModification(_spin, arguments);
  },
  _applyCombination: function _applyCombination(fn, args) {
    return fn.apply(null, [this].concat([].slice.call(args)));
  },
  analogous: function analogous() {
    return this._applyCombination(_analogous, arguments);
  },
  complement: function complement() {
    return this._applyCombination(_complement, arguments);
  },
  monochromatic: function monochromatic() {
    return this._applyCombination(_monochromatic, arguments);
  },
  splitcomplement: function splitcomplement() {
    return this._applyCombination(_splitcomplement, arguments);
  },
  // Disabled until https://github.com/bgrins/TinyColor/issues/254
  // polyad: function (number) {
  //   return this._applyCombination(polyad, [number]);
  // },
  triad: function triad() {
    return this._applyCombination(polyad, [3]);
  },
  tetrad: function tetrad() {
    return this._applyCombination(polyad, [4]);
  }
};

// If input is an object, force 1 into "1.0" to handle ratios properly
// String input requires "1.0" as input, so 1 will be treated as 1
tinycolor.fromRatio = function (color, opts) {
  if (_typeof(color) == "object") {
    var newColor = {};
    for (var i in color) {
      if (color.hasOwnProperty(i)) {
        if (i === "a") {
          newColor[i] = color[i];
        } else {
          newColor[i] = convertToPercentage(color[i]);
        }
      }
    }
    color = newColor;
  }
  return tinycolor(color, opts);
};

// Given a string or object, convert that input to RGB
// Possible string inputs:
//
//     "red"
//     "#f00" or "f00"
//     "#ff0000" or "ff0000"
//     "#ff000000" or "ff000000"
//     "rgb 255 0 0" or "rgb (255, 0, 0)"
//     "rgb 1.0 0 0" or "rgb (1, 0, 0)"
//     "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
//     "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
//     "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
//     "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
//     "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
//
function inputToRGB(color) {
  var rgb = {
    r: 0,
    g: 0,
    b: 0
  };
  var a = 1;
  var s = null;
  var v = null;
  var l = null;
  var ok = false;
  var format = false;
  if (typeof color == "string") {
    color = stringInputToObject(color);
  }
  if (_typeof(color) == "object") {
    if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
      rgb = rgbToRgb(color.r, color.g, color.b);
      ok = true;
      format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
    } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
      s = convertToPercentage(color.s);
      v = convertToPercentage(color.v);
      rgb = hsvToRgb(color.h, s, v);
      ok = true;
      format = "hsv";
    } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
      s = convertToPercentage(color.s);
      l = convertToPercentage(color.l);
      rgb = hslToRgb(color.h, s, l);
      ok = true;
      format = "hsl";
    }
    if (color.hasOwnProperty("a")) {
      a = color.a;
    }
  }
  a = boundAlpha(a);
  return {
    ok: ok,
    format: color.format || format,
    r: Math.min(255, Math.max(rgb.r, 0)),
    g: Math.min(255, Math.max(rgb.g, 0)),
    b: Math.min(255, Math.max(rgb.b, 0)),
    a: a
  };
}

// Conversion Functions
// --------------------

// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>

// `rgbToRgb`
// Handle bounds / percentage checking to conform to CSS color spec
// <http://www.w3.org/TR/css3-color/>
// *Assumes:* r, g, b in [0, 255] or [0, 1]
// *Returns:* { r, g, b } in [0, 255]
function rgbToRgb(r, g, b) {
  return {
    r: bound01(r, 255) * 255,
    g: bound01(g, 255) * 255,
    b: bound01(b, 255) * 255
  };
}

// `rgbToHsl`
// Converts an RGB color value to HSL.
// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
// *Returns:* { h, s, l } in [0,1]
function rgbToHsl(r, g, b) {
  r = bound01(r, 255);
  g = bound01(g, 255);
  b = bound01(b, 255);
  var max = Math.max(r, g, b),
    min = Math.min(r, g, b);
  var h,
    s,
    l = (max + min) / 2;
  if (max == min) {
    h = s = 0; // achromatic
  } else {
    var d = max - min;
    s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
    switch (max) {
      case r:
        h = (g - b) / d + (g < b ? 6 : 0);
        break;
      case g:
        h = (b - r) / d + 2;
        break;
      case b:
        h = (r - g) / d + 4;
        break;
    }
    h /= 6;
  }
  return {
    h: h,
    s: s,
    l: l
  };
}

// `hslToRgb`
// Converts an HSL color value to RGB.
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
// *Returns:* { r, g, b } in the set [0, 255]
function hslToRgb(h, s, l) {
  var r, g, b;
  h = bound01(h, 360);
  s = bound01(s, 100);
  l = bound01(l, 100);
  function hue2rgb(p, q, t) {
    if (t < 0) t += 1;
    if (t > 1) t -= 1;
    if (t < 1 / 6) return p + (q - p) * 6 * t;
    if (t < 1 / 2) return q;
    if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
    return p;
  }
  if (s === 0) {
    r = g = b = l; // achromatic
  } else {
    var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
    var p = 2 * l - q;
    r = hue2rgb(p, q, h + 1 / 3);
    g = hue2rgb(p, q, h);
    b = hue2rgb(p, q, h - 1 / 3);
  }
  return {
    r: r * 255,
    g: g * 255,
    b: b * 255
  };
}

// `rgbToHsv`
// Converts an RGB color value to HSV
// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
// *Returns:* { h, s, v } in [0,1]
function rgbToHsv(r, g, b) {
  r = bound01(r, 255);
  g = bound01(g, 255);
  b = bound01(b, 255);
  var max = Math.max(r, g, b),
    min = Math.min(r, g, b);
  var h,
    s,
    v = max;
  var d = max - min;
  s = max === 0 ? 0 : d / max;
  if (max == min) {
    h = 0; // achromatic
  } else {
    switch (max) {
      case r:
        h = (g - b) / d + (g < b ? 6 : 0);
        break;
      case g:
        h = (b - r) / d + 2;
        break;
      case b:
        h = (r - g) / d + 4;
        break;
    }
    h /= 6;
  }
  return {
    h: h,
    s: s,
    v: v
  };
}

// `hsvToRgb`
// Converts an HSV color value to RGB.
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
// *Returns:* { r, g, b } in the set [0, 255]
function hsvToRgb(h, s, v) {
  h = bound01(h, 360) * 6;
  s = bound01(s, 100);
  v = bound01(v, 100);
  var i = Math.floor(h),
    f = h - i,
    p = v * (1 - s),
    q = v * (1 - f * s),
    t = v * (1 - (1 - f) * s),
    mod = i % 6,
    r = [v, q, p, p, t, v][mod],
    g = [t, v, v, q, p, p][mod],
    b = [p, p, t, v, v, q][mod];
  return {
    r: r * 255,
    g: g * 255,
    b: b * 255
  };
}

// `rgbToHex`
// Converts an RGB color to hex
// Assumes r, g, and b are contained in the set [0, 255]
// Returns a 3 or 6 character hex
function rgbToHex(r, g, b, allow3Char) {
  var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];

  // Return a 3 character hex if possible
  if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
    return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
  }
  return hex.join("");
}

// `rgbaToHex`
// Converts an RGBA color plus alpha transparency to hex
// Assumes r, g, b are contained in the set [0, 255] and
// a in [0, 1]. Returns a 4 or 8 character rgba hex
function rgbaToHex(r, g, b, a, allow4Char) {
  var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];

  // Return a 4 character hex if possible
  if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
    return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
  }
  return hex.join("");
}

// `rgbaToArgbHex`
// Converts an RGBA color to an ARGB Hex8 string
// Rarely used, but required for "toFilter()"
function rgbaToArgbHex(r, g, b, a) {
  var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
  return hex.join("");
}

// `equals`
// Can be called with any tinycolor input
tinycolor.equals = function (color1, color2) {
  if (!color1 || !color2) return false;
  return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
};
tinycolor.random = function () {
  return tinycolor.fromRatio({
    r: Math.random(),
    g: Math.random(),
    b: Math.random()
  });
};

// Modification Functions
// ----------------------
// Thanks to less.js for some of the basics here
// <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>

function _desaturate(color, amount) {
  amount = amount === 0 ? 0 : amount || 10;
  var hsl = tinycolor(color).toHsl();
  hsl.s -= amount / 100;
  hsl.s = clamp01(hsl.s);
  return tinycolor(hsl);
}
function _saturate(color, amount) {
  amount = amount === 0 ? 0 : amount || 10;
  var hsl = tinycolor(color).toHsl();
  hsl.s += amount / 100;
  hsl.s = clamp01(hsl.s);
  return tinycolor(hsl);
}
function _greyscale(color) {
  return tinycolor(color).desaturate(100);
}
function _lighten(color, amount) {
  amount = amount === 0 ? 0 : amount || 10;
  var hsl = tinycolor(color).toHsl();
  hsl.l += amount / 100;
  hsl.l = clamp01(hsl.l);
  return tinycolor(hsl);
}
function _brighten(color, amount) {
  amount = amount === 0 ? 0 : amount || 10;
  var rgb = tinycolor(color).toRgb();
  rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
  rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
  rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
  return tinycolor(rgb);
}
function _darken(color, amount) {
  amount = amount === 0 ? 0 : amount || 10;
  var hsl = tinycolor(color).toHsl();
  hsl.l -= amount / 100;
  hsl.l = clamp01(hsl.l);
  return tinycolor(hsl);
}

// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
// Values outside of this range will be wrapped into this range.
function _spin(color, amount) {
  var hsl = tinycolor(color).toHsl();
  var hue = (hsl.h + amount) % 360;
  hsl.h = hue < 0 ? 360 + hue : hue;
  return tinycolor(hsl);
}

// Combination Functions
// ---------------------
// Thanks to jQuery xColor for some of the ideas behind these
// <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>

function _complement(color) {
  var hsl = tinycolor(color).toHsl();
  hsl.h = (hsl.h + 180) % 360;
  return tinycolor(hsl);
}
function polyad(color, number) {
  if (isNaN(number) || number <= 0) {
    throw new Error("Argument to polyad must be a positive number");
  }
  var hsl = tinycolor(color).toHsl();
  var result = [tinycolor(color)];
  var step = 360 / number;
  for (var i = 1; i < number; i++) {
    result.push(tinycolor({
      h: (hsl.h + i * step) % 360,
      s: hsl.s,
      l: hsl.l
    }));
  }
  return result;
}
function _splitcomplement(color) {
  var hsl = tinycolor(color).toHsl();
  var h = hsl.h;
  return [tinycolor(color), tinycolor({
    h: (h + 72) % 360,
    s: hsl.s,
    l: hsl.l
  }), tinycolor({
    h: (h + 216) % 360,
    s: hsl.s,
    l: hsl.l
  })];
}
function _analogous(color, results, slices) {
  results = results || 6;
  slices = slices || 30;
  var hsl = tinycolor(color).toHsl();
  var part = 360 / slices;
  var ret = [tinycolor(color)];
  for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {
    hsl.h = (hsl.h + part) % 360;
    ret.push(tinycolor(hsl));
  }
  return ret;
}
function _monochromatic(color, results) {
  results = results || 6;
  var hsv = tinycolor(color).toHsv();
  var h = hsv.h,
    s = hsv.s,
    v = hsv.v;
  var ret = [];
  var modification = 1 / results;
  while (results--) {
    ret.push(tinycolor({
      h: h,
      s: s,
      v: v
    }));
    v = (v + modification) % 1;
  }
  return ret;
}

// Utility Functions
// ---------------------

tinycolor.mix = function (color1, color2, amount) {
  amount = amount === 0 ? 0 : amount || 50;
  var rgb1 = tinycolor(color1).toRgb();
  var rgb2 = tinycolor(color2).toRgb();
  var p = amount / 100;
  var rgba = {
    r: (rgb2.r - rgb1.r) * p + rgb1.r,
    g: (rgb2.g - rgb1.g) * p + rgb1.g,
    b: (rgb2.b - rgb1.b) * p + rgb1.b,
    a: (rgb2.a - rgb1.a) * p + rgb1.a
  };
  return tinycolor(rgba);
};

// Readability Functions
// ---------------------
// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)

// `contrast`
// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
tinycolor.readability = function (color1, color2) {
  var c1 = tinycolor(color1);
  var c2 = tinycolor(color2);
  return (Math.max(c1.getLuminance(), c2.getLuminance()) + 0.05) / (Math.min(c1.getLuminance(), c2.getLuminance()) + 0.05);
};

// `isReadable`
// Ensure that foreground and background color combinations meet WCAG2 guidelines.
// The third argument is an optional Object.
//      the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
//      the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
// If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.

// *Example*
//    tinycolor.isReadable("#000", "#111") => false
//    tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
tinycolor.isReadable = function (color1, color2, wcag2) {
  var readability = tinycolor.readability(color1, color2);
  var wcag2Parms, out;
  out = false;
  wcag2Parms = validateWCAG2Parms(wcag2);
  switch (wcag2Parms.level + wcag2Parms.size) {
    case "AAsmall":
    case "AAAlarge":
      out = readability >= 4.5;
      break;
    case "AAlarge":
      out = readability >= 3;
      break;
    case "AAAsmall":
      out = readability >= 7;
      break;
  }
  return out;
};

// `mostReadable`
// Given a base color and a list of possible foreground or background
// colors for that base, returns the most readable color.
// Optionally returns Black or White if the most readable color is unreadable.
// *Example*
//    tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
//    tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString();  // "#ffffff"
//    tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
//    tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
tinycolor.mostReadable = function (baseColor, colorList, args) {
  var bestColor = null;
  var bestScore = 0;
  var readability;
  var includeFallbackColors, level, size;
  args = args || {};
  includeFallbackColors = args.includeFallbackColors;
  level = args.level;
  size = args.size;
  for (var i = 0; i < colorList.length; i++) {
    readability = tinycolor.readability(baseColor, colorList[i]);
    if (readability > bestScore) {
      bestScore = readability;
      bestColor = tinycolor(colorList[i]);
    }
  }
  if (tinycolor.isReadable(baseColor, bestColor, {
    level: level,
    size: size
  }) || !includeFallbackColors) {
    return bestColor;
  } else {
    args.includeFallbackColors = false;
    return tinycolor.mostReadable(baseColor, ["#fff", "#000"], args);
  }
};

// Big List of Colors
// ------------------
// <https://www.w3.org/TR/css-color-4/#named-colors>
var names = tinycolor.names = {
  aliceblue: "f0f8ff",
  antiquewhite: "faebd7",
  aqua: "0ff",
  aquamarine: "7fffd4",
  azure: "f0ffff",
  beige: "f5f5dc",
  bisque: "ffe4c4",
  black: "000",
  blanchedalmond: "ffebcd",
  blue: "00f",
  blueviolet: "8a2be2",
  brown: "a52a2a",
  burlywood: "deb887",
  burntsienna: "ea7e5d",
  cadetblue: "5f9ea0",
  chartreuse: "7fff00",
  chocolate: "d2691e",
  coral: "ff7f50",
  cornflowerblue: "6495ed",
  cornsilk: "fff8dc",
  crimson: "dc143c",
  cyan: "0ff",
  darkblue: "00008b",
  darkcyan: "008b8b",
  darkgoldenrod: "b8860b",
  darkgray: "a9a9a9",
  darkgreen: "006400",
  darkgrey: "a9a9a9",
  darkkhaki: "bdb76b",
  darkmagenta: "8b008b",
  darkolivegreen: "556b2f",
  darkorange: "ff8c00",
  darkorchid: "9932cc",
  darkred: "8b0000",
  darksalmon: "e9967a",
  darkseagreen: "8fbc8f",
  darkslateblue: "483d8b",
  darkslategray: "2f4f4f",
  darkslategrey: "2f4f4f",
  darkturquoise: "00ced1",
  darkviolet: "9400d3",
  deeppink: "ff1493",
  deepskyblue: "00bfff",
  dimgray: "696969",
  dimgrey: "696969",
  dodgerblue: "1e90ff",
  firebrick: "b22222",
  floralwhite: "fffaf0",
  forestgreen: "228b22",
  fuchsia: "f0f",
  gainsboro: "dcdcdc",
  ghostwhite: "f8f8ff",
  gold: "ffd700",
  goldenrod: "daa520",
  gray: "808080",
  green: "008000",
  greenyellow: "adff2f",
  grey: "808080",
  honeydew: "f0fff0",
  hotpink: "ff69b4",
  indianred: "cd5c5c",
  indigo: "4b0082",
  ivory: "fffff0",
  khaki: "f0e68c",
  lavender: "e6e6fa",
  lavenderblush: "fff0f5",
  lawngreen: "7cfc00",
  lemonchiffon: "fffacd",
  lightblue: "add8e6",
  lightcoral: "f08080",
  lightcyan: "e0ffff",
  lightgoldenrodyellow: "fafad2",
  lightgray: "d3d3d3",
  lightgreen: "90ee90",
  lightgrey: "d3d3d3",
  lightpink: "ffb6c1",
  lightsalmon: "ffa07a",
  lightseagreen: "20b2aa",
  lightskyblue: "87cefa",
  lightslategray: "789",
  lightslategrey: "789",
  lightsteelblue: "b0c4de",
  lightyellow: "ffffe0",
  lime: "0f0",
  limegreen: "32cd32",
  linen: "faf0e6",
  magenta: "f0f",
  maroon: "800000",
  mediumaquamarine: "66cdaa",
  mediumblue: "0000cd",
  mediumorchid: "ba55d3",
  mediumpurple: "9370db",
  mediumseagreen: "3cb371",
  mediumslateblue: "7b68ee",
  mediumspringgreen: "00fa9a",
  mediumturquoise: "48d1cc",
  mediumvioletred: "c71585",
  midnightblue: "191970",
  mintcream: "f5fffa",
  mistyrose: "ffe4e1",
  moccasin: "ffe4b5",
  navajowhite: "ffdead",
  navy: "000080",
  oldlace: "fdf5e6",
  olive: "808000",
  olivedrab: "6b8e23",
  orange: "ffa500",
  orangered: "ff4500",
  orchid: "da70d6",
  palegoldenrod: "eee8aa",
  palegreen: "98fb98",
  paleturquoise: "afeeee",
  palevioletred: "db7093",
  papayawhip: "ffefd5",
  peachpuff: "ffdab9",
  peru: "cd853f",
  pink: "ffc0cb",
  plum: "dda0dd",
  powderblue: "b0e0e6",
  purple: "800080",
  rebeccapurple: "663399",
  red: "f00",
  rosybrown: "bc8f8f",
  royalblue: "4169e1",
  saddlebrown: "8b4513",
  salmon: "fa8072",
  sandybrown: "f4a460",
  seagreen: "2e8b57",
  seashell: "fff5ee",
  sienna: "a0522d",
  silver: "c0c0c0",
  skyblue: "87ceeb",
  slateblue: "6a5acd",
  slategray: "708090",
  slategrey: "708090",
  snow: "fffafa",
  springgreen: "00ff7f",
  steelblue: "4682b4",
  tan: "d2b48c",
  teal: "008080",
  thistle: "d8bfd8",
  tomato: "ff6347",
  turquoise: "40e0d0",
  violet: "ee82ee",
  wheat: "f5deb3",
  white: "fff",
  whitesmoke: "f5f5f5",
  yellow: "ff0",
  yellowgreen: "9acd32"
};

// Make it easy to access colors via `hexNames[hex]`
var hexNames = tinycolor.hexNames = flip(names);

// Utilities
// ---------

// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
function flip(o) {
  var flipped = {};
  for (var i in o) {
    if (o.hasOwnProperty(i)) {
      flipped[o[i]] = i;
    }
  }
  return flipped;
}

// Return a valid alpha value [0,1] with all invalid values being set to 1
function boundAlpha(a) {
  a = parseFloat(a);
  if (isNaN(a) || a < 0 || a > 1) {
    a = 1;
  }
  return a;
}

// Take input from [0, n] and return it as [0, 1]
function bound01(n, max) {
  if (isOnePointZero(n)) n = "100%";
  var processPercent = isPercentage(n);
  n = Math.min(max, Math.max(0, parseFloat(n)));

  // Automatically convert percentage into number
  if (processPercent) {
    n = parseInt(n * max, 10) / 100;
  }

  // Handle floating point rounding errors
  if (Math.abs(n - max) < 0.000001) {
    return 1;
  }

  // Convert into [0, 1] range if it isn't already
  return n % max / parseFloat(max);
}

// Force a number between 0 and 1
function clamp01(val) {
  return Math.min(1, Math.max(0, val));
}

// Parse a base-16 hex value into a base-10 integer
function parseIntFromHex(val) {
  return parseInt(val, 16);
}

// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
// <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
function isOnePointZero(n) {
  return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1;
}

// Check to see if string passed in is a percentage
function isPercentage(n) {
  return typeof n === "string" && n.indexOf("%") != -1;
}

// Force a hex value to have 2 characters
function pad2(c) {
  return c.length == 1 ? "0" + c : "" + c;
}

// Replace a decimal with it's percentage value
function convertToPercentage(n) {
  if (n <= 1) {
    n = n * 100 + "%";
  }
  return n;
}

// Converts a decimal to a hex value
function convertDecimalToHex(d) {
  return Math.round(parseFloat(d) * 255).toString(16);
}
// Converts a hex value to a decimal
function convertHexToDecimal(h) {
  return parseIntFromHex(h) / 255;
}
var matchers = function () {
  // <http://www.w3.org/TR/css3-values/#integers>
  var CSS_INTEGER = "[-\\+]?\\d+%?";

  // <http://www.w3.org/TR/css3-values/#number-value>
  var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";

  // Allow positive/negative integer/number.  Don't capture the either/or, just the entire outcome.
  var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";

  // Actual matching.
  // Parentheses and commas are optional, but not required.
  // Whitespace can take the place of commas or opening paren
  var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
  var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
  return {
    CSS_UNIT: new RegExp(CSS_UNIT),
    rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
    rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
    hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
    hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
    hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
    hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
    hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
    hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
    hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
    hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
  };
}();

// `isValidCSSUnit`
// Take in a single string / number and check to see if it looks like a CSS unit
// (see `matchers` above for definition).
function isValidCSSUnit(color) {
  return !!matchers.CSS_UNIT.exec(color);
}

// `stringInputToObject`
// Permissive string parsing.  Take in a number of formats, and output an object
// based on detected format.  Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
function stringInputToObject(color) {
  color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
  var named = false;
  if (names[color]) {
    color = names[color];
    named = true;
  } else if (color == "transparent") {
    return {
      r: 0,
      g: 0,
      b: 0,
      a: 0,
      format: "name"
    };
  }

  // Try to match string input using regular expressions.
  // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
  // Just return an object and let the conversion functions handle that.
  // This way the result will be the same whether the tinycolor is initialized with string or object.
  var match;
  if (match = matchers.rgb.exec(color)) {
    return {
      r: match[1],
      g: match[2],
      b: match[3]
    };
  }
  if (match = matchers.rgba.exec(color)) {
    return {
      r: match[1],
      g: match[2],
      b: match[3],
      a: match[4]
    };
  }
  if (match = matchers.hsl.exec(color)) {
    return {
      h: match[1],
      s: match[2],
      l: match[3]
    };
  }
  if (match = matchers.hsla.exec(color)) {
    return {
      h: match[1],
      s: match[2],
      l: match[3],
      a: match[4]
    };
  }
  if (match = matchers.hsv.exec(color)) {
    return {
      h: match[1],
      s: match[2],
      v: match[3]
    };
  }
  if (match = matchers.hsva.exec(color)) {
    return {
      h: match[1],
      s: match[2],
      v: match[3],
      a: match[4]
    };
  }
  if (match = matchers.hex8.exec(color)) {
    return {
      r: parseIntFromHex(match[1]),
      g: parseIntFromHex(match[2]),
      b: parseIntFromHex(match[3]),
      a: convertHexToDecimal(match[4]),
      format: named ? "name" : "hex8"
    };
  }
  if (match = matchers.hex6.exec(color)) {
    return {
      r: parseIntFromHex(match[1]),
      g: parseIntFromHex(match[2]),
      b: parseIntFromHex(match[3]),
      format: named ? "name" : "hex"
    };
  }
  if (match = matchers.hex4.exec(color)) {
    return {
      r: parseIntFromHex(match[1] + "" + match[1]),
      g: parseIntFromHex(match[2] + "" + match[2]),
      b: parseIntFromHex(match[3] + "" + match[3]),
      a: convertHexToDecimal(match[4] + "" + match[4]),
      format: named ? "name" : "hex8"
    };
  }
  if (match = matchers.hex3.exec(color)) {
    return {
      r: parseIntFromHex(match[1] + "" + match[1]),
      g: parseIntFromHex(match[2] + "" + match[2]),
      b: parseIntFromHex(match[3] + "" + match[3]),
      format: named ? "name" : "hex"
    };
  }
  return false;
}
function validateWCAG2Parms(parms) {
  // return valid WCAG2 parms for isReadable.
  // If input parms are invalid, return {"level":"AA", "size":"small"}
  var level, size;
  parms = parms || {
    level: "AA",
    size: "small"
  };
  level = (parms.level || "AA").toUpperCase();
  size = (parms.size || "small").toLowerCase();
  if (level !== "AA" && level !== "AAA") {
    level = "AA";
  }
  if (size !== "small" && size !== "large") {
    size = "small";
  }
  return {
    level: level,
    size: size
  };
}

//arr遍历的数组   search 搜索的值
function XmlSearchWord(arr, search) {
  let searchLis = [];
  arr.map(item => {
    if (item.Text) {
      if (item.Text.indexOf(search) != -1) {
        let pList = item.Text.split('</p>');
        for (let i = 0; i < pList.length; i++) {
          if (pList[i].indexOf(search) != -1) {
            const Reg = new RegExp(search, 'g');
            pList[i].replace(/id=['"]([^'"]+)[^>]/gi, (match, pId) => {
              pList[i].replace(/<[^>]+>/g, '').replace(/&nbsp;/gi, '').replace(Reg, (match, searchIndex) => {
                let data = {
                  pId,
                  searchText: pList[i].replace(/<[^>]+>/g, '').replace(/&nbsp;/gi, ''),
                  ...item
                };
                let StrIndex = searchIndex > 30 ? searchIndex - 30 : 0;
                let EndIndex = data.searchText.length - searchIndex > 30 ? searchIndex + 30 : data.searchText.length;
                data.searchText = data.searchText.slice(StrIndex, EndIndex) + '...';
                searchLis.push(data);
              });
            });
          }
        }
      }
    } else if (item.textList) {
      if (JSON.stringify(item.textList).indexOf(search) != -1) {
        for (let i = 0; i < item.textList.length; i++) {
          if (item.textList[i].title.indexOf(search) != -1) {
            let data = {
              searchText: item.textList[i].title,
              className: item.textList[i].titleClass,
              index: item.textList[i].index,
              ...item
            };
            let searchIndex = item.textList[i].title.indexOf(search);
            let StrIndex = searchIndex > 30 ? searchIndex - 30 : 0;
            let EndIndex = data.searchText.length - searchIndex > 30 ? searchIndex + 30 : data.searchText.length;
            data.searchText = data.searchText.slice(StrIndex, EndIndex) + '...';
            searchLis.push(data);
          }
        }
      }
    }
  });
  return searchLis;
}

//
var script$2j = {
  name: 'xmlPreviewSearch',
  props: {
    viewList: Object,
    componentList: Array,
    title: String,
    pageType: {
      type: String,
      default: 'h5'
    },
    searchValue: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      list: [],
      input: '',
      ArrList: [],
      show: false
    };
  },
  created() {
    // this.ArrList = XmlSearchList(this.viewList, this.componentList).arr
  },
  watch: {
    input(a, b) {
      if (a.replace(/\s+/g, '') != b.replace(/\s+/g, '')) {
        this.changeInput();
      }
    },
    searchValue: {
      handler(newValue) {
        this.input = newValue;
      }
    }
  },
  methods: {
    changeInput() {
      if (this.input.replace(/\s+/g, '') !== '') {
        this.list = XmlSearchWord(this.componentList, this.input.replace(/\s+/g, ''));
        if (this.list.length > 0) {
          this.show = true;
        } else {
          this.show = false;
        }
      } else {
        this.list = [];
        this.show = false;
      }
    },
    seachItem(e) {
      e.inputText = this.input.replace(/\s+/g, '');
      this.$emit('seachItem', e, this.input);
      this.input = '';
    },
    onBackClick() {
      this.$emit('onBackClick');
    },
    quxiao() {
      this.input = '';
      this.list = [];
      this.show = false;
    },
    brightenKeyword(val) {
      const keyword = this.input.replace(/\s+/g, '');
      const Reg = new RegExp(keyword, 'g');
      let res = '';
      if (val) {
        res = val.replace(Reg, `<span style="color: red;">${keyword}</span>`);
        return res;
      }
    }
  }
};

var __$_require_assets_images_icons_back_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAABACAYAAAB2kAXpAAAAAXNSR0IArs4c6QAABABJREFUaEPVmluopmMUx39/UUy44cJMg+FikEMuGMnIOJcwlHIYpKkZmchxuJDT5MIpIzXIpMkhh5QwlPPx0uHKhbiYKCJXSMTor7U9W4/t29/3rP3t55usm137+z/v+r3Pca31vGIHme19gVXAEuBXYKukd6ZxtCO4bJ8HPAHsNsP/RknXxf8mDmZ7NfDYkA65UtKmiYLZvhp4YMQofSVpycTAbN8M3NkwdbZL2mUiYLbvBW5ogArJ15L27w5m+yHgikaokK2WtKUrmO2ngQsTUBsk3dZ1Vdp+EViZgFov6b5u+5jtnYE3gBMTUOskPVzr53UobS8A3gWWJaBWSYoh/5fNG5jtfYA4Ug5JQJ0j6aVB+nkBs70f8CEQf1tsO3CqpPdmE48NZvswIBzs1UJUDuwTJH00TD8WmO2jgbeBPRqhfgBOkvTZKP2cwWyvKFA7jXJSfv8GOF7Sthb9nMBsx/4U+1SrfQ6skPR9a4M0mO1LgcdbHQAxl2Ki/5hok4vHbK8DNiUcxPZxmqQ/E22mpM09Zvsm4K6EgwiVz07o8xus7TuAWxNOnpF0UUL/H+nIHrP9IHBVwslmSWsT+oHSoWC2twCXJZzcL+n6hH5W6axgtl8Azk04uV1SDPm82EAw26/Hakp4uFbSqCQj8bgZq7KELW8BxyaeslbS5oS+SfpPj9neE3gfOLKp5d+iCyQ9l9A3S6fASroeEcKBzS3hLEmvJPQpqWwvLWHLwsaWv5cj5oNG/ZxkAfZTImz5uRzGn87JW6JRgLlR/20kGJK+aNSPJWsF+wRYLum3sbwlGv/vweJdYyhPlhRBX3eLHvsDiCS1xX4pk//jFvE4mgA7puSDkay2WLxIBH+zpl4tDxmlmd5gDy9we49qUP2+UtLLCX1KWh9JB5SNtjVpDUd9j6TpVylpfhzihyZer+8hXsHtXgojRyXg+oY9FVys0jdjBSbg+geKFeBW4MwEXP/QuoJ7Fjg/Adc/GangHgEuT8D1T98quHuA9Qm4/glvBXcLsCEBFyWC0yVFoS5lIxPemU+zfQ2wMeElztVTuhZVqp5bAzyagOtfhqrgYqXGim21/oW7Cu4MIDKl1inRv9RZwR0HxPm6a2PXxW1u3+JwBRdJciTLkTS3WP9yegV3UInpFrWQFU3fC4gKbjEQiXDEdq3W98qmgouLiNhYj2glA/peclVw8XVA3MAtT8D1vRasQWy/FkdSAq7/RWrVe88D8Z1Fq10i6anWjbH1oQN1yVrul5KWTgQsaBPV78l93lANa3x3Ed9fDLPvJC2cWI9VcDcCdw8hm1qdEwcrwxphelzOz/T/pKS4RGuOCsaa/IMa2z4YuLicElHVfLWu6f4FuhpYUNovLf0AAAAASUVORK5CYII=";

var __$_require_assets_images_icons_zanwu_png__ = "data:image/png;base64, ";

/* script */
const __vue_script__$2j = script$2j;
var __vue_render__$2j = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { class: "xmlPreviewSearch-box-" + _vm.pageType }, [
    _vm.pageType == "h5"
      ? _c("div", { staticClass: "xmlPreviewSearch-title" }, [
          _c("img", {
            staticClass: "img",
            staticStyle: { cursor: "pointer" },
            attrs: { src: __$_require_assets_images_icons_back_png__ },
            on: { click: _vm.onBackClick },
          }),
          _vm._v(" "),
          _c("div", { staticClass: "xmlPreviewSearch-sou" }, [
            _vm._v(_vm._s(_vm.title)),
          ]),
        ])
      : _vm._e(),
    _vm._v(" "),
    _vm.pageType == "h5"
      ? _c("div", { staticClass: "xmlPreviewSearch-input" }, [
          _c(
            "div",
            {
              staticClass: "xmlPreviewSearch-icon",
              on: { click: _vm.changeInput },
            },
            [_c("i", { staticClass: "el-icon-search" })]
          ),
          _vm._v(" "),
          _c("input", {
            directives: [
              {
                name: "model",
                rawName: "v-model",
                value: _vm.input,
                expression: "input",
              },
            ],
            staticClass: "input",
            attrs: { maxlength: "20", placeholder: "请输入搜索内容" },
            domProps: { value: _vm.input },
            on: {
              change: _vm.changeInput,
              input: function ($event) {
                if ($event.target.composing) {
                  return
                }
                _vm.input = $event.target.value;
              },
            },
          }),
          _vm._v(" "),
          _c(
            "button",
            {
              staticClass: "input_text",
              on: {
                click: function ($event) {
                  return _vm.quxiao()
                },
              },
            },
            [_vm._v("取消")]
          ),
        ])
      : _vm._e(),
    _vm._v(" "),
    _vm.pageType == "pc"
      ? _c("div", { class: "xmlPreviewSearch-input-" + _vm.pageType }, [
          _c(
            "div",
            {
              staticStyle: { "font-size": "16px", cursor: "pointer" },
              on: { click: _vm.onBackClick },
            },
            [
              _c("i", {
                staticClass: "el-icon-arrow-left",
                staticStyle: { "font-size": "16px" },
              }),
              _vm._v("返回\n    "),
            ]
          ),
        ])
      : _vm._e(),
    _vm._v(" "),
    _c(
      "div",
      { staticClass: "seach-list" },
      [
        _vm._l(_vm.list, function (item, index) {
          return _c(
            "div",
            {
              key: index,
              staticClass: "seach-box",
              on: {
                click: function ($event) {
                  return _vm.seachItem(item)
                },
              },
            },
            [
              _c("div", { staticClass: "seach-label" }, [
                _vm._v(_vm._s(item.label)),
              ]),
              _vm._v(" "),
              _c("div", {
                staticClass: "seach-text",
                domProps: {
                  innerHTML: _vm._s(
                    _vm.brightenKeyword(item.searchText, _vm.input)
                  ),
                },
              }),
            ]
          )
        }),
        _vm._v(" "),
        _c(
          "div",
          {
            directives: [
              {
                name: "show",
                rawName: "v-show",
                value: !_vm.show,
                expression: "!show",
              },
            ],
            staticClass: "seach_zaiwu",
          },
          [
            _c("img", {
              attrs: { src: __$_require_assets_images_icons_zanwu_png__ },
            }),
            _vm._v(" "),
            _c("div", [
              _vm._v(_vm._s(_vm.input ? "未搜索到相关内容" : "请输入搜索内容")),
            ]),
          ]
        ),
      ],
      2
    ),
  ])
};
var __vue_staticRenderFns__$2j = [];
__vue_render__$2j._withStripped = true;

  /* style */
  const __vue_inject_styles__$2j = undefined;
  /* scoped */
  const __vue_scope_id__$2j = "data-v-7bb81286";
  /* module identifier */
  const __vue_module_identifier__$2j = undefined;
  /* functional template */
  const __vue_is_functional_template__$2j = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2j = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2j, staticRenderFns: __vue_staticRenderFns__$2j },
    __vue_inject_styles__$2j,
    __vue_script__$2j,
    __vue_scope_id__$2j,
    __vue_is_functional_template__$2j,
    __vue_module_identifier__$2j,
    false,
    undefined,
    undefined,
    undefined
  );

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

var script$2i = {
  name: 'xml-toolbar-pc',
  props: {
    textBookResource: {
      type: Object,
      default: () => {}
    },
    userType: {
      // 用户类型，可选teacher、student
      type: String,
      default: 'student'
    },
    NumShow: {
      type: Number,
      default: 0
    },
    isShowTeacherResource: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      toolbarList: [{
        name: '搜索',
        type: 'search',
        default: 'icon_01',
        select: 'icon_up_01',
        total: 'none',
        icon: ''
      }, {
        name: '授课',
        type: 'teachingResource',
        default: 'icon_02',
        select: 'icon_up_02',
        total: 'teachingResourceTotal',
        icon: ''
      }, {
        name: '图片',
        type: 'imageList',
        default: 'icon_03',
        select: 'icon_up_03',
        total: 'imageTotal',
        icon: ''
      }, {
        name: '视频',
        type: 'videoList',
        default: 'icon_04',
        select: 'icon_up_04',
        total: 'videoTotal',
        icon: ''
      }, {
        name: '音频',
        type: 'audioList',
        default: 'icon_05',
        select: 'icon_up_05',
        total: 'audioTotal',
        icon: 'icon_01'
      }, {
        name: '公式',
        type: 'formulaList',
        default: 'icon_06',
        select: 'icon_up_06',
        total: 'formulaTotal',
        icon: 'icon_02'
      }, {
        name: '互动',
        type: 'interactionList',
        default: 'icon_07',
        select: 'icon_up_07',
        total: 'interactionTotal',
        icon: 'icon_03'
      }, {
        name: '试题',
        type: 'questionList',
        default: 'icon_08',
        select: 'icon_up_08',
        total: 'questionTotal',
        icon: 'icon_04'
      }, {
        name: '文件',
        type: 'resourceList',
        default: 'icon_09',
        select: 'icon_up_09',
        total: 'resourceTotal',
        icon: 'icon_05'
      }],
      current: 0
    };
  },
  mounted() {
    if (!this.isShowTeacherResource && this.userType != 'teacher') {
      this.toolbarList.splice(1, 1);
    }
  },
  methods: {
    clickToolbar(index) {
      this.current = index;
      this.$emit('clickToolbar', this.toolbarList[index]);
    }
  }
};

/* script */
const __vue_script__$2i = script$2i;

/* template */
var __vue_render__$2i = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { staticClass: "xml-toolbar-pc" },
    [
      _vm._l(_vm.toolbarList, function (item, index) {
        return _c(
          "div",
          {
            key: index,
            staticClass: "toolbar-item",
            class: index == _vm.current ? item.select : item.default,
            on: {
              click: function ($event) {
                return _vm.clickToolbar(index)
              },
            },
          },
          [
            _c("div", { staticClass: "toolbar-icon" }),
            _vm._v(" "),
            _c("div", [_vm._v(_vm._s(item.name))]),
            _vm._v(" "),
            _c(
              "div",
              {
                directives: [
                  {
                    name: "show",
                    rawName: "v-show",
                    value: item.total != "none",
                    expression: "item.total != 'none'",
                  },
                ],
              },
              [
                _vm._v(
                  "(" +
                    _vm._s(
                      _vm.textBookResource[item.total]
                        ? _vm.textBookResource[item.total]
                        : "0"
                    ) +
                    ")"
                ),
              ]
            ),
          ]
        )
      }),
      _vm._v(" "),
      _c(
        "div",
        {
          staticClass: "select-toolbar",
          style: { top: _vm.current * 86 + 8 + "px" },
        },
        [_c("div", { staticClass: "toolbar" })]
      ),
    ],
    2
  )
};
var __vue_staticRenderFns__$2i = [];
__vue_render__$2i._withStripped = true;

  /* style */
  const __vue_inject_styles__$2i = undefined;
  /* scoped */
  const __vue_scope_id__$2i = undefined;
  /* module identifier */
  const __vue_module_identifier__$2i = undefined;
  /* functional template */
  const __vue_is_functional_template__$2i = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2i = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2i, staticRenderFns: __vue_staticRenderFns__$2i },
    __vue_inject_styles__$2i,
    __vue_script__$2i,
    __vue_scope_id__$2i,
    __vue_is_functional_template__$2i,
    __vue_module_identifier__$2i,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2h = {
  name: 'xmlPreviewSearch',
  props: {
    viewList: Object,
    componentList: Array,
    title: String,
    pageType: {
      type: String,
      default: 'pc'
    },
    searchValue: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      urlPre: "../assets/images/icons/",
      list: [],
      input: '',
      ArrList: [],
      searchTextShow: true,
      showEllipsisButton: false,
      contentExpand: false,
      show: false,
      launchValue: 0
    };
  },
  computed: {
    searchList() {
      let list = this.list;
      const map = [];
      list.forEach(e => {
        if (e.type == 'note__teacher') {
          this.teacherNoteList.push(e);
        }
        const findObj = map.find(innerTmp => innerTmp.firstLevelId === e.firstLevelId);
        if (findObj) {
          findObj.list.push(e);
        } else {
          map.push({
            firstLevelId: e.firstLevelId,
            firstLevelLabel: e.firstLevelLabel,
            chapterOrderNum: e.chapterOrderNum,
            list: [e]
          });
        }
      });
      return map;
    }
  },
  watch: {
    // 监听输入框
    // 监听input的值，当值改变时，调用changeInput方法
    input(a, b) {
      if (a.replace(/\s+/g, '') != b.replace(/\s+/g, '')) {
        this.changeInput();
        this.contentExpand = false;
      }
    },
    searchValue: {
      handler(newValue) {
        this.input = newValue;
      }
    }
  },
  methods: {
    changeInput() {
      if (this.input.replace(/\s+/g, '') !== '') {
        this.list = XmlSearchWord(this.componentList, this.input.replace(/\s+/g, ''));
        if (this.list.length > 0) {
          this.showEllipsisButton = true;
        }
      } else {
        this.list = [];
        console.log('输入为空');
      }
    },
    seachItem(e) {
      e.inputText = this.input.replace(/\s+/g, '');
      this.$emit('seachItem', e, this.input);
    },
    onBackClick() {
      this.$emit('onBackClick');
    },
    brightenKeyword(val) {
      const keyword = this.input.replace(/\s+/g, '');
      const Reg = new RegExp(keyword, 'g');
      let res = '';
      if (val) {
        res = val.replace(Reg, `<span style="background-color: #e7f0ff; color: #75a9f2;">${keyword}</span>`);
        return res;
      }
    },
    // 展开下拉
    toggleSearchText(id) {
      this.contentExpand = !this.contentExpand;
      this.searchTextShow = !this.searchTextShow;
    }
  }
};

var __$_require_assets_images_icons_searchmin_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAATtJREFUOE+V0j1rVVEQheFnYWFhMPkLEQT9AZKAIJLGyjaN4AfWEpKQKqYyFlHEyk7Q1o/KykLQTkRbG6sQiIha2FjK9s71nHC8xAvucu95Z9Zas2PitNbmsIBZ7OF9kl+TdekvWmsz2MF1HB0UfsZmksdDeAx20GucxG08wzecxg1cxvZo8lYP9+ADXMLZJB8Pkb+Ke1hK8qbe03n6gq0kdyehgZV3+JrkYg9ewEvMJ9mdAm7gZpIKbTxxeeTlCWaS/JwCXsPDJEd6cBFvcSbJhylgJb6cZL4Hq0Pt61WSK4eBrbXj+FTKkqyMwW4dV/EIayMP94dwBz2txHEqyf4B2MG3atH1U/Ac36sQpeJYZdCFU3v+M3EQ+Xms41xXWBZe4A5K1XYP/wX+K5hB41JUjU/8F9hZmkvy4zcDEm8cuHdPWwAAAABJRU5ErkJggg==";

var __$_require_assets_images_icons_without_png__ = "data:image/png;base64, ";

/* script */
const __vue_script__$2h = script$2h;
var __vue_render__$2h = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { class: "xmlPreviewSearch-box-" + _vm.pageType }, [
    _vm.pageType == "pc"
      ? _c("div", { staticClass: "xmlPreviewSearch-input" }, [
          _c("input", {
            directives: [
              {
                name: "model",
                rawName: "v-model",
                value: _vm.input,
                expression: "input",
              },
            ],
            staticClass: "input",
            attrs: { maxlength: "20", placeholder: "请输入" },
            domProps: { value: _vm.input },
            on: {
              change: _vm.changeInput,
              input: function ($event) {
                if ($event.target.composing) {
                  return
                }
                _vm.input = $event.target.value;
              },
            },
          }),
          _vm._v(" "),
          _c(
            "button",
            {
              staticClass: "input_text",
              on: {
                click: function ($event) {
                  return _vm.changeInput()
                },
              },
            },
            [
              _c("img", {
                attrs: {
                  src: __$_require_assets_images_icons_searchmin_png__,
                  alt: "",
                },
              }),
            ]
          ),
        ])
      : _vm._e(),
    _vm._v(" "),
    _c(
      "div",
      { staticClass: "seach-list" },
      [
        _c(
          "el-collapse",
          {
            attrs: { accordion: "" },
            model: {
              value: _vm.launchValue,
              callback: function ($$v) {
                _vm.launchValue = $$v;
              },
              expression: "launchValue",
            },
          },
          _vm._l(_vm.searchList, function (item, index) {
            return _c(
              "el-collapse-item",
              { key: index, attrs: { name: index } },
              [
                _c("template", { slot: "title" }, [
                  _c("div", { staticClass: "collapse-title" }, [
                    _vm._v(
                      "\n              " +
                        _vm._s(item.firstLevelLabel) +
                        "\n            "
                    ),
                  ]),
                ]),
                _vm._v(" "),
                _vm._l(item.list, function (items, index) {
                  return _c(
                    "div",
                    {
                      on: {
                        click: function ($event) {
                          return _vm.seachItem(items)
                        },
                      },
                    },
                    [
                      _c("div", {
                        staticClass: "xml-seach-item-text",
                        domProps: {
                          innerHTML: _vm._s(
                            _vm.brightenKeyword(items.searchText, _vm.input)
                          ),
                        },
                      }),
                    ]
                  )
                }),
              ],
              2
            )
          }),
          1
        ),
        _vm._v(" "),
        _c(
          "div",
          {
            directives: [
              {
                name: "show",
                rawName: "v-show",
                value: _vm.searchList.length == 0 && _vm.input == "",
                expression: "searchList.length==0 && input==''",
              },
            ],
            staticClass: "seach_zaiwu",
          },
          [
            _c("div", { staticClass: "search_left_img" }, [
              _c("img", {
                attrs: { src: __$_require_assets_images_icons_without_png__ },
              }),
            ]),
          ]
        ),
      ],
      1
    ),
  ])
};
var __vue_staticRenderFns__$2h = [];
__vue_render__$2h._withStripped = true;

  /* style */
  const __vue_inject_styles__$2h = undefined;
  /* scoped */
  const __vue_scope_id__$2h = "data-v-6dcc61a8";
  /* module identifier */
  const __vue_module_identifier__$2h = undefined;
  /* functional template */
  const __vue_is_functional_template__$2h = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2h = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2h, staticRenderFns: __vue_staticRenderFns__$2h },
    __vue_inject_styles__$2h,
    __vue_script__$2h,
    __vue_scope_id__$2h,
    __vue_is_functional_template__$2h,
    __vue_module_identifier__$2h,
    false,
    undefined,
    undefined,
    undefined
  );

var coverLocal = "data:image/png;base64, ";

//
var script$2g = {
  name: 'audioPlayerPage',
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    playStyle: {
      type: String,
      default: 'yuan-wen'
    },
    styleMode: {
      type: String,
      default: 'A'
    },
    url: {
      type: String,
      default: '',
      require: true
    },
    title: {
      type: String,
      default: '音频文件'
    },
    coverImageUrl: {
      type: String,
      default: ''
    },
    //进度是否能控制
    scheduleControl: {
      type: String,
      default: ''
    },
    loop: {
      type: Boolean,
      default: true
    },
    playMode: {
      type: String,
      default: 'xun-huan'
    },
    content: {
      type: String,
      default: '暂无简介'
    },
    targerLink: {
      type: String,
      default: ''
    }
  },
  computed: {
    videoAndMusicStop() {
      let playState = sessionStorage.getItem('SET_PLAY_STATE');
      return playState;
    },
    playModeIconSrc() {
      let srcMap = {
        'xun-huan': playRepeat,
        'dan-ci': playOnce
      };
      return srcMap[this.playMode];
    }
  },
  watch: {
    url: {
      handler(newVal) {
        let _this = this;
        this.isPlay = false;
        let ua = navigator.userAgent;
        /micromessenger/.test(ua.toLowerCase());
        let isIOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        if (isIOS && newVal) {
          try {
            this.$nextTick(() => {
              _this.$refs.musicAudio.muted = true;
              const playPromise = _this.$refs.musicAudio.play();
              _this.$refs.musicAudio.muted = false;
              if (playPromise) {
                playPromise.then(() => {
                  _this.$refs.musicAudio.pause();
                }).catch(error => {
                  _this.$refs.musicAudio.pause();
                  console.log(error);
                });
              }
            });
          } catch (error) {
            console.log(error);
            this.$message({
              type: 'warning',
              message: error,
              duration: 5000
            });
          }
        }
      },
      immediate: true
    },
    videoAndMusicStop(val) {
      console.log('watch', val);
      let currentPlayStamp = val || '--';
      if (`${this.url}__playTimeStamp__${this.lastOperateTimeStamp}` !== currentPlayStamp) {
        this.musicAudio.pause();
      }
    }
  },
  data() {
    return {
      coverLocal,
      isPlay: false,
      playTime: 0,
      playDuration: '00:00',
      playCurrentTime: '00:00',
      totalDuration: 0,
      link: {
        type: String,
        default: ''
      },
      //链接地址
      lastOperateTimeStamp: '',
      musicAudio: null,
      manualPlay: false
    };
  },
  mounted() {
    // 加载完毕后，先获取<video>标签DOM对象
    this.musicAudio = this.$refs.musicAudio;
    // this.videoContainer = this.$refs.videoContainer
    if (this.mode === 'preview' && this.playStyle === 'yuan-wen') {
      this.$emit('resetTimeUpdate');
    }
  },
  methods: {
    changeDuration() {
      this.$nextTick(() => {
        this.playDuration = this.timeFormat(this.$refs.musicAudio.duration);
        this.totalDuration = this.$refs.musicAudio.duration;
      });
    },
    //将单位为秒的的时间转换成mm:ss的形式
    timeFormat(num) {
      let minute = parseInt(num / 60);
      let second = parseInt(num % 60);
      minute = minute >= 10 ? minute : `0${minute}`;
      second = second >= 10 ? second : `0${second}`;
      return `${minute}:${second}`;
    },
    play() {
      // if (this.mode==='editor') {
      //   this.$message.warning('音频仅支持在预览模式下播放')
      //   return
      // }
      if (this.playStyle === 'yuan-wen') {
        this.doPlay();
      }
      if (this.playStyle === 'tiao-zhuan') {
        if (this.targerLink) {
          // window.location.href=this.targerLink
          window.open(this.targerLink, '_blank');
        } else {
          this.$message.warning('获取资源链接失败，请检查链接地址');
        }
      }
      if (this.playStyle === 'tan-chuang') {
        this.$emit('showDialog', {
          url: this.url,
          title: this.title,
          coverFileUrl: this.coverImageUrl
        });
      }
    },
    doPlay() {
      console.log('暂停');
      let audio = document.querySelectorAll('audio');
      audio.forEach(i => i.pause());
      let video = document.querySelectorAll('video');
      if (video && video.length) {
        video.forEach(i => i.pause());
      }
      if (this.isPlay) {
        this.$refs.musicAudio.pause();
        this.isPlay = !this.isPlay;
      } else {
        this.manualPlay = true;
        this.$refs.musicAudio.play().then(() => {
          this.isPlay = !this.isPlay;
          let timeStamp = new Date().getTime();
          this.lastOperateTimeStamp = timeStamp;
          let playStamp = `${this.url}__playTimeStamp__${timeStamp}`;
          sessionStorage.setItem('SET_PLAY_STATE', playStamp); //存储
        }).catch(error => {
          this.$message.warning('无效音频资源，请检查资源地址');
          console.log('音频播放catch', error);
        });
      }
      // this.isPlay ? this.$refs.musicAudio.pause() : this.$refs.musicAudio.play()
      // this.isPlay = !this.isPlay
      // let timeStamp = new Date().getTime()
      // this.lastOperateTimeStamp = timeStamp
      // let playStamp = `${this.url}__playTimeStamp__${timeStamp}`
      // // !this.isPlay && this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // // this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // sessionStorage.setItem('SET_PLAY_STATE', playStamp) //存储
    },
    updateTime(e) {
      this.playTime = this.$refs.musicAudio.currentTime;
      this.playCurrentTime = this.timeFormat(this.$refs.musicAudio.currentTime);
      if (this.playTime >= this.totalDuration) {
        this.isPlay = false;
      }
      this.$emit('timeUpdate', {
        event: e,
        time: this.$refs.musicAudio.currentTime
      });
    },
    changeTime(val) {
      this.$refs.musicAudio.currentTime = val;
    },
    onPlay() {
      if (!this.manualPlay) {
        this.$refs.musicAudio.pause();
      }
    }
  }
};

/* script */
const __vue_script__$2g = script$2g;

/* template */
var __vue_render__$2g = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticClass: "xml-audio-player-page" }, [
    _c("i", {
      staticClass: "el-icon-back",
      on: {
        click: function ($event) {
          return _vm.$emit("back")
        },
      },
    }),
    _vm._v(" "),
    _c("div", { staticClass: "audio-cover" }, [
      _c(
        "div",
        { staticClass: "square-wrapper" },
        [
          _c("el-image", {
            staticClass: "rotate",
            class: _vm.isPlay ? "active" : "paused",
            attrs: {
              src: _vm.coverImageUrl ? _vm.coverImageUrl : _vm.coverLocal,
              alt: "",
            },
          }),
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "play-button",
              on: {
                click: function ($event) {
                  $event.stopPropagation();
                  return _vm.play.apply(null, arguments)
                },
              },
            },
            [
              _c("i", {
                class: _vm.isPlay
                  ? "el-icon-video-pause"
                  : "el-icon-video-play",
              }),
            ]
          ),
        ],
        1
      ),
    ]),
    _vm._v(" "),
    _c("div", { staticClass: "audio-player-title" }, [
      _vm._v("\n        " + _vm._s(_vm.title) + "\n    "),
    ]),
    _vm._v(" "),
    _c("div", { staticClass: "audio-controls" }, [
      _c("div", { staticClass: "audio-controls__handler" }, [
        _c("div", { staticClass: "play-times" }, [
          _c("div", { staticClass: "current-time" }, [
            _vm._v(_vm._s(_vm.playCurrentTime)),
          ]),
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "progress" },
            [
              _c("el-slider", {
                attrs: {
                  max: _vm.totalDuration,
                  disabled: _vm.scheduleControl !== "yes",
                  "show-tooltip": false,
                },
                on: { change: _vm.changeTime },
                model: {
                  value: _vm.playTime,
                  callback: function ($$v) {
                    _vm.playTime = $$v;
                  },
                  expression: "playTime",
                },
              }),
            ],
            1
          ),
          _vm._v(" "),
          _c("div", { staticClass: "total-time" }, [
            _vm._v(_vm._s(_vm.playDuration)),
          ]),
        ]),
      ]),
    ]),
    _vm._v(" "),
    _c("audio", {
      ref: "musicAudio",
      staticClass: "audio-component",
      attrs: {
        controls: "",
        preload: "auto",
        src: _vm.url,
        loop: _vm.loop,
        link: _vm.link,
      },
      on: {
        canplay: _vm.changeDuration,
        timeupdate: _vm.updateTime,
        pause: function ($event) {
          _vm.isPlay = false;
        },
        play: _vm.onPlay,
      },
    }),
  ])
};
var __vue_staticRenderFns__$2g = [];
__vue_render__$2g._withStripped = true;

  /* style */
  const __vue_inject_styles__$2g = undefined;
  /* scoped */
  const __vue_scope_id__$2g = undefined;
  /* module identifier */
  const __vue_module_identifier__$2g = undefined;
  /* functional template */
  const __vue_is_functional_template__$2g = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2g = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2g, staticRenderFns: __vue_staticRenderFns__$2g },
    __vue_inject_styles__$2g,
    __vue_script__$2g,
    __vue_scope_id__$2g,
    __vue_is_functional_template__$2g,
    __vue_module_identifier__$2g,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2f = {
  name: 'audioPlayerPage',
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    playStyle: {
      type: String,
      default: 'yuan-wen'
    },
    styleMode: {
      type: String,
      default: 'A'
    },
    url: {
      type: String,
      default: '',
      require: true
    },
    title: {
      type: String,
      default: '音频文件'
    },
    coverImageUrl: {
      type: String,
      default: ''
    },
    //进度是否能控制
    scheduleControl: {
      type: String,
      default: ''
    },
    loop: {
      type: Boolean,
      default: true
    },
    playMode: {
      type: String,
      default: 'xun-huan'
    },
    content: {
      type: String,
      default: '暂无简介'
    },
    targerLink: {
      type: String,
      default: ''
    }
  },
  computed: {
    videoAndMusicStop() {
      let playState = sessionStorage.getItem('SET_PLAY_STATE');
      return playState;
    },
    playModeIconSrc() {
      let srcMap = {
        'xun-huan': playRepeat,
        'dan-ci': playOnce
      };
      return srcMap[this.playMode];
    }
  },
  watch: {
    url: {
      handler(newVal) {
        let _this = this;
        this.isPlay = false;
        let ua = navigator.userAgent;
        /micromessenger/.test(ua.toLowerCase());
        let isIOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        if (isIOS && newVal) {
          try {
            this.$nextTick(() => {
              _this.$refs.musicAudio.muted = true;
              const playPromise = _this.$refs.musicAudio.play();
              _this.$refs.musicAudio.muted = false;
              if (playPromise) {
                playPromise.then(() => {
                  _this.$refs.musicAudio.pause();
                }).catch(error => {
                  _this.$refs.musicAudio.pause();
                  console.log(error);
                });
              }
            });
          } catch (error) {
            console.log(error);
            this.$message({
              type: 'warning',
              message: error,
              duration: 5000
            });
          }
        }
      },
      immediate: true
    },
    videoAndMusicStop(val) {
      console.log('watch', val);
      let currentPlayStamp = val || '--';
      if (`${this.url}__playTimeStamp__${this.lastOperateTimeStamp}` !== currentPlayStamp) {
        this.musicAudio.pause();
      }
    }
  },
  data() {
    return {
      coverLocal,
      isPlay: false,
      playTime: 0,
      playDuration: '00:00',
      playCurrentTime: '00:00',
      totalDuration: 0,
      link: {
        type: String,
        default: ''
      },
      //链接地址
      lastOperateTimeStamp: '',
      musicAudio: null,
      manualPlay: false
    };
  },
  mounted() {
    // 加载完毕后，先获取<video>标签DOM对象
    this.musicAudio = this.$refs.musicAudio;
    // this.videoContainer = this.$refs.videoContainer
    if (this.mode === 'preview' && this.playStyle === 'yuan-wen') {
      this.$emit('resetTimeUpdate');
    }
  },
  methods: {
    changeDuration() {
      this.$nextTick(() => {
        this.playDuration = this.timeFormat(this.$refs.musicAudio.duration);
        this.totalDuration = this.$refs.musicAudio.duration;
      });
    },
    //将单位为秒的的时间转换成mm:ss的形式
    timeFormat(num) {
      let minute = parseInt(num / 60);
      let second = parseInt(num % 60);
      minute = minute >= 10 ? minute : `0${minute}`;
      second = second >= 10 ? second : `0${second}`;
      return `${minute}:${second}`;
    },
    play() {
      // if (this.mode==='editor') {
      //   this.$message.warning('音频仅支持在预览模式下播放')
      //   return
      // }
      if (this.playStyle === 'yuan-wen') {
        this.doPlay();
      }
      if (this.playStyle === 'tiao-zhuan') {
        if (this.targerLink) {
          // window.location.href=this.targerLink
          window.open(this.targerLink, '_blank');
        } else {
          this.$message.warning('获取资源链接失败，请检查链接地址');
        }
      }
      if (this.playStyle === 'tan-chuang') {
        this.$emit('showDialog', {
          url: this.url,
          title: this.title,
          coverFileUrl: this.coverImageUrl
        });
      }
    },
    doPlay() {
      console.log('暂停');
      let audio = document.querySelectorAll('audio');
      audio.forEach(i => i.pause());
      let video = document.querySelectorAll('video');
      if (video && video.length) {
        video.forEach(i => i.pause());
      }
      if (this.isPlay) {
        this.$refs.musicAudio.pause();
        this.isPlay = !this.isPlay;
      } else {
        this.manualPlay = true;
        this.$refs.musicAudio.play().then(() => {
          this.isPlay = !this.isPlay;
          let timeStamp = new Date().getTime();
          this.lastOperateTimeStamp = timeStamp;
          let playStamp = `${this.url}__playTimeStamp__${timeStamp}`;
          sessionStorage.setItem('SET_PLAY_STATE', playStamp); //存储
        }).catch(error => {
          this.$message.warning('无效音频资源，请检查资源地址');
          console.log('音频播放catch', error);
        });
      }
      // this.isPlay ? this.$refs.musicAudio.pause() : this.$refs.musicAudio.play()
      // this.isPlay = !this.isPlay
      // let timeStamp = new Date().getTime()
      // this.lastOperateTimeStamp = timeStamp
      // let playStamp = `${this.url}__playTimeStamp__${timeStamp}`
      // // !this.isPlay && this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // // this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // sessionStorage.setItem('SET_PLAY_STATE', playStamp) //存储
    },
    updateTime(e) {
      this.playTime = this.$refs.musicAudio.currentTime;
      this.playCurrentTime = this.timeFormat(this.$refs.musicAudio.currentTime);
      if (this.playTime >= this.totalDuration) {
        this.isPlay = false;
      }
      this.$emit('timeUpdate', {
        event: e,
        time: this.$refs.musicAudio.currentTime
      });
    },
    changeTime(val) {
      this.$refs.musicAudio.currentTime = val;
    },
    onPlay() {
      if (!this.manualPlay) {
        this.$refs.musicAudio.pause();
      }
    }
  }
};

/* script */
const __vue_script__$2f = script$2f;

/* template */
var __vue_render__$2f = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticClass: "xml-audio-player-page-pc" }, [
    _c("i", {
      staticClass: "el-icon-back",
      on: {
        click: function ($event) {
          return _vm.$emit("back")
        },
      },
    }),
    _vm._v(" "),
    _c("div", { staticClass: "audio-cover" }, [
      _c(
        "div",
        { staticClass: "square-wrapper" },
        [
          _c("el-image", {
            staticClass: "rotate",
            class: _vm.isPlay ? "active" : "paused",
            attrs: {
              src: _vm.coverImageUrl ? _vm.coverImageUrl : _vm.coverLocal,
              alt: "",
            },
          }),
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "play-button",
              on: {
                click: function ($event) {
                  $event.stopPropagation();
                  return _vm.play.apply(null, arguments)
                },
              },
            },
            [
              _c("i", {
                class: _vm.isPlay
                  ? "el-icon-video-pause"
                  : "el-icon-video-play",
              }),
            ]
          ),
        ],
        1
      ),
    ]),
    _vm._v(" "),
    _c("div", { staticClass: "audio-player-title" }, [
      _vm._v("\n        " + _vm._s(_vm.title) + "\n    "),
    ]),
    _vm._v(" "),
    _c("div", { staticClass: "audio-controls" }, [
      _c("div", { staticClass: "audio-controls__handler" }, [
        _c("div", { staticClass: "play-times" }, [
          _c("div", { staticClass: "current-time" }, [
            _vm._v(_vm._s(_vm.playCurrentTime)),
          ]),
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "progress" },
            [
              _c("el-slider", {
                attrs: {
                  max: _vm.totalDuration,
                  disabled: _vm.scheduleControl !== "yes",
                  "show-tooltip": false,
                },
                on: { change: _vm.changeTime },
                model: {
                  value: _vm.playTime,
                  callback: function ($$v) {
                    _vm.playTime = $$v;
                  },
                  expression: "playTime",
                },
              }),
            ],
            1
          ),
          _vm._v(" "),
          _c("div", { staticClass: "total-time" }, [
            _vm._v(_vm._s(_vm.playDuration)),
          ]),
        ]),
      ]),
    ]),
    _vm._v(" "),
    _c("audio", {
      ref: "musicAudio",
      staticClass: "audio-component",
      attrs: {
        controls: "",
        preload: "auto",
        src: _vm.url,
        loop: _vm.loop,
        link: _vm.link,
      },
      on: {
        canplay: _vm.changeDuration,
        timeupdate: _vm.updateTime,
        pause: function ($event) {
          _vm.isPlay = false;
        },
        play: _vm.onPlay,
      },
    }),
  ])
};
var __vue_staticRenderFns__$2f = [];
__vue_render__$2f._withStripped = true;

  /* style */
  const __vue_inject_styles__$2f = undefined;
  /* scoped */
  const __vue_scope_id__$2f = undefined;
  /* module identifier */
  const __vue_module_identifier__$2f = undefined;
  /* functional template */
  const __vue_is_functional_template__$2f = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2f = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2f, staticRenderFns: __vue_staticRenderFns__$2f },
    __vue_inject_styles__$2f,
    __vue_script__$2f,
    __vue_scope_id__$2f,
    __vue_is_functional_template__$2f,
    __vue_module_identifier__$2f,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2e = {
  name: 'resource-list-pc',
  components: {
    xmlPreviewSearch: __vue_component__$2h,
    VideoModalPlayer: __vue_component__$4u,
    audioPlayerPage: __vue_component__$2g,
    audioPlayerPagePc: __vue_component__$2f
  },
  props: {
    textBookResource: {
      type: Object,
      default: () => {}
    },
    resourceType: {
      type: String,
      default: ''
    },
    resourceIcon: {
      type: String,
      default: ''
    },
    resourcesList: {
      type: Array,
      default: () => []
    },
    userType: {
      // 用户类型，可选teacher、student
      type: String,
      default: 'teacher'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    componentList: {
      type: Array,
      default: () => []
    }
  },
  watch: {
    resourceType() {
      if (this.resourceType == 'teachingResource') {
        this.list = this.resourcesList || [];
      } else {
        this.list = this.textBookResource[this.resourceType] || [];
      }
      if (this.list.length > 0) {
        this.launchValue = 'teaching-resource_' + (this.resourceType == 'teachingResource' ? this.list[0].firstLevelId : this.list[0].chapterId);
      }
    },
    resourcesList() {
      this.list = this.resourcesList || [];
      this.list.forEach(item => {});
    }
  },
  data() {
    return {
      list: [],
      launchValue: '',
      //教师资源展开的唯一值
      location: '',
      Ahover: false,
      itemHoverStates: {},
      videoData: {
        show: false,
        src: ''
      },
      audioData: {
        show: false,
        src: '',
        title: ''
      },
      isMasked: false,
      audioUrl: '',
      isPlay: '',
      currentResources: ''
    };
  },
  mounted() {
    this.sendList();
  },
  methods: {
    sendList() {
      this.$EventBus.$emit('listUpdate', this.list);
    },
    getFileUrl(url) {
      if (url && url.indexOf('./') !== -1) {
        return this.resourceBasisPath + url.split('./')[1];
      } else if (url && url.indexOf('./') === -1) {
        return url;
      }
    },
    // 跳转到资源所在位置
    resourceDetails(item, items) {
      this.currentResources = items.id;
      this.location = '';
      this.$emit('resourceDetails', items);
    },
    resourcePlay(item, items) {
      if (items.resourcesType == 'recorded') {
        if (this.isPlay == '') {
          this.isPlay = items.id;
          this.audioUrl = items.fileUrl;
          this.$nextTick(() => {
            this.$refs.musicAudio.play();
          });
        } else {
          this.isPlay = '';
          this.$refs.musicAudio.pause();
        }
      }
    },
    // 跳转到资源所在位置
    resourceReader(item, items) {
      this.$emit('resourceReader', items);
    },
    setHoverState(index, isHovered) {
      this.$set(this.itemHoverStates, index, isHovered);
    },
    isItemHovered(index) {
      return this.itemHoverStates[index] || false;
    },
    // 图片预览
    imgPreview(item, items) {
      if (!items.isTrialExternal) {
        this.$xmlImgPreview({
          multiple: true,
          nowImgIndex: 0,
          imgList: [{
            url: this.getFileUrl(items.uploadFileUrl),
            title: items.title
          }]
        });
      }
      // this.$refs.xmlPopup.show = false
    },
    //资源预览
    resourcePrewiew(item, items) {
      if (items.isTrialExternal) {
        return;
      }
      if (items.resourcesType == 'image') {
        this.$xmlImgPreview({
          multiple: true,
          nowImgIndex: 0,
          imgList: [{
            url: this.getFileUrl(items.fileUrl),
            title: items.resourcesName
          }]
        });
      } else if (items.resourcesType == 'video') {
        this.videoData.src = this.getFileUrl(items.fileUrl);
        this.videoData.show = true;
      } else if (items.resourcesType == 'audio') {
        this.audioData.src = this.getFileUrl(items.fileUrl);
        this.audioData.show = true;
        this.audioData.title = items.resourcesName;
      } else if (items.resourcesType == 'office' || items.resourcesType == 'resources') {
        this.$emit('PrewiewOff', items);
      } else if (items.resourcesType == 'recorded') {
        if (this.isPlay == '') {
          this.isPlay = items.id;
          this.audioUrl = items.fileUrl;
          this.$nextTick(() => {
            this.$refs.musicAudio.play();
          });
        } else {
          this.isPlay = '';
          this.$refs.musicAudio.pause();
        }
      }
    },
    // 视频预览
    videoPreview(item, items) {
      if (!items.isTrialExternal) {
        this.videoData.src = this.getFileUrl(items.uploadFileUrl);
        this.videoData.show = true;
      }
      // this.$refs.xmlPopup.show = false
    },
    handleClose(done) {
      this.$confirm('确认关闭？').then(_ => {
        done();
      }).catch(_ => {});
    },
    // 音频预览
    audioPreview(item, items) {
      this.audioData.src = this.getFileUrl(items.uploadFileUrl);
      this.audioData.show = true;
      this.audioData.title = items.resourcesName;
      // this.$refs.xmlPopup.show = false
    },
    // 删除教师笔记
    deleteTeacherNotes(items) {
      this.$confirm(`确认删除此条笔记吗？`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        duration: 1000
      }).then(() => {
        this.$emit('deleteTeacherNotes', items);
      }).catch(() => {});
    },
    deleteFile(item, items) {
      this.$confirm(`确认删除${items.resourcesName}吗？`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        let data = {
          firstLevelId: item.chapterId,
          firstLevelLabel: item.firstLevelLabel,
          ...items
        };
        this.$emit('deleteTeachingResource', data);
      }).catch(() => {});
    },
    editFile(item, items) {
      let data = {
        firstLevelId: item.chapterId,
        firstLevelLabel: item.firstLevelLabel,
        ...items
      };
      this.$emit('editTeachingResource', data);
    },
    //下载
    downLoadFile(item, items) {
      // this.$emit('downLoadFile',items)
      // console.log(items,this.resourceBasisPath);
      window.open(items.fileUrl);
    },
    removeStyle(e) {
      if (e) {
        e = e.replace(/<[^>]+>/g, ''); //去除所有标签，以纯文本展示
        e = e.replace(/\s/gi, ''); //去除空格
        e = e.replace(/&nbsp;/gi, ''); //去除空格
        return e;
      } else {
        return '';
      }
    },
    change(e) {
      let i = e.split('_');
      let id = i[1];
      for (let index = 0; index < this.list.length; index++) {
        const element = this.list[index];
        if (element.chapterId == id) {
          this.list[index].state = true;
          return;
        }
      }
    },
    seachItem(item, text) {
      this.$emit('resourceDetails', item, 'search', text);
      console.log(item, 'item');
      console.log(text, 'text');
    },
    scrollFun(firstLevelId, location) {
      this.launchValue = 'teaching-resource_' + firstLevelId;
      this.location = location;
      setTimeout(() => {
        let Dom = document.getElementsByClassName('current-teacher-resources')[0];
        if (Dom) {
          let scrollTop = this.$refs.xmlResourceListPc.scrollTop + (Dom.getBoundingClientRect().top > 50 ? Dom.getBoundingClientRect().top - 50 : Dom.getBoundingClientRect().top < 0 ? Dom.getBoundingClientRect().top - 50 : 0);
          this.$refs.xmlResourceListPc.scrollTop = scrollTop;
        }
      }, 700);
    },
    formatTime(time) {
      if (time) {
        let Seconds = time / 1000;
        let m = parseInt(Seconds / 60);
        let s = Seconds % 60;
        // let date = (m > 9 ? m : '0' + m) + "'" + (s > 9 ? s : '0' + s) +
        let date = (m > 0 ? m + "'" : '') + s + '"';
        return date + ' 录音';
      } else {
        return '录音';
      }
    }
  }
};

var __$_require_static_images_icons_resource_lock_svg__ = "data:image/svg+xml,%3Csvg%20width%3D%2230%22%20height%3D%2230%22%20viewBox%3D%220%200%2030%2030%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M25.0612%2012.739H22.8417V8.07855C22.8417%204.17358%2019.3255%201%2014.9998%201C10.6744%201%207.15441%204.17358%207.15441%208.07855V12.739H4.93665C3.86676%2012.739%203%2013.5216%203%2014.4874V27.25C3%2028.2171%203.86676%2029%204.93665%2029H25.0632C26.1331%2029%2027%2028.2171%2027%2027.25V14.4874C27%2013.5216%2026.1332%2012.739%2025.0612%2012.739ZM16.0872%2021.2017V23.9876C16.0872%2024.1124%2015.9729%2024.2183%2015.8342%2024.2183H14.1676C14.0268%2024.2183%2013.9129%2024.1124%2013.9129%2023.9876V21.2017C13.1299%2020.8396%2012.5881%2020.1168%2012.5881%2019.2691C12.5881%2018.0675%2013.6696%2017.0917%2014.9998%2017.0917C16.3305%2017.0917%2017.4099%2018.0675%2017.4099%2019.2691C17.4136%2020.1168%2016.8702%2020.8396%2016.0872%2021.2017ZM19.831%2012.739H10.1687V8.19313C10.1687%205.7886%2012.3392%203.83183%2015.0019%203.83183C17.6664%203.83183%2019.8309%205.7886%2019.8309%208.19313L19.831%2012.739Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E";

var __$_require_static_images_default_over_video_cover_png__ = "data:image/png;base64, ";

var __$_require_static_images_icons_resource_note_icon_svg__ = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2218%22%20viewBox%3D%220%200%2018%2018%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M9.27034%2010.2555C9.80903%209.48573%2011.7823%206.71929%2012.5213%206.12418C11.579%208.23479%209.72279%2010.4064%208.61195%2012.4771C10.664%2013.1309%2011.594%2012.356%2012.7261%2011.4539L11.6043%2011.2515C13.029%2010.8125%2012.9295%2010.9751%2013.4284%2010.3266C13.8242%209.8123%2014.1527%209.11816%2014.2731%208.39322L13.346%208.50179C13.6418%208.33986%2014.3005%208.05532%2014.4052%207.89662C14.685%207.47231%2015.42%203.41471%2015.4286%202.57129C12.5954%202.59592%208.06861%208.16155%207.74116%2010.8215C7.41169%2013.4959%204.17444%2017.537%209.27034%2010.2555ZM13.4937%2011.7593C14.3387%2012.2331%2014.8413%2012.845%2014.8413%2013.5268C14.8413%2017.2052%202.57141%2017.2052%202.57141%2013.5268C2.57141%2011.8377%205.35854%2011.0801%206.80242%2010.8726C6.76843%2011.0999%206.69425%2011.3317%206.59731%2011.5687C5.60493%2011.7394%203.26887%2012.3708%203.26887%2013.5268C3.26887%2016.3054%2014.1438%2016.3054%2014.1438%2013.5268C14.1438%2013.0392%2013.6767%2012.574%2012.9049%2012.2C13.1025%2012.0647%2013.2964%2011.9154%2013.4937%2011.7593Z%22%20fill%3D%22%23ffffff%22%2F%3E%3C%2Fsvg%3E";

var __$_require_static_images_icons_resource_invisible_02_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAWCAYAAADTlvzyAAAAAXNSR0IArs4c6QAAAstJREFUSEu9lVmIjmEYhq/HHkWWE0v2UrInSSlLyhZFzoyEI2eWKCYksmQ5c2QcYE6USGMpWVLW5ECRbexbKSRkncd3j+f7vfP7zUhj3pr+f/q/972e537v+/mMJl7WxDx+A7r7BGA6UG5mHxu7oFLAHcAS4IzAjQ0tBWwLVAHj/we05B26ezH0IDAOGAz0BlqH1J+BB8B14BxwyMye13cNfzSNuw8HLgGtkgO+A0+Bt0BzoDPQBWgZz9QICqw1sxulwKUk1UHl8dcC+AS0AW4BY4BO8enABeBJBhkKTAPmhwIqbFMGXGdm+l5YdYAh5YHYrC5WAZXA4bjTR0CvZL+ge4DFZvbF3VWgoJuj+2PAnNR4BaC7q7PjwKTMnVeB2Wb2WIdHITcT2BbgA7AgOqows0V5Ie7eI6QdCZwEpuSdpsANwGrgiqBm9i45oB9wL+msNjJhnmtRSH8zu5/saR+wUdkdbzQzXdPP4Lt7H+AOIMgQM3uW6u7uZcBeQJ3pgEJkgGXAeqDMzPYX7eseDhZ8gArKgergNvAmgC+KNs4F9gFrgO1FOZUiK4F5ZqZnCsvduwawYwCrU0lV/YpwniQtjDV37xuSyjQjAOUvHw45QJJWJ5Iqy7o/OXurmamoX7M0HHYCmAhczCqbZWYvkwN2ZxFYmLnwYTizXXSmR1TIwLxId++WDQkNi9HAqSzPk7M7/FYHmLjxSEBfxf1UmlmNu2sA7ApnpnHKoyIjzZS7gW0RC8FmlIxF0ommhhy7PDNDM+AuUAEcBRQNjTbJJKiCr8LOA4MiKupcYRdUb5zazvJV32gbFuCpifSaOpqVrzMDaYx1KJqtOvdrJuNYM7ucghoEJh33DJny4a3/NSS0VL0ipOF9NrJZ71vmn9747i7ZzMzeF8WgwVfbPwFLSVUUhzwyO7OJtfSv7rC+Qxv6LWavjFdlZqfT538AuZz9F89GCIAAAAAASUVORK5CYII=";

var __$_require_static_images_icons_resource_invisible_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAWCAYAAADTlvzyAAAAAXNSR0IArs4c6QAAA6pJREFUSEu9lVtoXFUUhr91ztgJBup4IRAVrVooiNYLIhIQqhLwUhQszpMVMWZ2koGAVixo0EEqWqkKecjkzDh9iPZlQCJSLxBqpWC8ID4ELN61XiaGghkalYzJ2cvZ9ZzhNJm2UGL30wxn7/Xttdb/ry2c5SVnmccqYLlcvt1auxUYMcb8vdYXWgUMguAV4DHgILB1raHtgOcC+4Hb/g9o2x4GQbAS+qaIbFHVa4ENQDoqdQP4UVVnRORQKpWa7Ovrq52qDScVTbFYvMHzvE+AdYkAIfArUAd84ELgIuCcaI8FJkXk2Vwu92U78CpgtVr15+fnR5xogBSwCHQAX4Vh2OP7/gUi0mOtVWvttO/7v6jqdSJyD/BwVIFQRF7IZDKFbDbrLtlaJwCjUlYBd9hl8VSj0diXTqffinp6BLg8cV5FZG8mkxnKZrP/FAqFVHd3t4O+6LIXkXdV9YGk8FpAl1m9Xn9PVXub6vwc2GaM+dkFjy5yOIaJyG5V/Qt4xGUkIpVcLvdofJFyuXyptXayKb6bRGQqk8ncFWfaAgZBsAt4WkQ+W1xc7B0eHj4WBwiC4Crgu0Rmxy0ThmHa9/0v3EXCMNw4NDT0Q7xndHR0fUdHx5Sq3tzs8fPGGNei/4xfLpevsNZ+Axyz1m4eHBz8LVn3Uqm0XVUnosxcgJZlgB3Ac6q6fWBg4I3kuWKxeInneTPA+jAMN7kLHQdGGXwNzAObjTGzyYPj4+MPisjrwDPAy0mfuoqo6k4ReSiXy7k9rRUEQTfggOcDm4wx3ydLuht4EpgGepONHhsbu9L3fVfSI2EY3uj7vvNfPBxiwEYXMNEG5+UpoAd4yRizs1VS9yNS2PvAHcDHy8vL9+fz+d/jAKVS6TVV7WtK/ydgr4h0usyi7069V8eXrFQqFy8tLblhcQtwYHZ29s5CobB8AjChxrcj6FER2VGr1fYVCgVbrVbX1ev1MVV1ykzaKbbKwVQqdV8YhttUdU80FA4A97a1RaIUbmo4xT7RFIMHfKuqFVV9Z25u7nBXV9cGz/N6PM8TVZ1uNBpH0+n0R8A1gLNKJ+CMv6dWq43EmcXxTzraSqXS9arqwHcnMnJTx83KP0TEqup5K2ari7vULOOtxphPkwI6LTCR8WVuCABbADe83X83R91yfXEWmlHVD0XEvaOnfGXO6MWfmJjoXFhYkHw+/+cKG5z2aTsjYLtSrbBDbJlXjTGPJ/evOTCh9l2e5+3v7+//IAn8F8PthyYfFsMJAAAAAElFTkSuQmCC";

var __$_require_static_images_icons_books_edit_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAeCAYAAAAy2w7YAAAAAXNSR0IArs4c6QAAAphJREFUSEu11k9IFFEcB/Dvb8ZNF3cmgi3Cg/1B7BIkEYTOJrKnPUQh/YEoPHiNCFxWy5MFhe0sEXiqDkUURNElpItgUUyGYJfCUikIwQ4FhTOuUrvvF7PbbLrN/pvdfcf3Zn4ffr/33m+GUIMRCOk9xNAB+Ag8vGwMPssPS9U6gS49TIRxBmYl4BMDvYB03DSiT9fHrgpyEIDeKGvW4aWZkaSixS8AdDkf8wz9Q7DYCHHguzFkOhm4YZ6gXLkYH4jQwcBDq2VHHx6fTBfCKobyy2U1BXoZfK8YRqCjFUFue2JnoGqJ0wWxkD4ORrBsqBDilMoNCxy6upXEpmkGz5cFlULcMPZxVPpNEwC2M9I9JaFykXwMwDKAlBByeGVq4F1RqFLExuxyScI3w0BQCPmgjdjzBSGvCAnfpF0uJxMnU1eo1ohrRvVA/oPqhWyA6onkIDUU72OmWwCmlbWViN2FS30+spfRfePd3s0cBkXTXwHoAmAxke5v8N/49uKsVQirFMllpGiJ94C4D9BOAP3Zy8Y3zR/JS5gd+bUe9IJkoROPZGXpS5IhIpYx9HyLNtqagnwFwBmAL5rG4KgDeUUy0OZufZdI43NKllpXX0YXc0E1/QEBYVPIuzE1sFoNkoHUUDwimJ5YRqx5fYnUzuttLKU/gnmY5dSdSjbe9TCoocR5Zu43jdi+/AcUTb8L4AiArwC25beVUidzw89JQNPHCGgxjdgxeyGoXVOSoqFNktLtYHQS0Tn7cAghdzsNshIg1+tUTZ9gYC+AeQDtdkP8u7iUmWP+yaAx63XMbpaeByla/DYDfjAtAJgTLM01NzYtFLtHXrSSHz4vQQt2hloFKxaH1FDiFMB76ovRHClaYhLg/XWG3v4BEfuzLdxGxe4AAAAASUVORK5CYII=";

var __$_require_static_images_icons_books_delete_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAeCAYAAAA2Lt7lAAAAAXNSR0IArs4c6QAAAfBJREFUSEvtlrFrVEEQxr+Zl+SCWuTSihEh9hGEFCKJCCa7uesUMRYasPVv8AoFO9E/QCxExMZY5O07SJEiWiloZZugoGJjRJHD7H66icpx9+5y78BGb9qdmd/sx+zMCv6ySS/5Wa3uQ5KM5Po2GkGc+9wpT1cAFxbKnnwi5Mk9CtlU4KI497TVryvAG3MVwB0B6gTe50JIhch5AdbVudPFANbWQF5TkWOSpi873cJbu3OWpOlULoCVytHg/WMAB1ockhgH4DsAdpFp+NdZ9Gu2LzsScW5u0qs+EJERkJMA9kPkVS8N0OZDTgAoA3hNYBfQbNvGrAkwkzjXU4e1xntj7gG4pOQRybKN/wTgjbkO4Fvi3I1taxeFrCbOXaC1UyRvSghLUq+/i3L1JZE3ZgMin2Ib/klQKpVDo3EZwK1AnhrOsrUBYCDR7pvMe8mDLtpz2P0DEs3PP6fI1yHnZry1t0FeUWDcA2cFuK+qx2Vl5UXfoyIuf8Tfw+rqFo0pIYTxONwICKydkDTd/K1zX8OuyGbrGaDOqXTfw7ncYO0jkucUOCTOvW3baN6YuwCWSD5T4GOR6qE69DPuDIAPOj19WGq10AZgpXLQe/9QgBOIGhe3N0ouSpatx9COCTg7O4qxsdHC+ZeXt5ql7afCQswffRcc+OCKtZMAAAAASUVORK5CYII=";

var __$_require_static_images_icons_resource_download_icon_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA7RJREFUWEftlk9oFHcUx79vZsXdzExZTz0YMIKlQSxdQci6o5DSHCL2EJCempKA9laoJftPrDiiEHY3oMUeBD2kVMFCwYCUWkIxh8xutDm0UEoKFiPYPwdB6c7UmJ2dZ36bbjPZbHZnlxUv/q7z3vt+fu/3/gzhJR96yfp4BdByBkJ9magcoBEwDYC4RzwhMR66wAxYum4X4t+38qz+ASJGWFO6zgM0KgSY8QuABQAOwL1EFFkV5luOwx89vZN66AfEF4DSd+F1kkszROgF4yqxc+afwol7XoFgdLxnixw4C2AYzIslSP1L+fiDZhC+AFQ9O02gARc0apvxLxsF1fTcUQBXmLHgAmkq2XfsH42/N/NpCqDpEyMATzLzOSufPNXsRuK7pmfHAUpXbZl5iojTRTP1W61/fYCIEVa7lE8AHiSiPQxY1h/2TiwaS34A0G8EQk9D+wIy9UKiw8w8JGqFXXfILqTXFekGAOVg5l0q0yQRdTMgUncPkL6wzLGvfYnXMXrtQK6PGVMMDhM44s3EOgBNz7zJoJ/AeMQsj9qFsR/aFa31ExAu8yxAs5aZeKf6fR2AquduExAplZ29S3MnFjslXo2jxXJfgTBcKjs7q/H/B/ivje6DkS7mE5lOi4t4aix7ZKWmvnHhDttm6lpliFWFFD3zgQTpKvPyW1b+pBgyHT9qdLyf5MBt1+XjdiH5eQ3AxIgEnlx2nTee1QyZTpGsZWBtnqxlIJobkGRMlxnv/ZtPfNspUW8cTc9eBuiY95JrRdhjBLXtyl8rvT9XNJOH/ACosewNMSPsfPLDZvbB2MSOALkLBJovmomD9bsgljtJhHPMMKx84kyzoFose5+BJ1Y+ubehrVhkXV3TTNjDJTlq3x37uS6AmGBaSbkJYBDMc2WmKxI7v8NxH1nzGwuzIUDECCvBrfsgSW8T6LgYbPU6bOMo7jeC6rKSAnGaQMEqab3ibASg6rmLBHws/MVEZVDcNuOV1vOezZdRZR+EBiSSul24S5aZulTr3Ahg6/7xXVskaZDL7oIdfDaDGcOp90xNt6HXKdSX6ZYDpFtmsrIXagFEmzmQ5v38B9SvgSZVp8ayZ4nos5WhNlE0EwkvgBrLnSaCwcAFy0x82qyA2wLAbkNVtynfEXBACBHzkOgCgKZWxWnWemwdwq+G9WIARFQPxGqBsUOgQDvi60axX+KKXQ0EgFvFx/b7rdy8vSfwUq5C3AQjbP1p7/f9t+S7DVtKSfvGLbVh+zKbe74CeA6HppswnaiUHAAAAABJRU5ErkJggg==";

/* script */
const __vue_script__$2e = script$2e;
var __vue_render__$2e = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { ref: "xmlResourceListPc", staticClass: "xml-resource-list-pc" },
    [
      _vm.resourceType == "imageList"
        ? [
            _c(
              "el-collapse",
              {
                attrs: { accordion: "" },
                on: { change: _vm.change },
                model: {
                  value: _vm.launchValue,
                  callback: function ($$v) {
                    _vm.launchValue = $$v;
                  },
                  expression: "launchValue",
                },
              },
              _vm._l(_vm.list, function (item, index) {
                return _c(
                  "el-collapse-item",
                  {
                    key: index,
                    attrs: { name: "teaching-resource_" + item.chapterId },
                  },
                  [
                    _c("template", { slot: "title" }, [
                      _c("div", { staticClass: "collapse-title" }, [
                        _vm._v(
                          "\n            " + _vm._s(item.label) + "\n          "
                        ),
                      ]),
                    ]),
                    _vm._v(" "),
                    _c(
                      "div",
                      {
                        staticClass: "flie-title resource-list",
                        class: { "is-masked": _vm.isMasked },
                      },
                      _vm._l(item[_vm.resourceType], function (items, index) {
                        return _c(
                          "div",
                          {
                            staticClass: "resource-item image-item",
                            class: { "is-masked": _vm.isMasked },
                            on: {
                              click: function ($event) {
                                $event.stopPropagation();
                                return _vm.imgPreview(item, items)
                              },
                            },
                          },
                          [
                            _c(
                              "div",
                              {
                                directives: [
                                  {
                                    name: "show",
                                    rawName: "v-show",
                                    value: items.isTrialExternal,
                                    expression: "items.isTrialExternal",
                                  },
                                ],
                                staticClass: "mask-layer-trial-external",
                              },
                              [
                                _c("img", {
                                  attrs: {
                                    src: __$_require_static_images_icons_resource_lock_svg__,
                                    alt: "",
                                  },
                                }),
                              ]
                            ),
                            _vm._v(" "),
                            _c("div", { staticClass: "cover" }, [
                              item.state
                                ? _c("img", {
                                    attrs: {
                                      src: _vm.getFileUrl(items.uploadFileUrl),
                                      alt: "",
                                    },
                                  })
                                : _vm._e(),
                            ]),
                            _vm._v(" "),
                            _c("div", { staticClass: "image-title-box" }, [
                              _c(
                                "div",
                                {
                                  staticClass: "image-title",
                                  attrs: { title: items.title },
                                },
                                [
                                  _vm._v(
                                    _vm._s(
                                      items.title ? items.title : item.label
                                    )
                                  ),
                                ]
                              ),
                              _vm._v(" "),
                              _c("div", {
                                staticClass: "resource-icon",
                                on: {
                                  click: function ($event) {
                                    $event.stopPropagation();
                                    return _vm.resourceDetails(item, items)
                                  },
                                },
                              }),
                            ]),
                          ]
                        )
                      }),
                      0
                    ),
                  ],
                  2
                )
              }),
              1
            ),
          ]
        : _vm.resourceType == "videoList"
        ? [
            _c(
              "el-collapse",
              {
                attrs: { accordion: "" },
                on: { change: _vm.change },
                model: {
                  value: _vm.launchValue,
                  callback: function ($$v) {
                    _vm.launchValue = $$v;
                  },
                  expression: "launchValue",
                },
              },
              _vm._l(_vm.list, function (item, index) {
                return _c(
                  "el-collapse-item",
                  {
                    key: index,
                    attrs: { name: "teaching-resource_" + item.chapterId },
                  },
                  [
                    _c("template", { slot: "title" }, [
                      _c("div", { staticClass: "collapse-title" }, [
                        _vm._v(
                          "\n            " + _vm._s(item.label) + "\n          "
                        ),
                      ]),
                    ]),
                    _vm._v(" "),
                    _c(
                      "div",
                      { staticClass: "resource-list" },
                      _vm._l(item[_vm.resourceType], function (items, index) {
                        return _c(
                          "div",
                          {
                            staticClass: "resource-item image-item",
                            on: {
                              mouseover: function ($event) {
                                return _vm.setHoverState(index, true)
                              },
                              mouseout: function ($event) {
                                return _vm.setHoverState(index, false)
                              },
                              click: function ($event) {
                                $event.stopPropagation();
                                return _vm.videoPreview(item, items)
                              },
                            },
                          },
                          [
                            _c(
                              "div",
                              {
                                directives: [
                                  {
                                    name: "show",
                                    rawName: "v-show",
                                    value: items.isTrialExternal,
                                    expression: "items.isTrialExternal",
                                  },
                                ],
                                staticClass: "mask-layer-trial-external",
                              },
                              [
                                _c("img", {
                                  attrs: {
                                    src: __$_require_static_images_icons_resource_lock_svg__,
                                    alt: "",
                                  },
                                }),
                              ]
                            ),
                            _vm._v(" "),
                            _c("div", { staticClass: "cover" }, [
                              item.state && items.coverFileUrl
                                ? _c("img", {
                                    attrs: {
                                      src: _vm.getFileUrl(items.coverFileUrl),
                                      alt: "",
                                    },
                                  })
                                : _vm._e(),
                              _vm._v(" "),
                              !items.coverFileUrl
                                ? _c("img", {
                                    attrs: {
                                      src: __$_require_static_images_default_over_video_cover_png__,
                                      alt: "",
                                    },
                                  })
                                : _vm._e(),
                            ]),
                            _vm._v(" "),
                            _c("div", { staticClass: "image-title-box" }, [
                              _c(
                                "div",
                                {
                                  staticClass: "image-title",
                                  attrs: { title: items.title },
                                },
                                [_vm._v(_vm._s(items.title))]
                              ),
                              _vm._v(" "),
                              _c("div", {
                                staticClass: "resource-icon",
                                on: {
                                  click: function ($event) {
                                    $event.stopPropagation();
                                    return _vm.resourceDetails(item, items)
                                  },
                                },
                              }),
                            ]),
                          ]
                        )
                      }),
                      0
                    ),
                  ],
                  2
                )
              }),
              1
            ),
          ]
        : _vm.resourceType == "audioList"
        ? [
            _c(
              "el-collapse",
              {
                attrs: { accordion: "" },
                on: { change: _vm.change },
                model: {
                  value: _vm.launchValue,
                  callback: function ($$v) {
                    _vm.launchValue = $$v;
                  },
                  expression: "launchValue",
                },
              },
              _vm._l(_vm.list, function (item, index) {
                return _c(
                  "el-collapse-item",
                  {
                    key: index,
                    attrs: { name: "teaching-resource_" + item.chapterId },
                  },
                  [
                    _c("template", { slot: "title" }, [
                      _c("div", { staticClass: "collapse-title" }, [
                        _vm._v(
                          "\n            " + _vm._s(item.label) + "\n          "
                        ),
                      ]),
                    ]),
                    _vm._v(" "),
                    _c(
                      "div",
                      { staticClass: "resource-list" },
                      _vm._l(item[_vm.resourceType], function (items, index) {
                        return _c(
                          "div",
                          {
                            staticClass: "resource-item",
                            on: {
                              mouseover: function ($event) {
                                return _vm.setHoverState(index, true)
                              },
                              mouseout: function ($event) {
                                return _vm.setHoverState(index, false)
                              },
                              click: function ($event) {
                                $event.stopPropagation();
                                return _vm.audioPreview(item, items)
                              },
                            },
                          },
                          [
                            _c(
                              "div",
                              {
                                directives: [
                                  {
                                    name: "show",
                                    rawName: "v-show",
                                    value: items.isTrialExternal,
                                    expression: "items.isTrialExternal",
                                  },
                                ],
                                staticClass:
                                  "mask-layer-trial-external min-mask-layer",
                              },
                              [
                                _c("img", {
                                  attrs: {
                                    src: __$_require_static_images_icons_resource_lock_svg__,
                                    alt: "",
                                  },
                                }),
                              ]
                            ),
                            _vm._v(" "),
                            _c("div", {
                              staticClass: "icon",
                              class: _vm.resourceIcon,
                            }),
                            _vm._v(" "),
                            _c(
                              "div",
                              {
                                staticClass: "flie-title resource-title",
                                attrs: { title: items.title },
                              },
                              [_vm._v(_vm._s(items.title))]
                            ),
                            _vm._v(" "),
                            _c("div", {
                              staticClass: "resource-icon",
                              on: {
                                click: function ($event) {
                                  $event.stopPropagation();
                                  return _vm.resourceDetails(item, items)
                                },
                              },
                            }),
                          ]
                        )
                      }),
                      0
                    ),
                  ],
                  2
                )
              }),
              1
            ),
          ]
        : _vm.resourceType == "questionList"
        ? [
            _c(
              "el-collapse",
              {
                attrs: { accordion: "" },
                on: { change: _vm.change },
                model: {
                  value: _vm.launchValue,
                  callback: function ($$v) {
                    _vm.launchValue = $$v;
                  },
                  expression: "launchValue",
                },
              },
              _vm._l(_vm.list, function (item, index) {
                return _c(
                  "el-collapse-item",
                  {
                    key: index,
                    attrs: { name: "teaching-resource_" + item.chapterId },
                  },
                  [
                    _c("template", { slot: "title" }, [
                      _c("div", { staticClass: "collapse-title" }, [
                        _vm._v(
                          "\n            " + _vm._s(item.label) + "\n          "
                        ),
                      ]),
                    ]),
                    _vm._v(" "),
                    _c(
                      "div",
                      { staticClass: "resource-list" },
                      _vm._l(item[_vm.resourceType], function (items, index) {
                        return _c(
                          "div",
                          {
                            staticClass: "resource-item",
                            on: {
                              mouseover: function ($event) {
                                return _vm.setHoverState(index, true)
                              },
                              mouseout: function ($event) {
                                return _vm.setHoverState(index, false)
                              },
                            },
                          },
                          [
                            _c(
                              "div",
                              {
                                directives: [
                                  {
                                    name: "show",
                                    rawName: "v-show",
                                    value: items.isTrialExternal,
                                    expression: "items.isTrialExternal",
                                  },
                                ],
                                staticClass:
                                  "mask-layer-trial-external min-mask-layer",
                              },
                              [
                                _c("img", {
                                  attrs: {
                                    src: __$_require_static_images_icons_resource_lock_svg__,
                                    alt: "",
                                  },
                                }),
                              ]
                            ),
                            _vm._v(" "),
                            _c("div", {
                              staticClass: "icon",
                              class: _vm.resourceIcon,
                            }),
                            _vm._v(" "),
                            _c(
                              "div",
                              {
                                staticClass: "flie-title resource-title",
                                attrs: {
                                  title: _vm.removeStyle(items.stem.content),
                                },
                              },
                              [
                                _vm._v(
                                  "\n              " +
                                    _vm._s(
                                      _vm.removeStyle(items.stem.content)
                                    ) +
                                    "\n            "
                                ),
                              ]
                            ),
                            _vm._v(" "),
                            _c("div", {
                              staticClass: "resource-icon",
                              on: {
                                click: function ($event) {
                                  $event.stopPropagation();
                                  return _vm.resourceDetails(item, items)
                                },
                              },
                            }),
                          ]
                        )
                      }),
                      0
                    ),
                  ],
                  2
                )
              }),
              1
            ),
          ]
        : _vm.resourceType == "formulaList" ||
          _vm.resourceType == "interactionList"
        ? [
            _c(
              "el-collapse",
              {
                attrs: { accordion: "" },
                on: { change: _vm.change },
                model: {
                  value: _vm.launchValue,
                  callback: function ($$v) {
                    _vm.launchValue = $$v;
                  },
                  expression: "launchValue",
                },
              },
              _vm._l(_vm.list, function (item, index) {
                return _c(
                  "el-collapse-item",
                  {
                    key: index,
                    attrs: { name: "teaching-resource_" + item.chapterId },
                  },
                  [
                    _c("template", { slot: "title" }, [
                      _c("div", { staticClass: "collapse-title" }, [
                        _vm._v(
                          "\n            " + _vm._s(item.label) + "\n          "
                        ),
                      ]),
                    ]),
                    _vm._v(" "),
                    _c(
                      "div",
                      { staticClass: "resource-list" },
                      _vm._l(item[_vm.resourceType], function (items, index) {
                        return _c(
                          "div",
                          {
                            staticClass: "resource-item flex-column",
                            on: {
                              mouseover: function ($event) {
                                return _vm.setHoverState(index, true)
                              },
                              mouseout: function ($event) {
                                return _vm.setHoverState(index, false)
                              },
                            },
                          },
                          [
                            _c(
                              "div",
                              {
                                directives: [
                                  {
                                    name: "show",
                                    rawName: "v-show",
                                    value: items.isTrialExternal,
                                    expression: "items.isTrialExternal",
                                  },
                                ],
                                staticClass: "mask-layer-trial-external",
                              },
                              [
                                _c("img", {
                                  attrs: {
                                    src: __$_require_static_images_icons_resource_lock_svg__,
                                    alt: "",
                                  },
                                }),
                              ]
                            ),
                            _vm._v(" "),
                            _c("div", { staticClass: "resource-title-box" }, [
                              _c("div", {
                                staticClass: "icon",
                                class: _vm.resourceIcon,
                              }),
                              _vm._v(" "),
                              _c(
                                "div",
                                {
                                  staticClass: "flie-title resource-title",
                                  attrs: { title: items.fileNames },
                                },
                                [_vm._v(_vm._s(items.fileNames))]
                              ),
                              _vm._v(" "),
                              _c("div", {
                                staticClass: "resource-icon",
                                on: {
                                  click: function ($event) {
                                    $event.stopPropagation();
                                    return _vm.resourceDetails(item, items)
                                  },
                                },
                              }),
                            ]),
                            _vm._v(" "),
                            _c("iframe", {
                              directives: [
                                {
                                  name: "show",
                                  rawName: "v-show",
                                  value: _vm.resourceType == "formulaList",
                                  expression: "resourceType == 'formulaList'",
                                },
                              ],
                              attrs: {
                                width: "100%",
                                height: "120px",
                                src: _vm.getFileUrl(items.file),
                                frameborder: "0",
                                marginwidth: "0",
                                marginheight: "0",
                                allowtransparency: "yes",
                              },
                            }),
                          ]
                        )
                      }),
                      0
                    ),
                  ],
                  2
                )
              }),
              1
            ),
          ]
        : _vm.resourceType == "resourceList"
        ? [
            _c(
              "el-collapse",
              {
                attrs: { accordion: "" },
                on: { change: _vm.change },
                model: {
                  value: _vm.launchValue,
                  callback: function ($$v) {
                    _vm.launchValue = $$v;
                  },
                  expression: "launchValue",
                },
              },
              _vm._l(_vm.list, function (item, index) {
                return _c(
                  "el-collapse-item",
                  {
                    key: index,
                    attrs: { name: "teaching-resource_" + item.chapterId },
                  },
                  [
                    _c("template", { slot: "title" }, [
                      _c("div", { staticClass: "collapse-title" }, [
                        _vm._v(
                          "\n            " + _vm._s(item.label) + "\n          "
                        ),
                      ]),
                    ]),
                    _vm._v(" "),
                    _c(
                      "div",
                      { staticClass: "resource-list" },
                      _vm._l(item[_vm.resourceType], function (items, index) {
                        return _c(
                          "div",
                          {
                            staticClass: "resource-item",
                            on: {
                              mouseover: function ($event) {
                                return _vm.setHoverState(index, true)
                              },
                              mouseout: function ($event) {
                                return _vm.setHoverState(index, false)
                              },
                              click: function ($event) {
                                $event.stopPropagation();
                                return _vm.resourceDetails(item, items)
                              },
                            },
                          },
                          [
                            _c(
                              "div",
                              {
                                directives: [
                                  {
                                    name: "show",
                                    rawName: "v-show",
                                    value: items.isTrialExternal,
                                    expression: "items.isTrialExternal",
                                  },
                                ],
                                staticClass:
                                  "mask-layer-trial-external min-mask-layer",
                              },
                              [
                                _c("img", {
                                  attrs: {
                                    src: __$_require_static_images_icons_resource_lock_svg__,
                                    alt: "",
                                  },
                                }),
                              ]
                            ),
                            _vm._v(" "),
                            _c("div", {
                              staticClass: "icon",
                              class: _vm.resourceIcon,
                            }),
                            _vm._v(" "),
                            _c(
                              "div",
                              {
                                staticClass: "flie-title resource-title",
                                attrs: { title: items.title },
                              },
                              [_vm._v(_vm._s(items.title))]
                            ),
                            _vm._v(" "),
                            _c("div", {
                              staticClass: "resource-icon",
                              on: {
                                click: function ($event) {
                                  $event.stopPropagation();
                                  return _vm.resourceDetails(item, items)
                                },
                              },
                            }),
                          ]
                        )
                      }),
                      0
                    ),
                  ],
                  2
                )
              }),
              1
            ),
          ]
        : _vm.resourceType == "teachingResource"
        ? [
            _c(
              "el-collapse",
              {
                attrs: { accordion: "" },
                on: { change: _vm.change },
                model: {
                  value: _vm.launchValue,
                  callback: function ($$v) {
                    _vm.launchValue = $$v;
                  },
                  expression: "launchValue",
                },
              },
              _vm._l(_vm.list, function (item, index) {
                return _c(
                  "el-collapse-item",
                  {
                    key: index,
                    attrs: { name: "teaching-resource_" + item.firstLevelId },
                  },
                  [
                    _c("template", { slot: "title" }, [
                      _c("div", { staticClass: "collapse-title" }, [
                        _vm._v(
                          "\n            " +
                            _vm._s(item.firstLevelLabel) +
                            "\n          "
                        ),
                      ]),
                    ]),
                    _vm._v(" "),
                    _c(
                      "div",
                      { staticClass: "resource-list" },
                      _vm._l(item.list, function (items, index) {
                        return _c(
                          "div",
                          {
                            key: index,
                            staticClass: "xml-teaching-resource",
                            class:
                              items.location == _vm.location
                                ? "current-teacher-resources"
                                : "",
                          },
                          [
                            items.resourcesType == "notes"
                              ? [
                                  _c(
                                    "div",
                                    { staticClass: "xml-teacher-note" },
                                    [
                                      _c(
                                        "div",
                                        { staticClass: "xml-note-header" },
                                        [
                                          _c("img", {
                                            staticClass: "note-icon",
                                            attrs: {
                                              src: __$_require_static_images_icons_resource_note_icon_svg__,
                                              alt: "",
                                            },
                                          }),
                                          _vm._v(" "),
                                          _c("img", {
                                            directives: [
                                              {
                                                name: "show",
                                                rawName: "v-show",
                                                value:
                                                  items.isStudentShow != 0 &&
                                                  _vm.userType == "teacher",
                                                expression:
                                                  "items.isStudentShow != 0 && userType == 'teacher'",
                                              },
                                            ],
                                            staticClass: "eye",
                                            attrs: {
                                              src: __$_require_static_images_icons_resource_invisible_02_png__,
                                              alt: "",
                                            },
                                          }),
                                          _vm._v(" "),
                                          _vm.userType == "teacher"
                                            ? _c(
                                                "el-popover",
                                                {
                                                  attrs: {
                                                    placement: "bottom",
                                                    width: "40px",
                                                    trigger: "hover",
                                                    "popper-class":
                                                      "customPopper",
                                                  },
                                                },
                                                [
                                                  _c(
                                                    "div",
                                                    {
                                                      staticClass:
                                                        "teacher-note-popover",
                                                    },
                                                    [
                                                      _c(
                                                        "span",
                                                        {
                                                          on: {
                                                            click: function (
                                                              $event
                                                            ) {
                                                              return _vm.$emit(
                                                                "updateTeacherNotes",
                                                                items
                                                              )
                                                            },
                                                          },
                                                        },
                                                        [_vm._v("编辑")]
                                                      ),
                                                      _vm._v(" "),
                                                      _c(
                                                        "span",
                                                        {
                                                          on: {
                                                            click: function (
                                                              $event
                                                            ) {
                                                              return _vm.deleteTeacherNotes(
                                                                items
                                                              )
                                                            },
                                                          },
                                                        },
                                                        [_vm._v("删除")]
                                                      ),
                                                    ]
                                                  ),
                                                  _vm._v(" "),
                                                  _c("i", {
                                                    staticClass: "el-icon-more",
                                                    attrs: {
                                                      slot: "reference",
                                                    },
                                                    slot: "reference",
                                                  }),
                                                ]
                                              )
                                            : _vm._e(),
                                        ],
                                        1
                                      ),
                                      _vm._v(" "),
                                      _c(
                                        "div",
                                        {
                                          staticClass: "note-content",
                                          on: {
                                            click: function ($event) {
                                              _vm.$emit(
                                                "resourceDetails",
                                                items,
                                                "id",
                                                ""
                                              ),
                                                (_vm.location = "");
                                            },
                                          },
                                        },
                                        [
                                          _c("xmlTextOverflow", {
                                            attrs: { info: items.noteContent },
                                          }),
                                        ],
                                        1
                                      ),
                                    ]
                                  ),
                                ]
                              : [
                                  _c(
                                    "div",
                                    {
                                      staticClass:
                                        "resource-item teaching-resource-item",
                                      class:
                                        _vm.currentResources == items.id
                                          ? "xml-current-resources"
                                          : "",
                                    },
                                    [
                                      _c("div", {
                                        staticClass: "icon",
                                        class: [
                                          items.resourcesType == "recorded"
                                            ? "recorded"
                                            : items.fileExt
                                            ? items.fileExt.replace(/\./gi, "")
                                            : "",
                                          _vm.isPlay == items.id
                                            ? "isPlay"
                                            : "",
                                        ],
                                      }),
                                      _vm._v(" "),
                                      _c(
                                        "div",
                                        {
                                          staticClass:
                                            "resource-title resource-title-width",
                                          on: {
                                            click: function ($event) {
                                              $event.stopPropagation();
                                              return _vm.resourcePrewiew(
                                                item,
                                                items
                                              )
                                            },
                                          },
                                        },
                                        [
                                          _c(
                                            "span",
                                            {
                                              staticClass: "teacher-flie-title",
                                              attrs: {
                                                title: items.resourcesName,
                                              },
                                            },
                                            [
                                              _vm._v(
                                                _vm._s(
                                                  items.resourcesType ==
                                                    "recorded"
                                                    ? _vm.formatTime(
                                                        items.duration
                                                      )
                                                    : items.resourcesName
                                                )
                                              ),
                                            ]
                                          ),
                                          _vm._v(" "),
                                          _c("img", {
                                            directives: [
                                              {
                                                name: "show",
                                                rawName: "v-show",
                                                value:
                                                  items.isStudentShow != 0 &&
                                                  _vm.userType == "teacher",
                                                expression:
                                                  "items.isStudentShow != 0 && userType == 'teacher'",
                                              },
                                            ],
                                            attrs: {
                                              src: __$_require_static_images_icons_resource_invisible_png__,
                                              alt: "",
                                            },
                                          }),
                                        ]
                                      ),
                                      _vm._v(" "),
                                      _vm.userType == "teacher"
                                        ? _c("img", {
                                            attrs: {
                                              src: __$_require_static_images_icons_books_edit_png__,
                                              alt: "",
                                            },
                                            on: {
                                              click: function ($event) {
                                                $event.stopPropagation();
                                                return _vm.editFile(item, items)
                                              },
                                            },
                                          })
                                        : _vm._e(),
                                      _vm._v(" "),
                                      _vm.userType == "teacher"
                                        ? _c("img", {
                                            attrs: {
                                              src: __$_require_static_images_icons_books_delete_png__,
                                              alt: "",
                                            },
                                            on: {
                                              click: function ($event) {
                                                $event.stopPropagation();
                                                return _vm.deleteFile(
                                                  item,
                                                  items
                                                )
                                              },
                                            },
                                          })
                                        : _vm._e(),
                                      _vm._v(" "),
                                      items.isDownload == 1 &&
                                      _vm.userType != "teacher"
                                        ? _c("img", {
                                            staticStyle: { width: "20px" },
                                            attrs: {
                                              src: __$_require_static_images_icons_resource_download_icon_png__,
                                              alt: "",
                                            },
                                            on: {
                                              click: function ($event) {
                                                $event.stopPropagation();
                                                return _vm.downLoadFile(
                                                  item,
                                                  items
                                                )
                                              },
                                            },
                                          })
                                        : _vm._e(),
                                      _vm._v(" "),
                                      _c("div", {
                                        staticClass: "resource-icon",
                                        on: {
                                          click: function ($event) {
                                            $event.stopPropagation();
                                            return _vm.resourceDetails(
                                              item,
                                              items
                                            )
                                          },
                                        },
                                      }),
                                    ]
                                  ),
                                ],
                          ],
                          2
                        )
                      }),
                      0
                    ),
                  ],
                  2
                )
              }),
              1
            ),
          ]
        : _vm._e(),
      _vm._v(" "),
      _c("xml-empty", {
        directives: [
          {
            name: "show",
            rawName: "v-show",
            value: _vm.list.length == 0 && _vm.resourceType != "search",
            expression: "list.length == 0 && resourceType != 'search'",
          },
        ],
      }),
      _vm._v(" "),
      _vm.resourceType == "search"
        ? _c("xml-preview-search", {
            staticClass: "search-toobar",
            attrs: { componentList: _vm.componentList },
            on: { seachItem: _vm.seachItem },
          })
        : _vm._e(),
      _vm._v(" "),
      _c("audio", {
        ref: "musicAudio",
        staticClass: "audio-component",
        attrs: { controls: "", preload: "auto", src: _vm.audioUrl },
        on: {
          ended: function ($event) {
            _vm.isPlay = "";
          },
        },
      }),
      _vm._v(" "),
      _c(
        "el-dialog",
        {
          attrs: {
            visible: _vm.videoData.show,
            width: "1000px",
            "z-index": "1000",
            "show-close": false,
            "before-close": _vm.handleClose,
          },
          on: {
            "update:visible": function ($event) {
              return _vm.$set(_vm.videoData, "show", $event)
            },
          },
        },
        [
          _c(
            "div",
            { staticClass: "video-content" },
            [
              _c(
                "div",
                {
                  staticClass: "xml-el-icon-close-dialog",
                  on: {
                    click: function ($event) {
(_vm.videoData.show = false), (_vm.videoData.src = "");
                    },
                  },
                },
                [_c("i", { staticClass: "el-icon-close" })]
              ),
              _vm._v(" "),
              _vm.videoData.show
                ? _c("video-modal-player", {
                    attrs: { src: _vm.videoData.src },
                  })
                : _vm._e(),
            ],
            1
          ),
        ]
      ),
      _vm._v(" "),
      _c(
        "div",
        { staticClass: "resource-item", staticStyle: { position: "relative" } },
        [
          _c(
            "el-dialog",
            {
              attrs: {
                visible: _vm.audioData.show,
                width: "840px",
                "show-close": false,
                "before-close": _vm.handleClose,
              },
              on: {
                "update:visible": function ($event) {
                  return _vm.$set(_vm.audioData, "show", $event)
                },
              },
            },
            [
              _c(
                "div",
                {
                  staticClass: "xml-el-icon-close-dialog",
                  on: {
                    click: function ($event) {
                      _vm.audioData.show = false;
                    },
                  },
                },
                [_c("i", { staticClass: "el-icon-close" })]
              ),
              _vm._v(" "),
              _vm.audioData.show
                ? _c("audio-player-page-pc", {
                    staticStyle: { "z-index": "9999" },
                    attrs: {
                      url: _vm.audioData.src,
                      title: _vm.audioData.title,
                    },
                    on: {
                      back: function ($event) {
                        _vm.audioData.show = false;
                      },
                    },
                  })
                : _vm._e(),
            ],
            1
          ),
        ],
        1
      ),
    ],
    2
  )
};
var __vue_staticRenderFns__$2e = [];
__vue_render__$2e._withStripped = true;

  /* style */
  const __vue_inject_styles__$2e = undefined;
  /* scoped */
  const __vue_scope_id__$2e = undefined;
  /* module identifier */
  const __vue_module_identifier__$2e = undefined;
  /* functional template */
  const __vue_is_functional_template__$2e = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2e = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2e, staticRenderFns: __vue_staticRenderFns__$2e },
    __vue_inject_styles__$2e,
    __vue_script__$2e,
    __vue_scope_id__$2e,
    __vue_is_functional_template__$2e,
    __vue_module_identifier__$2e,
    false,
    undefined,
    undefined,
    undefined
  );

const fontSizeLabelMap = {
  1: '小',
  2: '中',
  3: '大'
};
const fontSizeValueMap = {
  1: '12px',
  2: '16px',
  3: '20px'
};

//
var script$2d = {
  name: 'setPop',
  props: {
    settingData: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      visible: false,
      selectedColor: null,
      isBlackBackground: false,
      ruleForm: {
        font: '宋体',
        //。。默认字体
        fontSize: 30,
        // 默认字号
        backgroundColor: '#f87db7',
        // 默认背景颜色
        lineHeight: '20',
        // 默认行间距
        WordOption: '20'
      },
      form: {
        themeFontFamily: '',
        //字体
        themeFontSize: 2,
        //字号
        themeBgColor: '',
        //当前颜色
        themeLineHeight: undefined,
        //行间距
        themeLetterSpacing: undefined //字间距
      },
      fontSizeLabelMap,
      RowOptions: [{
        value: '10',
        label: '10'
      }, {
        value: '20',
        label: '20'
      }, {
        value: '30',
        label: '30'
      }],
      WordOptions: [{
        value: '10',
        label: '10'
      }, {
        value: '20',
        label: '20'
      }, {
        value: '30',
        label: '30'
      }],
      colorOptions: [{
        label: '蓝色',
        value: '#efefef'
      }, {
        label: '暗绿色',
        value: '#ddd8c5'
      }, {
        label: '黄色',
        value: '#f2dcc4'
      }, {
        label: '绿色',
        value: '#e6f7e5'
      }, {
        label: '粉色',
        value: '#fbdee2'
      }, {
        label: '黑色',
        value: '#000000'
      }],
      WordOptions: [{
        value: '10',
        label: '10'
      }, {
        value: '20',
        label: '20'
      }, {
        value: '30',
        label: '30'
      }]
    };
  },
  watch: {
    settingData: {
      handler(newValue) {
        this.form = {
          ...this.form,
          ...newValue
        };
      },
      immediate: true,
      deep: true
    }
  },
  methods: {
    // handleColorClick(colorValue) {
    //   this.ruleForm.backgroundColor = colorValue
    //   this.selectedColor = colorValue
    //   this.isBlackBackground = colorValue.toLowerCase() === '#000000'
    // },
    // 设置字体
    setThemeFontFamily(value) {
      this.form.themeFontFamily = value;
      this.$emit('settingChange', 'themeFontFamily', value);
    },
    // 设置字号
    setThemeFontSize(type) {
      let emit = false;
      switch (type) {
        case 'plus':
          if (this.form.themeFontSize < 3) {
            this.form.themeFontSize++;
            emit = true;
          }
          break;
        case 'minus':
          if (this.form.themeFontSize > 1) {
            this.form.themeFontSize--;
            emit = true;
          }
          break;
      }
      emit && this.$emit('settingChange', 'themeFontSize', this.form.themeFontSize);
    },
    // 设置背景色
    setThemeBgColor(color) {
      if (color === this.form.themeBgColor) {
        color = '';
      }
      this.form.themeBgColor = color;
      this.selectedColor = color;
      this.isBlackBackground = color.toLowerCase() === '#000000';
      this.$emit('settingChange', 'themeBgColor', color);
    },
    setThemeLineHeight(value) {
      this.form.themeLineHeight = value;
      this.$emit('settingChange', 'themeLineHeight', value);
    },
    setThemeLetterSpacing(value) {
      this.form.themeLetterSpacing = value;
      this.$emit('settingChange', 'themeLetterSpacing', value);
    }
  }
};

/* script */
const __vue_script__$2d = script$2d;
/* template */
var __vue_render__$2d = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "el-dialog",
    {
      staticClass: "header",
      attrs: {
        "append-to-body": "",
        title: "文本设置",
        width: "500px",
        visible: _vm.visible,
      },
      on: {
        "update:visible": function ($event) {
          _vm.visible = $event;
        },
      },
    },
    [
      _c(
        "div",
        {
          staticClass: "xml-set-pop-pc",
          staticStyle: { width: "500px", margin: "0 auto", height: "300px" },
        },
        [
          _c(
            "el-form",
            { staticClass: "pop" },
            [
              _c(
                "el-form-item",
                { attrs: { label: "字体", prop: "font" } },
                [
                  _c(
                    "el-select",
                    {
                      staticClass: "select-font",
                      on: { change: _vm.setThemeFontFamily },
                      model: {
                        value: _vm.form.themeFontFamily,
                        callback: function ($$v) {
                          _vm.$set(_vm.form, "themeFontFamily", $$v);
                        },
                        expression: "form.themeFontFamily",
                      },
                    },
                    [
                      _c("el-option", { attrs: { label: "默认", value: "" } }),
                      _vm._v(" "),
                      _c("el-option", {
                        attrs: { label: "宋体", value: "宋体, SimSun" },
                      }),
                      _vm._v(" "),
                      _c("el-option", {
                        attrs: {
                          label: "楷体",
                          value: "楷体, 楷体_GB2312, SimKai",
                        },
                      }),
                      _vm._v(" "),
                      _c("el-option", {
                        attrs: { label: "黑体", value: "黑体, SimHei" },
                      }),
                    ],
                    1
                  ),
                ],
                1
              ),
              _vm._v(" "),
              _c("div", { staticClass: "set-item" }, [
                _c("span", { staticClass: "keyname" }, [_vm._v("字号")]),
                _vm._v(" "),
                _c("div", { staticStyle: { "margin-left": "14px" } }, [
                  _c(
                    "div",
                    {
                      staticClass: "size-btn",
                      on: {
                        click: function ($event) {
                          $event.stopPropagation();
                          return _vm.setThemeFontSize("minus")
                        },
                      },
                    },
                    [_vm._v("A-")]
                  ),
                  _vm._v(" "),
                  _c("span", [
                    _vm._v(
                      _vm._s(_vm.fontSizeLabelMap[_vm.form.themeFontSize])
                    ),
                  ]),
                  _vm._v(" "),
                  _c(
                    "div",
                    {
                      staticClass: "size-btn",
                      on: {
                        click: function ($event) {
                          $event.stopPropagation();
                          return _vm.setThemeFontSize("plus")
                        },
                      },
                    },
                    [_vm._v("A+")]
                  ),
                ]),
              ]),
              _vm._v(" "),
              _c("el-form-item", { attrs: { label: "背景色" } }, [
                _c(
                  "div",
                  { staticClass: "color-container" },
                  _vm._l(_vm.colorOptions, function (color, index) {
                    return _c(
                      "div",
                      {
                        key: index,
                        staticClass: "color-item",
                        class: {
                          "active-color": _vm.form.themeBgColor === color.value,
                        },
                        style: { backgroundColor: color.value },
                        on: {
                          click: function ($event) {
                            return _vm.setThemeBgColor(color.value)
                          },
                        },
                      },
                      [
                        _vm.form.themeBgColor === color.value
                          ? _c(
                              "div",
                              {
                                staticClass: "check-mark",
                                class: { "white-check": _vm.isBlackBackground },
                              },
                              [
                                _vm._v(
                                  "\n              " +
                                    _vm._s("✔") +
                                    "\n            "
                                ),
                              ]
                            )
                          : _vm._e(),
                      ]
                    )
                  }),
                  0
                ),
              ]),
            ],
            1
          ),
        ],
        1
      ),
    ]
  )
};
var __vue_staticRenderFns__$2d = [];
__vue_render__$2d._withStripped = true;

  /* style */
  const __vue_inject_styles__$2d = undefined;
  /* scoped */
  const __vue_scope_id__$2d = undefined;
  /* module identifier */
  const __vue_module_identifier__$2d = undefined;
  /* functional template */
  const __vue_is_functional_template__$2d = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2d = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2d, staticRenderFns: __vue_staticRenderFns__$2d },
    __vue_inject_styles__$2d,
    __vue_script__$2d,
    __vue_scope_id__$2d,
    __vue_is_functional_template__$2d,
    __vue_module_identifier__$2d,
    false,
    undefined,
    undefined,
    undefined
  );

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

var script$2c = {
  name: 'highlight',
  data() {
    return {};
  },
  props: {
    visiblea: false
  }
};

var __$_require_static_images_icons_books_green_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAACCAYAAADrTtSRAAAAAXNSR0IArs4c6QAAAGJJREFUKFNjVN5WksPE+F+XAQEe///PyAPnMv7/cMeztwNJHsxU2lqoy8zElDPU9P37z3iZUWFrqQQr0z8/mOP//2P8wMDIoIjwzL9Pd7z6pmN4elOeHDMrq8dQ0/fv379HAIOFVE1DkUsjAAAAAElFTkSuQmCC";

var __$_require_static_images_icons_books_yellow_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE8AAAAPCAYAAAClbJLqAAAAAXNSR0IArs4c6QAAAExJREFUWEft1LENACAMBDHYf+ggMUKudfprrFfuzJnjVgIX3srtR/D2dvCCHTx4RSC0fh68IBBSy4MXBEJqefCCQEgtD14QCKnlBbwHYtAs4xEgiVMAAAAASUVORK5CYII=";

/* script */
const __vue_script__$2c = script$2c;
var __vue_render__$2c = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "el-dialog",
    {
      staticClass: "header",
      attrs: {
        "append-to-body": "",
        title: "图例",
        width: "240px",
        height: "192px",
        visible: _vm.visiblea,
      },
      on: {
        "update:visible": function ($event) {
          _vm.visiblea = $event;
        },
      },
    },
    [
      _c("div", { staticClass: "legend" }, [
        _c("span", [_vm._v("笔记：")]),
        _vm._v(" "),
        _c("img", {
          attrs: {
            src: __$_require_static_images_icons_books_green_png__,
            alt: "",
          },
        }),
      ]),
      _vm._v(" "),
      _c("div", { staticClass: "legend" }, [
        _c("span", [_vm._v("高亮：")]),
        _vm._v(" "),
        _c("img", {
          attrs: {
            src: __$_require_static_images_icons_books_yellow_png__,
            alt: "",
          },
        }),
      ]),
      _vm._v(" "),
      _c("div", { staticClass: "legend" }, [
        _c("span", [_vm._v("授课资源：")]),
        _vm._v(" "),
        _c("p", {
          staticStyle: {
            width: "61px",
            height: "1px",
            border: "1px solid #f17f53",
          },
        }),
      ]),
    ]
  )
};
var __vue_staticRenderFns__$2c = [];
__vue_render__$2c._withStripped = true;

  /* style */
  const __vue_inject_styles__$2c = undefined;
  /* scoped */
  const __vue_scope_id__$2c = undefined;
  /* module identifier */
  const __vue_module_identifier__$2c = undefined;
  /* functional template */
  const __vue_is_functional_template__$2c = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2c = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2c, staticRenderFns: __vue_staticRenderFns__$2c },
    __vue_inject_styles__$2c,
    __vue_script__$2c,
    __vue_scope_id__$2c,
    __vue_is_functional_template__$2c,
    __vue_module_identifier__$2c,
    false,
    undefined,
    undefined,
    undefined
  );

//
//
//

var script$2b = {
  name: 'bookmark',
  data() {
    return {};
  },
  props: {
    visibleb: false
  },
  mounted() {}
};

/* script */
const __vue_script__$2b = script$2b;

/* template */
var __vue_render__$2b = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "el-dialog",
    {
      staticClass: "header",
      attrs: {
        "append-to-body": "",
        title: "书签设置",
        width: "500px",
        visible: _vm.visibleb,
      },
      on: {
        "update:visible": function ($event) {
          _vm.visibleb = $event;
        },
      },
    },
    [_vm._v(" ??? ")]
  )
};
var __vue_staticRenderFns__$2b = [];
__vue_render__$2b._withStripped = true;

  /* style */
  const __vue_inject_styles__$2b = undefined;
  /* scoped */
  const __vue_scope_id__$2b = undefined;
  /* module identifier */
  const __vue_module_identifier__$2b = undefined;
  /* functional template */
  const __vue_is_functional_template__$2b = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2b = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2b, staticRenderFns: __vue_staticRenderFns__$2b },
    __vue_inject_styles__$2b,
    __vue_script__$2b,
    __vue_scope_id__$2b,
    __vue_is_functional_template__$2b,
    __vue_module_identifier__$2b,
    false,
    undefined,
    undefined,
    undefined
  );

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

var script$2a = {
  name: 'DownloadFileUppop',
  props: {
    downloadFileLink: {
      type: String,
      default: ''
    },
    showToast: {
      type: Function,
      default: null
    }
  },
  data() {
    return {
      isShow: false,
      prompt: ''
    };
  },
  methods: {
    close() {
      setTimeout(() => {
        this.prompt = '';
      }, 700);
    },
    // async copyInputContent() {

    //   try {
    //     await navigator.clipboard.writeText(this.codeData)
    //     console.log('复制成功')
    //   } catch (error) {
    //     console.log('复制失败')
    //   }
    // }

    // /**
    //  * 提示语
    //  * type
    //  * @param {*}  warning : 提示
    //  * @param {*}  error : 错误
    //  * @param {*}  success : 成功
    //  */
    //  showToast(text, type) {
    //   this.showPrompt = true
    //   this.promptText = text
    //   this.toastType = type ? type : 'warning'
    //   setTimeout(() => {
    //     this.showPrompt = false
    //   }, 2000)
    // },

    /**
     * 复制文本
     * @param {*}  text : 复制的文本
     */
    copyInputContent() {
      let oInput = document.createElement('input');
      oInput.value = this.downloadFileLink;
      document.body.appendChild(oInput);
      oInput.select();
      document.execCommand('Copy');
      oInput.remove();
      // alert('复制成功,请到浏览器进行下载')
      this.showToast('复制成功', 'success');
      console.log('成功');
      this.isShow = false;
      this.$emit('CopySuccess');
    }
  },
  watch: {}
};

/* script */
const __vue_script__$2a = script$2a;

/* template */
var __vue_render__$2a = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "van-popup",
    {
      style: { borderRadius: "8px" },
      on: { close: _vm.close },
      model: {
        value: _vm.isShow,
        callback: function ($$v) {
          _vm.isShow = $$v;
        },
        expression: "isShow",
      },
    },
    [
      _c("div", { staticClass: "xml-download-file-uppop" }, [
        _c("div", { staticClass: "code-path" }, [
          _c("div", { staticClass: "download-file-link" }, [
            _vm._v("\n        " + _vm._s(_vm.downloadFileLink) + "\n      "),
          ]),
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "copy-btn", on: { click: _vm.copyInputContent } },
            [_vm._v("复制")]
          ),
        ]),
        _vm._v(" "),
        _c("p", { staticClass: "code-text" }, [
          _vm._v(
            "*" + _vm._s(_vm.prompt ? _vm.prompt : "请复制链接至浏览器下载")
          ),
        ]),
      ]),
    ]
  )
};
var __vue_staticRenderFns__$2a = [];
__vue_render__$2a._withStripped = true;

  /* style */
  const __vue_inject_styles__$2a = undefined;
  /* scoped */
  const __vue_scope_id__$2a = undefined;
  /* module identifier */
  const __vue_module_identifier__$2a = undefined;
  /* functional template */
  const __vue_is_functional_template__$2a = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2a = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2a, staticRenderFns: __vue_staticRenderFns__$2a },
    __vue_inject_styles__$2a,
    __vue_script__$2a,
    __vue_scope_id__$2a,
    __vue_is_functional_template__$2a,
    __vue_module_identifier__$2a,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$29 = {
  name: 'resource-list-phone',
  components: {
    VideoModalPlayer: __vue_component__$4u,
    audioPlayerPage: __vue_component__$2g,
    downFileUppop: __vue_component__$2a
  },
  props: {
    textBookResource: {
      type: Object,
      default: () => {}
    },
    resourcesList: {
      type: Array,
      default: () => []
    },
    userType: {
      // 用户类型，可选teacher、student
      type: String,
      default: 'teacher'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    showToast: {
      type: Function,
      default: null
    },
    isShowTeacherResource: {
      type: Boolean,
      default: false
    }
  },
  watch: {
    resourceType() {
      if (this.resourceType == 'teachingResource') {
        this.list = this.resourcesList || [];
      } else {
        this.list = this.textBookResource[this.resourceType] || [];
      }
    },
    resourcesList() {
      if (this.isShowTeacherResource) {
        this.list = this.resourcesList || [];
      }
    }
  },
  data() {
    return {
      toolbarList: [{
        name: '授课',
        type: 'teachingResource',
        default: 'icon_02',
        select: 'icon_up_02',
        total: 'teachingResourceTotal',
        icon: ''
      }, {
        name: '图片',
        type: 'imageList',
        default: 'icon_03',
        select: 'icon_up_03',
        total: 'imageTotal',
        icon: ''
      }, {
        name: '视频',
        type: 'videoList',
        default: 'icon_04',
        select: 'icon_up_04',
        total: 'videoTotal',
        icon: ''
      }, {
        name: '音频',
        type: 'audioList',
        default: 'icon_05',
        select: 'icon_up_05',
        total: 'audioTotal',
        icon: 'icon_01'
      }, {
        name: '公式',
        type: 'formulaList',
        default: 'icon_06',
        select: 'icon_up_06',
        total: 'formulaTotal',
        icon: 'icon_02'
      }, {
        name: '互动',
        type: 'interactionList',
        default: 'icon_07',
        select: 'icon_up_07',
        total: 'interactionTotal',
        icon: 'icon_03'
      }, {
        name: '试题',
        type: 'questionList',
        default: 'icon_08',
        select: 'icon_up_08',
        total: 'questionTotal',
        icon: 'icon_04'
      }, {
        name: '文件',
        type: 'resourceList',
        default: 'icon_09',
        select: 'icon_up_09',
        total: 'resourceTotal',
        icon: 'icon_05'
      }],
      current: 0,
      resourceType: 'teachingResource',
      list: this.resourcesList,
      collapseCurrent: 0,
      resourceIcon: '',
      audioData: {
        show: false,
        src: ''
      },
      videoData: {
        show: false,
        src: ''
      },
      downloadFileLink: '',
      showDown: false,
      audioUrl: '',
      isPlay: '',
      location: ''
    };
  },
  mounted() {
    if (!this.isShowTeacherResource) {
      this.resourceType = 'imageList';
      this.list = this.textBookResource[this.resourceType] || [];
      this.toolbarList.splice(0, 1);
    }
  },
  methods: {
    clickToolbar(index, item) {
      this.location = '';
      this.current = index;
      this.resourceType = item.type;
      this.resourceIcon = item.icon;
    },
    getFileUrl(url) {
      if (url && url.indexOf('./') !== -1) {
        return this.resourceBasisPath + url.split('./')[1];
      } else if (url && url.indexOf('./') === -1) {
        return url;
      }
    },
    // 跳转到资源所在位置
    resourceDetails(item, items) {
      this.location = '';
      // this.$emit('resourceDetails', items)
      if (items.resourcesType == 'recorded') {
        if (this.isPlay == '') {
          this.isPlay = items.id;
          this.audioUrl = items.fileUrl;
          this.$nextTick(() => {
            this.$refs.musicAudio.play();
          });
        } else {
          this.isPlay = '';
          this.$refs.musicAudio.pause();
        }
      } else {
        this.$emit('resourceDetails', items, 2);
      }
    },
    // 教师资源预览
    resourceReader(item, items) {
      console.log('🚀 ~ resourceReader ~ items:', items);
      if (items.resourcesType == 'image') {
        this.$xmlImgPreview({
          multiple: true,
          nowImgIndex: 0,
          imgList: [{
            url: items.fileUrl,
            title: items.resourcesName
          }]
        });
      } else if (items.resourcesType == 'audio') {
        this.audioData.src = items.fileUrl;
        this.audioData.show = true;
      } else if (items.resourcesType == 'recorded') {
        this.resourceDetails(item, items);
      } else if (items.resourcesType == 'video') {
        this.videoData.src = items.fileUrl;
        this.videoData.show = true;
      } else {
        this.$emit('resourceReader', items);
      }
      // this.$refs.xmlPopup.show = false
    },
    closeViewer() {
      this.videoData.show = false;
    },
    // 图片预览
    imgPreview(item, items) {
      this.$xmlImgPreview({
        multiple: true,
        nowImgIndex: 0,
        imgList: [{
          url: this.getFileUrl(items.uploadFileUrl),
          title: items.title
        }]
      });
    },
    // 音频预览
    audioPreview(item, items) {
      this.audioData.src = this.getFileUrl(items.uploadFileUrl);
      this.audioData.show = true;
      // this.$refs.xmlPopup.show = false
    },
    // 视频预览
    videoPreview(item, items) {
      this.videoData.src = this.getFileUrl(items.uploadFileUrl);
      this.videoData.show = true;
      // this.$refs.xmlPopup.show = false
    },
    close() {
      // this.$refs.xmlPopup.show = false
      this.$emit('close');
    },
    showResourceList(type) {
      if (type) {
        this.$refs.xmlPopup.show = !this.$refs.xmlPopup.show;
      } else {
        this.$refs.xmlPopup.show = false;
      }
    },
    removeStyle(e) {
      if (e) {
        e = e.replace(/<[^>]+>/g, ''); //去除所有标签，以纯文本展示
        e = e.replace(/\s/gi, ''); //去除空格
        e = e.replace(/&nbsp;/gi, ''); //去除空格
        return e;
      }
    },
    openTeacherResoucesList(e) {
      let index = this.list.findIndex(item => item.firstLevelId === e.firstLevelId);
      this.current = 0;
      this.resourceType = 'teachingResource';
      this.resourceIcon = '';
      this.collapseCurrent = index !== -1 ? index : 0;
      this.location = e.location;
      this.$refs.xmlPopup.show = true;
    },
    formatTime(time) {
      if (time) {
        let Seconds = time / 1000;
        let m = parseInt(Seconds / 60);
        let s = Seconds % 60;
        // let date = (m > 9 ? m : '0' + m) + "'" + (s > 9 ? s : '0' + s) +
        let date = (m > 0 ? m + "'" : '') + s + '"';
        return date + ' 录音';
      } else {
        return '录音';
      }
    }
  }
};

var __$_require_static_images_icons_resource_positioning_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAd4SURBVHgB7VrNbhNXFD5nZhyiJlCz6KYSxWwqdji7kNAyWcCim8IT1HkCYomAUBdxVilYVcITkKy6THZVxSKOmqRIXWCeAEc8QC2SSMbzc3uO7bHvjO/EnjsTSiW+hTUzvnPnfnPOPb8D8Bn/byB8JOTtSr7VupDn48nJD81mrdKEj4BzI8iEnA9TJTTgR3pIkS9FhjQFQF0IseX5Xq316kkDzgGZE8zbawWvba4D4r1ENwqx6fjeatZETcgQUzerSyCM34ncdUgKxKJpGEsTV+5C+93LPcgImUiQ1dF1prZpMnvoTyH20MCa8EVDGNjoPBQxLzyviIA2ndxW3LNjTuQWm7Vy6n2amiCT850vdgVgMfSHQFI5k1Su3Dj7/vWC57gVOvwJwgurGzlrIS3J1AQvzj3bDu03ASQpWDzZX65BAjBR33HpRUFhMJfYOT58dB9SwIAUmJ77dSVKzvGthaTkGCSpBkuM3nijf5Hmnrr5dAlSQFuCHWvpWK8hMP89cqNUcvS8Q5Jsmjnrmq6qWqAJzzEqIPs20y+3DuPJTc+u2WiYBT4Wvtc4efWkphrHkpy+VV1EAbu9S3m33WYpVkADWhKkt5wnw/AW+tLDzePDh4uqsew6DANWIOrohWj4AKunh482VfddnK8yQbt3qi1FrT3otR3ed/0FC8PZUo3jPUrk1mE4iuH9VTAQX0zPVVdU9wqEVek073SfmRh6RgaF3T+mvXeyP6xuZF1LiH4lcuOQBBChMn1rzY5eZ0NF6nUkXRr2l2NAi6AA48bgDGuqMbRwSTJEzPDvHx88vHx8sIyknqzOfbIoLLUUAWqD+SJ+dkxoEUTJV/nCexP9f2ruWZEcvzTGLx//+XgnOCfftikEPJdusSdn1wrReXwf6qpnJoGuHxzsKVSonY+hPcfZQnSM5buboXNrmICBoql8ZgKkcvRp4Bim1oKTQldFjwbHohD935q06qFz03oQHUPSCUUoljVZj44R8tzkVkADWo6e/Nc/RPJqdxF4Nfo/+yvyYzXo+TEau0RWNU8OfgvRyNNrJZNvDIJr8qMqH4fhAP4INKAXyVAKBD2rZqhSJAI55kUKBgahHGIJTas0PBKbnHUoH4N4dRCJGG9BA7oqOlAnctgqC8ghFzlrzgTOiD6w6QtTGb9yrNsrdXTgg6+VBGsRpGR0Rz63DKOkGsfOmiQ5Q4dbYSePTarFPHc8c+b0sFxX3UtlDzt07udqoAHtbEKOFckY1E8OHs2MuieQ9Dh1l+n56utAglycOjlYHjm/CvpuwsC+o2ZjoAq3omBiY5GbrdqyerK0QRPaBE3TrMEY4ZYO0PRL8rmuejK0CbJZj4Zb40hxFNi4RF1ImiQ6VSRjTVgbkLEUXcd6IZ/HuZBxkYqgSooXv3uqlbcxOimW7FdTSo+ROhaNShE8XOeMHxKi4/fkFKtT40knPUZqgp0QS4hy/wI5ftdxE6sq13hCKRaI1bTS6ywHMkKkhkLa5S6oMn3lvaSa9GIGe49CQcoZbcgAmaVLHHuCbHB884UqhIuiYzUR1wdXODbNlSAjZEaQY09Sh8GeIVXNmWGLGEW37G+y5Pt7lrP/LFQzgFZ3iRdmfnXn+tS337dajVoruP7h3ctXF67cKUrdpcLEN3fz1C36QzVP7usffqOxs8E5RyxURvwFMsTYe5ALtxSe3aMw43Y/jKIklALvGTmXYwtKlenXco/B9/3y6V+PN0LzUUkxVHUjq3l8uHwt+lyu71B5cbc7JHnD9EyCnbZYe+oBmW/OvpWmX2VMpEUNVA+wdHrwcCuOXFzZn4zXJkQ6T91boMZk4wrHAVCXWPcp8dZuyDLSNvWFWKA3YveKwcESmpw2xe27S/PVJSKzDvFrOLNCPkSQ376JsC37JHkx1FjY8wXWPOHujFKTS7eqFYp0ZJ/Iqhx+YVwvlUqKKlCvwiY9t2MbpgxqgdN2KUdLHyGCKtXq3bxH3dmKZVn1pP0BBUn54eX3B8sbkACdhmnbsakQvCIitVJV0zRE8NL8s7chyfWI6fT7QvMqSNIeXH2//7gCKdBtD4SJ0vEGJcf9yArlwfKeyWIBMmSSWc6t6gxT0HE5kGLf0Qspg2arliU5xvv95Qq3wBzPvZbl3BxgeEKE2tyu2+pzUUcyCPlxwiydxZzHBz+GLJzh/4IjlC1ZPmeYu+dBMmt0vs0JBerhdl7EyFQ3RdSpntMXSGnRiaxMayX6bQ752kXZJ4YI9lrT26CoVgeRw3l+VzYK3XDRuh0XgKiMlzKSOct3MTgmRCHqFEHsgePUT//+uQ4ZoxNNtS4UBVpFREGkyMnHRVVnfJuD8Q9Qf4EUB9Et53PFmtImcSSE0eT+Hn9REXdP8NUFRUZ5RK9AneMvuZPba3aOUfbAJpF/bljWRlwAMjKbCCIHkj+rxQ34z9EJF9+MG1klKllIZG3omuaPQLhHiDWELH3ScDFVTYaNkuu6ReEB7RM/3+vnkbohqRt+SYo7VnUtaKiSetfpp0ldKVJzpBQqvUHLrOgUB34JrVZLSfRTcz2f8SniXwP2q2L+oDicAAAAAElFTkSuQmCC";

/* script */
const __vue_script__$29 = script$29;
var __vue_render__$29 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    [
      _c(
        "xml-popup",
        {
          ref: "xmlPopup",
          on: {
            close: function ($event) {
              return _vm.close()
            },
          },
        },
        [
          _c("div", { staticClass: "xml-resource-list-phone" }, [
            _c("div", {
              staticClass: "xml-popup-mback",
              on: {
                click: function ($event) {
                  $event.stopPropagation();
                  _vm.$refs.xmlPopup.show = false;
                },
              },
            }),
            _vm._v(" "),
            _c("div", { staticClass: "xml-resource-list" }, [
              _c(
                "div",
                { staticClass: "xml-left-toolbar-phone" },
                [
                  _vm._l(_vm.toolbarList, function (item, index) {
                    return _c(
                      "div",
                      {
                        key: index,
                        staticClass: "toolbar-item",
                        class: index == _vm.current ? "current-toolbar" : "",
                        on: {
                          click: function ($event) {
                            $event.stopPropagation();
                            return _vm.clickToolbar(index, item)
                          },
                        },
                      },
                      [
                        _vm._v(
                          "\n            " +
                            _vm._s(item.name) +
                            "\n            "
                        ),
                        _c("span", [
                          _vm._v(
                            "(" +
                              _vm._s(
                                _vm.textBookResource[item.total]
                                  ? _vm.textBookResource[item.total]
                                  : "0"
                              ) +
                              ")"
                          ),
                        ]),
                      ]
                    )
                  }),
                  _vm._v(" "),
                  _c("div", {
                    staticClass: "select-toolbar",
                    style: { top: _vm.current * 14 + "vw" },
                  }),
                ],
                2
              ),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "xml-resource-content" },
                [
                  _vm.resourceType == "imageList"
                    ? _vm._l(_vm.list, function (item, index) {
                        return _c(
                          "xml-collapse",
                          {
                            key: index,
                            attrs: {
                              title: item.label,
                              name: index,
                              current: _vm.textBookResource["imageCurrent"],
                              className: "max-resource-content",
                            },
                            on: {
                              collapseClick: function (e) {
                                return (
                                  (_vm.textBookResource["imageCurrent"] = e),
                                  (item.state = true)
                                )
                              },
                            },
                          },
                          _vm._l(
                            item[_vm.resourceType],
                            function (items, index) {
                              return _c(
                                "div",
                                { staticClass: "max-resource-item" },
                                [
                                  _c(
                                    "div",
                                    {
                                      directives: [
                                        {
                                          name: "show",
                                          rawName: "v-show",
                                          value: items.isTrialExternal,
                                          expression: "items.isTrialExternal",
                                        },
                                      ],
                                      staticClass: "mask-layer-trial-external",
                                    },
                                    [
                                      _c("img", {
                                        attrs: {
                                          src: __$_require_static_images_icons_resource_lock_svg__,
                                          alt: "",
                                        },
                                      }),
                                    ]
                                  ),
                                  _vm._v(" "),
                                  _c(
                                    "div",
                                    {
                                      staticClass: "resource-cover",
                                      on: {
                                        click: function ($event) {
                                          $event.stopPropagation();
                                          return _vm.imgPreview(item, items)
                                        },
                                      },
                                    },
                                    [
                                      item.state
                                        ? _c("img", {
                                            attrs: {
                                              src: _vm.getFileUrl(
                                                items.uploadFileUrl
                                              ),
                                              alt: "",
                                            },
                                          })
                                        : _vm._e(),
                                    ]
                                  ),
                                  _vm._v(" "),
                                  _c("div", { staticClass: "item-bottom" }, [
                                    _c(
                                      "div",
                                      { staticClass: "resource-title" },
                                      [
                                        _vm._v(
                                          _vm._s(
                                            items.title
                                              ? items.title
                                              : item.label
                                          )
                                        ),
                                      ]
                                    ),
                                    _vm._v(" "),
                                    _c("img", {
                                      staticClass: "location",
                                      attrs: {
                                        src: __$_require_static_images_icons_resource_positioning_png__,
                                        alt: "",
                                      },
                                      on: {
                                        click: function ($event) {
                                          $event.stopPropagation();
                                          return _vm.resourceDetails(
                                            item,
                                            items
                                          )
                                        },
                                      },
                                    }),
                                  ]),
                                ]
                              )
                            }
                          ),
                          0
                        )
                      })
                    : _vm.resourceType == "videoList"
                    ? _vm._l(_vm.list, function (item, index) {
                        return _c(
                          "xml-collapse",
                          {
                            key: index,
                            attrs: {
                              title: item.label,
                              name: index,
                              current: _vm.textBookResource["videoCurrent"],
                              className: "max-resource-content",
                            },
                            on: {
                              collapseClick: function (e) {
                                return (
                                  (_vm.textBookResource["videoCurrent"] = e),
                                  (item.state = true)
                                )
                              },
                            },
                          },
                          _vm._l(
                            item[_vm.resourceType],
                            function (items, index) {
                              return _c(
                                "div",
                                { staticClass: "max-resource-item" },
                                [
                                  _c(
                                    "div",
                                    {
                                      directives: [
                                        {
                                          name: "show",
                                          rawName: "v-show",
                                          value: items.isTrialExternal,
                                          expression: "items.isTrialExternal",
                                        },
                                      ],
                                      staticClass: "mask-layer-trial-external",
                                    },
                                    [
                                      _c("img", {
                                        attrs: {
                                          src: __$_require_static_images_icons_resource_lock_svg__,
                                          alt: "",
                                        },
                                      }),
                                    ]
                                  ),
                                  _vm._v(" "),
                                  _c(
                                    "div",
                                    {
                                      staticClass: "resource-cover",
                                      on: {
                                        click: function ($event) {
                                          $event.stopPropagation();
                                          return _vm.videoPreview(item, items)
                                        },
                                      },
                                    },
                                    [
                                      item.state && items.coverFileUrl
                                        ? _c("img", {
                                            attrs: {
                                              src: _vm.getFileUrl(
                                                items.coverFileUrl
                                              ),
                                              alt: "",
                                            },
                                          })
                                        : _vm._e(),
                                      _vm._v(" "),
                                      !items.coverFileUrl
                                        ? _c("img", {
                                            attrs: {
                                              src: __$_require_static_images_default_over_video_cover_png__,
                                              alt: "",
                                            },
                                          })
                                        : _vm._e(),
                                    ]
                                  ),
                                  _vm._v(" "),
                                  _c("div", { staticClass: "item-bottom" }, [
                                    _c(
                                      "div",
                                      { staticClass: "resource-title" },
                                      [_vm._v(_vm._s(items.title))]
                                    ),
                                    _vm._v(" "),
                                    _c("img", {
                                      staticClass: "location",
                                      attrs: {
                                        src: __$_require_static_images_icons_resource_positioning_png__,
                                        alt: "",
                                      },
                                      on: {
                                        click: function ($event) {
                                          $event.stopPropagation();
                                          return _vm.resourceDetails(
                                            item,
                                            items
                                          )
                                        },
                                      },
                                    }),
                                  ]),
                                ]
                              )
                            }
                          ),
                          0
                        )
                      })
                    : _vm.resourceType == "audioList"
                    ? _vm._l(_vm.list, function (item, index) {
                        return _c(
                          "xml-collapse",
                          {
                            key: index,
                            attrs: {
                              title: item.label,
                              name: index,
                              current: _vm.textBookResource["audioCurrent"],
                            },
                            on: {
                              collapseClick: function (e) {
                                return (
                                  (_vm.textBookResource["audioCurrent"] = e),
                                  (item.state = true)
                                )
                              },
                            },
                          },
                          _vm._l(
                            item[_vm.resourceType],
                            function (items, index) {
                              return _c(
                                "div",
                                { staticClass: "resource-item" },
                                [
                                  _c(
                                    "div",
                                    {
                                      directives: [
                                        {
                                          name: "show",
                                          rawName: "v-show",
                                          value: items.isTrialExternal,
                                          expression: "items.isTrialExternal",
                                        },
                                      ],
                                      staticClass:
                                        "mask-layer-trial-external min-mask-layer",
                                    },
                                    [
                                      _c("img", {
                                        attrs: {
                                          src: __$_require_static_images_icons_resource_lock_svg__,
                                          alt: "",
                                        },
                                      }),
                                    ]
                                  ),
                                  _vm._v(" "),
                                  _c("div", {
                                    staticClass: "resource-icon",
                                    class: _vm.resourceIcon,
                                  }),
                                  _vm._v(" "),
                                  _c(
                                    "div",
                                    {
                                      staticClass: "resource-title",
                                      on: {
                                        click: function ($event) {
                                          $event.stopPropagation();
                                          return _vm.audioPreview(item, items)
                                        },
                                      },
                                    },
                                    [_vm._v(_vm._s(items.title))]
                                  ),
                                  _vm._v(" "),
                                  _c("img", {
                                    staticClass: "location",
                                    attrs: {
                                      src: __$_require_static_images_icons_resource_positioning_png__,
                                      alt: "",
                                    },
                                    on: {
                                      click: function ($event) {
                                        $event.stopPropagation();
                                        return _vm.resourceDetails(item, items)
                                      },
                                    },
                                  }),
                                ]
                              )
                            }
                          ),
                          0
                        )
                      })
                    : _vm.resourceType == "questionList"
                    ? _vm._l(_vm.list, function (item, index) {
                        return _c(
                          "xml-collapse",
                          {
                            key: index,
                            attrs: {
                              title: item.label,
                              name: index,
                              current: _vm.textBookResource["questionCurrent"],
                            },
                            on: {
                              collapseClick: function (e) {
                                return (
                                  (_vm.textBookResource["questionCurrent"] = e),
                                  (item.state = true)
                                )
                              },
                            },
                          },
                          _vm._l(
                            item[_vm.resourceType],
                            function (items, index) {
                              return _c(
                                "div",
                                { staticClass: "resource-item" },
                                [
                                  _c(
                                    "div",
                                    {
                                      directives: [
                                        {
                                          name: "show",
                                          rawName: "v-show",
                                          value: items.isTrialExternal,
                                          expression: "items.isTrialExternal",
                                        },
                                      ],
                                      staticClass:
                                        "mask-layer-trial-external min-mask-layer",
                                    },
                                    [
                                      _c("img", {
                                        attrs: {
                                          src: __$_require_static_images_icons_resource_lock_svg__,
                                          alt: "",
                                        },
                                      }),
                                    ]
                                  ),
                                  _vm._v(" "),
                                  _c("div", {
                                    staticClass: "resource-icon",
                                    class: _vm.resourceIcon,
                                  }),
                                  _vm._v(" "),
                                  _c("div", { staticClass: "resource-title" }, [
                                    _vm._v(
                                      _vm._s(
                                        _vm.removeStyle(items.stem.content)
                                      )
                                    ),
                                  ]),
                                  _vm._v(" "),
                                  _c("img", {
                                    staticClass: "location",
                                    attrs: {
                                      src: __$_require_static_images_icons_resource_positioning_png__,
                                      alt: "",
                                    },
                                    on: {
                                      click: function ($event) {
                                        $event.stopPropagation();
                                        return _vm.resourceDetails(item, items)
                                      },
                                    },
                                  }),
                                ]
                              )
                            }
                          ),
                          0
                        )
                      })
                    : _vm.resourceType == "formulaList"
                    ? _vm._l(_vm.list, function (item, index) {
                        return _c(
                          "xml-collapse",
                          {
                            key: index,
                            attrs: {
                              title: item.label,
                              name: index,
                              current: _vm.textBookResource["formulaCurrent"],
                            },
                            on: {
                              collapseClick: function (e) {
                                return (
                                  (_vm.textBookResource["formulaCurrent"] = e),
                                  (item.state = true)
                                )
                              },
                            },
                          },
                          _vm._l(
                            item[_vm.resourceType],
                            function (items, index) {
                              return _c(
                                "div",
                                { staticClass: "resource-item flex-column" },
                                [
                                  _c(
                                    "div",
                                    {
                                      directives: [
                                        {
                                          name: "show",
                                          rawName: "v-show",
                                          value: items.isTrialExternal,
                                          expression: "items.isTrialExternal",
                                        },
                                      ],
                                      staticClass: "mask-layer-trial-external",
                                    },
                                    [
                                      _c("img", {
                                        attrs: {
                                          src: __$_require_static_images_icons_resource_lock_svg__,
                                          alt: "",
                                        },
                                      }),
                                    ]
                                  ),
                                  _vm._v(" "),
                                  _c(
                                    "div",
                                    { staticClass: "resource-title-box" },
                                    [
                                      _c("div", {
                                        staticClass: "resource-icon",
                                        class: _vm.resourceIcon,
                                      }),
                                      _vm._v(" "),
                                      _c(
                                        "div",
                                        { staticClass: "resource-title" },
                                        [_vm._v(_vm._s(items.fileNames))]
                                      ),
                                      _vm._v(" "),
                                      _c("img", {
                                        staticClass: "location",
                                        attrs: {
                                          src: __$_require_static_images_icons_resource_positioning_png__,
                                          alt: "",
                                        },
                                        on: {
                                          click: function ($event) {
                                            $event.stopPropagation();
                                            return _vm.resourceDetails(
                                              item,
                                              items
                                            )
                                          },
                                        },
                                      }),
                                    ]
                                  ),
                                  _vm._v(" "),
                                  _c("iframe", {
                                    attrs: {
                                      width: "100%",
                                      height: "120px",
                                      src: _vm.getFileUrl(items.file),
                                      frameborder: "0",
                                    },
                                  }),
                                ]
                              )
                            }
                          ),
                          0
                        )
                      })
                    : _vm.resourceType == "interactionList"
                    ? _vm._l(_vm.list, function (item, index) {
                        return _c(
                          "xml-collapse",
                          {
                            key: index,
                            attrs: {
                              title: item.label,
                              name: index,
                              current:
                                _vm.textBookResource["interactionCurrent"],
                            },
                            on: {
                              collapseClick: function (e) {
                                return (
                                  (_vm.textBookResource["interactionCurrent"] =
                                    e),
                                  (item.state = true)
                                )
                              },
                            },
                          },
                          _vm._l(
                            item[_vm.resourceType],
                            function (items, index) {
                              return _c(
                                "div",
                                { staticClass: "resource-item" },
                                [
                                  _c(
                                    "div",
                                    {
                                      directives: [
                                        {
                                          name: "show",
                                          rawName: "v-show",
                                          value: items.isTrialExternal,
                                          expression: "items.isTrialExternal",
                                        },
                                      ],
                                      staticClass:
                                        "mask-layer-trial-external min-mask-layer",
                                    },
                                    [
                                      _c("img", {
                                        attrs: {
                                          src: __$_require_static_images_icons_resource_lock_svg__,
                                          alt: "",
                                        },
                                      }),
                                    ]
                                  ),
                                  _vm._v(" "),
                                  _c("div", {
                                    staticClass: "resource-icon",
                                    class: _vm.resourceIcon,
                                  }),
                                  _vm._v(" "),
                                  _c("div", { staticClass: "resource-title" }, [
                                    _vm._v(_vm._s(items.fileNames)),
                                  ]),
                                  _vm._v(" "),
                                  _c("img", {
                                    staticClass: "location",
                                    attrs: {
                                      src: __$_require_static_images_icons_resource_positioning_png__,
                                      alt: "",
                                    },
                                    on: {
                                      click: function ($event) {
                                        $event.stopPropagation();
                                        return _vm.resourceDetails(item, items)
                                      },
                                    },
                                  }),
                                ]
                              )
                            }
                          ),
                          0
                        )
                      })
                    : _vm.resourceType == "resourceList"
                    ? _vm._l(_vm.list, function (item, index) {
                        return _c(
                          "xml-collapse",
                          {
                            key: index,
                            attrs: {
                              title: item.label,
                              name: index,
                              current: _vm.textBookResource["imageCurrent"],
                            },
                            on: {
                              collapseClick: function (e) {
                                return (
                                  (_vm.textBookResource["imageCurrent"] = e),
                                  (item.state = true)
                                )
                              },
                            },
                          },
                          _vm._l(
                            item[_vm.resourceType],
                            function (items, index) {
                              return _c(
                                "div",
                                { staticClass: "resource-item" },
                                [
                                  _c(
                                    "div",
                                    {
                                      directives: [
                                        {
                                          name: "show",
                                          rawName: "v-show",
                                          value: items.isTrialExternal,
                                          expression: "items.isTrialExternal",
                                        },
                                      ],
                                      staticClass:
                                        "mask-layer-trial-external min-mask-layer",
                                    },
                                    [
                                      _c("img", {
                                        attrs: {
                                          src: __$_require_static_images_icons_resource_lock_svg__,
                                          alt: "",
                                        },
                                      }),
                                    ]
                                  ),
                                  _vm._v(" "),
                                  _c("div", {
                                    staticClass: "resource-icon",
                                    class: _vm.resourceIcon,
                                  }),
                                  _vm._v(" "),
                                  _c("div", { staticClass: "resource-title" }, [
                                    _vm._v(_vm._s(items.title)),
                                  ]),
                                  _vm._v(" "),
                                  _c("img", {
                                    staticClass: "location",
                                    attrs: {
                                      src: __$_require_static_images_icons_resource_positioning_png__,
                                      alt: "",
                                    },
                                    on: {
                                      click: function ($event) {
                                        $event.stopPropagation();
                                        return _vm.resourceDetails(item, items)
                                      },
                                    },
                                  }),
                                ]
                              )
                            }
                          ),
                          0
                        )
                      })
                    : _vm.resourceType == "teachingResource"
                    ? _vm._l(_vm.list, function (item, index) {
                        return _c(
                          "xml-collapse",
                          {
                            key: index,
                            attrs: {
                              title: item.firstLevelLabel,
                              name: index,
                              current: _vm.collapseCurrent,
                            },
                            on: {
                              collapseClick: function (e) {
                                return (
                                  (_vm.collapseCurrent = e), (item.state = true)
                                )
                              },
                            },
                          },
                          _vm._l(item.list, function (items, index) {
                            return _c(
                              "div",
                              {
                                key: index,
                                class: [
                                  items.location == _vm.location
                                    ? "current-teacher-resources"
                                    : "",
                                  items.resourcesType == "notes"
                                    ? "xml-teacher-note-box"
                                    : "",
                                ],
                              },
                              [
                                items.resourcesType == "notes"
                                  ? [
                                      _c(
                                        "div",
                                        { staticClass: "xml-teacher-note" },
                                        [
                                          _c(
                                            "div",
                                            { staticClass: "xml-note-header" },
                                            [
                                              _c("img", {
                                                staticClass: "note-icon",
                                                attrs: {
                                                  src: __$_require_static_images_icons_resource_note_icon_svg__,
                                                  alt: "",
                                                },
                                              }),
                                              _vm._v(" "),
                                              _c("img", {
                                                staticClass: "location",
                                                attrs: {
                                                  src: __$_require_static_images_icons_resource_positioning_png__,
                                                  alt: "",
                                                },
                                                on: {
                                                  click: function ($event) {
                                                    $event.stopPropagation();
                                                    return _vm.resourceDetails(
                                                      item,
                                                      items
                                                    )
                                                  },
                                                },
                                              }),
                                            ]
                                          ),
                                          _vm._v(" "),
                                          _c(
                                            "div",
                                            { staticClass: "note-content" },
                                            [
                                              _c("xmlTextOverflow", {
                                                attrs: {
                                                  info: items.noteContent,
                                                },
                                              }),
                                            ],
                                            1
                                          ),
                                        ]
                                      ),
                                    ]
                                  : [
                                      _c(
                                        "div",
                                        { staticClass: "resource-item" },
                                        [
                                          _c("div", {
                                            staticClass: "resource-icon",
                                            class: [
                                              items.resourcesType == "recorded"
                                                ? "recorded"
                                                : items.fileExt
                                                ? items.fileExt.replace(
                                                    /\./gi,
                                                    ""
                                                  )
                                                : "",
                                              _vm.isPlay == items.id
                                                ? "isPlay"
                                                : "",
                                            ],
                                            attrs: { userType: _vm.userType },
                                          }),
                                          _vm._v(" "),
                                          _c(
                                            "div",
                                            {
                                              staticClass: "resource-title",
                                              on: {
                                                click: function ($event) {
                                                  return _vm.resourceReader(
                                                    item,
                                                    items
                                                  )
                                                },
                                              },
                                            },
                                            [
                                              _vm._v(
                                                "\n                      " +
                                                  _vm._s(
                                                    items.resourcesType ==
                                                      "recorded"
                                                      ? _vm.formatTime(
                                                          items.duration
                                                        )
                                                      : items.resourcesName
                                                  ) +
                                                  "\n                    "
                                              ),
                                            ]
                                          ),
                                          _vm._v(" "),
                                          _c("img", {
                                            directives: [
                                              {
                                                name: "show",
                                                rawName: "v-show",
                                                value: items.isDownload == 1,
                                                expression:
                                                  "items.isDownload == 1",
                                              },
                                            ],
                                            staticClass: "location",
                                            attrs: {
                                              src: __$_require_static_images_icons_resource_download_icon_png__,
                                              alt: "",
                                            },
                                            on: {
                                              click: function ($event) {
                                                $event.stopPropagation()
                                                ;(_vm.downloadFileLink =
                                                  items.fileUrl),
                                                  (_vm.$refs.downFileUppop.isShow = true);
                                              },
                                            },
                                          }),
                                          _vm._v(" "),
                                          _c("img", {
                                            staticClass: "location",
                                            attrs: {
                                              src: __$_require_static_images_icons_resource_positioning_png__,
                                              alt: "",
                                            },
                                            on: {
                                              click: function ($event) {
                                                $event.stopPropagation();
                                                return _vm.resourceDetails(
                                                  item,
                                                  items
                                                )
                                              },
                                            },
                                          }),
                                        ]
                                      ),
                                    ],
                              ],
                              2
                            )
                          }),
                          0
                        )
                      })
                    : _vm._e(),
                  _vm._v(" "),
                  _c("xml-empty", {
                    directives: [
                      {
                        name: "show",
                        rawName: "v-show",
                        value: _vm.list.length == 0,
                        expression: "list.length == 0",
                      },
                    ],
                  }),
                ],
                2
              ),
            ]),
          ]),
        ]
      ),
      _vm._v(" "),
      _vm.audioData.show
        ? _c("audio-player-page", {
            attrs: { url: _vm.audioData.src },
            on: {
              back: function ($event) {
                _vm.audioData.show = false;
              },
            },
          })
        : _vm._e(),
      _vm._v(" "),
      _vm.videoData.show
        ? _c("div", { staticClass: "video-resource-player" }, [
            _c("i", {
              staticClass: "el-icon-back",
              attrs: { "on-close": _vm.closeViewer },
              on: {
                click: function ($event) {
                  $event.stopPropagation();
                  _vm.videoData.show = false;
                },
              },
            }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "video-content" },
              [_c("video-modal-player", { attrs: { src: _vm.videoData.src } })],
              1
            ),
          ])
        : _vm._e(),
      _vm._v(" "),
      _c("down-file-uppop", {
        ref: "downFileUppop",
        attrs: {
          downloadFileLink: _vm.downloadFileLink,
          showToast: _vm.showToast,
        },
      }),
      _vm._v(" "),
      _c("audio", {
        ref: "musicAudio",
        staticClass: "audio-component",
        attrs: { controls: "", preload: "auto", src: _vm.audioUrl },
        on: {
          ended: function ($event) {
            _vm.isPlay = "";
          },
        },
      }),
    ],
    1
  )
};
var __vue_staticRenderFns__$29 = [];
__vue_render__$29._withStripped = true;

  /* style */
  const __vue_inject_styles__$29 = undefined;
  /* scoped */
  const __vue_scope_id__$29 = undefined;
  /* module identifier */
  const __vue_module_identifier__$29 = undefined;
  /* functional template */
  const __vue_is_functional_template__$29 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$29 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$29, staticRenderFns: __vue_staticRenderFns__$29 },
    __vue_inject_styles__$29,
    __vue_script__$29,
    __vue_scope_id__$29,
    __vue_is_functional_template__$29,
    __vue_module_identifier__$29,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$28 = {
  name: 'xmlPreviewSearch',
  props: {
    viewList: Object,
    componentList: Array,
    title: String,
    pageType: {
      type: String,
      default: 'h5'
    },
    searchValue: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      urlPre: '../assets/images/icons/',
      list: [],
      input: '',
      ArrList: [],
      searchTextShow: true,
      showEllipsisButton: false,
      contentExpand: false,
      show: true,
      collapseCurrent: 0
    };
  },
  watch: {
    // 监听输入框
    // 监听input的值，当值改变时，调用changeInput方法
    input(a, b) {
      if (a.replace(/\s+/g, '') != b.replace(/\s+/g, '')) {
        this.changeInput();
        this.contentExpand = false;
      }
    },
    searchValue: {
      handler(newValue) {
        this.input = newValue;
      }
    }
  },
  computed: {
    searchList() {
      let list = this.list;
      const map = [];
      list.forEach(e => {
        if (e.type == 'note__teacher') {
          this.teacherNoteList.push(e);
        }
        const findObj = map.find(innerTmp => innerTmp.firstLevelId === e.firstLevelId);
        if (findObj) {
          findObj.list.push(e);
        } else {
          map.push({
            firstLevelId: e.firstLevelId,
            firstLevelLabel: e.firstLevelLabel,
            chapterOrderNum: e.chapterOrderNum,
            list: [e]
          });
        }
      });
      return map;
    }
  },
  methods: {
    changeInput() {
      if (this.input.replace(/\s+/g, '') !== '') {
        this.list = XmlSearchWord(this.componentList, this.input.replace(/\s+/g, ''));
        if (this.list.length > 0) {
          this.showEllipsisButton = true;
        }
      } else {
        this.list = [];
        console.log('输入为空');
      }
    },
    stopPropagation(event) {
      event.stopPropagation();
    },
    seachItem(e) {
      e.inputText = this.input.replace(/\s+/g, '');
      this.$emit('seachItem', e, this.input, this.show);
    },
    onBackClick() {
      this.$emit('onBackClick');
    },
    brightenKeyword(val) {
      const keyword = this.input.replace(/\s+/g, '');
      const Reg = new RegExp(keyword, 'g');
      let res = '';
      if (val) {
        res = val.replace(Reg, `<span style="color: red;">${keyword}</span>`);
        return res;
      }
    },
    // 展开下拉
    toggleSearchText(id) {
      this.contentExpand = !this.contentExpand;
      this.searchTextShow = !this.searchTextShow;
    }
  }
};

/* script */
const __vue_script__$28 = script$28;
var __vue_render__$28 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { class: "xmlPreviewSearch-box-" + _vm.pageType }, [
    _vm.pageType == "h5"
      ? _c("div", { staticClass: "xmlPreviewSearch-input" }, [
          _c("input", {
            directives: [
              {
                name: "model",
                rawName: "v-model",
                value: _vm.input,
                expression: "input",
              },
            ],
            staticClass: "input",
            attrs: { maxlength: "20", placeholder: "请输入" },
            domProps: { value: _vm.input },
            on: {
              change: _vm.changeInput,
              input: function ($event) {
                if ($event.target.composing) {
                  return
                }
                _vm.input = $event.target.value;
              },
            },
          }),
          _vm._v(" "),
          _c(
            "button",
            {
              staticClass: "input_text",
              on: {
                click: function ($event) {
                  return _vm.changeInput()
                },
              },
            },
            [
              _c(
                "span",
                {
                  staticStyle: {
                    color: "#fff",
                    "font-size": "14px",
                    "font-weight": "normal",
                  },
                },
                [_vm._v("搜索")]
              ),
            ]
          ),
        ])
      : _vm._e(),
    _vm._v(" "),
    _vm.pageType == "pc"
      ? _c("div", { class: "xmlPreviewSearch-input-" + _vm.pageType }, [
          _c(
            "div",
            {
              staticStyle: { "font-size": "16px", cursor: "pointer" },
              on: { click: _vm.onBackClick },
            },
            [
              _c("i", {
                staticClass: "el-icon-arrow-left",
                staticStyle: { "font-size": "16px" },
              }),
              _vm._v("返回\n    "),
            ]
          ),
        ])
      : _vm._e(),
    _vm._v(" "),
    _c(
      "div",
      { staticClass: "seach-list", on: { click: _vm.stopPropagation } },
      [
        _vm._l(_vm.searchList, function (item, index) {
          return _c(
            "xml-collapse",
            {
              key: index,
              attrs: {
                title: item.firstLevelLabel,
                name: index,
                current: _vm.collapseCurrent,
              },
              on: {
                collapseClick: function (e) {
                  return (_vm.collapseCurrent = e)
                },
              },
            },
            _vm._l(item.list, function (items, index) {
              return _c(
                "div",
                {
                  staticClass: "resource-item",
                  on: {
                    click: function ($event) {
                      return _vm.seachItem(items)
                    },
                  },
                },
                [
                  _c("div", {
                    staticClass: "seach-text",
                    domProps: {
                      innerHTML: _vm._s(
                        _vm.brightenKeyword(items.searchText, _vm.input)
                      ),
                    },
                  }),
                ]
              )
            }),
            0
          )
        }),
        _vm._v(" "),
        _c(
          "div",
          {
            directives: [
              {
                name: "show",
                rawName: "v-show",
                value: _vm.list.length == 0 && _vm.input == "",
                expression: "list.length == 0 && input == ''",
              },
            ],
            staticClass: "seach_zaiwu",
          },
          [
            _c("div", { staticClass: "search_left_img" }, [
              _c("img", {
                attrs: { src: __$_require_assets_images_icons_without_png__ },
              }),
            ]),
          ]
        ),
        _vm._v(" "),
        _c(
          "p",
          {
            directives: [
              {
                name: "show",
                rawName: "v-show",
                value: _vm.input !== "" && _vm.list.length == 0,
                expression: "input !== '' && list.length == 0",
              },
            ],
            staticClass: "search_no_data",
            staticStyle: {
              margin: "0",
              "text-align": "center",
              "line-height": "14",
              color: "#666666",
              "font-size": "24px",
              "font-weight": "100",
            },
          },
          [_vm._v("\n      搜索无结果\n    ")]
        ),
      ],
      2
    ),
  ])
};
var __vue_staticRenderFns__$28 = [];
__vue_render__$28._withStripped = true;

  /* style */
  const __vue_inject_styles__$28 = undefined;
  /* scoped */
  const __vue_scope_id__$28 = "data-v-31f61696";
  /* module identifier */
  const __vue_module_identifier__$28 = undefined;
  /* functional template */
  const __vue_is_functional_template__$28 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$28 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$28, staticRenderFns: __vue_staticRenderFns__$28 },
    __vue_inject_styles__$28,
    __vue_script__$28,
    __vue_scope_id__$28,
    __vue_is_functional_template__$28,
    __vue_module_identifier__$28,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$27 = {
  name: 'xml-toolbar-phone',
  components: {
    resourceListPhone: __vue_component__$29,
    searchPhone: __vue_component__$28
  },
  props: {
    pageType: {
      type: String,
      default: 'h5'
    },
    textBookName: {
      type: String,
      default: ''
    },
    textBookResource: {
      type: Object,
      default: () => {}
    },
    resourcesList: {
      type: Array,
      default: () => []
    },
    catalogList: {
      type: Array,
      default: () => []
    },
    userType: {
      // 用户类型，可选teacher、student
      type: String,
      default: ''
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    componentList: {
      type: Array,
      default: () => []
    },
    schedule: {
      type: String,
      default: '0'
    },
    location: {
      type: String,
      default: ''
    },
    showToast: {
      type: Function,
      default: null
    },
    notesList: {
      type: Array,
      default: () => []
    },
    //笔记列表
    bookmarkList: {
      type: Array,
      default: () => []
    },
    //书签列表
    highlightList: {
      //高亮列表
      type: Array,
      default: () => []
    },
    title: {
      type: String,
      default: ''
    },
    checkedId: {
      //当前选中视频
      type: String,
      default: ''
    },
    isShowTeacherResource: {
      type: Boolean,
      default: false
    },
    settingData: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      activeNames: ['1'],
      curnotetabs: 0,
      noteTabbarList: [{
        name: '笔记'
      }, {
        name: '书签'
      }, {
        name: '高亮'
      }],
      toolbarList: [{
        name: '目录',
        default: 'icon_10',
        select: 'icon_up_10'
      }, {
        name: '记录',
        default: 'icon_11',
        select: 'icon_up_11'
      }, {
        name: '资源',
        default: 'icon_12',
        select: 'icon_up_12'
      }, {
        name: '设置',
        default: 'icon_13',
        select: 'icon_up_13'
      }],
      current: -1,
      defaultProps: {
        children: 'children',
        label: 'label'
      },
      form: {
        themeFontFamily: '',
        //字体
        themeFontSize: 2,
        //字号
        themeBgColor: '',
        //当前颜色
        themeLineHeight: undefined,
        //行间距
        themeLetterSpacing: undefined //字间距
      },
      fontSizeLabelMap,
      options: [{
        value: '',
        label: '默认'
      }, {
        value: '宋体, SimSun',
        label: '宋体'
      }, {
        value: '楷体, 楷体_GB2312, SimKai',
        label: '楷体'
      }, {
        value: '黑体, SimHei',
        label: '黑体'
      }],
      RowOptions: [{
        value: '10',
        label: '10'
      }, {
        value: '20',
        label: '20'
      }, {
        value: '30',
        label: '30'
      }],
      WordOptions: [{
        value: '10',
        label: '10'
      }, {
        value: '20',
        label: '20'
      }, {
        value: '30',
        label: '30'
      }],
      colorList: [{
        colorval: '#EFEFEF'
      }, {
        colorval: '#DDD8C5'
      }, {
        colorval: '#F2DCC4'
      }, {
        colorval: '#E6F7E5'
      }, {
        colorval: '#FBDEE2'
      }, {
        colorval: '#000000'
      }],
      selectId: '',
      isShowSearch: false,
      isShowToolbar: true,
      innerHeight: window.innerHeight,
      noteNames: '',
      bookmarkNames: '',
      highlightNames: ''
    };
  },
  watch: {
    settingData: {
      handler(newValue) {
        this.form = {
          ...this.form,
          ...newValue
        };
      },
      immediate: true,
      deep: true
    },
    notesList: {
      handler(newValue) {
        this.noteNames = newValue[0]?.firstLevelId;
      },
      immediate: true,
      deep: true
    },
    bookmarkList: {
      handler(newValue) {
        this.bookmarkNames = newValue[0]?.firstLevelId;
      },
      immediate: true,
      deep: true
    },
    highlightList: {
      handler(newValue) {
        this.highlightNames = newValue[0]?.firstLevelId;
      },
      immediate: true,
      deep: true
    }
  },
  mounted() {
    // console.log('this.notesList[0]111111', this.notesList[0])
    // this.noteNames = this.notesList[0]?.firstLevelId
    // this.noteNames = this.notesList[0]?.firstLevelId
    // this.noteNames = this.notesList[0]?.firstLevelId
  },
  methods: {
    //
    clickToolbar(e) {
      if (this.current != e) {
        setTimeout(() => {
          this.current = e;
        }, 100);
      } else {
        this.current = -1;
      }
      if (e == 0) {
        this.$refs.catalogPopup.show = !this.$refs.catalogPopup.show;
        console.log(this.checkedId);
        this.selectId = this.checkedId;
        this.$refs.setPopup.show = false;
        this.$refs.notePpoup.show = false;
        this.$refs.resourceListPopup.showResourceList(false);
      } else if (e == 1) {
        this.$refs.notePpoup.show = !this.$refs.notePpoup.show;
        this.$refs.setPopup.show = false;
        this.$refs.catalogPopup.show = false;
        this.$refs.resourceListPopup.showResourceList(false);
      } else if (e == 3) {
        this.$refs.setPopup.show = !this.$refs.setPopup.show;
        this.$refs.catalogPopup.show = false;
        this.$refs.notePpoup.show = false;
        this.$refs.resourceListPopup.showResourceList(false);
      } else {
        this.$refs.setPopup.show = false;
        this.$refs.catalogPopup.show = false;
        this.$refs.notePpoup.show = false;
        this.$refs.resourceListPopup.showResourceList(true);
      }
      this.$refs.searchPopShow.show = false;
      this.$emit('clickToolbarPhone', this.toolbarList[e]);
    },
    // 设置字体
    setThemeFontFamily(value) {
      this.form.themeFontFamily = value;
      this.$emit('settingChange', 'themeFontFamily', value);
    },
    // 设置字号
    setThemeFontSize(type) {
      let emit = false;
      switch (type) {
        case 'plus':
          if (this.form.themeFontSize < 3) {
            this.form.themeFontSize++;
            emit = true;
          }
          break;
        case 'minus':
          if (this.form.themeFontSize > 1) {
            this.form.themeFontSize--;
            emit = true;
          }
          break;
      }
      emit && this.$emit('settingChange', 'themeFontSize', this.form.themeFontSize);
    },
    // 选择颜色
    setThemeBgColor(color) {
      if (color === this.form.themeBgColor) {
        color = '';
      }
      this.form.themeBgColor = color;
      this.$emit('settingChange', 'themeBgColor', color);
    },
    setThemeLineHeight(value) {
      this.form.themeLineHeight = value;
      this.$emit('settingChange', 'themeLineHeight', value);
    },
    setThemeLetterSpacing(value) {
      this.form.themeLetterSpacing = value;
      this.$emit('settingChange', 'themeLetterSpacing', value);
    },
    //笔记点击标签
    clicknotetab(e) {
      this.curnotetabs = e;
    },
    //当前展开
    handleChange(val) {
      console.log(val);
    },
    expandOrCollapseNode(node) {
      node.expanded = !node.expanded;
    },
    nodeClick(data) {
      this.$emit('onNodeClick', {
        id: data.id,
        label: data.label,
        xmlCompRef: data.xmlCompRef,
        locationChapterId: data.locationChapterId
      });
      this.selectId = data.id;
      this.clickToolbar(0);
    },
    backClick() {
      this.$emit('onBackClick');
    },
    filterNode(value, data, node) {
      return data.hiddenFlag !== '1';
    },
    expandHandle() {
      //   this.expandAll = !this.expandAll;
      // this.expandNodes(this.$refs.tree.store.root, 1)
    },
    // 遍历树形数据，设置每一项的expanded属性，实现展开收起
    expandNodes(node, level) {
      //   node.expanded = this.expandAll;

      node.expanded = true;
      for (let i = 0; i < node.childNodes.length; i++) {
        node.childNodes[i].expanded = this.expandAll;
        if (node.childNodes[i].childNodes.length > 0 && this.catalogShow == 0) {
          this.expandNodes(node.childNodes[i], level + 1);
        } else if (node.childNodes[i].childNodes.length > 0 && level < this.catalogShow) {
          this.expandNodes(node.childNodes[i], level + 1);
        }
      }
    },
    // 跳转到资源所在位置
    resourceDetails(items, e) {
      let list = items.location.split('/');
      let scrollId = `${list[2]}_#_${items.markEfiCode}`;
      this.$emit('resourceDetails', items, 'id', '', scrollId);
      this.clickToolbar(e);
    },
    // 教师资源预览
    resourceReader(items) {
      this.isShowToolbar = false;
      this.$emit('resourceReader', items);
    },
    showSearch() {
      this.$refs.searchPopShow.show = true;
      this.current = 9;
    },
    seachItem(item, text, show) {
      this.$emit('resourceDetails', item, 'search', text);
      this.$refs.searchPopShow.show = false;
    },
    // 添加书签
    addBookmark(location) {
      if (JSON.stringify(this.bookmarkList).indexOf(this.location) === -1) {
        // 添加书签

        this.$emit('addBookmark', location);
      } else {
        console.log('移除', location);
        // 移除书签
        this.$emit('deleteBookmark', location);
      }
    },
    // 打开教师资源列表
    openTeacherResoucesList(e) {
      this.$refs.resourceListPopup.openTeacherResoucesList(e);
    },
    deleteNote(items) {
      Dialog.confirm({
        title: '提示',
        message: '确认删除此条笔记吗？',
        confirmButtonText: '确定',
        cancelButtonText: '取消'
      }).then(() => {
        this.$EventBus.$emit('deleteNote', items, () => {});
      }).catch(() => {});
    },
    deleteBookmark(items) {
      Dialog.confirm({
        title: '提示',
        message: '确认删除此条书签吗？',
        confirmButtonText: '确定',
        cancelButtonText: '取消'
      }).then(() => {
        this.$EventBus.$emit('deleteBookmark', items);
      }).catch(() => {});
    },
    deleteHighlight(items) {
      Dialog.confirm({
        title: '提示',
        message: '确认删除此条高亮吗？',
        confirmButtonText: '确定',
        cancelButtonText: '取消'
      }).then(() => {
        this.$EventBus.$emit('deleteHighlight', items, () => {});
      }).catch(() => {});
    },
    removeStyle(e) {
      if (e) {
        e = e.replace(/<[^>]+>/g, ''); //去除所有标签，以纯文本展示
        e = e.replace(/\s/gi, ''); //去除空格
        e = e.replace(/&nbsp;/gi, ''); //去除空格
        return e;
      }
    }
  }
};

var __$_require_static_images_icons_toolbar_bookmark_svg__ = "data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2010.5V14.5C12%2014.5905%2011.9755%2014.6793%2011.929%2014.757C11.8825%2014.8346%2011.8158%2014.8982%2011.736%2014.9409C11.6562%2014.9836%2011.5663%2015.0038%2011.4759%2014.9995C11.3855%2014.9951%2011.298%2014.9663%2011.2227%2014.9161L7%2012.1009L2.77734%2014.9161C2.70204%2014.9663%202.61452%2014.9951%202.52412%2014.9995C2.43372%2015.0038%202.34383%2014.9836%202.26404%2014.9409C2.18425%2014.8982%202.11754%2014.8346%202.07104%2014.757C2.02454%2014.6793%201.99999%2014.5905%202%2014.5V2C2.00029%201.73487%202.10574%201.48069%202.29321%201.29321C2.48069%201.10574%202.73487%201.00029%203%201H11C11.2651%201.00029%2011.5193%201.10574%2011.7068%201.29321C11.8943%201.48069%2011.9997%201.73487%2012%202V2.5C12%202.63261%2011.9473%202.75979%2011.8536%202.85355C11.7598%202.94732%2011.6326%203%2011.5%203C11.3674%203%2011.2402%202.94732%2011.1464%202.85355C11.0527%202.75979%2011%202.63261%2011%202.5V2H3V13.5658L6.72266%2011.0839C6.80479%2011.0292%206.90129%2010.9999%207%2010.9999C7.09871%2010.9999%207.19521%2011.0292%207.27734%2011.0839L11%2013.5658V10.5C11%2010.3674%2011.0527%2010.2402%2011.1464%2010.1464C11.2402%2010.0527%2011.3674%2010%2011.5%2010C11.6326%2010%2011.7598%2010.0527%2011.8536%2010.1464C11.9473%2010.2402%2012%2010.3674%2012%2010.5ZM13.5%206H12V4.5C12%204.36739%2011.9473%204.24021%2011.8536%204.14645C11.7598%204.05268%2011.6326%204%2011.5%204C11.3674%204%2011.2402%204.05268%2011.1464%204.14645C11.0527%204.24021%2011%204.36739%2011%204.5V6H9.5C9.36739%206%209.24021%206.05268%209.14645%206.14645C9.05268%206.24021%209%206.36739%209%206.5C9%206.63261%209.05268%206.75979%209.14645%206.85355C9.24021%206.94732%209.36739%207%209.5%207H11V8.5C11%208.63261%2011.0527%208.75979%2011.1464%208.85355C11.2402%208.94732%2011.3674%209%2011.5%209C11.6326%209%2011.7598%208.94732%2011.8536%208.85355C11.9473%208.75979%2012%208.63261%2012%208.5V7H13.5C13.6326%207%2013.7598%206.94732%2013.8536%206.85355C13.9473%206.75979%2014%206.63261%2014%206.5C14%206.36739%2013.9473%206.24021%2013.8536%206.14645C13.7598%206.05268%2013.6326%206%2013.5%206Z%22%20fill%3D%22%230D3B8B%22%2F%3E%3C%2Fsvg%3E";

var __$_require_static_images_icons_toolbar_bookmark_up_svg__ = "data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_134_1211%29%22%3E%3Cpath%20d%3D%22M13.3333%200H2.66666C2.43091%200%202.20482%200.0936505%202.03812%200.260349C1.87142%200.427048%201.77777%200.653141%201.77777%200.888888V15.1111C1.77823%2015.2626%201.81741%2015.4115%201.8916%2015.5436C1.9658%2015.6758%202.07253%2015.7867%202.20167%2015.866C2.3308%2015.9452%202.47806%2015.9902%202.62945%2015.9965C2.78084%2016.0029%202.93134%2015.9704%203.06666%2015.9022L7.99999%2013.44L12.9333%2015.9022C13.0572%2015.9657%2013.1942%2015.9992%2013.3333%2016C13.4997%2016.0005%2013.663%2015.9543%2013.8044%2015.8667C13.9325%2015.7866%2014.0381%2015.6752%2014.1112%2015.543C14.1843%2015.4108%2014.2225%2015.2622%2014.2222%2015.1111V0.888888C14.2222%200.653141%2014.1286%200.427048%2013.9619%200.260349C13.7952%200.0936505%2013.5691%200%2013.3333%200ZM11.2978%205.96444L7.74221%209.51999C7.65958%209.60331%207.56127%209.66944%207.45295%209.71456C7.34463%209.75969%207.22844%209.78293%207.1111%209.78293C6.99376%209.78293%206.87757%209.75969%206.76926%209.71456C6.66094%209.66944%206.56262%209.60331%206.47999%209.51999L4.70221%207.74222C4.53483%207.57484%204.4408%207.34782%204.4408%207.11111C4.4408%206.87439%204.53483%206.64738%204.70221%206.48C4.86959%206.31262%205.09661%206.21858%205.33332%206.21858C5.57004%206.21858%205.79705%206.31262%205.96444%206.48L7.1111%207.63555L10.0355%204.70222C10.2029%204.53484%2010.4299%204.4408%2010.6667%204.4408C10.9034%204.4408%2011.1304%204.53484%2011.2978%204.70222C11.4651%204.8696%2011.5592%205.09662%2011.5592%205.33333C11.5592%205.57004%2011.4651%205.79706%2011.2978%205.96444Z%22%20fill%3D%22%231681E5%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_134_1211%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E";

var __$_require_static_images_icons_toolbar_search_svg__ = "data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M6.97055%202.77438C9.12004%202.77782%2010.9176%204.40873%2011.1293%206.54772C11.3413%208.68671%209.89843%2010.6386%207.79156%2011.0635C5.68449%2011.4885%203.59802%2010.2485%202.96428%208.19459C2.33055%206.14065%203.35519%203.94065%205.33519%203.10428C5.85257%202.88543%206.40879%202.77322%206.97055%202.77438ZM6.97055%201.80469C4.11438%201.80469%201.79883%204.12024%201.79883%206.9764C1.79883%209.83257%204.11438%2012.1481%206.97055%2012.1481C9.82671%2012.1481%2012.1423%209.83257%2012.1423%206.9764C12.1423%204.12024%209.82671%201.80469%206.97055%201.80469ZM13.7099%2014.2006C13.6462%2014.2008%2013.5831%2014.1883%2013.5243%2014.1639C13.4654%2014.1394%2013.412%2014.1036%2013.3671%2014.0584L10.9105%2011.6019C10.7269%2011.4116%2010.7295%2011.1091%2010.9164%2010.9221C11.1035%2010.735%2011.4059%2010.7324%2011.596%2010.9162L14.0526%2013.3728C14.1203%2013.4406%2014.1665%2013.527%2014.1852%2013.621C14.2039%2013.715%2014.1943%2013.8125%2014.1576%2013.9011C14.121%2013.9897%2014.059%2014.0655%2013.9793%2014.1188C13.8996%2014.1721%2013.8058%2014.2006%2013.7099%2014.2006Z%22%20fill%3D%22%230D3B8B%22%2F%3E%3C%2Fsvg%3E";

var __$_require_static_images_icons_resource_note_icon_02_svg__ = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2218%22%20viewBox%3D%220%200%2018%2018%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M9.27034%2010.2555C9.80903%209.48573%2011.7823%206.71929%2012.5213%206.12418C11.579%208.23479%209.72279%2010.4064%208.61195%2012.4771C10.664%2013.1309%2011.594%2012.356%2012.7261%2011.4539L11.6043%2011.2515C13.029%2010.8125%2012.9295%2010.9751%2013.4284%2010.3266C13.8242%209.8123%2014.1527%209.11816%2014.2731%208.39322L13.346%208.50179C13.6418%208.33986%2014.3005%208.05532%2014.4052%207.89662C14.685%207.47231%2015.42%203.41471%2015.4286%202.57129C12.5954%202.59592%208.06861%208.16155%207.74116%2010.8215C7.41169%2013.4959%204.17444%2017.537%209.27034%2010.2555ZM13.4937%2011.7593C14.3387%2012.2331%2014.8413%2012.845%2014.8413%2013.5268C14.8413%2017.2052%202.57141%2017.2052%202.57141%2013.5268C2.57141%2011.8377%205.35854%2011.0801%206.80242%2010.8726C6.76843%2011.0999%206.69425%2011.3317%206.59731%2011.5687C5.60493%2011.7394%203.26887%2012.3708%203.26887%2013.5268C3.26887%2016.3054%2014.1438%2016.3054%2014.1438%2013.5268C14.1438%2013.0392%2013.6767%2012.574%2012.9049%2012.2C13.1025%2012.0647%2013.2964%2011.9154%2013.4937%2011.7593Z%22%20fill%3D%22%23333333%22%2F%3E%3C%2Fsvg%3E";

var __$_require_static_images_icons_resource_delete_svg__ = "data:image/svg+xml,%3Csvg%20width%3D%2214%22%20height%3D%2214%22%20viewBox%3D%220%200%2014%2014%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20id%3D%22%26%23229%3B%26%23136%3B%26%23160%3B%26%23233%3B%26%23153%3B%26%23164%3B3%201%22%20clip-path%3D%22url%28%23clip0_235_1461%29%22%3E%3Cpath%20id%3D%22Vector%22%20d%3D%22M10.9266%2011.9545C10.9266%2012.4248%2010.5437%2012.8076%2010.0734%2012.8076H3.92656C3.45625%2012.8076%203.07344%2012.4248%203.07344%2011.9545V2.89824H10.9266V11.9545ZM4.77969%201.36699C4.77969%201.26855%204.85625%201.19199%204.95469%201.19199H9.05625C9.15469%201.19199%209.23125%201.26855%209.23125%201.36699V1.88105H4.77969V1.36699ZM13.4859%201.88105H10.2484V1.36699C10.2484%200.710728%209.7125%200.174805%209.05625%200.174805H4.95469C4.29844%200.174805%203.7625%200.710728%203.7625%201.36699V1.88105H0.514062C0.229687%201.88105%200%202.11074%200%202.39512C0%202.67949%200.229687%202.90918%200.514062%202.90918H2.04531V11.9545C2.04531%2012.9936%202.8875%2013.8357%203.92656%2013.8357H10.0734C11.1125%2013.8357%2011.9547%2012.9936%2011.9547%2011.9545V2.89824H13.4859C13.7703%202.89824%2014%202.66855%2014%202.38418C14%202.0998%2013.7703%201.88105%2013.4859%201.88105ZM7%2011.2654C7.28437%2011.2654%207.51406%2011.0357%207.51406%2010.7514V5.28262C7.51406%204.99824%207.28437%204.76855%207%204.76855C6.71563%204.76855%206.48594%204.99824%206.48594%205.28262V10.7514C6.48594%2011.0357%206.71563%2011.2654%207%2011.2654ZM4.60469%2011.2654C4.88906%2011.2654%205.11875%2011.0357%205.11875%2010.7514V5.28262C5.11875%204.99824%204.88906%204.76855%204.60469%204.76855C4.32031%204.76855%204.09063%204.99824%204.09063%205.28262V10.7514C4.10156%2011.0357%204.33125%2011.2654%204.60469%2011.2654ZM9.39531%2011.2654C9.67969%2011.2654%209.90937%2011.0357%209.90937%2010.7514V5.28262C9.90937%204.99824%209.67969%204.76855%209.39531%204.76855C9.11094%204.76855%208.88125%204.99824%208.88125%205.28262V10.7514C8.88125%2011.0357%209.11094%2011.2654%209.39531%2011.2654Z%22%20fill%3D%22%23FF5A5A%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_235_1461%22%3E%3Crect%20width%3D%2214%22%20height%3D%2214%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E";

var __$_require_static_images_icons_resource_student_bookmark_svg__ = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2218%22%20viewBox%3D%220%200%2018%2018%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.1977%2015.4284C10.0303%2015.4296%209.8643%2015.3975%209.70937%2015.3341C9.55445%2015.2707%209.41363%2015.1772%209.29508%2015.059L8.89674%2014.6617C6.96962%2012.7382%205.04489%2010.8123%203.12255%208.8839C2.92267%208.68157%202.6826%208.40348%202.60468%208.03972C2.58456%207.94673%202.57413%207.8519%202.57355%207.75675C2.57115%206.4344%202.57077%205.11234%202.5724%203.79056C2.57326%203.10466%203.08898%202.58176%203.77086%202.57459C4.02714%202.57129%205.15529%202.57129%205.15529%202.57129H7.69226C8.00694%202.57129%208.28532%202.66887%208.57847%202.87995C8.81567%203.05099%209.01556%203.25174%209.2275%203.4644L15.0368%209.27005C15.4408%209.67427%2015.5434%2010.279%2015.2928%2010.7754C15.2315%2010.8974%2015.1512%2011.0088%2015.0549%2011.1055C13.7412%2012.4255%2012.4255%2013.7421%2011.1078%2015.0553C10.9883%2015.1745%2010.8463%2015.2689%2010.6901%2015.3329C10.5338%2015.3969%2010.3665%2015.4294%2010.1977%2015.4284ZM3.80487%203.42594C3.57327%203.42594%203.42375%203.56944%203.42375%203.79056C3.42217%205.33428%203.4226%206.5943%203.42533%207.75517C3.42533%207.8064%203.43609%207.87829%203.46694%207.9255C3.55017%208.05579%203.64444%208.20288%203.76081%208.31882C5.42706%209.98996%209.86102%2014.4219%209.86102%2014.4219C9.96147%2014.5224%2010.0786%2014.5762%2010.1978%2014.5762C10.317%2014.5762%2010.4361%2014.5218%2010.5385%2014.4183L11.6277%2013.3286C12.5426%2012.415%2013.4857%2011.471%2014.419%2010.5476C14.5091%2010.4541%2014.5595%2010.3293%2014.5595%2010.1994C14.5595%2010.0695%2014.5091%209.94468%2014.419%209.8512C13.5696%209.00788%2012.7078%208.14677%2011.8748%207.31378L9.34903%204.79545C9.23108%204.67793%209.11514%204.55639%209.00278%204.43887C8.69327%204.11515%208.4037%203.81209%208.053%203.56025C7.9382%203.47875%207.83388%203.4235%207.69183%203.4235L4.54056%203.42436L3.80487%203.42594ZM7.03807%208.69047C6.60029%208.68872%206.18103%208.5136%205.87208%208.20344C5.56313%207.89327%205.38965%207.47333%205.38961%207.03555C5.39363%206.13053%206.13377%205.39497%207.03979%205.39497C7.25757%205.39437%207.47331%205.43705%207.67446%205.52054C7.8756%205.60403%208.05816%205.72666%208.2115%205.8813C8.36485%206.03595%208.48594%206.21953%208.56773%206.42137C8.64953%206.62321%208.69039%206.8393%208.68796%207.05707C8.68394%207.95807%207.9461%208.69033%207.04352%208.69033L7.03807%208.69047ZM7.04453%206.03381C6.49064%206.03381%206.03591%206.48309%206.03074%207.03469C6.02929%207.16662%206.05418%207.29751%206.10395%207.4197C6.15373%207.54188%206.22738%207.65291%206.3206%207.74628C6.41406%207.84151%206.52548%207.91726%206.64841%207.96913C6.77134%208.021%206.90335%208.04797%207.03678%208.04848C7.59497%208.04848%208.04898%207.59676%208.04927%207.04201C8.04905%206.77597%207.94378%206.52079%207.75637%206.33198C7.56896%206.14317%207.31457%206.03601%207.04854%206.03381H7.04453Z%22%20fill%3D%22%23333333%22%2F%3E%3C%2Fsvg%3E";

var __$_require_static_images_icons_resource_student_lighheight_svg__ = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2218%22%20viewBox%3D%220%200%2018%2018%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M9.00006%204.7421C10.7915%204.7421%2012.2487%206.18175%2012.2487%207.9509C12.2511%208.59456%2012.0565%209.22392%2011.6904%209.75641C11.3243%2010.2889%2010.8038%2010.6997%2010.1972%2010.9348L10.2025%2010.9489C10.1438%2010.9763%2010.0943%2011.0196%2010.0597%2011.0739C10.0251%2011.1281%2010.0068%2011.1909%2010.0071%2011.255H9.97036V12.0391H7.97819V11.255H7.94136C7.94136%2011.2506%207.94365%2011.2465%207.94365%2011.2421C7.9409%2011.178%207.91967%2011.1161%207.88247%2011.0636C7.84528%2011.0111%207.79366%2010.9702%207.7337%2010.9457L7.7476%2010.9126C7.15564%2010.6693%206.65003%2010.258%206.29471%209.73086C5.93938%209.20369%205.75031%208.58428%205.7514%207.95096C5.75133%206.18141%207.20852%204.7421%209.00006%204.7421ZM9.66757%2014.2579H8.28105C8.20085%2014.2578%208.12395%2014.2263%208.06719%2014.1703C8.01044%2014.1144%207.97846%2014.0385%207.97826%2013.9592V12.7812H9.97036V13.9592C9.97027%2014.0385%209.93833%2014.1145%209.88155%2014.1705C9.82477%2014.2265%209.74781%2014.2579%209.66757%2014.2579ZM7.22694%2011.4918V13.9592C7.22777%2014.5338%207.69923%2014.9993%208.28098%2015H9.66757C10.2493%2014.9993%2010.7209%2014.5338%2010.7217%2013.9592V11.517C11.4053%2011.198%2011.9827%2010.6932%2012.3862%2010.0616C12.7897%209.43008%2013.0026%208.69802%2013%207.95124C13%205.7725%2011.2054%204%208.99999%204C6.79453%204%205%205.7725%205%207.9509C4.99892%208.68773%205.20701%209.4101%205.60065%2010.036C5.99428%2010.6619%206.5577%2011.1662%207.22694%2011.4918Z%22%20fill%3D%22%23333333%22%2F%3E%3Cpath%20d%3D%22M9.0153%203.84177C9.22323%203.83368%209.384%203.65988%209.38436%203.45215L9.38471%203.44979C9.38471%203.44521%209.38663%203.44127%209.38663%203.43705C9.38663%203.43397%209.38471%203.43161%209.38471%203.42853V2.38767C9.38471%202.38266%209.38706%202.37844%209.38663%202.37293C9.38276%202.27142%209.33946%202.1755%209.26604%202.10578C9.19262%202.03606%209.09495%201.9981%208.99402%202.00007C8.89309%202.00204%208.79696%202.04378%208.72628%202.11631C8.65561%202.18884%208.61604%202.28638%208.61607%202.38796L8.61564%202.39068C8.61564%202.39454%208.61337%202.39841%208.61337%202.40306C8.61372%202.40614%208.61529%202.4085%208.61564%202.41158V3.45201C8.61564%203.45738%208.61337%203.4621%208.61337%203.46711C8.61742%203.57038%208.66201%203.66781%208.73736%203.73805C8.81271%203.80828%208.91266%203.84558%209.0153%203.84177ZM6.68205%204.46259C6.85811%204.35092%206.91097%204.11957%206.80803%203.93947L6.80711%203.93733C6.80483%203.93332%206.80455%203.92895%206.80248%203.9253C6.80099%203.92265%206.79807%203.92158%206.79658%203.91893L6.27934%203.01758C6.27685%203.01322%206.27678%203.00835%206.27372%203.00384C6.22074%202.91614%206.13536%202.85316%206.03631%202.82869C5.93726%202.80422%205.8326%202.82026%205.74528%202.8733C5.65796%202.92634%205.5951%203.01205%205.57048%203.11164C5.54586%203.21124%205.56147%203.31659%205.61391%203.40462L5.61491%203.4072C5.61683%203.41056%205.61676%203.41507%205.61911%203.41908C5.62096%203.42159%205.62352%203.4228%205.6253%203.42531L6.14233%204.32637C6.14503%204.33102%206.14538%204.33625%206.14787%204.34061C6.20273%204.42795%206.28977%204.48984%206.3899%204.51271C6.49004%204.53557%206.5951%204.51755%206.68205%204.46259ZM4.9699%206.17416C5.06694%205.9889%204.99772%205.76192%204.81902%205.6577L4.81717%205.65627C4.81319%205.65398%204.81077%205.65033%204.80714%205.64818C4.80451%205.64668%204.80145%205.64718%204.79882%205.6456L3.90305%205.12521C3.89871%205.1227%203.89629%205.11848%203.89138%205.11619C3.8019%205.06652%203.69647%205.05465%203.59829%205.0832C3.5001%205.11174%203.41721%205.17836%203.36785%205.26841C3.31848%205.35845%203.30669%205.46454%203.33506%205.56333C3.36342%205.66213%203.42964%205.74553%203.51912%205.79521L3.52126%205.79692C3.5246%205.79886%203.5268%205.80279%203.53079%205.80508C3.53363%205.8063%203.53641%205.80609%203.53925%205.80738L4.43474%206.32762C4.43936%206.33027%204.44228%206.33464%204.44662%206.33715C4.53751%206.38524%204.64365%206.39509%204.74175%206.36453C4.83986%206.33398%204.92191%206.26551%204.9699%206.17416ZM13.0302%2010.8922C12.9332%2011.0774%2013.0024%2011.3044%2013.1811%2011.4086L13.1829%2011.4102C13.1869%2011.4124%2013.1892%2011.4162%2013.1928%2011.4182C13.1954%2011.4197%2013.1986%2011.4192%2013.2012%2011.4207L14.097%2011.9412C14.1013%2011.9437%2014.1038%2011.9479%2014.1086%2011.9503C14.153%2011.9754%2014.2018%2011.9914%2014.2523%2011.9973C14.3028%2012.0033%2014.354%2011.9992%2014.4029%2011.9852C14.4518%2011.9712%2014.4975%2011.9475%2014.5373%2011.9157C14.5771%2011.8838%2014.6102%2011.8444%2014.6348%2011.7995C14.6594%2011.7547%2014.6749%2011.7055%2014.6804%2011.6546C14.686%2011.6037%2014.6815%2011.5523%2014.6672%2011.5032C14.6529%2011.4541%2014.629%2011.4083%2014.5971%2011.3685C14.5651%2011.3287%2014.5256%2011.2957%2014.4809%2011.2713L14.4788%2011.2695C14.4755%2011.2676%2014.4732%2011.2637%2014.4692%2011.2614C14.4665%2011.26%2014.4636%2011.2603%2014.4608%2011.259L13.5653%2010.7388C13.5608%2010.7361%2013.5577%2010.7318%2013.5534%2010.7293C13.4625%2010.6812%2013.3564%2010.6714%2013.2583%2010.7019C13.1602%2010.7324%2013.0782%2010.8009%2013.0302%2010.8922ZM4.33763%208.51778C4.32959%208.30855%204.15687%208.14678%203.95036%208.14642L3.94801%208.14606C3.94346%208.14606%203.93947%208.14413%203.93535%208.14413C3.93236%208.14413%203.92994%208.14606%203.92688%208.14606H2.89254C2.88756%208.14606%202.88336%208.1437%202.87789%208.14413C2.7757%208.14613%202.67849%208.18888%202.60764%208.263C2.53678%208.33711%202.49809%208.43651%202.50007%208.53933C2.50205%208.64215%202.54455%208.73997%202.6182%208.81126C2.69186%208.88256%202.79064%208.92149%202.89282%208.9195L2.89553%208.91993C2.89937%208.91993%202.90321%208.92222%202.90783%208.92222C2.91089%208.92186%202.91324%208.92028%202.9163%208.91993H3.95029C3.95562%208.91993%203.96032%208.92222%203.9653%208.92222C4.06793%208.91815%204.16477%208.87329%204.23458%208.79747C4.30438%208.72165%204.34144%208.62107%204.33763%208.51778ZM13.6624%208.54856C13.6704%208.75772%2013.8431%208.9195%2014.0496%208.91993L14.052%208.92028C14.0565%208.92028%2014.0604%208.92236%2014.0646%208.92236C14.0676%208.92236%2014.0701%208.92028%2014.0731%208.92035H15.1075C15.1124%208.92035%2015.1167%208.92279%2015.122%208.92236C15.2242%208.92033%2015.3214%208.87755%2015.3923%208.80343C15.4632%208.72931%2015.5019%208.62992%2015.4999%208.52709C15.4979%208.42428%2015.4554%208.3265%2015.3817%208.25522C15.3081%208.18395%2015.2093%208.14502%2015.1071%208.147L15.1045%208.14649C15.1006%208.14649%2015.0967%208.14435%2015.0921%208.14435C15.0891%208.14456%2015.0868%208.14628%2015.0837%208.14649H14.0497C14.0444%208.14649%2014.0396%208.14428%2014.0346%208.14435C13.932%208.14837%2013.8352%208.19319%2013.7654%208.26898C13.6956%208.34476%2013.6586%208.44531%2013.6624%208.54856ZM4.95461%2010.8656C4.84371%2010.6884%204.61372%2010.6352%204.43474%2010.7389L4.4326%2010.7397C4.42862%2010.742%204.42428%2010.7423%204.42065%2010.7444C4.41802%2010.7459%204.41695%2010.7488%204.41432%2010.7503L3.51855%2011.2708C3.51421%2011.2733%203.50938%2011.2734%203.50489%2011.2764C3.41774%2011.3298%203.35514%2011.4157%203.33083%2011.5153C3.30651%2011.615%203.32245%2011.7203%203.37516%2011.8082C3.42788%2011.896%203.51305%2011.9593%203.61203%2011.9841C3.71101%2012.0088%203.81571%2011.9931%203.90319%2011.9404L3.90575%2011.9393C3.9091%2011.9374%203.91358%2011.9375%203.91756%2011.9351C3.92005%2011.9333%203.92126%2011.9307%203.92375%2011.9288L4.81923%2011.4086C4.82386%2011.4059%204.82905%2011.4056%204.83339%2011.4031C4.92019%2011.3479%204.98169%2011.2603%205.00442%2011.1596C5.02714%2011.0588%205.00923%2010.9531%204.95461%2010.8656ZM13.0454%206.20078C13.1564%206.37787%2013.3863%206.43106%2013.5653%206.32755L13.5675%206.32662C13.5715%206.32433%2013.5759%206.32419%2013.5795%206.32211C13.5821%206.32061%2013.5832%206.3176%2013.5859%206.31603L14.4817%205.79564C14.4859%205.79313%2014.4908%205.79306%2014.4953%205.79005C14.5828%205.7369%2014.6457%205.65095%2014.6702%205.55111C14.6948%205.45126%2014.6789%205.34569%2014.6261%205.25763C14.5732%205.1696%2014.4878%205.10629%2014.3886%205.08163C14.2893%205.05698%2014.1844%205.07298%2014.097%205.12614L14.0945%205.12707C14.091%205.129%2014.0866%205.12908%2014.0827%205.13144C14.0802%205.13308%2014.079%205.1358%2014.0765%205.13752L13.181%205.65777C13.1764%205.66042%2013.1711%205.66085%2013.1669%205.66343C13.08%205.71854%2013.0185%205.80607%2012.9957%205.90682C12.9729%206.00756%2012.9908%206.11329%2013.0454%206.20078ZM11.3444%204.47798C11.5285%204.57554%2011.7541%204.50596%2011.8577%204.32615L11.8592%204.32422C11.8614%204.32021%2011.8652%204.31792%2011.8673%204.31427C11.8688%204.31162%2011.8682%204.30847%2011.8698%204.30575L12.387%203.40441C12.3894%203.40011%2012.3936%203.39753%2012.396%203.39274C12.4444%203.30277%2012.4555%203.19719%2012.4269%203.099C12.3983%203.00082%2012.3323%202.91799%2012.2433%202.86856C12.1542%202.81914%2012.0494%202.80713%2011.9516%202.83515C11.8538%202.86317%2011.771%202.92895%2011.7212%203.01816L11.7195%203.02023C11.7175%203.02367%2011.7136%203.02596%2011.7113%203.02997C11.71%203.03269%2011.7103%203.03562%2011.7091%203.03834L11.192%203.9394C11.1893%203.94398%2011.1851%203.94706%2011.1827%203.95143C11.1348%204.04285%2011.1249%204.14965%2011.1553%204.24838C11.1856%204.34711%2011.2536%204.42968%2011.3444%204.47798Z%22%20fill%3D%22%23333333%22%2F%3E%3C%2Fsvg%3E";

/* script */
const __vue_script__$27 = script$27;
var __vue_render__$27 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    [
      _c(
        "div",
        {
          directives: [
            {
              name: "show",
              rawName: "v-show",
              value: _vm.isShowToolbar,
              expression: "isShowToolbar",
            },
          ],
          staticClass: "title-bar",
        },
        [
          _c("div", { staticClass: "title-bar-con" }, [
            _c("div", { staticClass: "cur-name" }, [_vm._v(_vm._s(_vm.title))]),
            _vm._v(" "),
            _c("div", { staticClass: "search-box" }, [
              _c("div", [_vm._v(_vm._s(_vm.schedule) + "%")]),
              _vm._v(" "),
              _c(
                "div",
                {
                  on: {
                    click: function ($event) {
                      $event.stopPropagation();
                      return _vm.addBookmark(_vm.location)
                    },
                  },
                },
                [
                  _c("img", {
                    directives: [
                      {
                        name: "show",
                        rawName: "v-show",
                        value:
                          JSON.stringify(_vm.bookmarkList).indexOf(
                            _vm.location
                          ) == -1,
                        expression:
                          "JSON.stringify(bookmarkList).indexOf(location) == -1",
                      },
                    ],
                    staticClass: "icon",
                    attrs: {
                      src: __$_require_static_images_icons_toolbar_bookmark_svg__,
                      alt: "",
                    },
                  }),
                  _vm._v(" "),
                  _c("img", {
                    directives: [
                      {
                        name: "show",
                        rawName: "v-show",
                        value:
                          JSON.stringify(_vm.bookmarkList).indexOf(
                            _vm.location
                          ) !== -1,
                        expression:
                          "JSON.stringify(bookmarkList).indexOf(location) !== -1",
                      },
                    ],
                    staticClass: "icon",
                    attrs: {
                      src: __$_require_static_images_icons_toolbar_bookmark_up_svg__,
                      alt: "",
                    },
                  }),
                ]
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  on: {
                    click: function ($event) {
                      $event.stopPropagation();
                      return _vm.showSearch.apply(null, arguments)
                    },
                  },
                },
                [
                  _c("img", {
                    staticClass: "icon",
                    attrs: {
                      src: __$_require_static_images_icons_toolbar_search_svg__,
                      alt: "",
                    },
                  }),
                ]
              ),
            ]),
          ]),
        ]
      ),
      _vm._v(" "),
      _c(
        "div",
        {
          staticClass: "xml-toolbar-phone-content",
          style: { height: _vm.innerHeight + "px" },
        },
        [
          _c(
            "div",
            {
              directives: [
                {
                  name: "show",
                  rawName: "v-show",
                  value: _vm.isShowToolbar,
                  expression: "isShowToolbar",
                },
              ],
              staticClass: "xml-toolbar-phone",
              on: {
                click: function ($event) {
                  $event.stopPropagation();
                },
              },
            },
            _vm._l(_vm.toolbarList, function (item, index) {
              return _c(
                "div",
                {
                  key: index,
                  staticClass: "toolbar-phone-item",
                  class: index == _vm.current ? item.select : item.default,
                  on: {
                    click: function ($event) {
                      $event.stopPropagation();
                      return _vm.clickToolbar(index)
                    },
                  },
                },
                [
                  _c("div", { staticClass: "toolbar-icon" }),
                  _vm._v(" "),
                  _c("div", [_vm._v(_vm._s(item.name))]),
                ]
              )
            }),
            0
          ),
        ]
      ),
      _vm._v(" "),
      _c(
        "xml-popup",
        {
          ref: "searchPopShow",
          on: {
            close: function ($event) {
              _vm.current = -1;
            },
          },
        },
        [
          _c(
            "div",
            {
              staticClass: "search-pop",
              style: { height: (_vm.innerHeight / 10) * 8 + "px" },
            },
            [
              _c("div", {
                staticClass: "xml-popup-mback",
                on: {
                  click: function ($event) {
                    $event.stopPropagation();
                    _vm.$refs.searchPopShow.show = false;
                  },
                },
              }),
              _vm._v(" "),
              _c("search-phone", {
                staticClass: "search-pop-content",
                attrs: { componentList: _vm.componentList },
                on: { seachItem: _vm.seachItem },
              }),
            ],
            1
          ),
        ]
      ),
      _vm._v(" "),
      _c(
        "xml-popup",
        {
          ref: "catalogPopup",
          on: {
            close: function ($event) {
              _vm.current = -1;
            },
          },
        },
        [
          _c(
            "div",
            { staticClass: "catalog-pop" },
            [
              _c("div", {
                staticClass: "xml-popup-mback",
                on: {
                  click: function ($event) {
                    $event.stopPropagation();
                    return _vm.clickToolbar(0)
                  },
                },
              }),
              _vm._v(" "),
              _c("div", { staticClass: "book-name" }, [
                _vm._v(_vm._s(_vm.textBookName)),
              ]),
              _vm._v(" "),
              _c("el-tree", {
                ref: "tree",
                class:
                  "preview-tree-box-" + _vm.pageType + " custom-catalog-tree",
                attrs: {
                  id: "preview-tree",
                  indent: 24,
                  draggable: false,
                  "default-expand-all": true,
                  data: _vm.catalogList,
                  "node-key": "id",
                  props: _vm.defaultProps,
                  "filter-node-method": _vm.filterNode,
                  "expand-on-click-node": false,
                },
                scopedSlots: _vm._u([
                  {
                    key: "default",
                    fn: function (ref) {
                      var node = ref.node;
                      var data = ref.data;
                      return _c(
                        "div",
                        {
                          staticClass: "catalog-node",
                          class: [node.childNodes.length ? "parent-node" : ""],
                        },
                        [
                          _c(
                            "div",
                            {
                              class: [
                                "catalog-node__left",
                                node.level === 1 ? "with-prefix" : "",
                              ],
                              on: {
                                click: function () {
                                  return _vm.nodeClick(data)
                                },
                              },
                            },
                            [
                              _c(
                                "div",
                                {
                                  staticClass: "catalog-node__label",
                                  class:
                                    data.isSampleSeal == "0"
                                      ? "sample-seal"
                                      : "",
                                },
                                [
                                  _c(
                                    "div",
                                    {
                                      class: [
                                        "node-label",
                                        node.expanded ? "expanded-node" : "",
                                      ],
                                    },
                                    [
                                      _c(
                                        "span",
                                        {
                                          class:
                                            _vm.selectId == data.id
                                              ? "highlight-bg"
                                              : "",
                                        },
                                        [
                                          _vm._v(
                                            "\n                  " +
                                              _vm._s(node.label) +
                                              "\n                "
                                          ),
                                        ]
                                      ),
                                    ]
                                  ),
                                ]
                              ),
                            ]
                          ),
                          _vm._v(" "),
                          _c(
                            "div",
                            {
                              staticClass: "catalog-node__right",
                              on: {
                                click: function () {
                                  return _vm.expandOrCollapseNode(node)
                                },
                              },
                            },
                            [
                              node.childNodes.length && node.expanded
                                ? _c("i", {
                                    staticClass: "el-icon-arrow-down",
                                    staticStyle: {
                                      color: "var(--preview-theme-color)",
                                      "font-size": "16px",
                                      "font-weight": "600",
                                    },
                                  })
                                : node.childNodes.length && !node.expanded
                                ? _c("i", {
                                    staticClass: "el-icon-arrow-right",
                                    staticStyle: {
                                      "font-size": "16px",
                                      "font-weight": "600",
                                    },
                                  })
                                : _vm._e(),
                            ]
                          ),
                        ]
                      )
                    },
                  },
                ]),
              }),
            ],
            1
          ),
        ]
      ),
      _vm._v(" "),
      _c(
        "xml-popup",
        {
          ref: "setPopup",
          on: {
            close: function ($event) {
              _vm.current = -1;
            },
          },
        },
        [
          _c(
            "div",
            {
              staticClass: "set-pop",
              on: {
                click: function ($event) {
                  $event.stopPropagation();
                },
              },
            },
            [
              _c("div", { staticClass: "set-item" }, [
                _c("span", { staticClass: "keyname" }, [_vm._v("字体")]),
                _vm._v(" "),
                _c(
                  "div",
                  {
                    staticClass: "family-select-box",
                    staticStyle: { "margin-left": "14px" },
                  },
                  [
                    _c(
                      "el-select",
                      {
                        attrs: {
                          placeholder: "请选择",
                          "popper-append-to-body": false,
                        },
                        on: { change: _vm.setThemeFontFamily },
                        model: {
                          value: _vm.form.themeFontFamily,
                          callback: function ($$v) {
                            _vm.$set(_vm.form, "themeFontFamily", $$v);
                          },
                          expression: "form.themeFontFamily",
                        },
                      },
                      _vm._l(_vm.options, function (item) {
                        return _c("el-option", {
                          key: item.value,
                          attrs: { label: item.label, value: item.value },
                        })
                      }),
                      1
                    ),
                  ],
                  1
                ),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "set-item" }, [
                _c("span", { staticClass: "keyname" }, [_vm._v("字号")]),
                _vm._v(" "),
                _c("div", { staticStyle: { "margin-left": "14px" } }, [
                  _c(
                    "div",
                    {
                      staticClass: "size-btn",
                      on: {
                        click: function ($event) {
                          $event.stopPropagation();
                          return _vm.setThemeFontSize("minus")
                        },
                      },
                    },
                    [_vm._v("A-")]
                  ),
                  _vm._v(" "),
                  _c("span", [
                    _vm._v(
                      _vm._s(_vm.fontSizeLabelMap[_vm.form.themeFontSize])
                    ),
                  ]),
                  _vm._v(" "),
                  _c(
                    "div",
                    {
                      staticClass: "size-btn",
                      on: {
                        click: function ($event) {
                          $event.stopPropagation();
                          return _vm.setThemeFontSize("plus")
                        },
                      },
                    },
                    [_vm._v("A+")]
                  ),
                ]),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "set-item" }, [
                _c("span", { staticClass: "keyname" }, [_vm._v("背景色")]),
                _vm._v(" "),
                _c(
                  "div",
                  { staticClass: "color-box" },
                  _vm._l(_vm.colorList, function (item, index) {
                    return _c("div", {
                      staticClass: "color-tag",
                      class:
                        _vm.form.themeBgColor === item.colorval ? "active" : "",
                      style: { background: item.colorval },
                      on: {
                        click: function ($event) {
                          $event.stopPropagation();
                          return _vm.setThemeBgColor(item.colorval)
                        },
                      },
                    })
                  }),
                  0
                ),
              ]),
            ]
          ),
        ]
      ),
      _vm._v(" "),
      _c(
        "xml-popup",
        {
          ref: "notePpoup",
          on: {
            close: function ($event) {
              _vm.current = -1;
            },
          },
        },
        [
          _c(
            "div",
            {
              staticClass: "note-pop",
              on: {
                click: function ($event) {
                  $event.stopPropagation();
                },
              },
            },
            [
              _c("div", {
                staticClass: "xml-popup-mback",
                on: {
                  click: function ($event) {
                    $event.stopPropagation();
                    return _vm.clickToolbar(1)
                  },
                },
              }),
              _vm._v(" "),
              _vm.curnotetabs == 0
                ? [
                    _c(
                      "div",
                      { staticClass: "note-list" },
                      [
                        _c(
                          "el-collapse",
                          {
                            attrs: { accordion: "" },
                            on: { change: _vm.handleChange },
                            model: {
                              value: _vm.noteNames,
                              callback: function ($$v) {
                                _vm.noteNames = $$v;
                              },
                              expression: "noteNames",
                            },
                          },
                          _vm._l(_vm.notesList, function (item, index) {
                            return _c(
                              "el-collapse-item",
                              {
                                key: index,
                                attrs: { name: item.firstLevelId },
                              },
                              [
                                _c("template", { slot: "title" }, [
                                  _c("div", { staticClass: "collapse-title" }, [
                                    _vm._v(
                                      "\n                  " +
                                        _vm._s(item.firstLevelLabel) +
                                        "\n                "
                                    ),
                                  ]),
                                ]),
                                _vm._v(" "),
                                _vm._l(item.list, function (items, index) {
                                  return _c(
                                    "div",
                                    {
                                      key: index,
                                      staticClass: "note-item collapse-item",
                                      on: {
                                        click: function ($event) {
                                          return _vm.resourceDetails(items, 1)
                                        },
                                      },
                                    },
                                    [
                                      _c("img", {
                                        attrs: {
                                          src: __$_require_static_images_icons_resource_note_icon_02_svg__,
                                          alt: "",
                                        },
                                      }),
                                      _vm._v(" "),
                                      _c("div", [
                                        _c("div", { staticClass: "or-text" }, [
                                          _vm._v(
                                            "\n                    " +
                                              _vm._s(
                                                _vm.removeStyle(
                                                  items.selectionText
                                                )
                                              ) +
                                              "\n                  "
                                          ),
                                        ]),
                                        _vm._v(" "),
                                        _c(
                                          "div",
                                          { staticClass: "note-con" },
                                          [
                                            _c("xmlTextOverflow", {
                                              attrs: {
                                                info: items.noteContent,
                                              },
                                            }),
                                          ],
                                          1
                                        ),
                                      ]),
                                      _vm._v(" "),
                                      _c(
                                        "div",
                                        { staticClass: "operate-btns" },
                                        [
                                          _c(
                                            "div",
                                            {
                                              staticClass: "delete-btn",
                                              on: {
                                                "!click": function ($event) {
                                                  $event.stopPropagation();
                                                  return _vm.deleteNote(items)
                                                },
                                              },
                                            },
                                            [
                                              _c("img", {
                                                attrs: {
                                                  src: __$_require_static_images_icons_resource_delete_svg__,
                                                  alt: "",
                                                },
                                              }),
                                              _vm._v(
                                                "\n                    删除\n                  "
                                              ),
                                            ]
                                          ),
                                        ]
                                      ),
                                    ]
                                  )
                                }),
                              ],
                              2
                            )
                          }),
                          1
                        ),
                        _vm._v(" "),
                        _c("xml-empty", {
                          directives: [
                            {
                              name: "show",
                              rawName: "v-show",
                              value: _vm.notesList.length == 0,
                              expression: "notesList.length == 0",
                            },
                          ],
                        }),
                      ],
                      1
                    ),
                  ]
                : _vm.curnotetabs == 1
                ? [
                    _c(
                      "div",
                      { staticClass: "note-list" },
                      [
                        _c(
                          "el-collapse",
                          {
                            attrs: { accordion: "" },
                            on: { change: _vm.handleChange },
                            model: {
                              value: _vm.bookmarkNames,
                              callback: function ($$v) {
                                _vm.bookmarkNames = $$v;
                              },
                              expression: "bookmarkNames",
                            },
                          },
                          _vm._l(_vm.bookmarkList, function (item, index) {
                            return _c(
                              "el-collapse-item",
                              {
                                key: index,
                                attrs: { name: item.firstLevelId },
                              },
                              [
                                _c("template", { slot: "title" }, [
                                  _c("div", { staticClass: "collapse-title" }, [
                                    _vm._v(
                                      "\n                  " +
                                        _vm._s(item.firstLevelLabel) +
                                        "\n                "
                                    ),
                                  ]),
                                ]),
                                _vm._v(" "),
                                _vm._l(item.list, function (items, k) {
                                  return _c(
                                    "div",
                                    {
                                      key: k,
                                      staticClass: "mark-item collapse-item",
                                      on: {
                                        click: function ($event) {
                                          return _vm.resourceDetails(items, 1)
                                        },
                                      },
                                    },
                                    [
                                      _c("img", {
                                        attrs: {
                                          src: __$_require_static_images_icons_resource_student_bookmark_svg__,
                                          alt: "",
                                        },
                                      }),
                                      _vm._v(" "),
                                      _c("div", [
                                        _vm._v(
                                          _vm._s(
                                            _vm.removeStyle(items.bookmarkText)
                                          )
                                        ),
                                      ]),
                                      _vm._v(" "),
                                      _c(
                                        "div",
                                        { staticClass: "operate-btns" },
                                        [
                                          _c(
                                            "div",
                                            {
                                              staticClass: "delete-btn",
                                              on: {
                                                "!click": function ($event) {
                                                  $event.stopPropagation();
                                                  return _vm.deleteBookmark(
                                                    items
                                                  )
                                                },
                                              },
                                            },
                                            [
                                              _c("img", {
                                                attrs: {
                                                  src: __$_require_static_images_icons_resource_delete_svg__,
                                                  alt: "",
                                                },
                                              }),
                                              _vm._v(
                                                "\n                    删除\n                  "
                                              ),
                                            ]
                                          ),
                                        ]
                                      ),
                                    ]
                                  )
                                }),
                              ],
                              2
                            )
                          }),
                          1
                        ),
                        _vm._v(" "),
                        _c("xml-empty", {
                          directives: [
                            {
                              name: "show",
                              rawName: "v-show",
                              value: _vm.bookmarkList.length == 0,
                              expression: "bookmarkList.length == 0",
                            },
                          ],
                        }),
                      ],
                      1
                    ),
                  ]
                : _vm.curnotetabs == 2
                ? [
                    _c(
                      "div",
                      { staticClass: "note-list" },
                      [
                        _c(
                          "el-collapse",
                          {
                            attrs: { accordion: "" },
                            on: { change: _vm.handleChange },
                            model: {
                              value: _vm.highlightNames,
                              callback: function ($$v) {
                                _vm.highlightNames = $$v;
                              },
                              expression: "highlightNames",
                            },
                          },
                          _vm._l(_vm.highlightList, function (item, index) {
                            return _c(
                              "el-collapse-item",
                              {
                                key: index,
                                attrs: { name: item.firstLevelId },
                              },
                              [
                                _c("template", { slot: "title" }, [
                                  _c("div", { staticClass: "collapse-title" }, [
                                    _vm._v(
                                      "\n                  " +
                                        _vm._s(item.firstLevelLabel) +
                                        "\n                "
                                    ),
                                  ]),
                                ]),
                                _vm._v(" "),
                                _vm._l(item.list, function (items, index) {
                                  return _c(
                                    "div",
                                    {
                                      key: index,
                                      staticClass:
                                        "Highlight-item collapse-item",
                                      on: {
                                        click: function ($event) {
                                          return _vm.resourceDetails(items, 1)
                                        },
                                      },
                                    },
                                    [
                                      _c("img", {
                                        attrs: {
                                          src: __$_require_static_images_icons_resource_student_lighheight_svg__,
                                          alt: "",
                                        },
                                      }),
                                      _vm._v(" "),
                                      _c("div", [
                                        _vm._v(
                                          "\n                  " +
                                            _vm._s(
                                              _vm.removeStyle(
                                                items.selectionText
                                              )
                                            ) +
                                            "\n                "
                                        ),
                                      ]),
                                      _vm._v(" "),
                                      _c(
                                        "div",
                                        { staticClass: "operate-btns" },
                                        [
                                          _c(
                                            "div",
                                            {
                                              staticClass: "delete-btn",
                                              on: {
                                                "!click": function ($event) {
                                                  $event.stopPropagation();
                                                  return _vm.deleteHighlight(
                                                    items
                                                  )
                                                },
                                              },
                                            },
                                            [
                                              _c("img", {
                                                attrs: {
                                                  src: __$_require_static_images_icons_resource_delete_svg__,
                                                  alt: "",
                                                },
                                              }),
                                              _vm._v(
                                                "\n                    删除\n                  "
                                              ),
                                            ]
                                          ),
                                        ]
                                      ),
                                    ]
                                  )
                                }),
                              ],
                              2
                            )
                          }),
                          1
                        ),
                        _vm._v(" "),
                        _c("xml-empty", {
                          directives: [
                            {
                              name: "show",
                              rawName: "v-show",
                              value: _vm.highlightList.length == 0,
                              expression: "highlightList.length == 0",
                            },
                          ],
                        }),
                      ],
                      1
                    ),
                  ]
                : _vm._e(),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "note-tabbar" },
                _vm._l(_vm.noteTabbarList, function (item, index) {
                  return _c(
                    "div",
                    {
                      class: _vm.curnotetabs == index ? "active" : "",
                      on: {
                        click: function ($event) {
                          $event.stopPropagation();
                          return _vm.clicknotetab(index)
                        },
                      },
                    },
                    [_vm._v("\n          " + _vm._s(item.name) + "\n        ")]
                  )
                }),
                0
              ),
            ],
            2
          ),
        ]
      ),
      _vm._v(" "),
      _c("resource-list-phone", {
        ref: "resourceListPopup",
        attrs: {
          textBookResource: _vm.textBookResource,
          resourcesList: _vm.resourcesList,
          resourceBasisPath: _vm.resourceBasisPath,
          showToast: _vm.showToast,
          isShowTeacherResource: _vm.isShowTeacherResource,
          userType: _vm.userType,
        },
        on: {
          resourceDetails: _vm.resourceDetails,
          resourceReader: _vm.resourceReader,
          close: function ($event) {
            _vm.current = -1;
          },
        },
      }),
    ],
    1
  )
};
var __vue_staticRenderFns__$27 = [];
__vue_render__$27._withStripped = true;

  /* style */
  const __vue_inject_styles__$27 = undefined;
  /* scoped */
  const __vue_scope_id__$27 = undefined;
  /* module identifier */
  const __vue_module_identifier__$27 = undefined;
  /* functional template */
  const __vue_is_functional_template__$27 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$27 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$27, staticRenderFns: __vue_staticRenderFns__$27 },
    __vue_inject_styles__$27,
    __vue_script__$27,
    __vue_scope_id__$27,
    __vue_is_functional_template__$27,
    __vue_module_identifier__$27,
    false,
    undefined,
    undefined,
    undefined
  );

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

var script$26 = {
  name: 'modifyNotes',
  props: {},
  data() {
    return {
      show: false,
      noteContent: '',
      selectionText: '',
      data: ''
    };
  },
  methods: {
    open(data) {
      this.show = true;
      this.noteContent = data.noteContent;
      this.selectionText = data.selectionText;
      this.data = data;
    },
    // 点击关闭按钮
    close() {},
    onCancelClick() {
      this.show = false;
    },
    onSaveClick() {
      console.log('保存');
      if (!this.noteContent.trim()) {
        this.$message({
          message: '笔记内容不能为空',
          type: 'warning'
        });
        return;
      }
      this.data.noteContent = this.noteContent;
      this.$emit('saveNote', this.data);
      // 关闭对话框
      this.show = false;
    }
  }
};

/* script */
const __vue_script__$26 = script$26;
/* template */
var __vue_render__$26 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "el-dialog",
    {
      attrs: {
        "append-to-body": "",
        title: "编辑笔记",
        visible: _vm.show,
        width: "400px",
      },
      on: {
        "update:visible": function ($event) {
          _vm.show = $event;
        },
        close: _vm.close,
      },
      scopedSlots: _vm._u([
        {
          key: "footer",
          fn: function () {
            return [
              _c("el-button", { on: { click: _vm.onCancelClick } }, [
                _vm._v("取消"),
              ]),
              _vm._v(" "),
              _c(
                "el-button",
                { attrs: { type: "primary" }, on: { click: _vm.onSaveClick } },
                [_vm._v("保存")]
              ),
            ]
          },
          proxy: true,
        },
      ]),
    },
    [
      _c(
        "div",
        { staticClass: "add-teacher-resources-dialog" },
        [
          _c(
            "el-form",
            { attrs: { "label-width": "100px", "label-position": "left" } },
            [
              _c("div", { staticClass: "content-left" }, [
                _vm._v(_vm._s(_vm.selectionText)),
              ]),
              _vm._v(" "),
              _c("el-input", {
                attrs: {
                  type: "textarea",
                  rows: 4,
                  placeholder: "请输入笔记内容",
                  maxlength: "200",
                },
                model: {
                  value: _vm.noteContent,
                  callback: function ($$v) {
                    _vm.noteContent = $$v;
                  },
                  expression: "noteContent",
                },
              }),
            ],
            1
          ),
        ],
        1
      ),
    ]
  )
};
var __vue_staticRenderFns__$26 = [];
__vue_render__$26._withStripped = true;

  /* style */
  const __vue_inject_styles__$26 = undefined;
  /* scoped */
  const __vue_scope_id__$26 = undefined;
  /* module identifier */
  const __vue_module_identifier__$26 = undefined;
  /* functional template */
  const __vue_is_functional_template__$26 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$26 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$26, staticRenderFns: __vue_staticRenderFns__$26 },
    __vue_inject_styles__$26,
    __vue_script__$26,
    __vue_scope_id__$26,
    __vue_is_functional_template__$26,
    __vue_module_identifier__$26,
    false,
    undefined,
    undefined,
    undefined
  );

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

var script$25 = {
  //预览教材目录
  name: 'PreviewCatalog',
  props: {
    textBookName: String,
    textBookId: String,
    catalogList: Array,
    userType: {
      type: String,
      default: 'teacher'
    },
    notesList: {
      type: Array,
      default: []
    },
    checkedId: {
      type: String,
      default: ''
    },
    pageType: {
      type: String,
      default: 'h5'
    },
    styleType: {
      type: String,
      default: ''
    },
    isShow: false,
    title: String,
    PreviewCatalog: false
  },
  data() {
    return {
      deleteItem: '',
      deletetype: '',
      reminder: false,
      xmlshow: false,
      currentActive: 0,
      tabs: ['目录', '笔记', '书签'],
      scrollTop: 0,
      defaultProps: {
        children: 'children',
        label: 'label'
      },
      selectId: '',
      catalogLists: [],
      searchValue: '',
      currentNodeKey: ''
      // image
    };
  },
  watch: {
    catalogList: {
      handler(newValue) {
        if (this.catalogLists.length > 0) {
          this.currentNodeKey = this.catalogLists[0].id;
        }
      },
      immediate: true
    },
    checkedId: {
      handler(newValue) {
        this.currentNodeKey = this.checkedId;
        this.scrollTopFun();
        // if (this.$refs.tree) {
        //   this.$refs.tree.setCurrentKey(newValue)
        //   let Dom = document.getElementsByClassName('highlight-bg')
        //   let DomBox = document.getElementById('preview-tree')

        //   if (Dom) {
        //     setTimeout(() => {
        //       if (Dom[0].getBoundingClientRect().top > 400 || Dom[0].getBoundingClientRect().top < 200) {
        //         DomBox.scrollTop = 0
        //         DomBox.scrollTop = Dom[0].getBoundingClientRect().top - 300
        //       }
        //     }, 500)
        //   }
        // }
      },
      immediate: true,
      deep: true
    },
    isShow: {
      handler(newValue) {
        let dom = document.getElementById('preview-tree');
        if (dom) {
          dom.animate({
            scrollTop: this.scrollTop
          }, 200);
        }
      },
      immediate: true
    },
    searchValue: {
      handler(newValue) {
        this.$emit('onSearchPc', newValue);
      }
    }
  },
  created() {},
  mounted() {
    this.scrollTopFun();
    const origin = this.catalogList;
    const filterMenu = menuList => {
      return menuList.filter(item => {
        return item.hiddenFlag !== '1';
      }).map(item => {
        item = Object.assign({}, item);
        if (item.children?.length) {
          item.children = filterMenu(item.children);
        }
        return item;
      });
    };
    this.catalogLists = filterMenu(origin);
    setTimeout(() => {
      if (this.catalogLists.length > 0) {
        this.currentNodeKey = this.catalogLists[0].id;
      }
    }, 500);
  },
  methods: {
    nodeclick(data, onj, node) {
      this.$emit('onNodeClick', {
        id: data.id,
        label: data.label,
        xmlCompRef: data.xmlCompRef,
        locationChapterId: data.locationChapterId
      });
      this.selectId = data.id;
    },
    changeTab(val) {
      this.currentActive = val;
      if (this.currentActive == 0) {
        setTimeout(() => {
          this.scrollTopFun();
        }, 500);
      }
    },
    expandOrCollapseNode(node) {
      node.expanded = !node.expanded;
    },
    nodeClick(data) {
      this.$emit('onNodeClick', {
        id: data.id,
        label: data.label,
        xmlCompRef: data.xmlCompRef
      });
      this.$emit('resourceDetails', data, 'id', '');
      this.selectId = data.id;
    },
    backClick() {
      this.$emit('onBackClick');
    },
    jumpingNotes(item) {
      this.$emit('onBackClick');
      this.$emit('jumpingNotes', item);
    },
    jumpingBookmark(item) {
      this.$emit('onBackClick');
      this.$emit('jumpingBookmark', item);
    },
    editNotoPC(item) {
      if (this.pageType == 'h5') {
        this.$emit('onBackClick');
      }
      this.$emit('editNotoPC', item);
    },
    deleteNotoPC(item, type) {
      this.reminder = true;
      // this.$emit('deleteNotoPC', item, index)
      this.deleteItem = item;
      this.deletetype = type;
    },
    confirmDelete() {
      this.reminder = false;
      this.$emit('deleteNotoPC', this.deleteItem, this.deletetype);
    },
    scrollTopFun() {
      if (this.$refs.tree) {
        this.$refs.tree.setCurrentKey(this.checkedId);
        let Dom = document.getElementsByClassName('is-current');
        let DomBox = document.getElementById('preview-left-student');
        if (Dom) {
          setTimeout(() => {
            if (Dom[0]) {
              if (Dom[0].getBoundingClientRect().top > document.documentElement.clientHeight - 40 || Dom[0].getBoundingClientRect().top < 60) {
                if (DomBox) {
                  DomBox.scrollTop = 0;
                  DomBox.scrollTo({
                    top: Dom[0].getBoundingClientRect().top - 300,
                    behavior: 'smooth'
                  });
                }
              }
            }
          }, 500);
        }
      }
    },
    filterNode(value, data, node) {
      return data.hiddenFlag !== '1';
    }
  }
};

var __$_require_static_images_icons_books_catalog_left_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAgCAYAAAAWl4iLAAAAAXNSR0IArs4c6QAAArRJREFUSEuV1XtIFFEUx/HfmdlV20JXjTRRigiSLCmKikDCCpPQTazsoYlZaS6GoEkJBUUSJhS93NAUI0tTK5UEM6MiKiIilTAMooIiwVpfuW27unNiF4rKx73Ov/O9H87cGe4QpnDFWfrugrFBYkkHSUSeZGNJb7AC3WcAqnANcZ40HFfSnwPwWSEKuDSMhk4Btr4EaJkQJrQ2mwNipWCT5esCjdVuIQqAmFLvZPtXScFxFusJMB2RgG3OH86ge/nBNjHMTKZL/e8AzBPBBFQ1mQNS3Z0Q3lRmXa1oylMR6r6vsBJ7K8uvVQrefHnAQsxZEnAPGY1h9UnkEsIZpawfVAa+AJgphAlnavf65/3uJt2KlIp+k0bUJEQ9I/LS6t3+HVJwauXADRC2iWHquprmt+jvbsKJk69Zfb01XQ8Agwgm4sMVu4ynpOB914fSCFwpQgFoOmV0rmVH4Ccp2Fw92Aai9UKY8dCy03ft/924W5FdYwtRVc09gSKCmTj9/FbfMU82Lnzw5nAuiE+LUAB2h90ZfCElcEhq4kONw+0ELJGAa4sSZmwfrxsz8bHG7wtdqtIlgYIZ8YWm6c1S8PEW20liFEjAvUGzDKGZy2lECDMzFbXZP4AxRwgTLhbEGA5M1P2zFcX37VEK8FiIuj8X4pW56wwvpOBzj+ylYGRIwG9zoqeFT9b9mbiui72+WX/2ABQghJmOmtd4F0rB5c8cCczcIEQBVjXMT4/yeS8FX3nuqAewRQzzk7RVPlGizrMVle1s1I+OuE8yH+ECRmbyCq8yYecO6l459zBQLooBOMhbH5IUQX2i1jPx7c6RBwCiRTEIDYmR+kRh5/6hNL7mMAWujzInGQGJ8Yt1Mi8Y1PLGlc/gYokp+oZZnZ0UQU6JFtTa7eokIFIiLo0JV/dLdJ7kF9A34eGKDiwmAAAAAElFTkSuQmCC";

var __$_require_static_images_icons_books_catalog_right_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAiCAYAAABbXymAAAAAAXNSR0IArs4c6QAAAr5JREFUSEu11ltIVFEUxvFvnTOjOeokFTEZExqYD/OQl25YZNKFLMSwKKUSNVCQMsiHriBUoHTxQTDIQMQJrAkyoUgrsilCmQyLNDRQS61EgkSnEZ3LiqMYajPu3UPndf/3j8WeczZD+IenbZArwSiU2NJBEtFU0tnJQeNGfAOwVGLPWWn4TT+nE+GBBOqDimhpuG2A7wE4IIIJsCeaaZsU3N7HEV4dhgAES8D5iWa6JQW/HeB8Bm6KUAATqgem+GgakYId/WwHsFUCvr9hFe3XOiHc0sdRIO6VaRmUkRRF9VLw614+z+DLEtP+HPXSij0xNCEFv+jxdREQK4SJq5JXqwUz3YJH8ayb1yvkcwhRAAwlefsaeikFN3V7K4hxQgL+sjNWiSYiFsLNzawbN3m/grFcBBNzaapFf252F/AoGj549hLwUIRq6z5Fteyz0EcpuP795B0GHZKA32Ws1cfP7/xOfLuVjfog93cABhFMoOKDCfpyKdjqmMwlQrUI1U5BVd3mrIRQ7Tqd8/iduKZ18jnAKWKYnuZsCtrlr/sLrra7zF6d8hmAIoIZnJu/OaRGCr7xauI0mMtEKABXsBJsOraFxqTgiubxDgYsIpiAu0UpIZmBujlHceWJM05R1HYROn3JUFrxjkUB3/M5cFmj6zoTTglhxo8ly0IiC9aRWzixzcZqV5hrEIBJBDOhsiQ19PhC3Z+JLzxy7iYfPRah0+uUdCnN0CIFn2lwWsE4IoIJ1FOabojBrJss4FtRaBsOM6iGIYBDhTDh4tWM8BJhpwVFNudRAteKYm1d9XFseabxk6idOuPCurEmgP1+mrMBAhyVWcaNInTqV8ir+xWp83n6tWEkNpysOry4QqID5dWOFgN8TSL2uKGstGaHD0u0oOyaEe1LixPFDDRacyJSRd3MuvAPiyw0v/tv8G/n6daZTIqGOwAAAABJRU5ErkJggg==";

/* script */
const __vue_script__$25 = script$25;
var __vue_render__$25 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "xml-preview-catalog-pc",
      attrs: { id: "xmlPreviewCatalogPc" },
    },
    [
      _vm.userType == "teacher"
        ? _c(
            "div",
            {
              staticClass: "catalog-header",
              class: _vm.userType == "teacher" ? "catalogHeaderHeader" : "",
            },
            [
              _c("img", {
                attrs: {
                  src: __$_require_static_images_icons_books_catalog_left_png__,
                  alt: "",
                },
              }),
              _vm._v(" "),
              _c("div", { staticClass: "catalog-title" }, [_vm._v("教材目录")]),
              _vm._v(" "),
              _c("img", {
                attrs: {
                  src: __$_require_static_images_icons_books_catalog_right_png__,
                  alt: "",
                },
              }),
            ]
          )
        : _vm._e(),
      _vm._v(" "),
      _vm.userType == "teacher"
        ? _c(
            "div",
            {
              staticClass: "text-book-name",
              class: _vm.userType == "teacher" ? "textbookNameTeacer" : "",
            },
            [
              _c("span", [
                _vm._v(
                  _vm._s(_vm.textBookName ? _vm.textBookName : "未选择教材")
                ),
              ]),
            ]
          )
        : _vm._e(),
      _vm._v(" "),
      _c(
        "div",
        {
          staticClass: "catalog-content",
          class: _vm.userType == "teacher" ? "catalogContentTeacher" : "",
        },
        [
          _vm.currentNodeKey != ""
            ? _c("el-tree", {
                ref: "tree",
                attrs: {
                  id: "preview-tree",
                  "default-expand-all": true,
                  data: _vm.catalogLists,
                  props: _vm.defaultProps,
                  "highlight-current": _vm.PreviewCatalog,
                  indent: 24,
                  draggable: false,
                  "node-key": "id",
                  "filter-node-method": _vm.filterNode,
                  "expand-on-click-node": false,
                  "current-node-key": _vm.currentNodeKey,
                },
                on: { "node-click": _vm.nodeclick },
                scopedSlots: _vm._u(
                  [
                    {
                      key: "default",
                      fn: function (ref) {
                        var node = ref.node;
                        var data = ref.data;
                        return _c(
                          "span",
                          {},
                          [
                            [
                              _c(
                                "div",
                                {
                                  staticClass: "catalog-node__right",
                                  on: {
                                    click: function ($event) {
                                      $event.stopPropagation();
                                      return function () {
                                        return _vm.expandOrCollapseNode(node)
                                      }.apply(null, arguments)
                                    },
                                  },
                                },
                                [
                                  node.childNodes.length && node.expanded
                                    ? _c("i", {
                                        staticClass: "el-icon-arrow-down",
                                        staticStyle: {
                                          "font-size": "16px",
                                          "font-weight": "600",
                                        },
                                      })
                                    : node.childNodes.length && !node.expanded
                                    ? _c("i", {
                                        staticClass: "el-icon-arrow-right",
                                        staticStyle: {
                                          "font-size": "16px",
                                          "font-weight": "600",
                                        },
                                      })
                                    : _vm._e(),
                                ]
                              ),
                              _vm._v(" "),
                              _c("span", {
                                staticClass: "custom-tree-node",
                                attrs: { title: node.label },
                                domProps: { textContent: _vm._s(node.label) },
                                on: {
                                  click: function () {
                                    return _vm.nodeClick(data)
                                  },
                                },
                              }),
                            ],
                          ],
                          2
                        )
                      },
                    },
                  ],
                  null,
                  false,
                  271666982
                ),
              })
            : _vm._e(),
        ],
        1
      ),
    ]
  )
};
var __vue_staticRenderFns__$25 = [];
__vue_render__$25._withStripped = true;

  /* style */
  const __vue_inject_styles__$25 = undefined;
  /* scoped */
  const __vue_scope_id__$25 = "data-v-58c6a147";
  /* module identifier */
  const __vue_module_identifier__$25 = undefined;
  /* functional template */
  const __vue_is_functional_template__$25 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$25 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$25, staticRenderFns: __vue_staticRenderFns__$25 },
    __vue_inject_styles__$25,
    __vue_script__$25,
    __vue_scope_id__$25,
    __vue_is_functional_template__$25,
    __vue_module_identifier__$25,
    false,
    undefined,
    undefined,
    undefined
  );

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

var script$24 = {
  name: 'xmlEmpty'
};

/* script */
const __vue_script__$24 = script$24;

/* template */
var __vue_render__$24 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticClass: "xml-empty-content" }, [
    _c(
      "svg",
      {
        staticClass: "icon",
        attrs: {
          t: "1712834383184",
          viewBox: "0 0 1238 1024",
          version: "1.1",
          xmlns: "http://www.w3.org/2000/svg",
          "p-id": "2473",
          "xmlns:xlink": "http://www.w3.org/1999/xlink",
          width: "154.75",
          height: "128",
        },
      },
      [
        _c("path", {
          attrs: {
            d: "M23.81001 23.81h904.93a23.81 23.81 0 0 1 23.82 23.82v940.65a23.81 23.81 0 0 1-23.82 23.81H23.81001A23.81 23.81 0 0 1 0.00001 988.28V47.63A23.81 23.81 0 0 1 23.81001 23.8z m95.26 95.26a23.81 23.81 0 0 0-23.81 23.81v750.14a23.81 23.81 0 0 0 23.81 23.82h714.42a23.81 23.81 0 0 0 23.81-23.82V142.88a23.81 23.81 0 0 0-23.81-23.81H119.07001z",
            fill: "#ECF0F9",
            "p-id": "2474",
          },
        }),
        _vm._v(" "),
        _c("path", {
          attrs: {
            d: "M190.51001 285.77h571.54v59.53H190.50001v-59.53z m0 142.88h571.54v59.54H190.50001v-59.54z m0 142.88h404.84v59.54H190.50001v-59.54z",
            fill: "#ECF0F9",
            "p-id": "2475",
          },
        }),
        _vm._v(" "),
        _c("path", {
          attrs: {
            d: "M309.58001 0h333.4a23.81 23.81 0 0 1 23.81 23.81v83.35a23.81 23.81 0 0 1-23.81 23.82h-333.4a23.81 23.81 0 0 1-23.81-23.82V23.81A23.81 23.81 0 0 1 309.58001 0z",
            fill: "#E0E4ED",
            "p-id": "2476",
          },
        }),
        _vm._v(" "),
        _c("path", {
          attrs: {
            d: "M995.98001 357.44c-5.13 10.8-6.46 23.04-3.99 36.73 3.73 20.54 15.16 35.14 28.1 35.14l0.92 17.76c13.4 3.99 24.96 1.67 34.7-6.98-5.61-12.37-7.88-23.83-6.8-34.4l8.36-7.03 1.88-18.82-11.22-4.76-13.21-28.73-38.73 11.07z",
            fill: "#FFDCBC",
            "p-id": "2477",
          },
        }),
        _vm._v(" "),
        _c("path", {
          attrs: {
            d: "M883.63001 965.52a142.88 47.63 0 1 0 285.77 0 142.88 47.63 0 1 0-285.77 0z",
            fill: "#E2E6EF",
            "p-id": "2478",
          },
        }),
        _vm._v(" "),
        _c("path", {
          attrs: {
            d: "M1006.22001 909.48c-1.82 12.8-8.83 23.06-21.04 30.81-18.31 11.63-7.91 19.98 5.52 19.98 13.44 0 47.5-14.02 49.89-25.4 1.58-7.57-1.58-17.2-9.45-28.88l-24.92 3.49z",
            fill: "#416396",
            "p-id": "2479",
          },
        }),
        _vm._v(" "),
        _c("path", {
          attrs: {
            d: "M1036.86001 926.15c-32.34 23.38-40.82 38.89-25.43 46.5 15.37 7.62 34.5-0.14 57.38-23.25 5.89-7.7 3.02-16.76-8.61-27.2-8.48-2.93-16.26-1.61-23.34 3.95z",
            fill: "#466DA6",
            "p-id": "2480",
          },
        }),
        _vm._v(" "),
        _c("path", {
          attrs: {
            d: "M992.15001 360.3c7.73-19.88 21.82-28.74 42.28-26.6 20.47 2.15 32.03 14.98 34.66 38.49-0.43 17.35-6.84 30.22-19.23 38.61-2.02-2.49-1.87-4.76 0.47-6.86 3.04-2.72 9.22-10.14 6.25-17.1-1.98-4.61-5.05-5.91-9.2-3.86 1.18-12.46-5-20.9-18.53-25.34-13.55-4.43-25.78-3.55-36.7 2.67z",
            fill: "#58626B",
            "p-id": "2481",
          },
        }),
        _vm._v(" "),
        _c("path", {
          attrs: {
            d: "M1085.63001 670.67l-16.97 260.96c-12.02 8.57-22.86 7.84-32.53-2.15l-11.05-218.81-11.3 103.91 18.4 95.37c-5.31 7.2-13.9 9.34-25.74 6.41l-39.46-105.03 4.86-150.5 113.8 9.84z",
            fill: "#2274FF",
            "p-id": "2482",
          },
        }),
        _vm._v(" "),
        _c("path", {
          attrs: {
            d: "M1102.20001 513.96c15.71 26.9 29.17 38.96 40.36 36.23 16.79-4.11 51.67-60.17 61.21-66.28 5.96-3.8 18.39-3.95 33.48-1.49 1.43 0 1.7-0.68 0.8-1.99-20.12-17.83-35.08-22.14-44.89-12.91a4921.51 4921.51 0 0 1-50.6 46.44l-17-26.49-23.38 26.5z m-108.52-2.35c-15.71 34.82-29.17 50.88-40.36 48.14-16.79-4.11-51.68-60.17-61.21-66.28-5.96-3.8-18.39-15.87-33.49-13.4-1.42-0.02-1.7-0.68-0.8-1.98 20.13-9.9 35.08-10.24 44.9-1.03 9.82 9.22 26.68 24.71 50.6 46.45l16.98-26.5 23.38 14.6z",
            fill: "#FFDCBC",
            "p-id": "2483",
          },
        }),
        _vm._v(" "),
        _c("path", {
          attrs: {
            d: "M1023.64001 445.38c11.87 3.05 23.4 0.71 34.6-7 19.41-2.35 32.8 1.08 40.14 10.29a938.75 938.75 0 0 0 28.73 33.88c-3.8 18.21-13.38 29.93-28.73 35.17l-7.34-7.43c3.34 98.59 2.23 153.57-3.34 164.93-47.95 3.1-87.28-0.51-117.95-10.79l14.74-149.92-22.8-19.58L990.27001 454c5.69-6.34 10.9-10.13 15.64-11.36 4.74-1.22 10.66-0.32 17.74 2.74z",
            fill: "#F6F8FC",
            "p-id": "2484",
          },
        }),
      ]
    ),
  ])
};
var __vue_staticRenderFns__$24 = [];
__vue_render__$24._withStripped = true;

  /* style */
  const __vue_inject_styles__$24 = undefined;
  /* scoped */
  const __vue_scope_id__$24 = undefined;
  /* module identifier */
  const __vue_module_identifier__$24 = undefined;
  /* functional template */
  const __vue_is_functional_template__$24 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$24 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$24, staticRenderFns: __vue_staticRenderFns__$24 },
    __vue_inject_styles__$24,
    __vue_script__$24,
    __vue_scope_id__$24,
    __vue_is_functional_template__$24,
    __vue_module_identifier__$24,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$23 = {
  name: 'BookMarkStudent',
  components: {
    xmlResourceListPc: __vue_component__$2e,
    xmlEmpty: __vue_component__$24
  },
  props: {
    bookmarkList: [],
    location: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      launchValue: ''
    };
  },
  watch: {
    bookmarkList() {
      this.launchValue = this.bookmarkList[0]?.firstLevelId;
    },
    settingData: {
      handler(newValue) {
        this.form = {
          ...this.form,
          ...newValue
        };
      },
      immediate: true,
      deep: true
    }
  },
  mounted() {
    this.launchValue = this.bookmarkList[0]?.firstLevelId;
  },
  methods: {
    deleteBookmarkItem(item) {
      this.$confirm(`确认删除此条书签吗？`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        duration: 1000
      }).then(() => {
        this.$EventBus.$emit('deleteBookmark', item);
      });
    },
    removeStyle(e) {
      if (e) {
        e = e.replace(/<[^>]+>/g, ''); //去除所有标签，以纯文本展示
        e = e.replace(/\s/gi, ''); //去除空格
        e = e.replace(/&nbsp;/gi, ''); //去除空格
        return e;
      }
    }
  }
};

/* script */
const __vue_script__$23 = script$23;
var __vue_render__$23 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { staticClass: "bookm-mark-student demo-collapse" },
    [
      _vm.bookmarkList.length == 0
        ? _c("xmlEmpty", { staticClass: "xml-empty" })
        : _vm._e(),
      _vm._v(" "),
      _c(
        "el-collapse",
        {
          staticClass: "pcbookmarkList",
          attrs: { accordion: "" },
          model: {
            value: _vm.launchValue,
            callback: function ($$v) {
              _vm.launchValue = $$v;
            },
            expression: "launchValue",
          },
        },
        _vm._l(_vm.bookmarkList, function (item) {
          return _c(
            "el-collapse-item",
            { key: item.firstLevelId, attrs: { name: item.firstLevelId } },
            [
              _c("template", { slot: "title" }, [
                _c("div", { staticClass: "collapse-title" }, [
                  _vm._v(
                    "\n          " + _vm._s(item.firstLevelLabel) + "\n        "
                  ),
                ]),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "resource-list" }, [
                _c(
                  "div",
                  { staticStyle: { width: "100%" } },
                  [
                    _vm._l(item.list, function (items, index) {
                      return _c(
                        "div",
                        { key: index, staticClass: "xml-teacher-note" },
                        [
                          _c(
                            "div",
                            { staticClass: "xml-note-header delete-btn" },
                            [
                              _c("img", {
                                staticClass: "note-icon",
                                attrs: {
                                  src: __$_require_static_images_icons_resource_student_bookmark_svg__,
                                  alt: "",
                                },
                              }),
                              _vm._v(" "),
                              _c("div", {
                                staticClass: "delete-btn-item",
                                on: {
                                  click: function ($event) {
                                    return _vm.deleteBookmarkItem(items)
                                  },
                                },
                              }),
                            ]
                          ),
                          _vm._v(" "),
                          _c(
                            "div",
                            {
                              staticClass: "note-content",
                              attrs: { title: items.bookmarkText },
                              on: {
                                click: function ($event) {
                                  return _vm.$emit(
                                    "resourceDetails",
                                    items,
                                    "id",
                                    ""
                                  )
                                },
                              },
                            },
                            [
                              _vm._v(
                                "\n                " +
                                  _vm._s(_vm.removeStyle(items.bookmarkText)) +
                                  "\n              "
                              ),
                            ]
                          ),
                        ]
                      )
                    }),
                  ],
                  2
                ),
              ]),
            ],
            2
          )
        }),
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$23 = [];
__vue_render__$23._withStripped = true;

  /* style */
  const __vue_inject_styles__$23 = undefined;
  /* scoped */
  const __vue_scope_id__$23 = undefined;
  /* module identifier */
  const __vue_module_identifier__$23 = undefined;
  /* functional template */
  const __vue_is_functional_template__$23 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$23 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$23, staticRenderFns: __vue_staticRenderFns__$23 },
    __vue_inject_styles__$23,
    __vue_script__$23,
    __vue_scope_id__$23,
    __vue_is_functional_template__$23,
    __vue_module_identifier__$23,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$22 = {
  name: 'nodeStudent',
  components: {
    xmlResourceListPc: __vue_component__$2e,
    xmlEmpty: __vue_component__$24
  },
  props: {
    nodesList: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      show: false,
      expansion: false,
      isContentLong: false,
      isMasked: false,
      exoabsionShowFalse: false,
      exoabsionShow: true,
      launchValue: ''
    };
  },
  watch: {
    nodesList() {
      this.launchValue = this.nodesList[0]?.firstLevelId;
    },
    settingData: {
      handler(newValue) {
        this.form = {
          ...this.form,
          ...newValue
        };
      },
      immediate: true,
      deep: true
    }
  },
  mounted() {
    this.launchValue = this.nodesList[0]?.firstLevelId;
  },
  methods: {
    toggleExpansion(e) {
      this.expansion = !this.expansion;
      //  e= e.noteContent.split('')
      e = e.split('');
      if (e.length >= 151) {
        this.exoabsionShow = true;
      }
    },
    deleteItem(items) {
      // 删除提示
      this.$confirm(`确认删除此条笔记吗？`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        duration: 1000
      }).then(() => {
        this.$EventBus.$emit('deleteNote', items, () => {});
      }).catch(() => {});
    },
    editNoteStudent(items) {
      this.$EventBus.$emit('editStudentNote', items);
    }
  },
  created() {}
};

/* script */
const __vue_script__$22 = script$22;
var __vue_render__$22 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { staticClass: "node-student demo-collapse" },
    [
      _vm.nodesList.length == 0
        ? _c("xmlEmpty", { staticClass: "xml-empty" })
        : _vm._e(),
      _vm._v(" "),
      _c(
        "el-collapse",
        {
          staticClass: "pcnotelist",
          attrs: { accordion: "" },
          model: {
            value: _vm.launchValue,
            callback: function ($$v) {
              _vm.launchValue = $$v;
            },
            expression: "launchValue",
          },
        },
        _vm._l(_vm.nodesList, function (item) {
          return _c(
            "el-collapse-item",
            { key: item.firstLevelId, attrs: { name: item.firstLevelId } },
            [
              _c("template", { slot: "title" }, [
                _c("div", { staticClass: "collapse-title" }, [
                  _vm._v(
                    "\n          " + _vm._s(item.firstLevelLabel) + "\n        "
                  ),
                ]),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "resource-list" }, [
                _c(
                  "div",
                  { staticStyle: { width: "100%" } },
                  [
                    _vm._l(item.list, function (items, index) {
                      return _c(
                        "div",
                        { key: index, staticClass: "xml-teacher-note" },
                        [
                          _c(
                            "div",
                            { staticClass: "xml-note-header" },
                            [
                              _c("img", {
                                staticClass: "note-icon",
                                attrs: {
                                  src: __$_require_static_images_icons_resource_note_icon_svg__,
                                  alt: "",
                                },
                              }),
                              _vm._v(" "),
                              _c(
                                "el-popover",
                                {
                                  attrs: {
                                    placement: "bottom",
                                    width: "40px",
                                    trigger: "hover",
                                    "popper-class": "customPopper",
                                  },
                                },
                                [
                                  _c(
                                    "div",
                                    { staticClass: "teacher-note-popover" },
                                    [
                                      _c(
                                        "span",
                                        {
                                          on: {
                                            click: function ($event) {
                                              return _vm.editNoteStudent(items)
                                            },
                                          },
                                        },
                                        [_vm._v("编辑")]
                                      ),
                                      _vm._v(" "),
                                      _c(
                                        "span",
                                        {
                                          on: {
                                            click: function ($event) {
                                              return _vm.deleteItem(items)
                                            },
                                          },
                                        },
                                        [_vm._v("删除")]
                                      ),
                                    ]
                                  ),
                                  _vm._v(" "),
                                  _c("i", {
                                    staticClass: "el-icon-more",
                                    attrs: { slot: "reference" },
                                    slot: "reference",
                                  }),
                                ]
                              ),
                            ],
                            1
                          ),
                          _vm._v(" "),
                          _c(
                            "div",
                            {
                              staticClass:
                                "note-content note-content-studentnode",
                              class: _vm.expansion
                                ? "note-content-studentnodeFlex"
                                : "",
                              on: {
                                click: function ($event) {
                                  $event.stopPropagation();
                                  return _vm.$emit(
                                    "resourceDetails",
                                    items,
                                    "id",
                                    ""
                                  )
                                },
                              },
                            },
                            [
                              _c("xmlTextOverflow", {
                                attrs: { info: items.noteContent },
                              }),
                            ],
                            1
                          ),
                        ]
                      )
                    }),
                  ],
                  2
                ),
              ]),
            ],
            2
          )
        }),
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$22 = [];
__vue_render__$22._withStripped = true;

  /* style */
  const __vue_inject_styles__$22 = undefined;
  /* scoped */
  const __vue_scope_id__$22 = undefined;
  /* module identifier */
  const __vue_module_identifier__$22 = undefined;
  /* functional template */
  const __vue_is_functional_template__$22 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$22 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$22, staticRenderFns: __vue_staticRenderFns__$22 },
    __vue_inject_styles__$22,
    __vue_script__$22,
    __vue_scope_id__$22,
    __vue_is_functional_template__$22,
    __vue_module_identifier__$22,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$21 = {
  name: 'highlightStudent',
  components: {
    xmlResourceListPc: __vue_component__$2e,
    xmlEmpty: __vue_component__$24
  },
  props: {
    highlightList: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      launchValue: ''
    };
  },
  watch: {
    highlightList() {
      this.launchValue = this.highlightList[0]?.firstLevelId;
    },
    settingData: {
      handler(newValue) {
        this.form = {
          ...this.form,
          ...newValue
        };
      },
      immediate: true,
      deep: true
    }
  },
  mounted() {
    this.launchValue = this.highlightList[0]?.firstLevelId;
  },
  methods: {
    deleteHighlightItem(items) {
      this.$confirm(`确认删除此条高亮吗？`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        duration: 1000
      }).then(() => {
        this.$EventBus.$emit('deleteHighlight', items, () => {});
      }).catch(() => {});
    },
    removeStyle(e) {
      if (e) {
        e = e.replace(/<[^>]+>/g, ''); //去除所有标签，以纯文本展示
        e = e.replace(/\s/gi, ''); //去除空格
        e = e.replace(/&nbsp;/gi, ''); //去除空格
        return e;
      }
    }
  },
  created() {}
};

/* script */
const __vue_script__$21 = script$21;
var __vue_render__$21 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { staticClass: "highlight-student demo-collapse" },
    [
      _vm.highlightList.length == 0
        ? _c("xmlEmpty", { staticClass: "xml-empty" })
        : _vm._e(),
      _vm._v(" "),
      _c(
        "el-collapse",
        {
          staticClass: "pcstudenthighlight",
          attrs: { accordion: "" },
          model: {
            value: _vm.launchValue,
            callback: function ($$v) {
              _vm.launchValue = $$v;
            },
            expression: "launchValue",
          },
        },
        _vm._l(_vm.highlightList, function (item) {
          return _c(
            "el-collapse-item",
            { key: item.firstLevelId, attrs: { name: item.firstLevelId } },
            [
              _c("template", { slot: "title" }, [
                _c("div", { staticClass: "collapse-title" }, [
                  _vm._v(
                    "\n          " + _vm._s(item.firstLevelLabel) + "\n        "
                  ),
                ]),
              ]),
              _vm._v(" "),
              _vm._l(item.list, function (items, index) {
                return _c("div", { key: index, staticClass: "resource-list" }, [
                  _c(
                    "div",
                    { staticStyle: { width: "100%" } },
                    [
                      [
                        _c("div", { staticClass: "xml-teacher-note" }, [
                          _c(
                            "div",
                            { staticClass: "xml-note-header delete-btn" },
                            [
                              _c("img", {
                                staticClass: "note-icon",
                                attrs: {
                                  src: __$_require_static_images_icons_resource_student_lighheight_svg__,
                                  alt: "",
                                },
                              }),
                              _vm._v(" "),
                              _c("div", {
                                staticClass: "delete-btn-item",
                                on: {
                                  click: function ($event) {
                                    return _vm.deleteHighlightItem(items)
                                  },
                                },
                              }),
                            ]
                          ),
                          _vm._v(" "),
                          _c(
                            "div",
                            {
                              staticClass: "note-content",
                              attrs: { title: items.selectionText },
                              on: {
                                click: function ($event) {
                                  return _vm.$emit(
                                    "resourceDetails",
                                    items,
                                    "id",
                                    ""
                                  )
                                },
                              },
                            },
                            [
                              _c("xmlTextOverflow", {
                                attrs: {
                                  info: _vm.removeStyle(items.selectionText),
                                },
                              }),
                            ],
                            1
                          ),
                        ]),
                      ],
                    ],
                    2
                  ),
                ])
              }),
            ],
            2
          )
        }),
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$21 = [];
__vue_render__$21._withStripped = true;

  /* style */
  const __vue_inject_styles__$21 = undefined;
  /* scoped */
  const __vue_scope_id__$21 = undefined;
  /* module identifier */
  const __vue_module_identifier__$21 = undefined;
  /* functional template */
  const __vue_is_functional_template__$21 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$21 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$21, staticRenderFns: __vue_staticRenderFns__$21 },
    __vue_inject_styles__$21,
    __vue_script__$21,
    __vue_scope_id__$21,
    __vue_is_functional_template__$21,
    __vue_module_identifier__$21,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$20 = {
  name: 'PreviewLeftStudent',
  data() {
    return {
      activeName: 'fourth',
      data: {
        notes: {
          list: []
        },
        bookmark: {
          list: []
        },
        highlight: {
          list: []
        },
        resources: {
          list: []
        }
      },
      businessType: 'textBook',
      selectId: '',
      PreviewCatalog: false,
      textBookList: [],
      componentList: [],
      scrollTop: 0,
      catalogLists: []
    };
  },
  components: {
    PreviewCatalog: __vue_component__$25,
    BookMarkStudent: __vue_component__$23,
    nodeStudent: __vue_component__$22,
    highlightStudent: __vue_component__$21
  },
  props: {
    textBookId: String,
    catalogList: Array,
    location: {
      type: String,
      default: ''
    },
    deleteNote: {
      type: Function,
      default: () => {}
    },
    editNote: {
      type: Function,
      default: () => {}
    },
    deleteBookmark: {
      type: Function,
      default: () => {}
    },
    deleteHighlight: {
      type: Function,
      default: () => {}
    },
    userType: {
      type: String,
      default: 'student'
    },
    pageType: {
      //页面类型：取值h5、pc、pad
      type: String,
      default: 'h5'
    },
    styleType: {
      //阅读风格
      type: String,
      default: 'A'
    },
    textBookId: {
      //数字教材Id
      type: String,
      default: ''
    },
    checkedId: {
      type: String,
      default: ''
    },
    looseLeafData: Object,
    //所有活页信息
    resourcesList: {
      type: Array,
      default: () => []
    },
    textBookName: {
      type: String,
      default: ''
    },
    notesList: {
      type: Array,
      default: () => []
    },
    highlightList: {
      type: Array,
      default: () => []
    },
    bookmarkList: {
      type: Array,
      default: () => []
    }
  },
  computed: {
    teacherResourcesList() {
      this.textBookResource.teachingResourceTotal = 0;
      let list = this.resourcesList;
      list.sort(this.sortBy('chapterOrderNum', 1));
      const map = [];
      list.forEach(e => {
        if (e.type == 'note__teacher') {
          this.teacherNoteList.push(e);
        }
        if (e.isStudentShow != 1 || this.userType == 'teacher') {
          this.textBookResource.teachingResourceTotal += 1;
          const findObj = map.find(innerTmp => innerTmp.firstLevelId === e.firstLevelId);
          if (findObj) {
            findObj.list.push(e);
          } else {
            map.push({
              firstLevelId: e.firstLevelId,
              firstLevelLabel: e.firstLevelLabel,
              chapterOrderNum: e.chapterOrderNum,
              list: [e]
            });
          }
        }
      });
      return map;
    }
  },
  watch: {
    catalogList: {
      handler(newValue) {
        if (this.catalogLists.length > 0) {
          this.currentNodeKey = this.catalogLists[0].id;
        }
      },
      immediate: true
    }
  },
  mounted() {
    const origin = this.catalogList;
    const filterMenu = menuList => {
      return menuList.filter(item => {
        return item.hiddenFlag !== '1';
      }).map(item => {
        item = Object.assign({}, item);
        if (item.children?.length) {
          item.children = filterMenu(item.children);
        }
        return item;
      });
    };
    this.catalogLists = filterMenu(origin), setTimeout(() => {
      if (this.catalogLists.length > 0) {
        this.currentNodeKey = this.catalogLists[0].id;
      }
    }, 500);
    this.$nextTick(() => {
      let height = document.getElementById('textBookName').clientHeight;
      let Dom = document.getElementById('preview-left-student').getElementsByClassName('el-tabs__header');
      if (Dom) {
        Dom[0].style.top = height + 'px';
      }
      console.log(height, Dom);
    });
  },
  methods: {
    // 目录跳转指定章节
    catalogClick(obj) {
      this.$emit('onNodeClick', obj);
    },
    // 笔记跳转到指定位置
    jumpingNotes(item) {
      this.$emit('jumpingNotes', obj);
    },
    // 书签跳转到指定位置
    jumpingBookmark(item) {
      this.$emit('jumpingBookmark', obj);
    },
    resourceDetails(items, type, text) {
      this.$emit('resourceDetails', items, type, text);
      console.log(items, 'items');
    }
  }
};

/* script */
const __vue_script__$20 = script$20;
/* template */
var __vue_render__$20 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "preview-left-student",
      attrs: { id: "preview-left-student" },
    },
    [
      _c(
        "div",
        { staticClass: "text-book-name", attrs: { id: "textBookName" } },
        [
          _c("span", [
            _vm._v(_vm._s(_vm.textBookName ? _vm.textBookName : "未选择教材")),
          ]),
        ]
      ),
      _vm._v(" "),
      _vm.userType == "student"
        ? _c(
            "el-tabs",
            {
              staticClass: "demo-tabs Preview-left-student",
              attrs: { userType: _vm.userType },
              model: {
                value: _vm.activeName,
                callback: function ($$v) {
                  _vm.activeName = $$v;
                },
                expression: "activeName",
              },
            },
            [
              _c(
                "el-tab-pane",
                { attrs: { label: "目录", name: "fourth" } },
                [
                  _vm.businessType === "textBook"
                    ? _c("xml-preview-catalog", {
                        ref: "xmlPreviewCatalog",
                        staticClass:
                          "pc-catalog pc-catalog--render pc-student-catalog pc-student-left",
                        attrs: {
                          "page-type": _vm.pageType,
                          "style-type": _vm.styleType,
                          "text-book-id": _vm.textBookId,
                          "catalog-list": _vm.catalogList,
                          userType: _vm.userType,
                          notesList: _vm.notesList,
                          checkedId: _vm.checkedId,
                          PreviewCatalog: _vm.PreviewCatalog,
                          textBookName: _vm.textBookName,
                        },
                        on: {
                          onNodeClick: _vm.catalogClick,
                          jumpingNotes: _vm.jumpingNotes,
                          jumpingBookmark: _vm.jumpingBookmark,
                        },
                      })
                    : _vm._e(),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "el-tab-pane",
                { attrs: { label: "书签", name: "first" } },
                [
                  _c("book-mark-student", {
                    attrs: { bookmarkList: _vm.bookmarkList },
                    on: {
                      deleteBookmark: _vm.deleteBookmark,
                      resourceDetails: _vm.resourceDetails,
                    },
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "el-tab-pane",
                { attrs: { label: "笔记", name: "second" } },
                [
                  _c("node-student", {
                    attrs: { nodesList: _vm.notesList },
                    on: {
                      deleteNote: _vm.deleteNote,
                      editNote: function ($event) {
                        _vm.$emit("editNote", function (e) {
                          return e
                        });
                      },
                      resourceDetails: _vm.resourceDetails,
                    },
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "el-tab-pane",
                { attrs: { label: "高亮", name: "third" } },
                [
                  _c("highlight-student", {
                    attrs: { highlightList: _vm.highlightList },
                    on: {
                      deleteHighlight: _vm.deleteHighlight,
                      resourceDetails: _vm.resourceDetails,
                    },
                  }),
                ],
                1
              ),
            ],
            1
          )
        : _vm._e(),
    ],
    1
  )
};
var __vue_staticRenderFns__$20 = [];
__vue_render__$20._withStripped = true;

  /* style */
  const __vue_inject_styles__$20 = undefined;
  /* scoped */
  const __vue_scope_id__$20 = undefined;
  /* module identifier */
  const __vue_module_identifier__$20 = undefined;
  /* functional template */
  const __vue_is_functional_template__$20 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$20 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$20, staticRenderFns: __vue_staticRenderFns__$20 },
    __vue_inject_styles__$20,
    __vue_script__$20,
    __vue_scope_id__$20,
    __vue_is_functional_template__$20,
    __vue_module_identifier__$20,
    false,
    undefined,
    undefined,
    undefined
  );

//
let target;
var script$1$ = {
  name: 'XmlDigitalTeaching',
  components: {
    xmlPreviewSearch: __vue_component__$2j,
    xmlToolbarPc: __vue_component__$2i,
    xmlResourceListPc: __vue_component__$2e,
    addFile: __vue_component__$4N,
    setPop: __vue_component__$2d,
    xmlToolbarPhone: __vue_component__$27,
    downFileUppop: __vue_component__$2a,
    PdfView: __vue_component__$4y,
    modifyNotes: __vue_component__$26,
    resourceListPhone: __vue_component__$29,
    PreviewLeftStudent: __vue_component__$20,
    highlight: __vue_component__$2c,
    bookmark: __vue_component__$2b
  },
  props: {
    textBookData: Object,
    //数字教材信息
    catalogList: Array,
    //目录
    looseLeafData: Object,
    //所有活页信息
    deleteNote: {
      type: Function,
      default: () => {}
    },
    editNote: {
      type: Function,
      default: () => {}
    },
    deleteHighlight: {
      type: Function,
      default: () => {}
    },
    isShowTeacherResource: {
      // 是否显示教师资源
      type: Boolean,
      default: false
    },
    notesList: {
      type: Array,
      default: () => []
    },
    //笔记列表
    bookmarkList: {
      type: Array,
      default: () => []
    },
    //书签列表
    resourcesList: {
      //教师资源列表
      type: Array,
      default: () => []
    },
    highlightList: {
      //高亮列表
      type: Array,
      default: () => []
    },
    readerType: {
      //阅读器类型,reader:阅读器器模式可添加书签、笔记等，preview：预览模式不可添加书签、笔记等，loose-leaf:活页模式只显示教材内容
      type: String,
      default: 'reader'
    },
    pageType: {
      //页面类型：取值h5、pc、pad
      type: String,
      default: 'h5'
    },
    styleType: {
      //阅读风格
      type: String,
      default: 'A'
    },
    isTrial: {
      // 是否为试读模式
      type: Boolean,
      default: false
    },
    isTrialIndex: {
      // 是否为试读模式进度
      type: Number,
      default: 10
    },
    textBookId: {
      //数字教材Id
      type: String,
      default: ''
    },
    basisPath: {
      //资源文件基础路径
      type: String,
      default: ''
    },
    officePreviewPath: {
      //office 在线预览路径
      type: String,
      default: ''
    },
    location: {
      type: String,
      default: ''
    },
    releaseUrlList: {
      //需要放行的Url
      type: Array,
      default: () => []
    },
    continueReading: {
      // 是否显示继续阅读弹窗
      type: Boolean,
      default: false
    },
    downloadType: {
      // 下载方式弹窗
      type: String,
      default: 'pop-up'
    },
    testPaperPath: {
      //试题预览地址
      type: String,
      default: 'http://124.133.23.84:10014'
    },
    trialText: {
      // 试读结束提示语
      type: String,
      default: '<p>--- 试读结束 ---</p>'
    },
    trialPrompt: {
      // 试读模式弹窗提示语
      type: String,
      default: '该处已超出试读范围'
    },
    readOnly: {
      // 只读模式，只可阅读不能添加笔记书签
      type: Boolean,
      default: false
    },
    isShowAi: {
      type: String,
      default: '1'
    },
    catalogLevel: {
      //目录显示的最小层级
      type: Number,
      default: 3
    },
    textBookMergeLevel: {
      //教材内容合并到几级目录下
      type: Number,
      default: 1
    },
    learningDuration: {
      //已学习总时长
      type: Number,
      default: 0
    },
    classId: {
      // 班级唯一标识
      type: String,
      default: ''
    },
    gradesName: {
      // 班级名称
      type: String,
      default: ''
    },
    userType: {
      // 用户类型，可选teacher、student
      type: String,
      default: 'teacher'
      // default: 'student'
    },
    action: {
      // 上传文件地址
      type: String,
      default: ''
    },
    headers: {
      // 上传文件头部
      type: Object,
      default: () => {}
    },
    data: {
      // 上传文件附带的额外参数
      type: Object,
      default: () => {}
    },
    setting: {
      // @pos 此参数留作外部使用, 内部临时使用data.persistentReaderSetting
      // 设置
      type: Object,
      default: () => {}
    },
    fileSize: {
      // 最大上传文件大小
      type: Number,
      default: 300
    },
    isOpenHyperlink: {
      // 移动端是否可以直接打开超链接
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      pageTitle: '',
      businessType: 'textBook',
      //业务类型：looseLeaf，textBook,此组件只处理textBook
      showType: 'leaf',
      //显示的类型：leaf 活页，catalog
      contentList: [],
      //内容list，只有3个
      selectId: '',
      chapterIndex: 0,
      componentList: [],
      textCatalog: [],
      componentTotal: 0,
      scrollObserver: null,
      showPrompt: false,
      promptText: '',
      toastType: '',
      readLocation: '',
      //当前阅读的位置
      startIndex: 0,
      endIndex: 1,
      continueRead: false,
      isiOS: false,
      //是否是ios
      downloadFileLink: '',
      seachInput: '',
      videoDomId: '',
      videoDomList: [],
      audioDomId: '',
      audioDomList: [],
      scrollTimer: null,
      componentIndex: 0,
      xmlDigitalTeaching: '',
      scrollId: '',
      themeColor: '',
      currentLocation: '',
      //当前点击的组件id
      learningTime: 0,
      //本次学习时长

      locationChapterId: '',
      //当前内容阅读所在目录id
      locationLabel: '',
      //当前内容阅读所在目录名称
      firstLevelLabel: '',
      //一级目录名称
      firstLevelChapterId: '',
      //一级目录id
      textBookResource: {
        imageList: [],
        audioList: [],
        videoList: [],
        resourceList: [],
        formulaList: [],
        interactionList: [],
        questionList: [],
        imageTotal: 0,
        audioTotal: 0,
        videoTotal: 0,
        resourceTotal: 0,
        formulaTotal: 0,
        interactionTotal: 0,
        questionTotal: 0,
        teachingResourceTotal: 0,
        imageCurrent: 0,
        audioCurrent: 0,
        videoCurrent: 0,
        resourceCurrent: 0,
        formulaCurrent: 0,
        interactionCurrent: 0,
        questionCurrent: 0
      },
      resourceType: 'search',
      resourceIcon: 'icon_01',
      showViewer: false,
      imageViewTitles: [],
      imageViewSrcs: [],
      playTimeMap: {},
      viewerVisible: false,
      hotzoneTarget: {
        type: '',
        value: '',
        label: '',
        desc: '',
        cover: ''
      },
      hotTargetViewerVisible: false,
      schedule: '0',
      currentGroupInfo: {},
      //当前阅读位置块信息
      showPdf: false,
      fileBaseUrl: '',
      fileBaseTitle: '',
      PreviewCatalog: false,
      currentIndex: 0,
      isBookmarkAddSuccess: false,
      keyboardShow: false,
      //移动端键盘是否弹出
      persistentReaderSetting: {},
      isBookmarked: false,
      // bookmarkIconSrc: '../../../static/images/icons/books/bookmark-top.png', // 原始图片路径
      // bookmarkedIconSrc: '../../../static/images/icons/books/bookmark-top-active.svg', // 激活图片路径
      isShowToolbarTip: false,
      tippyTplBarId: ''
      // localIsShowTeacherResource:this.isShowTeacherResource
    };
  },
  computed: {
    teacherResourcesList() {
      this.textBookResource.teachingResourceTotal = 0;
      let list = this.resourcesList;
      list.sort(this.sortBy('chapterOrderNum', 1));
      const map = [];
      list.forEach(e => {
        if (e.type == 'note__teacher') ;
        if (e.isStudentShow != 1 || this.userType == 'teacher') {
          this.textBookResource.teachingResourceTotal += 1;
          const findObj = map.find(innerTmp => innerTmp.firstLevelId === e.firstLevelId);
          if (findObj) {
            findObj.list.push(e);
            findObj.list.sort(this.sortBy('textOrderNum', 1));
          } else {
            map.push({
              firstLevelId: e.firstLevelId,
              firstLevelLabel: e.firstLevelLabel,
              chapterOrderNum: e.chapterOrderNum,
              list: [e]
            });
          }
        }
      });
      return map;
    },
    teacherNoteList() {
      let list = this.resourcesList || [];
      let teacherNoteList = [];
      list.forEach(e => {
        if ((e.isStudentShow != 1 || this.userType == 'teacher') && this.isShowTeacherResource) {
          teacherNoteList.push(e);
        }
      });
      return teacherNoteList;
    },
    bookmarkData() {
      let list = this.bookmarkList;
      list.sort(this.sortBy('orderNum', 1));
      const map = [];
      list.forEach((e, index) => {
        const findObj = map.find(innerTmp => innerTmp.firstLevelId === e.firstLevelId);
        if (findObj) {
          findObj.list.push({
            ...e,
            bookmarkIndex: index + 1
          });
        } else {
          map.push({
            firstLevelId: e.firstLevelId,
            firstLevelLabel: e.firstLevelLabel,
            chapterOrderNum: e.chapterOrderNum,
            list: [{
              ...e,
              bookmarkIndex: index + 1
            }]
          });
        }
      });
      return map;
    },
    highlightData() {
      let list = this.highlightList;
      list.sort(this.sortBy('chapterOrderNum', 1));
      const map = [];
      list.forEach(e => {
        const findObj = map.find(innerTmp => innerTmp.topChapterId === e.topChapterId);
        if (findObj) {
          findObj.list.push(e);
          findObj.list.sort(this.sortBy('textOrderNum', 1));
        } else {
          map.push({
            topChapterId: e.topChapterId,
            firstLevelId: e.topChapterId,
            firstLevelLabel: e.topChapterLabel,
            chapterOrderNum: e.blockIndex,
            list: [e]
          });
        }
      });
      return map;
    },
    notesListData() {
      let list = this.notesList;
      list.sort(this.sortBy('chapterOrderNum', 1));
      const map = [];
      list.forEach(e => {
        const findObj = map.find(innerTmp => innerTmp.topChapterId === e.topChapterId);
        if (findObj) {
          findObj.list.push(e);
          findObj.list.sort(this.sortBy('textOrderNum', 1));
        } else {
          map.push({
            topChapterId: e.topChapterId,
            firstLevelId: e.topChapterId,
            firstLevelLabel: e.topChapterLabel,
            chapterOrderNum: e.blockIndex,
            list: [e]
          });
        }
      });
      return map;
    },
    useReaderSetting() {
      if (this.setting) {
        return Object.keys(this.setting).length ? this.setting : this.persistentReaderSetting;
      } else {
        return this.persistentReaderSetting;
      }
    }
  },
  provide() {
    return {
      getToolbarVisible: () => this.$refs.xmlToolbarPhone?.isShowToolbar || false,
      getKeyboardShow: () => this.keyboardShow
    };
  },
  watch: {
    setting: {
      handler: function (newSetting, oldSetting) {
        if (oldSetting) {
          let {
            themeBgColor,
            themeFontSize,
            themeFontFamily,
            themeLineHeight,
            themeLetterSpacing
          } = newSetting;
          if (themeBgColor !== undefined && themeBgColor !== oldSetting?.themeBgColor) {
            this.setThemeColor(themeBgColor);
          }
          if (themeFontSize !== undefined && themeFontSize !== oldSetting?.themeFontSize) {
            this.setThemeFontSize(themeFontSize);
          }
          if (themeFontFamily !== undefined && themeFontFamily !== oldSetting?.themeFontFamily) {
            this.setThemeFontFamily(themeFontFamily);
          }
          if (themeLineHeight !== undefined && themeLineHeight !== oldSetting?.themeLineHeight) {
            this.setThemeLineHeight(themeLineHeight);
          }
          if (themeLetterSpacing !== undefined && themeLetterSpacing !== oldSetting?.themeLetterSpacing) {
            this.setThemeLetterSpacing(themeLetterSpacing);
          }
        }
      },
      immediate: true,
      deep: true
    },
    persistentReaderSetting: {
      handler: function (newSetting, oldSetting) {
        let {
          themeBgColor,
          themeFontSize,
          themeFontFamily,
          themeLineHeight,
          themeLetterSpacing
        } = newSetting;
        if (oldSetting) {
          if (themeBgColor !== undefined && themeBgColor !== oldSetting?.themeBgColor) {
            this.setThemeColor(themeBgColor);
          }
          if (themeFontSize !== undefined && themeFontSize !== oldSetting?.themeFontSize) {
            this.setThemeFontSize(themeFontSize);
          }
          if (themeFontFamily !== undefined && themeFontFamily !== oldSetting?.themeFontFamily) {
            this.setThemeFontFamily(themeFontFamily);
          }
          if (themeLineHeight !== oldSetting?.themeLineHeight) {
            this.setThemeLineHeight(themeLineHeight);
          }
          if (themeLetterSpacing !== oldSetting?.themeLetterSpacing) {
            this.setThemeLetterSpacing(themeLetterSpacing);
          }
        }
      },
      immediate: true,
      deep: true
    }
    // isShowTeacherResource(newVal) {
    //   this.localIsShowTeacherResource = newVal;
    // }
  },
  beforeDestroy() {
    if (this.scrollObserver) {
      this.scrollObserver.disconnect();
      this.scrollObserver = null;
    }
  },
  created() {
    this.getPersistentSetting();
    this.queryData();
    this.$nextTick(() => {
      window.showImageBYDate = () => {
        target = window.event.target;
        if (target.isShow == true) return;
        target.isShow = true;
        $(target).find('img').click();
        setTimeout(() => {
          target.isShow = false;
        }, 1000);
        return false;
      };
      window.inlineAudioPlay = uuid => {
        target = window.event.target;
        if (target.isShow == true) return;
        target.isShow = true;
        let audio = document.getElementById(`audio${uuid}`);
        if (audio.paused) {
          audio.play();
          document.getElementById(`icon${uuid}`).className = 'wifi-symbol playing';
        } else {
          audio.pause();
          audio.currentTime = 0; //音乐从头播放
          document.getElementById(`icon${uuid}`).className = 'wifi-symbol';
        }
        setTimeout(() => {
          target.isShow = false;
        }, 1000);
        return false;
      };
    });
  },
  mounted() {
    this.$nextTick(() => {
      setTimeout(() => {
        this.initObserver();
      }, 1500);
      window.document.oncontextmenu = function (e) {
        e.preventDefault();
      };
      let u = navigator.userAgent;
      this.isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
      this.textBookData.themeColor ? this.themeColor = this.textBookData.themeColor : this.themeColor = '#6883FA';
      if (this.textBookData.captionText) {
        document.title = this.textBookData.captionText;
      }
      let _this = this;
      this.$EventBus.$on('videoTimeUpdate', throttle$2(5000, function (options) {
        const {
          time,
          data
        } = options;
        const defaultOnce = 5;
        const precision = 0.25;
        if (_this.playTimeMap[data.statisticsId] === undefined) {
          // 当次预览未播放过的视频首次不计
          _this.$set(_this.playTimeMap, data.statisticsId, {
            seconds: 0,
            time: 0,
            jump: 0,
            deviation: 0
          });
          return;
        }
        const jumpStep = Number((time - _this.playTimeMap[data.statisticsId].time).toFixed(6));
        if (jumpStep > defaultOnce + precision || jumpStep < -(defaultOnce + precision)) {
          _this.$set(_this.playTimeMap, data.statisticsId, {
            ..._this.playTimeMap[data.statisticsId],
            time,
            jump: _this.playTimeMap[data.statisticsId].jump + jumpStep
          });
          return;
        }
        if (jumpStep < defaultOnce - precision) {
          const deviation = _this.playTimeMap[data.statisticsId].deviation + jumpStep;
          if (deviation < 1) {
            _this.$set(_this.playTimeMap, data.statisticsId, {
              ..._this.playTimeMap[data.statisticsId],
              time,
              deviation
            });
          } else {
            const numSplit = (deviation + '').split('.');
            Number(numSplit[0]);
            const newDeviation = Number('0.' + numSplit[1]);
            _this.$set(_this.playTimeMap, data.statisticsId, {
              ..._this.playTimeMap[data.statisticsId],
              time,
              deviation: newDeviation
            });
          }
          return;
        }
        const seconds = _this.playTimeMap[data.statisticsId] ? _this.playTimeMap[data.statisticsId].seconds + defaultOnce : 0;
        _this.$set(_this.playTimeMap, data.statisticsId, {
          ..._this.playTimeMap[data.statisticsId],
          seconds,
          time
        });
      }));
      this.$EventBus.$on('audioTimeUpdate', throttle$2(5000, function (options) {
        const {
          time,
          data
        } = options;
        const defaultOnce = 5;
        const precision = 0.25;
        if (_this.playTimeMap[data.statisticsId] === undefined) {
          // 当次预览未播放过的视频首次不计
          _this.$set(_this.playTimeMap, data.statisticsId, {
            seconds: 0,
            time: 0,
            jump: 0,
            deviation: 0
          });
          return;
        }
        const jumpStep = Number((time - _this.playTimeMap[data.statisticsId].time).toFixed(6));
        if (jumpStep > defaultOnce + precision || jumpStep < -(defaultOnce + precision)) {
          _this.$set(_this.playTimeMap, data.statisticsId, {
            ..._this.playTimeMap[data.statisticsId],
            time,
            jump: _this.playTimeMap[data.statisticsId].jump + jumpStep
          });
          return;
        }
        if (jumpStep < defaultOnce - precision) {
          const deviation = _this.playTimeMap[data.statisticsId].deviation + jumpStep;
          if (deviation < 1) {
            _this.$set(_this.playTimeMap, data.statisticsId, {
              ..._this.playTimeMap[data.statisticsId],
              time,
              deviation
            });
          } else {
            const numSplit = (deviation + '').split('.');
            Number(numSplit[0]);
            const newDeviation = Number('0.' + numSplit[1]);
            _this.$set(_this.playTimeMap, data.statisticsId, {
              ..._this.playTimeMap[data.statisticsId],
              time,
              deviation: newDeviation
            });
          }
          return;
        }
        const seconds = _this.playTimeMap[data.statisticsId] ? _this.playTimeMap[data.statisticsId].seconds + defaultOnce : 0;
        _this.$set(_this.playTimeMap, data.statisticsId, {
          ..._this.playTimeMap[data.statisticsId],
          seconds,
          time
        });
      }));
      this.$EventBus.$on('resetTimeUpdate', function (data) {
        const {
          statisticsId
        } = data;
        if (statisticsId) {
          _this.$set(_this.playTimeMap, statisticsId, undefined);
        }
      });
      this.$EventBus.$on('handleMagicLinkAudioPlay', function (data) {
        const {
          targetId,
          plaintext,
          title,
          content,
          type,
          isPlaying,
          callback
        } = data;
        const playerId = 'player__' + targetId.split('__')[1];
        if (!this.magicLinkAudio) {
          const audioElem = new Audio(content);
          audioElem.setAttribute('id', playerId);
          // audioElem.addEventListener("canplaythrough", event => {
          //     audioElem.play();
          //     typeof callback === 'function' && callback(audioElem)
          // });
          this.magicLinkAudio = audioElem;
          this.magicLinkAudio.play().then(() => $(`#${targetId}`).attr('data-isplaying', 'true'));
        } else {
          if (this.magicLinkAudio.id === playerId) {
            // 如果是同一个魔链音频, 仅切换播放状态
            if (this.magicLinkAudio.paused) {
              this.magicLinkAudio.play().then(() => $(`#${targetId}`).attr('data-isplaying', 'true'));
            } else {
              this.magicLinkAudio.pause();
            }
            $(`#${targetId}`).attr('data-isplaying', this.magicLinkAudio.paused ? 'false' : 'true');
          } else {
            const oldTarget = `#${this.magicLinkAudio.id.replace('player__', 'ml-audio__')}`;
            this.magicLinkAudio.pause();
            $(oldTarget).attr('data-isplaying', 'false');
            // 不是同一个魔链音频直接切换音频源
            this.magicLinkAudio.setAttribute('id', playerId);
            this.magicLinkAudio.setAttribute('src', content);
            this.magicLinkAudio.play().then(() => $(`#${targetId}`).attr('data-isplaying', 'true'));
          }
        }
      });
      this.$EventBus.$on('hotzoneClick', function (set) {
        const {
          type = '',
          value,
          label,
          desc = '',
          cover = ''
        } = set || {};
        _this.hotzoneTarget = {
          type,
          value,
          label,
          desc,
          cover
        };
        if (!type || !value) {
          that.$message.error('当前热区绑定非有效目标');
          return;
        }
        const modalTypeDict = ['richtext', 'image', 'audio', 'video'];
        if (type === 'looseleaf') {
          // 浏览活页
          // _this.viewerVisible = true
          window.open('https://looseleaf-v2.ysy.crtvup.com.cn/' + 'previewLooseLeaf?pageType=' + _this.pageType + '&businessType=looseLeaf' + '&looseLeafId=' + _this.hotzoneTarget.value + '&isTrial=' + true + '&uuid=' + v4());
        }
        if (type === 'chapter') {
          // 浏览章节
          _this.$message.error('暂不支持热区跳转章节');
          // _this.JumpPosition('xml-digital-teaching/' + value + '/' + 'placeholders', 50)
        }
        if (type === 'link') {
          const re = /((http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?)/;
          const result = re.test(value);
          if (!result) {
            _this.$message.error('当前热区绑定非有效链接');
            return;
          }
          _this.$confirm(`当前热区绑定外部链接地址为：${value} ，确认打开？`, '', {
            customClass: 'mobile-fix-msgbox'
          }).then(_ => {
            window.open(value, '_blank');
            done();
          }).catch(_ => {});
        }
        if (modalTypeDict.includes(type)) {
          _this.hotTargetViewerVisible = true;
        }
      });

      // window.showleafletDate = uuid => {
      //   window.open(ENV_CONFIG.VUE_APP_TEXTBOOK_WEB + 'previewLooseLeaf?pageType=h5' + '&businessType=looseLeaf' + '&looseLeafId=' + uuid + '&isTrial=' + this.isTrial + '&uuid=' + uuidv4())
      // }
      window.showImageBYDate = uuid => {
        target = window.event.target;
        let imgs = $(target).find('img');
        if (!imgs.length) {
          imgs = $('#image__' + uuid) ? $('#image__' + uuid).find('img') : null;
        }
        const titles = [];
        const srcs = [];
        if (imgs) {
          imgs.each(function (img) {
            const title = $(this).attr('preview-text') || '';
            const src = $(this).prop('src') || '';
            titles.push(title);
            srcs.push(src);
          });
        }
        that.imageViewTitles = titles;
        that.imageViewSrcs = srcs;
        prevOverflow = document.body.style.overflow;
        document.body.style.overflow = 'hidden';
        that.showViewer = true;
      };
      window.inlineAudioPlay = uuid => {
        target = window.event.target;
        if (target.isShow == true) return;
        target.isShow = true;
        const audio = document.getElementById('audio' + uuid);
        if (audio.paused) {
          audio.play();
          document.getElementById('icon' + uuid).className = 'wifi-symbol playing';
        } else {
          audio.pause();
          audio.currentTime = 0; // 音乐从头播放
          document.getElementById('icon' + uuid).className = 'wifi-symbol';
        }
        setTimeout(() => {
          target.isShow = false;
        }, 1000);
        return false;
      };
      this.$EventBus.$on('addTeacherResources', function (model, rollback) {
        _this.$refs.addTeacherResources.open({
          ...model,
          textBookId: _this.textBookData.id,
          isDownload: 0,
          resourcesName: '',
          fileUrl: '',
          location: _this.currentLocation,
          chapterId: _this.componentList[_this.currentIndex].chapterId,
          orderNum: 0,
          firstLevelId: _this.componentList[_this.currentIndex].firstLevelId,
          firstLevelLabel: _this.componentList[_this.currentIndex].firstLevelLabel,
          chapterOrderNum: _this.componentList[_this.currentIndex].chapterOrderNum,
          textOrderNum: _this.getTextOrderNum(model),
          locationChapterId: _this.componentList[_this.currentIndex].locationChapterId,
          id: '',
          resourcesType: '',
          fileExt: '',
          isStudentShow: 0
        });
      });
      this.$EventBus.$on('openTeacherResources', function (e, markEfiStr) {
        let itemResources = _this.resourcesList.find(item => item.markEfiCode === e.markEfiStr);
        _this.openTeacherResoucesList(itemResources);
      });
      // @pos 添加笔记
      this.$EventBus.$on('createNote', function (model, rollback) {
        if (!_this.currentLocation) {
          _this.$message.error('匹配笔记位置失败');
          return;
        }
        if (_this.userType == 'student') {
          _this.$emit('addNote', {
            ...model,
            location: _this.currentLocation,
            topChapterLabel: _this.componentList[_this.currentIndex].firstLevelLabel,
            topChapterId: _this.componentList[_this.currentIndex].firstLevelId,
            locationChapterId: _this.componentList[_this.currentIndex].locationChapterId,
            chapterOrderNum: _this.componentList[_this.currentIndex].chapterOrderNum,
            textOrderNum: _this.getTextOrderNum(model),
            id: new Date().getTime()
          }, () => rollback(model.markId));
        }
      });
      this.$EventBus.$on('editStudentNote', function (model) {
        _this.$refs.modifyNotes.open(model);
      });
      this.$EventBus.$on('editNote', function (model) {
        if (_this.userType == 'student') {
          _this.$emit('editNote', {
            ...model
          });
        } else {
          _this.$emit('editTeacherNote', {
            ...model
          });
        }
      });

      //  删除笔记
      this.$EventBus.$on('deleteNote', function (model, feedback) {
        if (_this.userType == 'student') {
          _this.$emit('deleteNote', {
            ...model
          }, () => feedback(model.markId));
          _this.$EventBus.$emit('underlineSign', {
            ...model,
            signType: 'underline',
            operationType: 'remove'
          });
        } else {
          _this.$emit('deleteTeacherNote', {
            ...model
          }, () => feedback(model.markId));
        }
      });

      // 删除高亮
      this.$EventBus.$on('deleteHighlight', function (model, feedback) {
        _this.$emit('deleteHighlight', {
          ...model
        }, () => feedback(model.markId));
        _this.$EventBus.$emit('underlineSign', {
          ...model,
          signType: 'highlight',
          operationType: 'remove'
        });
      });
      // 是否显示移动端提示气泡
      this.$EventBus.$on('selectionTextChange', function (data) {
        if (data.state) {
          _this.$refs.xmlToolbarPhone.isShowToolbar = false;
        }
        _this.isShowToolbarTip = data.state;
        _this.tippyTplBarId = data.tippyTplBarId;
      });

      // 删除书签
      this.$EventBus.$on('deleteBookmark', function (model, feedback) {
        _this.$emit('deleteBookmark', {
          ...model
        }, () => feedback(model.markId));
      });
      this.$EventBus.$on('createHighlight', function (model, rollback) {
        if (!_this.currentLocation) {
          _this.$message.error('匹配高亮位置失败');
          rollback(model.markId);
          return;
        }
        _this.$emit('addHighlight', {
          ...model,
          location: _this.currentLocation,
          topChapterLabel: _this.componentList[_this.currentIndex].firstLevelLabel,
          topChapterId: _this.componentList[_this.currentIndex].firstLevelId,
          locationChapterId: _this.componentList[_this.currentIndex].locationChapterId,
          chapterOrderNum: _this.componentList[_this.currentIndex].chapterOrderNum,
          textOrderNum: _this.getTextOrderNum(model),
          id: new Date().getTime()
        }, () => rollback(model.markId));
      });
      function isMobile() {
        return 'ontouchstart' in window || 'onmsgesturechange' in window;
      }
      const diffThreshold = 50;
      const originHeight = document.documentElement.clientHeight || document.body.clientHeight;
      function handleMobileKeyboard() {
        const resizeHeight = document.documentElement.clientHeight || document.body.clientHeight;
        if (Math.abs(originHeight - resizeHeight) > diffThreshold) {
          _this.keyboardShow = true;
        } else {
          _this.keyboardShow = false;
        }
      }
      if (isMobile()) {
        window.addEventListener('resize', handleMobileKeyboard);
      }
      this.$once('hook:beforeDestroy', () => {
        _this.$EventBus.$off('createNote');
        _this.$EventBus.$off('createHighlight');
        _this.$EventBus.$off('addTeacherResources');
        _this.$EventBus.$off('openTeacherResources');
        isMobile() && window.removeEventListener('resize', handleMobileKeyboard);
      });
    });
    // try {
    //   // 将未标记图像路径转换为 base64
    //   this.bookmarkIconSrc = convertImageToBase64(bookmarkIconSrc);
    // } catch (error) {
    //   console.error('notbase64:', error);
    // }
    // if (this.pageType == 'h5') {
    //   window.addEventListener('scroll', this.updateScrollTop)
    // }

    // this.$EventBus.$on('addTeacherResources', function (model, rollback) {
    //   // this.$emit('addTeacherResources', model, rollback)
    //   console.log(addTeacherResources)
    // }),
  },
  methods: {
    // @pos 过滤当前章节的教师笔记
    filterTeacherNoteList(targetChapterId) {
      if (this.isShowTeacherResource) {
        return this.resourcesList.filter(item => {
          // let chapterId = item.location.split('/')[1]
          return item.locationChapterId === targetChapterId;
        });
      }
    },
    filterStudentNoteList(targetChapterId) {
      // @todo locationChapterId数据不准确, 待修复后校验此处处理
      return this.notesList.filter(item => {
        // let chapterId = item.location.split('/')[1]
        return item.locationChapterId === targetChapterId;
      });
    },
    filterHighlightList(targetChapterId) {
      // @todo locationChapterId数据不准确, 待修复后校验此处处理
      return this.highlightList.filter(item => {
        // let chapterId = item.location.split('/')[1]
        return item.locationChapterId === targetChapterId;
      });
    },
    getPersistentSetting() {
      this.persistentReaderSetting = JSON.parse(localStorage.getItem('reader-setting_#_' + this.textBookData.id)) || {};
    },
    persistentSettingChange(key, value) {
      let newSetting = Object.assign({}, this.persistentReaderSetting, {
        [key]: value
      });
      localStorage.setItem('reader-setting_#_' + this.textBookData.id, JSON.stringify(newSetting));
      this.persistentReaderSetting = JSON.parse(localStorage.getItem('reader-setting_#_' + this.textBookData.id)) || {};
    },
    settingChange(key, value) {
      this.$emit('settingChange', key, value);
      this.persistentSettingChange(key, value);
      // @todo 处理样式变更引发的重排或重绘后笔记位置的同步更新
      this.$EventBus.$emit('previewRepaint');
    },
    setThemeSecondaryColor(bgColor) {
      let color = tinycolor(bgColor);
      if (!color.isValid()) {
        document.getElementById('xmlPreviewDom').setAttribute('data-theme-secondary-color', '');
        document.getElementById('xmlPreviewDom').style.removeProperty('--reader-theme-secondary-color');
        return;
      }
      let secondaryColor = '';
      if (color.getLuminance() < 0.4) {
        secondaryColor = color.clone().lighten(15).toString();
      } else {
        secondaryColor = color.clone().darken(5).toString();
      }
      document.getElementById('xmlPreviewDom').setAttribute('data-theme-secondary-color', secondaryColor);
      document.getElementById('xmlPreviewDom').style.setProperty('--reader-theme-secondary-color', secondaryColor);
    },
    setThemeFontColor(darkColor) {
      document.getElementById('xmlPreviewDom').setAttribute('data-theme-font-color', darkColor);
      darkColor !== '' ? document.getElementById('xmlPreviewDom').style.setProperty('--reader-theme-font-color', '#FEFEFE') : document.getElementById('xmlPreviewDom').style.removeProperty('--reader-theme-font-color');
    },
    setThemeLinkColor(darkColor) {
      document.getElementById('xmlPreviewDom').setAttribute('data-theme-link-color', darkColor);
      darkColor !== '' ? document.getElementById('xmlPreviewDom').style.setProperty('--reader-theme-link-color', '#23ABF2') : document.getElementById('xmlPreviewDom').style.removeProperty('--reader-theme-link-color');
    },
    setThemeColor(bgColor) {
      document.getElementById('xmlPreviewDom').setAttribute('data-theme-bg-color', bgColor);
      let color = tinycolor(bgColor),
        darkThemeBgColor = '';
      color.isValid() ? document.getElementById('xmlPreviewDom').style.setProperty('--reader-theme-color', color.toString()) : document.getElementById('xmlPreviewDom').style.removeProperty('--reader-theme-color');
      this.setThemeSecondaryColor(bgColor);
      if (color.isValid() && color.getLuminance() < 0.25) {
        darkThemeBgColor = color.toString();
      }
      this.setThemeFontColor(darkThemeBgColor);
      this.setThemeLinkColor(darkThemeBgColor);
    },
    setThemeFontSize(size) {
      document.getElementById('xmlPreviewDom').setAttribute('data-theme-font-size', size == '2' ? '' : size);
      document.getElementById('xmlPreviewDom').style.setProperty('--reader-theme-font-size', fontSizeValueMap[size]);
      // if(this.userType === 'student' && isMobile()) {
      // }
    },
    setThemeFontFamily(firstFamily) {
      document.getElementById('xmlPreviewDom').setAttribute('data-theme-font-family', firstFamily);
      firstFamily === '' ? document.getElementById('xmlPreviewDom').style.removeProperty('--reader-theme-font-family') : document.getElementById('xmlPreviewDom').style.setProperty('--reader-theme-font-family', firstFamily);
      // if(this.userType === 'student' && isMobile()) {
      // }
    },
    setThemeLineHeight(lineHeight) {
      document.getElementById('xmlPreviewDom').setAttribute('data-theme-line-height', lineHeight ? lineHeight + 'px' : '');
      lineHeight === undefined ? document.getElementById('xmlPreviewDom').style.removeProperty('--reader-theme-line-height') : document.getElementById('xmlPreviewDom').style.setProperty('--reader-theme-line-height', lineHeight + 'px');
    },
    setThemeLetterSpacing(letterSpacing) {
      document.getElementById('xmlPreviewDom').setAttribute('data-theme-letter-spacing', letterSpacing ? letterSpacing + 'px' : '');
      letterSpacing === undefined ? document.getElementById('xmlPreviewDom').style.removeProperty('--reader-theme-letter-spacing') : document.getElementById('xmlPreviewDom').style.setProperty('--reader-theme-letter-spacing', letterSpacing + 'px');
    },
    clickdigital(e) {
      let nodeName = 'IMG,A,Video';
      if (nodeName.indexOf(e.target.nodeName) == -1) {
        this.$refs.xmlToolbarPhone.isShowToolbar = !this.$refs.xmlToolbarPhone.isShowToolbar;
      }
    },
    // 通过目录列表和活页列表获取数据
    queryData() {
      this.learningTime = parseInt(new Date().getTime() / 1000);
      this.pageTitle = this.textBookData.textBooksName;
      const filterMenu = (menuList, level, id) => {
        return menuList.filter(item => {
          return level <= this.catalogLevel;
        }).map(item => {
          item = Object.assign({}, {
            ...item,
            locationChapterId: id ? id : item.id
          });
          if (item.children?.length) {
            let locationChapterId = id ? id : level == this.textBookMergeLevel ? item.id : '';
            item.children = filterMenu(item.children, level + 1, locationChapterId);
          }
          return item;
        });
      };
      this.textCatalog = filterMenu(this.catalogList, 1);
      this.contentList = [];
      const getItemByChild = (list, level, orderNum) => {
        for (let i = 0; i < list.length; i++) {
          let it = list[i];
          if (this.looseLeafData[it.id] && this.looseLeafData[it.id].looseLeafInfo) {
            if (JSON.parse(this.looseLeafData[it.id].looseLeafInfo).length > 0) {
              // 更新组件总数
              this.componentTotal += JSON.parse(this.looseLeafData[it.id].looseLeafInfo).length;
              this.$set(list[i], 'xmlCompRef', JSON.parse(this.looseLeafData[it.id].looseLeafInfo)[0].xmlCompRef);
              this.$set(list[i], 'chapterOrderNum', orderNum ? orderNum : i); //目录层级
              this.$set(list[i], 'catalogLevel', level); //目录层级
              this.looseLeafData[it.id].label = it.label;
              this.contentList.push(it);
              if (it.children) {
                getItemByChild(it.children, level + 1, orderNum ? orderNum : i);
              }
            }
          } else {
            this.$set(list[i], 'xmlCompRef', v4());
          }
        }
      };
      getItemByChild(this.textCatalog, 1, '');
      // 处理数据格式
      let locationList = this.location ? this.location.split('/') : [];
      locationList.length > 3 ? this.scrollId = locationList[3] : this.scrollId = this.location;
      this.chapterIndex = 0;
      this.formattedData(this.contentList[0].id); //@format
      this.selectId = this.contentList[0].id;
      if (locationList.length > 0 && locationList[1] != this.contentList[0].id) {
        if (this.continueReading && !this.readOnly) {
          //是否展示继续阅读弹窗
          this.continueRead = true;
        } else {
          this.scrollFun(this.location, 0);
        }
      }
    },
    // 处理活页json数据信息 传入id获取数据解析为list
    formattedData(chapterId) {
      let list = JSON.parse(this.looseLeafData[chapterId].looseLeafInfo);
      let imageList = []; //图片列表
      let audioList = []; //音频列表
      let videoList = []; //视频列表
      let formulaList = []; //公式列表
      let interactionList = []; //互动列表
      let resourceList = []; //资源列表
      let questionList = []; //试题列表
      // 设置一级标题的ID和名称。
      if (this.contentList[this.chapterIndex].catalogLevel == 1) {
        this.firstLevelLabel = this.looseLeafData[chapterId].label;
        this.firstLevelChapterId = chapterId;
      }
      // 设置当前位置的章节ID和名称。 若当前目录层级小于等于教材合并到目录的层级
      if (this.contentList[this.chapterIndex].catalogLevel <= this.textBookMergeLevel) {
        this.locationChapterId = chapterId;
        this.locationLabel = this.looseLeafData[chapterId].label;
      }
      let readIndex = Number(this.componentTotal * (this.isTrialIndex / 100)).toFixed(0); //可以试读到的组件index

      list.map(element => {
        let isTrialExternal = this.isTrial ? this.componentIndex < readIndex ? false : true : false;
        // 向数据里添加位置信息，第一位：章节Id 、第二位：模块Id
        let location = `xml-digital-teaching/${chapterId}/${element.xmlCompRef}`;
        this.$set(element, 'location', location);

        // 向数据里添加章节Id
        this.$set(element, 'chapterId', chapterId);
        this.$set(element, 'componentIndex', this.componentIndex);
        this.componentIndex++;
        this.$set(element, 'label', this.looseLeafData[chapterId].label); //章节名字
        this.$set(element, 'firstLevelId', this.firstLevelChapterId); //章节所在一级标题的Id
        this.$set(element, 'firstLevelLabel', this.firstLevelLabel); //章节所在一级标题的名称
        this.$set(element, 'locationChapterId', this.locationChapterId); //当前内容阅读所在目录id
        this.$set(element, 'locationLabel', this.locationLabel); //当前内容阅读所在目录名称
        this.$set(element, 'chapterOrderNum', this.contentList[this.chapterIndex].chapterOrderNum); //当前内容阅读所在目录顺序

        // 根据不同的组件类型进行处理
        if (element.componentsName == 'xml-single-text-group') {
          // 文本
          this.$set(element, 'Text', element.data.pGroupData.textData?.html); //文本内容
        } else if (element.componentsName == 'xml-single-image-group') {
          // 图片
          let textList = [];
          element.data.pGroupData.imageData.imageList.map((item, index) => {
            this.$set(item, 'firstLevelId', this.firstLevelChapterId); //章节所在一级标题的Id
            this.$set(item, 'locationChapterId', this.locationChapterId); //章节所在章节Id
            this.$set(item, 'isTrialExternal', isTrialExternal); //是否是试读之外的资源
            this.$set(item, 'location', location);
            this.$set(item, 'titleClass', 'xml-image-title');
            this.$set(item, 'index', index);
            textList.push({
              title: item.title,
              titleClass: 'xml-image-title',
              index: index
            });
          });
          imageList = imageList.concat(element.data.pGroupData.imageData.imageList);
          this.$set(element, 'textList', textList); //文本内容
        } else if (element.componentsName == 'xml-single-music-group') {
          // 音频
          let textList = [];
          element.data.pGroupData.musicData.musicSetList.map((item, index) => {
            this.$set(item, 'firstLevelId', this.firstLevelChapterId); //章节所在一级标题的Id
            this.$set(item, 'locationChapterId', this.locationChapterId); //章节所在章节Id
            this.$set(item, 'isTrialExternal', isTrialExternal); //是否是试读之外的资源
            this.$set(item, 'location', location);
            this.$set(item, 'titleClass', 'xml-audio-title');
            this.$set(item, 'index', index);
            textList.push({
              title: item.title,
              titleClass: 'xml-audio-title',
              index: index
            });
          });
          audioList = audioList.concat(element.data.pGroupData.musicData.musicSetList);
          this.$set(element, 'textList', textList); //文本内容
        } else if (element.componentsName == 'xml-single-video-group') {
          // 视频
          let textList = [];
          element.data.pGroupData.videoData.videoSetList.map((item, index) => {
            this.$set(item, 'firstLevelId', this.firstLevelChapterId); //章节所在一级标题的Id
            this.$set(item, 'locationChapterId', this.locationChapterId); //章节所在章节Id
            this.$set(item, 'isTrialExternal', isTrialExternal); //是否是试读之外的资源
            this.$set(item, 'location', location);
            this.$set(item, 'titleClass', 'xml-video-title');
            this.$set(item, 'index', index);
            textList.push({
              title: item.title,
              titleClass: 'xml-video-title',
              index: index
            });
          });
          videoList = videoList.concat(element.data.pGroupData.videoData.videoSetList);
          this.$set(element, 'textList', textList); //文本内容
        } else if (element.componentsName == 'xml-single-resource-group') {
          // 资源

          let textList = [];
          element.data.pGroupData.resourceData.resourceSetList.map((item, index) => {
            let title = item.title || item.fileFormat;
            this.$set(item, 'firstLevelId', this.firstLevelChapterId); //章节所在一级标题的Id
            this.$set(item, 'locationChapterId', this.locationChapterId); //章节所在章节Id
            this.$set(item, 'isTrialExternal', isTrialExternal); //是否是试读之外的资源
            this.$set(item, 'location', location);
            this.$set(item, 'titleClass', 'xml-resource-title');
            this.$set(item, 'index', index);
            textList.push({
              title: title,
              titleClass: 'xml-resource-title',
              index: index
            });
          });
          resourceList = resourceList.concat(element.data.pGroupData.resourceData.resourceSetList);
          this.$set(element, 'textList', textList); //文本内容
        } else if (element.componentsName == 'xml-single-book-group') {
          // 电子书
          let textList = [];
          element.data.pGroupData.ebookData.ebookSetList.map((item, index) => {
            let title = item.title || item.name;
            this.$set(item, 'firstLevelId', this.firstLevelChapterId); //章节所在一级标题的Id
            this.$set(item, 'locationChapterId', this.locationChapterId); //章节所在章节Id
            this.$set(item, 'isTrialExternal', isTrialExternal); //是否是试读之外的资源
            this.$set(item, 'location', location);
            this.$set(item, 'titleClass', 'xml-ebook-title');
            this.$set(item, 'index', index);
            textList.push({
              title: title,
              titleClass: 'xml-ebook-title',
              index: index
            });
          });
          resourceList = resourceList.concat(element.data.pGroupData.ebookData.ebookSetList);
          this.$set(element, 'textList', textList); //文本内容
        } else if (element.componentsName == 'xml-single-question-group') {
          // 试题

          let textList = [];
          element.data.pGroupData.questionData.questionSetList.map((item, index) => {
            this.$set(item, 'firstLevelId', this.firstLevelChapterId); //章节所在一级标题的Id
            this.$set(item, 'locationChapterId', this.locationChapterId); //章节所在章节Id
            this.$set(item, 'isTrialExternal', isTrialExternal); //是否是试读之外的资源
            this.$set(item, 'location', location);
            this.$set(item, 'titleClass', 'xml-question-title');
            this.$set(item, 'index', index);
            textList.push({
              title: item.stem.content,
              titleClass: 'xml-question-title',
              index: index
            });
          });
          questionList = questionList.concat(element.data.pGroupData.questionData.questionSetList);
          this.$set(element, 'textList', textList); //文本内容
        } else if (element.componentsName == 'xml-single-test-paper-group') {
          // 试卷
          let textList = [];
          element.data.pGroupData.testPaperData.testPaperSetList.map((item, index) => {
            this.$set(item, 'firstLevelId', this.firstLevelChapterId); //章节所在一级标题的Id
            this.$set(item, 'locationChapterId', this.locationChapterId); //章节所在章节Id
            this.$set(item, 'isTrialExternal', isTrialExternal); //是否是试读之外的资源
            this.$set(item, 'location', location);
            this.$set(item, 'titleClass', 'xml-paper-title');
            this.$set(item, 'index', index);
            textList.push({
              title: item.paperName,
              titleClass: 'xml-paper-title',
              index: index
            });
          });
          // testPaperList = testPaperList.concat(element.data.pGroupData.testPaperData.testPaperSetList)
          this.$set(element, 'textList', textList); //文本内容
        } else if (element.componentsName == 'xml-single-hotzone-group') {
          //热区
          let textList = [];
          element.data.pGroupData.xmlBlockData.imageList.map((item, index) => {
            textList.push({
              title: item.title,
              titleClass: 'xml-hot-zone-title',
              index: index
            });
          });
          this.$set(element, 'textList', textList); //文本内容
        } else if (element.componentsName == 'xml-single-html-group') {
          //网页
          let textList = [];
          this.$set(element.data.pGroupData.htmlData, 'firstLevelId', this.firstLevelChapterId); //章节所在一级标题的Id
          this.$set(element.data.pGroupData.htmlData, 'locationChapterId', this.locationChapterId); //章节所在章节Id
          this.$set(element.data.pGroupData.htmlData, 'isTrialExternal', isTrialExternal); //是否是试读之外的资源
          this.$set(element.data.pGroupData.htmlData, 'location', location);
          this.$set(element.data.pGroupData.htmlData, 'titleClass', 'xml-paper-title');
          this.$set(element.data.pGroupData.htmlData, 'index', 0);
          if (element.data.pGroupData.htmlData.code) {
            //代码块
            textList.push({
              title: element.data.pGroupData.htmlData.code,
              titleClass: '',
              index: 0
            });
            this.$set(element, 'textList', textList); //文本内容
          } else if (element.data.pGroupData.htmlData.htmlFileType == 'formula') {
            //公式
            formulaList.push(element.data.pGroupData.htmlData);
          } else if (element.data.pGroupData.htmlData.htmlFileType == 'pattern') {
            //虚拟仿真模型
            interactionList.push(element.data.pGroupData.htmlData);
          }
        } else if (element.componentsName.indexOf('title') !== -1) {
          //标题
          this.$set(element, 'Text', element.data.pGroupData.titleTextData?.html); //文本内容
          if (element.data.pGroupData.numberTextData) {
            element.Text += element.data.pGroupData.numberTextData.html;
          }
        } else if (element.componentsName.indexOf('paragraph') !== -1) {
          //段落
          this.$set(element, 'Text', ''); //文本内容
          for (let item in element.data.pGroupData) {
            if (Array.isArray(element.data.pGroupData[item])) {
              for (let index in element.data.pGroupData[item]) {
                if (element.data.pGroupData[item][index].html) {
                  element.Text += element.data.pGroupData[item][index].html;
                }
              }
            } else if (element.data.pGroupData[item].html) {
              element.Text += element.data.pGroupData[item].html;
            }
          }
        } else if (element.componentsName.indexOf('imageText') !== -1) {
          //图文
          this.$set(element, 'Text', ''); //文本内容
          for (let item in element.data.pGroupData) {
            if (element.data.pGroupData[item].html) {
              element.Text += element.data.pGroupData[item].html;
            }
          }
        }
      });
      ({
        label: this.looseLeafData[chapterId].label,
        chapterId: chapterId,
        list: list
      });
      if (!this.isTrial || this.componentList.length < readIndex && this.isTrial) {
        //判断是否非试读模式或当前内容在可试读内
        // 组件数据添加到componentList
        let compList = [];
        if (this.componentList.length + list.length > readIndex && this.isTrial) {
          //如果当前章节内容累加进去之后会超出试读区域就截取试读区域内的内容
          let i = readIndex - this.componentList.length;
          compList = list.slice(0, i);
        } else {
          compList = list;
        }
        this.componentList = this.componentList.concat(compList);
      }

      //
      if (this.contentList[this.chapterIndex].catalogLevel == 1) {
        this.formattedResourceList(imageList, audioList, videoList, formulaList, interactionList, resourceList, questionList, this.firstLevelChapterId, this.firstLevelLabel, true);
      } else {
        this.formattedResourceList(imageList, audioList, videoList, formulaList, interactionList, resourceList, questionList, this.firstLevelChapterId, this.firstLevelLabel, false);
      }
      if (this.contentList.length - 1 > this.chapterIndex) {
        this.chapterIndex++;
        this.formattedData(this.contentList[this.chapterIndex].id);
        // 判断是否是 试读模式
        // if (this.chapterIndex < Number(readIndex / 100).toFixed(0) && this.isTrial) {
        //   this.chapterIndex++
        //   this.formattedData(direction, this.contentList[this.chapterIndex].id, false)
        // } else if (!this.isTrial) {
        //   this.chapterIndex++
        //   this.formattedData(direction, this.contentList[this.chapterIndex].id, false)
        // }
      }
      this.currentGroupInfo = this.componentList[0] || {};
    },
    // 初始化资源列表
    formattedResourceList(imageList, audioList, videoList, formulaList, interactionList, resourceList, questionList, chapterId, label, state) {
      if (imageList.length > 0 && JSON.stringify(this.textBookResource.imageList).indexOf(chapterId) == -1) {
        this.textBookResource.imageList.push({
          chapterId: chapterId,
          imageList: imageList,
          label: label,
          state: this.textBookResource.imageList.length == 0 ? true : false
        });
      } else if (imageList.length > 0) {
        let i = this.textBookResource.imageList.length - 1;
        this.textBookResource.imageList[i].imageList = this.textBookResource.imageList[i].imageList.concat(imageList);
      }
      if (audioList.length > 0 && JSON.stringify(this.textBookResource.audioList).indexOf(chapterId) == -1) {
        this.textBookResource.audioList.push({
          chapterId: chapterId,
          audioList: audioList,
          label: label,
          state: this.textBookResource.imageList.length == 0 ? true : false
        });
      } else if (audioList.length > 0) {
        let i = this.textBookResource.audioList.length - 1;
        this.textBookResource.audioList[i].audioList = this.textBookResource.audioList[i].audioList.concat(audioList);
      }
      if (videoList.length > 0 && JSON.stringify(this.textBookResource.videoList).indexOf(chapterId) == -1) {
        this.textBookResource.videoList.push({
          chapterId: chapterId,
          videoList: videoList,
          label: label,
          state: this.textBookResource.videoList.length == 0 ? true : false
        });
      } else if (videoList.length > 0) {
        let i = this.textBookResource.videoList.length - 1;
        this.textBookResource.videoList[i].videoList = this.textBookResource.videoList[i].videoList.concat(videoList);
      }
      if (formulaList.length > 0 && JSON.stringify(this.textBookResource.formulaList).indexOf(chapterId) == -1) {
        this.textBookResource.formulaList.push({
          chapterId: chapterId,
          formulaList: formulaList,
          label: label,
          state: this.textBookResource.imageList.length == 0 ? true : false
        });
      } else if (formulaList.length > 0) {
        let i = this.textBookResource.formulaList.length - 1;
        this.textBookResource.formulaList[i].formulaList = this.textBookResource.formulaList[i].formulaList.concat(formulaList);
      }
      if (interactionList.length > 0 && JSON.stringify(this.textBookResource.interactionList).indexOf(chapterId) == -1) {
        this.textBookResource.interactionList.push({
          chapterId: chapterId,
          interactionList: interactionList,
          label: label,
          state: this.textBookResource.imageList.length == 0 ? true : false
        });
      } else if (interactionList.length > 0) {
        let i = this.textBookResource.interactionList.length - 1;
        this.textBookResource.interactionList[i].interactionList = this.textBookResource.interactionList[i].interactionList.concat(interactionList);
      }
      if (resourceList.length > 0 && JSON.stringify(this.textBookResource.resourceList).indexOf(chapterId) == -1) {
        this.textBookResource.resourceList.push({
          chapterId: chapterId,
          resourceList: resourceList,
          label: label,
          state: this.textBookResource.imageList.length == 0 ? true : false
        });
      } else if (resourceList.length > 0) {
        let i = this.textBookResource.resourceList.length - 1;
        this.textBookResource.resourceList[i].resourceList = this.textBookResource.resourceList[i].resourceList.concat(resourceList);
      }
      if (questionList.length > 0 && JSON.stringify(this.textBookResource.questionList).indexOf(chapterId) == -1) {
        this.textBookResource.questionList.push({
          chapterId: chapterId,
          questionList: questionList,
          label: label,
          state: this.textBookResource.imageList.length == 0 ? true : false
        });
      } else if (questionList.length > 0) {
        let i = this.textBookResource.questionList.length - 1;
        this.textBookResource.questionList[i].questionList = this.textBookResource.questionList[i].questionList.concat(questionList);
      }
      this.textBookResource.imageTotal += imageList.length;
      this.textBookResource.audioTotal += audioList.length;
      this.textBookResource.videoTotal += videoList.length;
      this.textBookResource.formulaTotal += formulaList.length;
      this.textBookResource.interactionTotal += interactionList.length;
      this.textBookResource.resourceTotal += resourceList.length;
      this.textBookResource.questionTotal += questionList.length;
    },
    // 查询元素是否在可视窗口
    initObserver() {
      let _this = this;
      this.videoDomList = document.querySelectorAll('video') || [];
      this.audioDomList = document.querySelectorAll('aodio') || [];
      if (!this.isOpenHyperlink && this.pageType !== 'pc') {
        let ADom = document.getElementsByTagName('a');
        if (ADom) {
          for (let i = 0; i < ADom.length; i++) {
            if (JSON.stringify(this.releaseUrlList).indexOf(ADom[i].href) == -1) {
              ADom[i].onclick = function (e) {
                _this.downloadFileLink = ADom[i].href;
                _this.$refs.downFileUppop.prompt = '受小程序限制该网址无法直接打开，请复制至手机浏览器观看';
                setTimeout(() => {
                  _this.$refs.downFileUppop.isShow = true;
                }, 200);
                return false;
              };
            }
          }
        }
      }
      let elems = document.querySelectorAll('.parent-group-mark');
      let rootElem = document.querySelector('.preview-counter-main');
      let rootRect = rootElem.getBoundingClientRect();
      let options = {
        root: rootElem,
        rootMargin: `0px 0px ${0 - rootRect.height + 160}px 0px`,
        threshold: 1
      };
      this.scrollObserver = new IntersectionObserver(entries => {
        entries.forEach(entrie => {
          // 遍历entries数组
          if (entrie.isIntersecting) {
            // 当前元素可见
            this.selectId = entrie.target.id.split('/').length > 2 ? entrie.target.id.split('/')[1] : this.selectId;
            if (entrie.target.id !== this.readLocation && entrie.target.id) {
              if (entrie.target.id.indexOf('xml-single-video-group') !== -1) {
                this.videoDomId = entrie.target.id;
              }
              if (entrie.target.id.indexOf('xml-single-audio-group') !== -1) {
                this.audioDomId = entrie.target.id;
              }
              if (entrie.target.id.indexOf('xml-digital-teaching') !== -1) {
                this.xmlDigitalTeaching = entrie.target.id;
              }
              this.readLocation = entrie.target.id;
            }
            this.updateReadLocation();
          }
        });
      }, this.pageType == 'pc' ? options : {
        threshold: 0.01,
        rootMargin: `0px 0px ${0 - window.innerHeight + 60}px 0px`
      });
      if (elems) {
        elems.forEach(elem => {
          this.scrollObserver.observe(elem);
        });
      }
    },
    updateReadLocation() {
      clearTimeout(this.scrollTimer);
      let location = this.readLocation.indexOf('xml-digital-teaching') !== -1 ? this.readLocation : this.xmlDigitalTeaching + '/' + this.readLocation;
      let t1 = document.documentElement.scrollTop || document.body.scrollTop;
      let list = location.split('/');
      let locationId = list[0] + '/' + list[1] + '/' + list[2];
      let index = this.componentList.findIndex(value => value.location == locationId);
      this.currentGroupInfo = this.componentList[index] || {};
      this.scrollTimer = setTimeout(() => {
        let t2 = document.documentElement.scrollTop || document.body.scrollTop;
        if (t2 == t1) {
          let learningTime = parseInt(new Date().getTime() / 1000) - this.learningTime;
          this.schedule = ((index + 1) / this.componentTotal * 100).toFixed(1);
          let locationData = {
            location: location,
            //当前阅读位置
            schedule: this.schedule,
            //当前阅读进度
            learningTime: learningTime,
            //本次学习时长
            learningDuration: this.learningDuration + learningTime //总学习时长
          };
          this.$emit('updateReadLocation', locationData);
        }
      }, 1000);
    },
    // pc删除笔记
    deleteNotoPC(item, type) {
      if (type == 'notes') {
        this.$emit('deleteNotes', item);
      } else if (type == 'bookmark') {
        this.$emit('deleteBookmark', item);
      }
    },
    // 笔记跳转到指定位置
    jumpingNotes(item) {
      this.JumpPosition(item.location, 100, 'notes', '', item);
    },
    // 书签跳转到指定位置
    jumpingBookmark(item) {
      this.JumpPosition(item.location, 100, 'notes', '', item);
    },
    // 目录跳转指定章节
    catalogClick(obj) {
      this.showType = 'leaf';
      this.selectId = obj.id;
      this.JumpPosition('xml-digital-teaching/' + obj.id + '/' + obj.xmlCompRef, 50, 'class', obj.id);
    },
    // 跳转到指定位置
    JumpPosition(location, maxTop, type, scrollId, markTarget) {
      let list = location.split('/');
      let chapterId = list[1];
      if (this.isTrial) {
        if (this.componentList.findIndex(item => item.chapterId == chapterId) == -1) {
          this.showToast(this.trialPrompt, 'warning');
          return;
        }
      }
      let index = this.componentList.findIndex(item => item.location == location);
      setTimeout(() => {
        console.log('🚀 ~ JumpPosition ~ location, maxTop, type, scrollId, markTarget:', location, maxTop, type, scrollId, markTarget, index);
        this.$refs.xmlPreviewLooseLeaf.jumpTo(index, type, scrollId, () => {
          if (markTarget) {
            setTimeout(() => {
              this.$EventBus.$emit('markJumpIn', markTarget);
            }, 100);
          }
        });
        this.currentGroupInfo = this.componentList[index] || {};
        this.selectId = this.currentGroupInfo.chapterId;
        let learningTime = parseInt(new Date().getTime() / 1000) - this.learningTime;
        this.schedule = ((index + 1) / this.componentTotal * 100).toFixed(1);
        let locationData = {
          location: location,
          //当前阅读位置
          schedule: this.schedule,
          //当前阅读进度
          learningTime: learningTime,
          //本次学习时长
          learningDuration: this.learningDuration + learningTime //总学习时长
        };
        this.$emit('updateReadLocation', locationData);
        if (type === 'search') {
          let Dom = document.getElementById(scrollId ? scrollId : location);
          this.searchHighlight(Dom);
        }
      }, 300);

      // console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaa', index)
      // let startIndex=this.componentList.length-index>20&&index>10?index-10:
      // this.startIndex = index
      // this.endIndex = index + 1
      // setTimeout(() => {
      //   this.initObserver()
      //   // this.scrollFun(location, maxTop, type, scrollId)
      // }, 200)
    },
    /**
     * 滚动页面到指定位置
     * location:块级别内容位置id
     * maxTop:滚动高度距顶部的距离
     * type:滚动类型
     * scrollId:要滚动到的目标标签id
     */
    scrollFun(location, maxTop, type, scrollId) {
      setTimeout(() => {
        let Dom = null;
        if (type == 'class') {
          Dom = document.getElementsByClassName(scrollId)[0];
        } else {
          Dom = document.getElementById(scrollId ? scrollId : location);
        }
        // //将页面滚动到指定位置
        if (Dom) {
          // if (this.pageType === 'pc') {
          let scrollTop = this.$refs.xmlPreviewDom.scrollTop + (Dom.getBoundingClientRect().top > maxTop ? Dom.getBoundingClientRect().top - maxTop : Dom.getBoundingClientRect().top < 0 ? Dom.getBoundingClientRect().top - maxTop : 0);
          this.$refs.xmlPreviewDom.scrollTop = scrollTop;
          // } else {
          //   let scrollTop =
          //     (document.documentElement.scrollTop > 0 ? document.documentElement.scrollTop : document.body.scrollTop) +
          //     (Dom.getBoundingClientRect().top > maxTop
          //       ? Dom.getBoundingClientRect().top - maxTop
          //       : Dom.getBoundingClientRect().top < 0
          //       ? Dom.getBoundingClientRect().top - maxTop
          //       : 0)
          //   document.documentElement.scrollTop = scrollTop
          //   document.body.scrollTop = scrollTop
          // }
          if (type === 'search') {
            this.searchHighlight(Dom);
          }
        }
      }, 500);
    },
    // 搜索内容高亮
    searchHighlight(Dom) {
      const keyword = this.seachInput.replace(/\s+/g, '');
      const Reg = new RegExp(keyword, 'g');
      let domText = Dom.innerHTML;
      let domHtml = Dom.innerHTML;
      // Dom.innerHTML = domText.replace(Reg, `<span style="color: blue;">${keyword}</span>`)
      Dom.innerHTML = domText.replace(Reg, `<span style="background-color: yellow; color: red;">${keyword}</span>`);
      setTimeout(() => {
        Dom.innerHTML = domHtml;
      }, 2000);
    },
    // 打开教师资源列表
    openTeacherResoucesList(item) {
      if (this.pageType == 'pc') {
        this.$refs.xmlToolBarPc.clickToolbar(1);
        setTimeout(() => {
          this.$refs.xmlResourceListPc.scrollFun(item.firstLevelId, item.location);
        }, 200);
      } else {
        this.$refs.xmlToolbarPhone.openTeacherResoucesList(item);
      }
    },
    // 跳转到资源所在位置
    resourceDetails(items, type, text, scrollId) {
      this.seachInput = text;
      this.JumpPosition(items.location, 100, type, scrollId, items);
    },
    // 跳转到资源所在位置
    underlineSignDetails(items) {
      let list = items.location.split('/');
      let scrollId = `${list[2]}_#_${items.markEfiCode}`;
      this.JumpPosition(items.location, 100, 'id', scrollId, items);
    },
    // 获取当前点击的块
    clickComp(item) {
      console.log('获取当前点击的块', item);
      this.currentLocation = item.location;
      this.currentIndex = item.componentIndex;
    },
    // 资源类型文件下载
    downloadFile(e) {
      if (this.downloadType == 'pop-up') {
        if (this.pageType == 'pc') {
          window.open(this.basisPath + e.item.uploadFileUrl.split('./')[1]);
        } else {
          this.downloadFileLink = this.basisPath + e.item.uploadFileUrl.split('./')[1];
          this.$refs.downFileUppop.isShow = true;
        }
      } else {
        this.$emit('downloadFile', e);
      }
    },
    // 编辑教师笔记
    handleUpdateTeacherNotes(e) {
      this.$refs.addTeacherResources.open({
        isEdit: true,
        ...e
      });
    },
    // 保存修改的笔记
    saveNote(data) {
      this.$emit('editNote', data);
    },
    // 确认添加教师资源
    addResources(e) {
      this.$emit('addResources', e);
      this.$EventBus.$emit('underlineSign', {
        ...e,
        signType: 'underline',
        operationType: 'add'
      });
    },
    // 确认添加教师笔记
    addTeacherNote(e) {
      this.$emit('addTeacherNote', e);
      this.$EventBus.$emit('underlineSign', {
        ...e,
        signType: 'underline',
        operationType: 'add'
      });
    },
    underlineSign(e) {
      this.$EventBus.$emit('underlineSign', {
        ...model,
        signType: 'underline',
        operationType: 'add'
      });
    },
    // 编辑教师资源
    editTeachingResource(e) {
      this.$refs.addTeacherResources.open({
        isEdit: true,
        ...e
      });
    },
    // 确认编辑教师资源
    editResources(e) {
      this.$emit('editResources', e);
    },
    // 确认删除教师笔记
    deleteTeacherNotes(e) {
      this.$EventBus.$emit('underlineSign', {
        ...e,
        signType: 'underline',
        operationType: 'remove'
      });
      this.$emit('deleteResource', e);
    },
    // 确认删除教师资源
    deleteTeachingResource(e) {
      this.$EventBus.$emit('underlineSign', {
        ...e,
        signType: 'underline',
        operationType: 'remove'
      });
      this.$emit('deleteResource', e);
    },
    // 教师资源预览
    resourceReader(e) {
      this.fileBaseUrl = this.officePreviewPath + e.fileUrl;
      this.fileBaseTitle = e.resourcesName;
      this.showPdf = true;
      this.$refs.xmlToolbarPhone.isShowToolbar = false;
    },
    // 打开html包
    openHtml(data) {
      this.fileBaseUrl = data.previewUrl;
      this.fileBaseTitle = data.title;
      this.showPdf = true;
      this.$refs.xmlToolbarPhone.isShowToolbar = false;
    },
    // 复制html链接
    copyHtmlUrl(data) {
      this.downloadFileLink = data.link;
      this.$refs.downFileUppop.isShow = true;
      this.$refs.downFileUppop.prompt = '受小程序限制该网址无法直接打开，请复制至手机浏览器观看';
    },
    // 添加书签
    addBookmark(location) {
      this.isBookmarked = !this.isBookmarked;
      this.isBookmarkAddSuccess = !this.isBookmarkAddSuccess;
      let bookmarkText = '';
      if (this.currentGroupInfo.textList && this.currentGroupInfo.textList.length > 0) {
        bookmarkText = this.currentGroupInfo.textList[0].title || this.currentGroupInfo.label;
      } else if (this.currentGroupInfo.Text) {
        bookmarkText = this.removeStyle(this.currentGroupInfo.Text) || this.currentGroupInfo.label;
      } else {
        bookmarkText = this.currentGroupInfo.label;
      }
      let data = {
        classId: this.classId,
        chapterId: this.currentGroupInfo.chapterId,
        firstLevelId: this.currentGroupInfo.firstLevelId,
        firstLevelLabel: this.currentGroupInfo.firstLevelLabel,
        orderNum: this.currentGroupInfo.componentIndex,
        locationChapterId: this.componentList[this.currentIndex].locationChapterId,
        chapterOrderNum: this.componentList[this.currentIndex].chapterOrderNum,
        type: 'bookmark',
        location: location,
        creationTime: new Date(),
        bookmarkId: new Date().getTime(),
        bookmarkText: bookmarkText,
        id: new Date().getTime()
      };
      this.$emit('addBookmark', data);
    },
    // 移除书签
    deleteBookmark(location) {
      let i = this.bookmarkList.findIndex(item => item.location === location);
      if (i !== -1) {
        this.$emit('deleteBookmark', this.bookmarkList[i]);
      }
    },
    // 资源阅读
    showFileReader(e) {
      this.fileBaseUrl = this.officePreviewPath + e.fileUrl;
      this.fileBaseTitle = e.title;
      this.showPdf = true;
    },
    // 复制文本
    CopyFileLkin() {
      let oInput = document.createElement('input');
      oInput.value = this.downloadFileLink;
      document.body.appendChild(oInput);
      oInput.select();
      document.execCommand('Copy');
      oInput.remove();
      this.showToast('复制成功', 'success');
    },
    // 打开试卷
    openTestPaper({
      info,
      showRobot
    }) {
      if (this.pageType == 'pc') {
        const url = this.testPaperPath + `/answer?testPaperId=${info.id}&showRobot=${showRobot}&BookName=${this.pageTitle}`;
        window.open(url);
      } else {
        const url = this.testPaperPath + `/mobile-answer?testPaperId=${info.id}&showRobot=${showRobot}&BookName=${this.pageTitle}`;
        window.open(url);
      }
    },
    //AI解析
    setanalysis(e) {
      this.$emit('setanalysis', e);
    },
    // 音视频移出窗口暂停
    moveWindowPause() {
      //如果当前窗口的是视频
      if (this.videoDomId) {
        let videoDom = document.getElementById(this.videoDomId);
        if (videoDom.getBoundingClientRect().top < -100 || videoDom.getBoundingClientRect().bottom > (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight + 100)) {
          this.videoDomId = '';
          this.videoDomList.forEach(i => {
            i.pause();
          });
        }
      } else if (this.audioDomId) {
        //如果当前窗口的是视频
        let audioDom = document.getElementById(this.audioDomId);
        if (audioDom.getBoundingClientRect().top < -100 || audioDom.getBoundingClientRect().bottom > (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight + 100)) {
          this.audioDomId = '';
          this.audioDomList.forEach(i => {
            i.pause();
          });
        }
      }
    },
    /**
     * 提示语
     * type
     * @param {*}  warning : 提示
     * @param {*}  error : 错误
     * @param {*}  success : 成功
     */
    showToast(text, type) {
      this.showPrompt = true;
      this.promptText = text;
      this.toastType = type ? type : 'warning';
      setTimeout(() => {
        this.showPrompt = false;
      }, 2000);
    },
    closeViewer() {
      document.body.style.overflow = prevOverflow;
      this.showViewer = false;
      this.imageViewTitles = [];
      this.imageViewSrcs = [];
    },
    // pc端切换工具栏
    clickToolbar(item) {
      this.resourceType = item.type;
      this.resourceIcon = item.icon;
    },
    removeStyle(e) {
      if (e) {
        e = e.replace(/<[^>]+>/g, ''); //去除所有标签，以纯文本展示
        e = e.replace(/\s/gi, ''); //去除空格
        e = e.replace(/&nbsp;/gi, ''); //去除空格
        return e;
      }
    },
    //计算文本在教材中的位置
    getTextOrderNum(e) {
      let paragraph = e.markEfiCode.split('mark(')[1].split('/')[0];
      let start = e.markEfiCode.split(':')[1].split(',')[0];
      let orderNum = e.blockIndex + paragraph.padStart(6, '0') + start.padStart(6, '0');
      return orderNum;
    },
    // 对象数组排序
    sortBy(attr, rev) {
      if (rev == undefined) {
        rev = 1;
      }
      return function (a, b) {
        a = a[attr];
        b = b[attr];
        if (a < b) {
          return rev * -1;
        }
        if (a > b) {
          return rev * 1;
        }
        return 0;
      };
    },
    bookmarkAddSuccess() {
      this.isBookmarkAddSuccess = !this.isBookmarkAddSuccess;
      if (this.isBookmarkAddSuccess) {
        this.$message.success('已添加书签');
      } else {
        this.$message.warning('书签已移除');
      }
    }
  }
};

var __$_require_static_images_icons_books_grades_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAgCAYAAAB3j6rJAAAAAXNSR0IArs4c6QAABDdJREFUWEftlnuIVHUUxz/n7qyvnTuD4R9poWX0gsJA2dW5Y5klIQgZRP0hFfTASkpq52pmj1F67dyRxOhBUPQihCKQkESKBnbuKEGBIpJgmEFh9HDbO0ttu3tP/sbZdVZnxru6S/3R76/L73fO+X3O+X1/53eF/8iQZhxJJ79M4dYQvVyUyXVthcOB795/vvnUBZna0XVxLGZ9CCyOsMG+wHevi2DX1OQMkGlO16wWrK+Ai0566s8gRaA8KpLQjnI1MDEgiVTucxW5CQhVeabc0+dxMPv36enEU7mtIrJ2QkDsxTmHsJI9qmTLJXdTo3pOLIjj5QAX6Ala+2ZSyP71b4F8cqLUtynsLvvuLc3U1bwiWSvh2O0h4TwLpp4Zx9rb63furZ0fJVY75RUQbgB2BL678lxAEou62tWy3gKuaeQvwqbeopttCBJ3crsFWRYFxHa8N4DVCl+XfXeBCZpIex2qfMmpKoRAULNh0nyfFcROee8h3BXlJtiO9wWwFGFnUHRXsCQbswfaDgBXntBZH8iaIDFpO5892j8MYjteD5A8K0jcyT8o6OvGMbSY19ft7q9X3uT13qXhEIeAVpCNgZ95IZ7ylopg4EzGq3qLrmmIo0ZkEHtJfgYDethQAwdolRuDQubX2mgXdGxLDMT6dwGLgP4YQ1cc95/4wXZyGRDPVCOYNSfJR3cMnTOIcYyn8w+L6qvVID8JvBgqBVokREmLsgH0kmqveapccp+v6iOryrPA0cB3K+vnBVIJ6nibFZ5udmsUeaXsd64FUWNnO/knQQ3Ub4HvzmgAYp6JNlTXB6V1pmeNjIavb1vau9lSNlePYMTB3BIjtqDoflobKO7k7hRku5mzLJ3/R/e6b2rXE86WhUq4pzKnrAxK7o5IIMNGbUtyF1r9LXOx1BoMrSN/7nn8x3rZTp//UnJwSsvRqr4OxhhabrRjbJPpl+eGOrgTuAo4PqV12uxfCmtGPaJN/0eaHU29tXgq95CIvFZd6xfoVrCANDCpMi96X1Bc9/bp/iMg9qItKaxwBchM0OiAyjG12FUuuoWTWvHMW2W00nraZgOiZHpL7rZ6SVQ2jDv5bYI+MtYKjLaXdwK/816TcjKVu0xF7tFqm1dlXywcfLdn74bvG+0hCSe/StEPqga9wJExAs0Gpp/00Q2hYnpMwzFJwt+HtTNKrCOtGg61tMYW9hQeM2048pjhdNn9Ij4q10Z2gv2Ctbr2BRbbyX0HMheRXFDMrB9DsBHTRNp7TpWNY/TtI5QFwZ7MtxUN245nzm1OvYcoauBE2hvuqsdC1eWN/GItWEOh1S7oVmAyyvtByb17IkAatvdaODvtvYnyAHAo8F3TW8a9IpFAaio4Yj/eR/M/SOXo65W6mdCbHk3UGzLOdmdqZJw3iBruFEg8lb9dCONRPcfTTrHK5VLmYxPzH7R7Aj+Ga+t2AAAAAElFTkSuQmCC";

var __$_require_static_images_icons_books_highlight_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAAAXNSR0IArs4c6QAABd1JREFUWEfFmFtsXNUVhr+1zzlzBl8zcRJsQ0ABAklapFQQmgSlKqioFZeHCggIFIRUqgIVVUVV5bH0sVXphSBK1UoN5aVJ+lQFFB64qBJ2hKhUIIgQk5jg1g6+xh7f5lz2avYZj2uP7Xgc0rClIx179ln73//619prbaGGoare6cHJdbkwd20KO7H2FmAjxrRhtS4zYWQSa/uALox5R1OO2pzfdXUd/SKSLreMnG+CqsqZ8fE1VoPtVs2DqrpTRJoQ6lBCoPp7RSihTAqMKXQYsX81Eh9tbWgYFBFdar0lgXSphkExuclTfRLkdtA1QLDczqp+j0EGQd9IRV6IG/1/bhQpLWZjUSDdIyOrfK/+PlV+DFwvKwcwby2FGDghyu8SnTi0oVA4Ww1mAZB/j2mL1eRJER5HtX2FDJx/ukivKi/64v++vckx9b8xD4hjwpO6HxqRHymsu6ggZowJ9IPsi+3483OZmQXiNJEvxnvOCfTnglxcJqp2pGjvOeH+bLoxeLmimQyIi47/FJPtqvonYPMi0XCxyXHR85GIPHZFo3/URVMGpK+oaxONf63KA19UmLUidgIW4YAvwdNtjTIgBw+qd+t30jut6h9A22o15Oa5XYiUH9WZZyUG0D4j3g/ePuK9Kv3j2lpK418h7EZrzxOegdRClCiJdYkVQl/wPbAWlsxc84HGAgdyXvBT+Wx4apd4Zj/INbVspsLC6JRysj/l1GDKREnJ+7C+xeeGVsPqOpOZqg2MntLUPio9Z+O9KrpXoLAckAqInuGUw+9FfDKQ0pQ3NF8mTETK8ITS2mS4e2vADZd7iEjmsvMeIzAiIr+QnrH4kKre45hdDoij//Mxy186S4xOWr61JcdX2j1yPpl7ugcsR45FxFZ5ZEeea9Z6tQApichh6RmL3kO5cbGQ9TIKyvDc+1QMh9+P6DwZ88C2kK1XeeS88q7dNKvQ1Z9mQNcXDA9vD2m+zJC4H2Z85V6rSHIH5QfSMxr3g66tZsOqMh2XjbtFfAND45Y/d5S4omB48OaQhrxkTFSGE3CcKkeOxfzj45jHvhFyZcHLRO0WLwsaPPcyfwxKz2hUBBrm/t/NG5tSXvswYmRSMwPuKU4rx8+kfPdrOW7bHBAYyYBWf3u8L+H5N6YzwOuaysJ1YBpC4bZNQaajeZ8pE9JzNhpHqK825qLi1fcjhiZsliecaxyQkwOWe2/K8c1NSwP5+EzCc69Pc3mTYU1DefepQlNeuGNLjrbmxYCMRgOAqzXmDeeaqajsGjdcfhgqWvZ3lLh6tWH3tpD6cKFrEueaD2PeOh7xvV151he8Gfc5ZoV8sJRrahWrIQP2939FvNMd89DXQ2680sN3VM3h2YX0Sx0l2puFPTvy88XqBL0w2amqHnPh+zdVvbvW8D0zanmpY5rxEnz7qwGbWz0CX3BMnB4qh68DvGdnyHXrVhS+8V5U91JLQnPnisKnQ2nGzOnhlEK9YZVLaCUYKNpME/dsDdnUZjBILdl1BJVfymdj8S5R3Q/UnOJdPI9OKic+Tzk5UEnxwlUthi1tHi2ZQGsC4eR3SkUerRx6zyLcv9JDL0mhlGgWmlmOCCDwyiG9XGrPIkCIUQ6FXvCTrAzYfkfpLjHei5e+DJA+lfTxo0fCV2YLo8hGvxFk96UqjBwbVvVgPBU9fV1rY/9sqdhbTHZY1T9eylLRiHy/vdHvnC0Vnbu6uzXvt8R7ziWFZ9D/b/GMaO85gTyTDAUvb9gg02W5zBndI7rKM8lTgj4FLDgIq7PvBf49oMi+1Pr7NhRkttFacAz2jumaRJMnvtQGq7LD4WFtnjDxbpWs5dz4RQU803J2ifLbehscXL1aRqvZPG8TnhtJbjaePoHI7egFNOEuT7gmXPVNm8oLUcF/d0VNeAVt5Voi1mCHqHE9z05FmhStF8gtdi2hEAkygdoiIm+r2AOBhJ2tDVzYtcRc6qouam4FtoFuBJl/UYP2gXQB7yJ0psY/UetFzX8BFwjPnZn+MiMAAAAASUVORK5CYII=";

var __$_require_static_images_icons_books_bookmark_top_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAAAXNSR0IArs4c6QAABhlJREFUWEe1mGtsHFcVx3/nzsyusb1OncbGcZSGtHFTNxQ1TYA0bXkEKhAFKgENSKhShYpoiopQEcpHykcQTwU15SVVCh9IUgmQClRIOFC1jQVpEyjIIZYabAe7OH6v196dxz3kTrLuxt5dr0M70mhGuzP3/ubc/3ldoYFDVb2hiYXOTDZzUwJ7sfY9QA/GbMRqczqEkQWsHQMGMeYvmtBvM/7glmbGRSRZbRqp94Cqyuvz8xusBnusms+p6l4RaUNoRskCy99XhBLKgsCcwktG7C+NRP1dra0TIqK15qsJMqiaDfLxLk/1UZB9oBuAYLUvW/Z/BDIB2peIPBnl/Jd7RErVxqgKcn56+jrfa/mMKl8Fbpa1A1w1l0IEnBPlh7EWjm9tb59ZDrMC5MKcXm81flSER1DtXqMF6j8uMqrKU4uFxcPbu9smKh++CsRZwpPmLxuRryh0vqkQVwYTGLfoocQu/KjSMksgThNN+ejBSwL9piBvriWWfZGio5eE+41iLjhS1kwK4rzjP/l4j6r+DOit4g01jSMCnoC76hWfcBd3n57V33Q/D4jIw5tyfr/zphRkLK8dsUbfU+WzaxGmmzyxysyCEiXgG/DSU9L7bODCS3XHdAIW4agvweMbc3JRjh1T766PJh+zqj8G3dioLoxAlCinhxP+8M+QUqy0NQmtTUJLxqTXGzsMt3Z7BJ4sWevq8XXMiPelF5/zfifj89pVSqLvIOxHG4sTZYhTQzEnBiLetdnjli6fUgJzC5b5IlyYsYxMJRz4YBNvzxliW/UTI4GjGS/4ugxPLd4jnnka5MZGrFEJ0TcQsWuLz/u3B+lSFCPI+G6JhKHJhJ+/UOThu5u4qdOrBeLU9Jom9iEZmYkOquhBgfbVQKpBfGB7QBjDC4MR0wvKjm6PnVt8JueVnzxf5L7bMuzY5KW5oJpwFaZF5FsyMhcdV9VPCGnuqHlUhbglwBOh72zIwFhCR87w74mEL9zdxNsC4Rf9xdRiu9/h49fQiUJJRJ6Vkbnwbyi31XPZahDvuzlIxTm7qPz+1ZB8SdnW4dH3r4jPvzdL1zrDM6dK6dUtnQOz1X3ZJcpXZWQ2GgftqJcVY6u8PBTzxyuacBAtGcHpz6oy+HrCb86EFELo6fT49K5M6s7H/1qic53hw70Bze75mrmXCRmZDfNAa62M6CBeGY7pOxuxc7NPGSKpGNTFkqmCshAqnTmDs+CfzkW8MhTzydsz7Oj2a2oknVcpyMhMOI/QUg3EecJ43nL4RJFtnR7378zQmpUVHuCE6AKZMVAoKSfORqkFP9QbcMcN/uU4UrfwcSCz4UXA1RorDje4i5pHXioRWeWB3VluWG9I7EoPcGHeWeTP5y5D7OsN2L3lMkSdJSnPObGqWF2EHp1O+NXpMB3wU3dk2Lzew1bAOIhCqDx/bRCqqv9w7vuMqn68mvs6cxp3GhieTPj16RARSWE2tZsUxunh/4BwS1Z23+ggqgepE9CcBpZgzoQERrj/dmcZQ754zctRXpZpVL4tw3PRPaL6NFA3xC+HyXjCvbcGDP43weWcNWqiUo+vqchD5aT3XYQHVkt6SzBTCc+eCZksaKqbj7zzDe9oQJhvQAgRyvGsF3wtLQP23Fu6T4z3VCNlgINJBTyT8PcLlo3rDL3dBmehNUGkODKmkjzS/1z2t0uFUWjD7wuyv9HCyMGEsaY5xAm6bpyoHi0jq3osWgwf39aVG18qFUfz8Z1W9adrKRWdx9QpB+uHMBgwIl/szvknl0pF98b589rkXx89eOnbnkDf2uIZ0dFLTeIT8WRwZOtWKaaLVIl9flqv80z8mKCPATUT4Wp1yyr/X1TkUGL9Q1vbZanRWlHZjs7phljjA29lg+WLf7i7zbWilQ5UBX9qStcVTLRfJW05exoVcC1LXGk5B0X5QYsNjq1fL7PLn63bhGem493G0wOI7EOvoQl3ccI14aonbCJPhu3+qTU14WXa8rZEpMGdosb1PHsVaVO0RSBTbVtCIRSkgNo8Ii+q2KOBZE92tXJt2xKVplu2UXMX8G7QHpCrN2rQMZBB4BTCycT45xrdqPkf0cQOrNcuZKsAAAAASUVORK5CYII=";

var __$_require_static_images_icons_books_bookmark_top_active_svg__ = "data:image/svg+xml,%3Csvg%20width%3D%2234%22%20height%3D%2234%22%20viewBox%3D%220%200%2034%2034%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20cx%3D%2217%22%20cy%3D%2217%22%20r%3D%2217%22%20fill%3D%22%23E3F1FA%22%2F%3E%3Cg%20clip-path%3D%22url%28%23clip0_213_1676%29%22%3E%3Cpath%20d%3D%22M22.3333%209H11.6667C11.4309%209%2011.2048%209.09365%2011.0381%209.26035C10.8714%209.42705%2010.7778%209.65314%2010.7778%209.88889V24.1111C10.7782%2024.2626%2010.8174%2024.4115%2010.8916%2024.5436C10.9658%2024.6758%2011.0725%2024.7867%2011.2017%2024.866C11.3308%2024.9452%2011.4781%2024.9902%2011.6295%2024.9965C11.7808%2025.0029%2011.9313%2024.9704%2012.0667%2024.9022L17%2022.44L21.9333%2024.9022C22.0572%2024.9657%2022.1942%2024.9992%2022.3333%2025C22.4997%2025.0005%2022.663%2024.9543%2022.8044%2024.8667C22.9325%2024.7866%2023.0381%2024.6752%2023.1112%2024.543C23.1843%2024.4108%2023.2225%2024.2622%2023.2222%2024.1111V9.88889C23.2222%209.65314%2023.1286%209.42705%2022.9619%209.26035C22.7952%209.09365%2022.5691%209%2022.3333%209ZM20.2978%2014.9644L16.7422%2018.52C16.6596%2018.6033%2016.5613%2018.6694%2016.4529%2018.7146C16.3446%2018.7597%2016.2284%2018.7829%2016.1111%2018.7829C15.9938%2018.7829%2015.8776%2018.7597%2015.7693%2018.7146C15.6609%2018.6694%2015.5626%2018.6033%2015.48%2018.52L13.7022%2016.7422C13.5348%2016.5748%2013.4408%2016.3478%2013.4408%2016.1111C13.4408%2015.8744%2013.5348%2015.6474%2013.7022%2015.48C13.8696%2015.3126%2014.0966%2015.2186%2014.3333%2015.2186C14.57%2015.2186%2014.7971%2015.3126%2014.9644%2015.48L16.1111%2016.6356L19.0355%2013.7022C19.2029%2013.5348%2019.4299%2013.4408%2019.6667%2013.4408C19.9034%2013.4408%2020.1304%2013.5348%2020.2978%2013.7022C20.4651%2013.8696%2020.5592%2014.0966%2020.5592%2014.3333C20.5592%2014.57%2020.4651%2014.7971%2020.2978%2014.9644Z%22%20fill%3D%22%231681E5%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_213_1676%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22white%22%20transform%3D%22translate%289%209%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E";

var __$_require_static_images_icons_books_set_up_png__ = "data:image/png;base64, ";

/* script */
const __vue_script__$1$ = script$1$;
var __vue_render__$1$ = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "xml-digital-teaching-preview",
      style: { "--preview-theme-color": _vm.themeColor },
    },
    [
      _vm.pageType == "pc" && _vm.readerType !== "loose-leaf"
        ? [
            _c("div", { staticClass: "xml-digital-teaching-pc" }, [
              _c(
                "div",
                { staticClass: "preview-container-pc-left" },
                [
                  _vm.businessType === "textBook" && _vm.userType === "teacher"
                    ? _c("xml-preview-catalog", {
                        ref: "xmlPreviewCatalog",
                        staticClass: "pc-catalog pc-catalog--render",
                        attrs: {
                          "page-type": _vm.pageType,
                          "style-type": _vm.styleType,
                          "text-book-id": _vm.textBookId,
                          "catalog-list": _vm.textCatalog,
                          userType: _vm.userType,
                          notesList: _vm.notesList,
                          checkedId: _vm.selectId,
                          PreviewCatalog: _vm.PreviewCatalog,
                          textBookName: _vm.textBookData.textBooksName,
                        },
                        on: {
                          onNodeClick: _vm.catalogClick,
                          deleteNotoPC: _vm.deleteNotoPC,
                          jumpingNotes: _vm.jumpingNotes,
                          jumpingBookmark: _vm.jumpingBookmark,
                        },
                      })
                    : _vm._e(),
                  _vm._v(" "),
                  _vm.userType === "student"
                    ? _c("preview-left-student", {
                        ref: "xmlPreviewCatalog",
                        attrs: {
                          location: _vm.location,
                          userType: _vm.userType,
                          "page-type": _vm.pageType,
                          "style-type": _vm.styleType,
                          "text-book-id": _vm.textBookId,
                          "catalog-list": _vm.textCatalog,
                          bookmarkList: _vm.bookmarkData,
                          notesList: _vm.notesListData,
                          highlightList: _vm.highlightData,
                          checkedId: _vm.selectId,
                          PreviewCatalog: _vm.PreviewCatalog,
                          looseLeaf: _vm.looseLeafData,
                          resourcesList: _vm.teacherResourcesList,
                          textBookName: _vm.textBookData.textBooksName,
                          textBookResource: _vm.textBookResource,
                        },
                        on: {
                          onNodeClick: _vm.catalogClick,
                          deleteNotoPC: _vm.deleteNotoPC,
                          jumpingNotes: _vm.jumpingNotes,
                          jumpingBookmark: _vm.jumpingBookmark,
                          addBookmark: _vm.addBookmark,
                          deleteNote: _vm.deleteNote,
                          deleteBookmark: _vm.deleteBookmark,
                          deleteHighlight: _vm.deleteHighlight,
                          resourceDetails: _vm.underlineSignDetails,
                        },
                      })
                    : _vm._e(),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                { ref: "rightContent", staticClass: "preview-counter-main-pc" },
                [
                  _c("div", { staticClass: "preview-counter-header" }, [
                    _c("div", { staticClass: "text-book-title" }, [
                      _vm._v(_vm._s(_vm.currentGroupInfo.locationLabel)),
                    ]),
                    _vm._v(" "),
                    _c("div", { staticClass: "header-right" }, [
                      _vm.gradesName
                        ? _c("div", { staticClass: "grades" }, [
                            _c("img", {
                              attrs: {
                                src: __$_require_static_images_icons_books_grades_png__,
                                alt: "",
                              },
                            }),
                            _vm._v(" "),
                            _c("span", { attrs: { title: _vm.gradesName } }, [
                              _vm._v(_vm._s(_vm.gradesName)),
                            ]),
                          ])
                        : _vm._e(),
                      _vm._v(" "),
                      _vm.userType === "student"
                        ? _c(
                            "div",
                            {
                              staticClass: "set-up highlight",
                              on: {
                                click: function ($event) {
                                  _vm.$refs.visiblea.visiblea = true;
                                },
                              },
                            },
                            [
                              _c("img", {
                                attrs: {
                                  src: __$_require_static_images_icons_books_highlight_png__,
                                  alt: "",
                                },
                              }),
                            ]
                          )
                        : _vm._e(),
                      _vm._v(" "),
                      _vm.userType === "student"
                        ? _c("div", { staticClass: "set-up bookmark" }, [
                            JSON.stringify(_vm.bookmarkList).indexOf(
                              _vm.currentGroupInfo.location
                            ) == -1
                              ? _c("img", {
                                  attrs: {
                                    src: __$_require_static_images_icons_books_bookmark_top_png__,
                                    alt: "",
                                  },
                                  on: {
                                    click: function ($event) {
                                      return _vm.addBookmark(
                                        _vm.currentGroupInfo.location
                                      )
                                    },
                                  },
                                })
                              : _c("img", {
                                  attrs: {
                                    src: __$_require_static_images_icons_books_bookmark_top_active_svg__,
                                    alt: "",
                                  },
                                  on: {
                                    click: function ($event) {
                                      return _vm.deleteBookmark(
                                        _vm.currentGroupInfo.location
                                      )
                                    },
                                  },
                                }),
                          ])
                        : _vm._e(),
                      _vm._v(" "),
                      _c(
                        "div",
                        {
                          staticClass: "set-up",
                          on: {
                            click: function ($event) {
                              _vm.$refs.visible.visible = true;
                            },
                          },
                        },
                        [
                          _c("img", {
                            attrs: {
                              src: __$_require_static_images_icons_books_set_up_png__,
                              alt: "",
                            },
                          }),
                        ]
                      ),
                    ]),
                  ]),
                  _vm._v(" "),
                  _c(
                    "div",
                    {
                      ref: "xmlPreviewDom",
                      staticClass: "preview-counter-main preview-list-pc",
                      attrs: { id: "xmlPreviewDom" },
                    },
                    [
                      _c("xml-preview-loose-leaf", {
                        ref: "xmlPreviewLooseLeaf",
                        class: "preview-screen-" + _vm.pageType,
                        attrs: {
                          "business-type": _vm.businessType,
                          looseLeaf: _vm.looseLeafData,
                          CompList: _vm.componentList,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.basisPath,
                          officePreviewPath: _vm.officePreviewPath,
                          endIndex: _vm.endIndex,
                          isTrial: _vm.isTrial,
                          trialText: _vm.trialText,
                          isShowAi: _vm.isShowAi,
                          resourcesList: _vm.teacherResourcesList,
                          highlightList: _vm.highlightList,
                          studentNoteList: _vm.notesList,
                          teacherNoteList: _vm.teacherNoteList,
                          userType: _vm.userType,
                          readerType: _vm.readerType,
                          isShowTeacherResource: _vm.isShowTeacherResource,
                        },
                        on: {
                          downloadFile: _vm.downloadFile,
                          showFileReader: _vm.showFileReader,
                          openTestPaper: _vm.openTestPaper,
                          setanalysis: _vm.setanalysis,
                          clickComp: _vm.clickComp,
                          openTeacherResoucesList: _vm.openTeacherResoucesList,
                          initObserver: _vm.initObserver,
                        },
                      }),
                    ],
                    1
                  ),
                ]
              ),
              _vm._v(" "),
              _c("div", { staticClass: "preview-container-pc-right" }, [
                _c(
                  "div",
                  { staticClass: "preview-toolbar-content" },
                  [
                    _c("xml-resource-list-pc", {
                      ref: "xmlResourceListPc",
                      attrs: {
                        textBookResource: _vm.textBookResource,
                        resourceType: _vm.resourceType,
                        resourceIcon: _vm.resourceIcon,
                        resourcesList: _vm.teacherResourcesList,
                        resourceBasisPath: _vm.basisPath,
                        isShowTeacherResource: _vm.isShowTeacherResource,
                        componentList: _vm.componentList,
                        userType: _vm.userType,
                      },
                      on: {
                        deleteTeachingResource: _vm.deleteTeachingResource,
                        deleteTeacherNotes: _vm.deleteTeacherNotes,
                        editTeachingResource: _vm.editTeachingResource,
                        resourceDetails: _vm.resourceDetails,
                        updateTeacherNotes: _vm.handleUpdateTeacherNotes,
                        PrewiewOff: _vm.resourceReader,
                      },
                    }),
                  ],
                  1
                ),
                _vm._v(" "),
                _c(
                  "div",
                  { staticClass: "xml-toolbar-pc-content" },
                  [
                    _c("xml-toolbar-pc", {
                      ref: "xmlToolBarPc",
                      attrs: {
                        textBookResource: _vm.textBookResource,
                        isShowTeacherResource: _vm.isShowTeacherResource,
                      },
                      on: { clickToolbar: _vm.clickToolbar },
                    }),
                  ],
                  1
                ),
              ]),
            ]),
          ]
        : (_vm.pageType == "h5" || _vm.pageType == "pad") &&
          _vm.readerType !== "loose-leaf"
        ? [
            _c("div", { staticClass: "xml-digital-teaching-phone" }, [
              _c(
                "div",
                {
                  ref: "xmlPreviewDom",
                  staticClass: "preview-counter-main preview-list",
                  attrs: { id: "xmlPreviewDom" },
                  on: {
                    click: function ($event) {
                      $event.stopPropagation();
                      return _vm.clickdigital($event)
                    },
                  },
                },
                [
                  _c("xml-preview-loose-leaf", {
                    ref: "xmlPreviewLooseLeaf",
                    class: "preview-screen-" + _vm.pageType,
                    attrs: {
                      "business-type": _vm.businessType,
                      looseLeaf: _vm.looseLeafData,
                      CompList: _vm.componentList,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.basisPath,
                      officePreviewPath: _vm.officePreviewPath,
                      endIndex: _vm.endIndex,
                      isTrial: _vm.isTrial,
                      trialText: _vm.trialText,
                      isShowAi: _vm.isShowAi,
                      resourcesList: _vm.teacherResourcesList,
                      highlightList: _vm.highlightList,
                      studentNoteList: _vm.notesList,
                      teacherNoteList: _vm.teacherNoteList,
                      userType: _vm.userType,
                      readerType: _vm.readerType,
                      isShowTeacherResource: _vm.isShowTeacherResource,
                      isCopyUrl: !_vm.isOpenHyperlink && _vm.pageType !== "pc",
                    },
                    on: {
                      downloadFile: _vm.downloadFile,
                      showFileReader: _vm.showFileReader,
                      openTestPaper: _vm.openTestPaper,
                      setanalysis: _vm.setanalysis,
                      clickComp: _vm.clickComp,
                      openTeacherResoucesList: _vm.openTeacherResoucesList,
                      openHtml: _vm.openHtml,
                      copyHtmlUrl: _vm.copyHtmlUrl,
                      initObserver: _vm.initObserver,
                    },
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "toolbar-pop" },
                [
                  _c("xml-toolbar-phone", {
                    ref: "xmlToolbarPhone",
                    attrs: {
                      textBookResource: _vm.textBookResource,
                      resourcesList: _vm.teacherResourcesList,
                      catalogList: _vm.textCatalog,
                      resourceBasisPath: _vm.basisPath,
                      componentList: _vm.componentList,
                      schedule: _vm.schedule,
                      showToast: _vm.showToast,
                      bookmarkList: _vm.bookmarkData,
                      notesList: _vm.notesListData,
                      highlightList: _vm.highlightData,
                      location: _vm.currentGroupInfo.location,
                      title: _vm.currentGroupInfo.locationLabel,
                      checkedId: _vm.selectId,
                      isShowTeacherResource: _vm.isShowTeacherResource,
                      settingData: _vm.useReaderSetting,
                      userType: _vm.userType,
                      textBookName: _vm.textBookData.textBooksName,
                    },
                    on: {
                      resourceDetails: _vm.resourceDetails,
                      resourceReader: _vm.resourceReader,
                      onNodeClick: _vm.catalogClick,
                      addBookmark: _vm.addBookmark,
                      deleteBookmark: _vm.deleteBookmark,
                      settingChange: _vm.settingChange,
                    },
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: _vm.isShowToolbarTip && _vm.isiOS,
                      expression: "isShowToolbarTip && isiOS",
                    },
                  ],
                  staticClass: "xml-mobile-toolbar-tip",
                },
                [
                  _c(
                    "div",
                    {
                      staticClass: "tipbar-action",
                      on: {
                        click: function ($event) {
                          $event.stopPropagation();
                          return _vm.$EventBus.$emit("clickToolbarTip", {
                            type: "copy",
                            tippyTplBarId: _vm.tippyTplBarId,
                          })
                        },
                      },
                    },
                    [
                      _c("i", { staticClass: "tipbar-icon copy" }),
                      _vm._v(" "),
                      _c("span", [_vm._v("复制")]),
                    ]
                  ),
                  _vm._v(" "),
                  _c(
                    "div",
                    {
                      staticClass: "tipbar-action",
                      on: {
                        click: function ($event) {
                          $event.stopPropagation();
                          return _vm.$EventBus.$emit("clickToolbarTip", {
                            type: "note",
                            tippyTplBarId: _vm.tippyTplBarId,
                          })
                        },
                      },
                    },
                    [
                      _c("i", { staticClass: "tipbar-icon note" }),
                      _vm._v(" "),
                      _c("span", [_vm._v("笔记")]),
                    ]
                  ),
                  _vm._v(" "),
                  _c(
                    "div",
                    {
                      staticClass: "tipbar-action",
                      on: {
                        click: function ($event) {
                          $event.stopPropagation();
                          return _vm.$EventBus.$emit("clickToolbarTip", {
                            type: "highlight",
                            tippyTplBarId: _vm.tippyTplBarId,
                          })
                        },
                      },
                    },
                    [
                      _c("i", { staticClass: "tipbar-icon highlight" }),
                      _vm._v(" "),
                      _c("span", [_vm._v("高亮")]),
                    ]
                  ),
                  _vm._v(" "),
                  _c("span", { staticClass: "tipbar-remark" }, [
                    _vm._v("均<=200字"),
                  ]),
                ]
              ),
              _vm._v(" "),
              _vm._m(0),
            ]),
          ]
        : _vm.readerType === "loose-leaf"
        ? [
            _c(
              "div",
              {
                ref: "xmlPreviewDom",
                staticClass: "preview-counter-main preview-list-pc",
                attrs: { id: "xmlPreviewDom" },
              },
              [
                _c("xml-preview-loose-leaf", {
                  ref: "xmlPreviewLooseLeaf",
                  class: "preview-screen-" + _vm.pageType,
                  attrs: {
                    "business-type": _vm.businessType,
                    looseLeaf: _vm.looseLeafData,
                    CompList: _vm.componentList,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.basisPath,
                    officePreviewPath: _vm.officePreviewPath,
                    endIndex: _vm.endIndex,
                    isTrial: _vm.isTrial,
                    trialText: _vm.trialText,
                    isShowAi: _vm.isShowAi,
                    resourcesList: _vm.teacherResourcesList,
                    highlightList: _vm.highlightList,
                    studentNoteList: _vm.notesList,
                    teacherNoteList: _vm.teacherNoteList,
                    userType: _vm.userType,
                    readerType: _vm.readerType,
                    isShowTeacherResource: _vm.isShowTeacherResource,
                  },
                  on: {
                    downloadFile: _vm.downloadFile,
                    showFileReader: _vm.showFileReader,
                    openTestPaper: _vm.openTestPaper,
                    setanalysis: _vm.setanalysis,
                    clickComp: _vm.clickComp,
                    openTeacherResoucesList: _vm.openTeacherResoucesList,
                    initObserver: _vm.initObserver,
                  },
                }),
              ],
              1
            ),
          ]
        : _vm._e(),
      _vm._v(" "),
      _c(
        "div",
        {
          directives: [
            {
              name: "show",
              rawName: "v-show",
              value: _vm.continueRead,
              expression: "continueRead",
            },
          ],
          staticClass: "continue-read-box",
          class: _vm.pageType != "pc" ? "continue-read-h5" : "",
        },
        [
          _c("div", { staticClass: "notes-text-box" }, [
            _c("div", { staticClass: "title-box" }, [_vm._v("提示")]),
            _vm._v(" "),
            _c("div", { staticClass: "text" }, [
              _vm._v("检测到上次阅读位置,是否继续阅读."),
            ]),
            _vm._v(" "),
            _c("div", { staticClass: "add-notes-btn" }, [
              _c(
                "div",
                {
                  on: {
                    click: function ($event) {
                      _vm.continueRead = false;
                    },
                  },
                },
                [_vm._v("取消")]
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  staticClass: "confirm",
                  on: {
                    click: function ($event) {
                      _vm.JumpPosition(
                        _vm.location,
                        50,
                        "initial",
                        _vm.scrollId
                      ),
                        (_vm.continueRead = false);
                    },
                  },
                },
                [_vm._v("\n          确认\n        ")]
              ),
            ]),
          ]),
        ]
      ),
      _vm._v(" "),
      _c("down-file-uppop", {
        ref: "downFileUppop",
        attrs: {
          downloadFileLink: _vm.downloadFileLink,
          showToast: _vm.showToast,
        },
      }),
      _vm._v(" "),
      _vm.showViewer
        ? _c("xml-image-viewer", {
            attrs: {
              title: _vm.imageViewTitles,
              "z-index": 2000,
              "on-close": _vm.closeViewer,
              "url-list": _vm.imageViewSrcs,
            },
          })
        : _vm._e(),
      _vm._v(" "),
      _c("XmlHotTargetModalViewer", {
        attrs: { visible: _vm.hotTargetViewerVisible, data: _vm.hotzoneTarget },
        on: {
          "update:visible": function ($event) {
            _vm.hotTargetViewerVisible = $event;
          },
        },
      }),
      _vm._v(" "),
      _c("add-file", {
        ref: "addTeacherResources",
        attrs: {
          actionUrl: _vm.action,
          headers: _vm.headers,
          fileSize: _vm.fileSize,
          data: _vm.data,
        },
        on: {
          addResources: _vm.addResources,
          editResources: _vm.editResources,
          addTeacherNote: _vm.addTeacherNote,
        },
      }),
      _vm._v(" "),
      _c("set-pop", {
        ref: "visible",
        attrs: { settingData: _vm.useReaderSetting },
        on: { settingChange: _vm.settingChange },
      }),
      _vm._v(" "),
      _c("highlight", { ref: "visiblea" }),
      _vm._v(" "),
      _c("bookmark", { ref: "visibleb" }),
      _vm._v(" "),
      _c(
        "div",
        {
          directives: [
            {
              name: "show",
              rawName: "v-show",
              value: _vm.showPrompt,
              expression: "showPrompt",
            },
          ],
          staticClass: "xml-toast-prompt-box",
        },
        [
          _c("div", {
            staticClass: "prompt-text",
            class: _vm.toastType,
            domProps: { innerHTML: _vm._s(_vm.promptText) },
          }),
        ]
      ),
      _vm._v(" "),
      _c("modify-notes", {
        ref: "modifyNotes",
        on: { saveNote: _vm.saveNote },
      }),
      _vm._v(" "),
      _c("PdfView", {
        attrs: {
          show: _vm.showPdf,
          baseUrl: _vm.fileBaseUrl,
          textInfo: _vm.fileBaseTitle,
        },
        on: {
          handleClose: function ($event) {
            _vm.showPdf = false;
          },
        },
      }),
    ],
    2
  )
};
var __vue_staticRenderFns__$1$ = [
  function () {
    var _vm = this;
    var _h = _vm.$createElement;
    var _c = _vm._self._c || _h;
    return _c("div", { staticClass: "font-pre-loader" }, [
      _c("div", { attrs: { id: "sim-sun" } }, [_vm._v("宋体")]),
      _vm._v(" "),
      _c("div", { attrs: { id: "sim-hei" } }, [_vm._v("黑体")]),
      _vm._v(" "),
      _c("div", { attrs: { id: "sim-kai" } }, [_vm._v("楷体")]),
    ])
  },
];
__vue_render__$1$._withStripped = true;

  /* style */
  const __vue_inject_styles__$1$ = undefined;
  /* scoped */
  const __vue_scope_id__$1$ = undefined;
  /* module identifier */
  const __vue_module_identifier__$1$ = undefined;
  /* functional template */
  const __vue_is_functional_template__$1$ = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1$ = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1$, staticRenderFns: __vue_staticRenderFns__$1$ },
    __vue_inject_styles__$1$,
    __vue_script__$1$,
    __vue_scope_id__$1$,
    __vue_is_functional_template__$1$,
    __vue_module_identifier__$1$,
    false,
    undefined,
    undefined,
    undefined
  );

var hammer = createCommonjsModule(function (module) {
/*! Hammer.JS - v2.0.7 - 2016-04-22
 * http://hammerjs.github.io/
 *
 * Copyright (c) 2016 Jorik Tangelder;
 * Licensed under the MIT license */
(function (window, document, exportName, undefined$1) {

  var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
  var TEST_ELEMENT = document.createElement('div');
  var TYPE_FUNCTION = 'function';
  var round = Math.round;
  var abs = Math.abs;
  var now = Date.now;

  /**
   * set a timeout with a given scope
   * @param {Function} fn
   * @param {Number} timeout
   * @param {Object} context
   * @returns {number}
   */
  function setTimeoutContext(fn, timeout, context) {
    return setTimeout(bindFn(fn, context), timeout);
  }

  /**
   * if the argument is an array, we want to execute the fn on each entry
   * if it aint an array we don't want to do a thing.
   * this is used by all the methods that accept a single and array argument.
   * @param {*|Array} arg
   * @param {String} fn
   * @param {Object} [context]
   * @returns {Boolean}
   */
  function invokeArrayArg(arg, fn, context) {
    if (Array.isArray(arg)) {
      each(arg, context[fn], context);
      return true;
    }
    return false;
  }

  /**
   * walk objects and arrays
   * @param {Object} obj
   * @param {Function} iterator
   * @param {Object} context
   */
  function each(obj, iterator, context) {
    var i;
    if (!obj) {
      return;
    }
    if (obj.forEach) {
      obj.forEach(iterator, context);
    } else if (obj.length !== undefined$1) {
      i = 0;
      while (i < obj.length) {
        iterator.call(context, obj[i], i, obj);
        i++;
      }
    } else {
      for (i in obj) {
        obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
      }
    }
  }

  /**
   * wrap a method with a deprecation warning and stack trace
   * @param {Function} method
   * @param {String} name
   * @param {String} message
   * @returns {Function} A new function wrapping the supplied method.
   */
  function deprecate(method, name, message) {
    var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\n' + message + ' AT \n';
    return function () {
      var e = new Error('get-stack-trace');
      var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '').replace(/^\s+at\s+/gm, '').replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';
      var log = window.console && (window.console.warn || window.console.log);
      if (log) {
        log.call(window.console, deprecationMessage, stack);
      }
      return method.apply(this, arguments);
    };
  }

  /**
   * extend object.
   * means that properties in dest will be overwritten by the ones in src.
   * @param {Object} target
   * @param {...Object} objects_to_assign
   * @returns {Object} target
   */
  var assign;
  if (typeof Object.assign !== 'function') {
    assign = function assign(target) {
      if (target === undefined$1 || target === null) {
        throw new TypeError('Cannot convert undefined or null to object');
      }
      var output = Object(target);
      for (var index = 1; index < arguments.length; index++) {
        var source = arguments[index];
        if (source !== undefined$1 && source !== null) {
          for (var nextKey in source) {
            if (source.hasOwnProperty(nextKey)) {
              output[nextKey] = source[nextKey];
            }
          }
        }
      }
      return output;
    };
  } else {
    assign = Object.assign;
  }

  /**
   * extend object.
   * means that properties in dest will be overwritten by the ones in src.
   * @param {Object} dest
   * @param {Object} src
   * @param {Boolean} [merge=false]
   * @returns {Object} dest
   */
  var extend = deprecate(function extend(dest, src, merge) {
    var keys = Object.keys(src);
    var i = 0;
    while (i < keys.length) {
      if (!merge || merge && dest[keys[i]] === undefined$1) {
        dest[keys[i]] = src[keys[i]];
      }
      i++;
    }
    return dest;
  }, 'extend', 'Use `assign`.');

  /**
   * merge the values from src in the dest.
   * means that properties that exist in dest will not be overwritten by src
   * @param {Object} dest
   * @param {Object} src
   * @returns {Object} dest
   */
  var merge = deprecate(function merge(dest, src) {
    return extend(dest, src, true);
  }, 'merge', 'Use `assign`.');

  /**
   * simple class inheritance
   * @param {Function} child
   * @param {Function} base
   * @param {Object} [properties]
   */
  function inherit(child, base, properties) {
    var baseP = base.prototype,
      childP;
    childP = child.prototype = Object.create(baseP);
    childP.constructor = child;
    childP._super = baseP;
    if (properties) {
      assign(childP, properties);
    }
  }

  /**
   * simple function bind
   * @param {Function} fn
   * @param {Object} context
   * @returns {Function}
   */
  function bindFn(fn, context) {
    return function boundFn() {
      return fn.apply(context, arguments);
    };
  }

  /**
   * let a boolean value also be a function that must return a boolean
   * this first item in args will be used as the context
   * @param {Boolean|Function} val
   * @param {Array} [args]
   * @returns {Boolean}
   */
  function boolOrFn(val, args) {
    if (typeof val == TYPE_FUNCTION) {
      return val.apply(args ? args[0] || undefined$1 : undefined$1, args);
    }
    return val;
  }

  /**
   * use the val2 when val1 is undefined
   * @param {*} val1
   * @param {*} val2
   * @returns {*}
   */
  function ifUndefined(val1, val2) {
    return val1 === undefined$1 ? val2 : val1;
  }

  /**
   * addEventListener with multiple events at once
   * @param {EventTarget} target
   * @param {String} types
   * @param {Function} handler
   */
  function addEventListeners(target, types, handler) {
    each(splitStr(types), function (type) {
      target.addEventListener(type, handler, false);
    });
  }

  /**
   * removeEventListener with multiple events at once
   * @param {EventTarget} target
   * @param {String} types
   * @param {Function} handler
   */
  function removeEventListeners(target, types, handler) {
    each(splitStr(types), function (type) {
      target.removeEventListener(type, handler, false);
    });
  }

  /**
   * find if a node is in the given parent
   * @method hasParent
   * @param {HTMLElement} node
   * @param {HTMLElement} parent
   * @return {Boolean} found
   */
  function hasParent(node, parent) {
    while (node) {
      if (node == parent) {
        return true;
      }
      node = node.parentNode;
    }
    return false;
  }

  /**
   * small indexOf wrapper
   * @param {String} str
   * @param {String} find
   * @returns {Boolean} found
   */
  function inStr(str, find) {
    return str.indexOf(find) > -1;
  }

  /**
   * split string on whitespace
   * @param {String} str
   * @returns {Array} words
   */
  function splitStr(str) {
    return str.trim().split(/\s+/g);
  }

  /**
   * find if a array contains the object using indexOf or a simple polyFill
   * @param {Array} src
   * @param {String} find
   * @param {String} [findByKey]
   * @return {Boolean|Number} false when not found, or the index
   */
  function inArray(src, find, findByKey) {
    if (src.indexOf && !findByKey) {
      return src.indexOf(find);
    } else {
      var i = 0;
      while (i < src.length) {
        if (findByKey && src[i][findByKey] == find || !findByKey && src[i] === find) {
          return i;
        }
        i++;
      }
      return -1;
    }
  }

  /**
   * convert array-like objects to real arrays
   * @param {Object} obj
   * @returns {Array}
   */
  function toArray(obj) {
    return Array.prototype.slice.call(obj, 0);
  }

  /**
   * unique array with objects based on a key (like 'id') or just by the array's value
   * @param {Array} src [{id:1},{id:2},{id:1}]
   * @param {String} [key]
   * @param {Boolean} [sort=False]
   * @returns {Array} [{id:1},{id:2}]
   */
  function uniqueArray(src, key, sort) {
    var results = [];
    var values = [];
    var i = 0;
    while (i < src.length) {
      var val = key ? src[i][key] : src[i];
      if (inArray(values, val) < 0) {
        results.push(src[i]);
      }
      values[i] = val;
      i++;
    }
    if (sort) {
      if (!key) {
        results = results.sort();
      } else {
        results = results.sort(function sortUniqueArray(a, b) {
          return a[key] > b[key];
        });
      }
    }
    return results;
  }

  /**
   * get the prefixed property
   * @param {Object} obj
   * @param {String} property
   * @returns {String|Undefined} prefixed
   */
  function prefixed(obj, property) {
    var prefix, prop;
    var camelProp = property[0].toUpperCase() + property.slice(1);
    var i = 0;
    while (i < VENDOR_PREFIXES.length) {
      prefix = VENDOR_PREFIXES[i];
      prop = prefix ? prefix + camelProp : property;
      if (prop in obj) {
        return prop;
      }
      i++;
    }
    return undefined$1;
  }

  /**
   * get a unique id
   * @returns {number} uniqueId
   */
  var _uniqueId = 1;
  function uniqueId() {
    return _uniqueId++;
  }

  /**
   * get the window object of an element
   * @param {HTMLElement} element
   * @returns {DocumentView|Window}
   */
  function getWindowForElement(element) {
    var doc = element.ownerDocument || element;
    return doc.defaultView || doc.parentWindow || window;
  }
  var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
  var SUPPORT_TOUCH = ('ontouchstart' in window);
  var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined$1;
  var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
  var INPUT_TYPE_TOUCH = 'touch';
  var INPUT_TYPE_PEN = 'pen';
  var INPUT_TYPE_MOUSE = 'mouse';
  var INPUT_TYPE_KINECT = 'kinect';
  var COMPUTE_INTERVAL = 25;
  var INPUT_START = 1;
  var INPUT_MOVE = 2;
  var INPUT_END = 4;
  var INPUT_CANCEL = 8;
  var DIRECTION_NONE = 1;
  var DIRECTION_LEFT = 2;
  var DIRECTION_RIGHT = 4;
  var DIRECTION_UP = 8;
  var DIRECTION_DOWN = 16;
  var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
  var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
  var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
  var PROPS_XY = ['x', 'y'];
  var PROPS_CLIENT_XY = ['clientX', 'clientY'];

  /**
   * create new input type manager
   * @param {Manager} manager
   * @param {Function} callback
   * @returns {Input}
   * @constructor
   */
  function Input(manager, callback) {
    var self = this;
    this.manager = manager;
    this.callback = callback;
    this.element = manager.element;
    this.target = manager.options.inputTarget;

    // smaller wrapper around the handler, for the scope and the enabled state of the manager,
    // so when disabled the input events are completely bypassed.
    this.domHandler = function (ev) {
      if (boolOrFn(manager.options.enable, [manager])) {
        self.handler(ev);
      }
    };
    this.init();
  }
  Input.prototype = {
    /**
     * should handle the inputEvent data and trigger the callback
     * @virtual
     */
    handler: function () {},
    /**
     * bind the events
     */
    init: function () {
      this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
      this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
      this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
    },
    /**
     * unbind the events
     */
    destroy: function () {
      this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
      this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
      this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
    }
  };

  /**
   * create new input type manager
   * called by the Manager constructor
   * @param {Hammer} manager
   * @returns {Input}
   */
  function createInputInstance(manager) {
    var Type;
    var inputClass = manager.options.inputClass;
    if (inputClass) {
      Type = inputClass;
    } else if (SUPPORT_POINTER_EVENTS) {
      Type = PointerEventInput;
    } else if (SUPPORT_ONLY_TOUCH) {
      Type = TouchInput;
    } else if (!SUPPORT_TOUCH) {
      Type = MouseInput;
    } else {
      Type = TouchMouseInput;
    }
    return new Type(manager, inputHandler);
  }

  /**
   * handle input events
   * @param {Manager} manager
   * @param {String} eventType
   * @param {Object} input
   */
  function inputHandler(manager, eventType, input) {
    var pointersLen = input.pointers.length;
    var changedPointersLen = input.changedPointers.length;
    var isFirst = eventType & INPUT_START && pointersLen - changedPointersLen === 0;
    var isFinal = eventType & (INPUT_END | INPUT_CANCEL) && pointersLen - changedPointersLen === 0;
    input.isFirst = !!isFirst;
    input.isFinal = !!isFinal;
    if (isFirst) {
      manager.session = {};
    }

    // source event is the normalized value of the domEvents
    // like 'touchstart, mouseup, pointerdown'
    input.eventType = eventType;

    // compute scale, rotation etc
    computeInputData(manager, input);

    // emit secret event
    manager.emit('hammer.input', input);
    manager.recognize(input);
    manager.session.prevInput = input;
  }

  /**
   * extend the data with some usable properties like scale, rotate, velocity etc
   * @param {Object} manager
   * @param {Object} input
   */
  function computeInputData(manager, input) {
    var session = manager.session;
    var pointers = input.pointers;
    var pointersLength = pointers.length;

    // store the first input to calculate the distance and direction
    if (!session.firstInput) {
      session.firstInput = simpleCloneInputData(input);
    }

    // to compute scale and rotation we need to store the multiple touches
    if (pointersLength > 1 && !session.firstMultiple) {
      session.firstMultiple = simpleCloneInputData(input);
    } else if (pointersLength === 1) {
      session.firstMultiple = false;
    }
    var firstInput = session.firstInput;
    var firstMultiple = session.firstMultiple;
    var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
    var center = input.center = getCenter(pointers);
    input.timeStamp = now();
    input.deltaTime = input.timeStamp - firstInput.timeStamp;
    input.angle = getAngle(offsetCenter, center);
    input.distance = getDistance(offsetCenter, center);
    computeDeltaXY(session, input);
    input.offsetDirection = getDirection(input.deltaX, input.deltaY);
    var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
    input.overallVelocityX = overallVelocity.x;
    input.overallVelocityY = overallVelocity.y;
    input.overallVelocity = abs(overallVelocity.x) > abs(overallVelocity.y) ? overallVelocity.x : overallVelocity.y;
    input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
    input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
    input.maxPointers = !session.prevInput ? input.pointers.length : input.pointers.length > session.prevInput.maxPointers ? input.pointers.length : session.prevInput.maxPointers;
    computeIntervalInputData(session, input);

    // find the correct target
    var target = manager.element;
    if (hasParent(input.srcEvent.target, target)) {
      target = input.srcEvent.target;
    }
    input.target = target;
  }
  function computeDeltaXY(session, input) {
    var center = input.center;
    var offset = session.offsetDelta || {};
    var prevDelta = session.prevDelta || {};
    var prevInput = session.prevInput || {};
    if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
      prevDelta = session.prevDelta = {
        x: prevInput.deltaX || 0,
        y: prevInput.deltaY || 0
      };
      offset = session.offsetDelta = {
        x: center.x,
        y: center.y
      };
    }
    input.deltaX = prevDelta.x + (center.x - offset.x);
    input.deltaY = prevDelta.y + (center.y - offset.y);
  }

  /**
   * velocity is calculated every x ms
   * @param {Object} session
   * @param {Object} input
   */
  function computeIntervalInputData(session, input) {
    var last = session.lastInterval || input,
      deltaTime = input.timeStamp - last.timeStamp,
      velocity,
      velocityX,
      velocityY,
      direction;
    if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined$1)) {
      var deltaX = input.deltaX - last.deltaX;
      var deltaY = input.deltaY - last.deltaY;
      var v = getVelocity(deltaTime, deltaX, deltaY);
      velocityX = v.x;
      velocityY = v.y;
      velocity = abs(v.x) > abs(v.y) ? v.x : v.y;
      direction = getDirection(deltaX, deltaY);
      session.lastInterval = input;
    } else {
      // use latest velocity info if it doesn't overtake a minimum period
      velocity = last.velocity;
      velocityX = last.velocityX;
      velocityY = last.velocityY;
      direction = last.direction;
    }
    input.velocity = velocity;
    input.velocityX = velocityX;
    input.velocityY = velocityY;
    input.direction = direction;
  }

  /**
   * create a simple clone from the input used for storage of firstInput and firstMultiple
   * @param {Object} input
   * @returns {Object} clonedInputData
   */
  function simpleCloneInputData(input) {
    // make a simple copy of the pointers because we will get a reference if we don't
    // we only need clientXY for the calculations
    var pointers = [];
    var i = 0;
    while (i < input.pointers.length) {
      pointers[i] = {
        clientX: round(input.pointers[i].clientX),
        clientY: round(input.pointers[i].clientY)
      };
      i++;
    }
    return {
      timeStamp: now(),
      pointers: pointers,
      center: getCenter(pointers),
      deltaX: input.deltaX,
      deltaY: input.deltaY
    };
  }

  /**
   * get the center of all the pointers
   * @param {Array} pointers
   * @return {Object} center contains `x` and `y` properties
   */
  function getCenter(pointers) {
    var pointersLength = pointers.length;

    // no need to loop when only one touch
    if (pointersLength === 1) {
      return {
        x: round(pointers[0].clientX),
        y: round(pointers[0].clientY)
      };
    }
    var x = 0,
      y = 0,
      i = 0;
    while (i < pointersLength) {
      x += pointers[i].clientX;
      y += pointers[i].clientY;
      i++;
    }
    return {
      x: round(x / pointersLength),
      y: round(y / pointersLength)
    };
  }

  /**
   * calculate the velocity between two points. unit is in px per ms.
   * @param {Number} deltaTime
   * @param {Number} x
   * @param {Number} y
   * @return {Object} velocity `x` and `y`
   */
  function getVelocity(deltaTime, x, y) {
    return {
      x: x / deltaTime || 0,
      y: y / deltaTime || 0
    };
  }

  /**
   * get the direction between two points
   * @param {Number} x
   * @param {Number} y
   * @return {Number} direction
   */
  function getDirection(x, y) {
    if (x === y) {
      return DIRECTION_NONE;
    }
    if (abs(x) >= abs(y)) {
      return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
    }
    return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
  }

  /**
   * calculate the absolute distance between two points
   * @param {Object} p1 {x, y}
   * @param {Object} p2 {x, y}
   * @param {Array} [props] containing x and y keys
   * @return {Number} distance
   */
  function getDistance(p1, p2, props) {
    if (!props) {
      props = PROPS_XY;
    }
    var x = p2[props[0]] - p1[props[0]],
      y = p2[props[1]] - p1[props[1]];
    return Math.sqrt(x * x + y * y);
  }

  /**
   * calculate the angle between two coordinates
   * @param {Object} p1
   * @param {Object} p2
   * @param {Array} [props] containing x and y keys
   * @return {Number} angle
   */
  function getAngle(p1, p2, props) {
    if (!props) {
      props = PROPS_XY;
    }
    var x = p2[props[0]] - p1[props[0]],
      y = p2[props[1]] - p1[props[1]];
    return Math.atan2(y, x) * 180 / Math.PI;
  }

  /**
   * calculate the rotation degrees between two pointersets
   * @param {Array} start array of pointers
   * @param {Array} end array of pointers
   * @return {Number} rotation
   */
  function getRotation(start, end) {
    return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
  }

  /**
   * calculate the scale factor between two pointersets
   * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
   * @param {Array} start array of pointers
   * @param {Array} end array of pointers
   * @return {Number} scale
   */
  function getScale(start, end) {
    return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
  }
  var MOUSE_INPUT_MAP = {
    mousedown: INPUT_START,
    mousemove: INPUT_MOVE,
    mouseup: INPUT_END
  };
  var MOUSE_ELEMENT_EVENTS = 'mousedown';
  var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';

  /**
   * Mouse events input
   * @constructor
   * @extends Input
   */
  function MouseInput() {
    this.evEl = MOUSE_ELEMENT_EVENTS;
    this.evWin = MOUSE_WINDOW_EVENTS;
    this.pressed = false; // mousedown state

    Input.apply(this, arguments);
  }
  inherit(MouseInput, Input, {
    /**
     * handle mouse events
     * @param {Object} ev
     */
    handler: function MEhandler(ev) {
      var eventType = MOUSE_INPUT_MAP[ev.type];

      // on start we want to have the left mouse button down
      if (eventType & INPUT_START && ev.button === 0) {
        this.pressed = true;
      }
      if (eventType & INPUT_MOVE && ev.which !== 1) {
        eventType = INPUT_END;
      }

      // mouse must be down
      if (!this.pressed) {
        return;
      }
      if (eventType & INPUT_END) {
        this.pressed = false;
      }
      this.callback(this.manager, eventType, {
        pointers: [ev],
        changedPointers: [ev],
        pointerType: INPUT_TYPE_MOUSE,
        srcEvent: ev
      });
    }
  });
  var POINTER_INPUT_MAP = {
    pointerdown: INPUT_START,
    pointermove: INPUT_MOVE,
    pointerup: INPUT_END,
    pointercancel: INPUT_CANCEL,
    pointerout: INPUT_CANCEL
  };

  // in IE10 the pointer types is defined as an enum
  var IE10_POINTER_TYPE_ENUM = {
    2: INPUT_TYPE_TOUCH,
    3: INPUT_TYPE_PEN,
    4: INPUT_TYPE_MOUSE,
    5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
  };
  var POINTER_ELEMENT_EVENTS = 'pointerdown';
  var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';

  // IE10 has prefixed support, and case-sensitive
  if (window.MSPointerEvent && !window.PointerEvent) {
    POINTER_ELEMENT_EVENTS = 'MSPointerDown';
    POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
  }

  /**
   * Pointer events input
   * @constructor
   * @extends Input
   */
  function PointerEventInput() {
    this.evEl = POINTER_ELEMENT_EVENTS;
    this.evWin = POINTER_WINDOW_EVENTS;
    Input.apply(this, arguments);
    this.store = this.manager.session.pointerEvents = [];
  }
  inherit(PointerEventInput, Input, {
    /**
     * handle mouse events
     * @param {Object} ev
     */
    handler: function PEhandler(ev) {
      var store = this.store;
      var removePointer = false;
      var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
      var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
      var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
      var isTouch = pointerType == INPUT_TYPE_TOUCH;

      // get index of the event in the store
      var storeIndex = inArray(store, ev.pointerId, 'pointerId');

      // start and mouse must be down
      if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
        if (storeIndex < 0) {
          store.push(ev);
          storeIndex = store.length - 1;
        }
      } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
        removePointer = true;
      }

      // it not found, so the pointer hasn't been down (so it's probably a hover)
      if (storeIndex < 0) {
        return;
      }

      // update the event in the store
      store[storeIndex] = ev;
      this.callback(this.manager, eventType, {
        pointers: store,
        changedPointers: [ev],
        pointerType: pointerType,
        srcEvent: ev
      });
      if (removePointer) {
        // remove from the store
        store.splice(storeIndex, 1);
      }
    }
  });
  var SINGLE_TOUCH_INPUT_MAP = {
    touchstart: INPUT_START,
    touchmove: INPUT_MOVE,
    touchend: INPUT_END,
    touchcancel: INPUT_CANCEL
  };
  var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
  var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';

  /**
   * Touch events input
   * @constructor
   * @extends Input
   */
  function SingleTouchInput() {
    this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
    this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
    this.started = false;
    Input.apply(this, arguments);
  }
  inherit(SingleTouchInput, Input, {
    handler: function TEhandler(ev) {
      var type = SINGLE_TOUCH_INPUT_MAP[ev.type];

      // should we handle the touch events?
      if (type === INPUT_START) {
        this.started = true;
      }
      if (!this.started) {
        return;
      }
      var touches = normalizeSingleTouches.call(this, ev, type);

      // when done, reset the started state
      if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
        this.started = false;
      }
      this.callback(this.manager, type, {
        pointers: touches[0],
        changedPointers: touches[1],
        pointerType: INPUT_TYPE_TOUCH,
        srcEvent: ev
      });
    }
  });

  /**
   * @this {TouchInput}
   * @param {Object} ev
   * @param {Number} type flag
   * @returns {undefined|Array} [all, changed]
   */
  function normalizeSingleTouches(ev, type) {
    var all = toArray(ev.touches);
    var changed = toArray(ev.changedTouches);
    if (type & (INPUT_END | INPUT_CANCEL)) {
      all = uniqueArray(all.concat(changed), 'identifier', true);
    }
    return [all, changed];
  }
  var TOUCH_INPUT_MAP = {
    touchstart: INPUT_START,
    touchmove: INPUT_MOVE,
    touchend: INPUT_END,
    touchcancel: INPUT_CANCEL
  };
  var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';

  /**
   * Multi-user touch events input
   * @constructor
   * @extends Input
   */
  function TouchInput() {
    this.evTarget = TOUCH_TARGET_EVENTS;
    this.targetIds = {};
    Input.apply(this, arguments);
  }
  inherit(TouchInput, Input, {
    handler: function MTEhandler(ev) {
      var type = TOUCH_INPUT_MAP[ev.type];
      var touches = getTouches.call(this, ev, type);
      if (!touches) {
        return;
      }
      this.callback(this.manager, type, {
        pointers: touches[0],
        changedPointers: touches[1],
        pointerType: INPUT_TYPE_TOUCH,
        srcEvent: ev
      });
    }
  });

  /**
   * @this {TouchInput}
   * @param {Object} ev
   * @param {Number} type flag
   * @returns {undefined|Array} [all, changed]
   */
  function getTouches(ev, type) {
    var allTouches = toArray(ev.touches);
    var targetIds = this.targetIds;

    // when there is only one touch, the process can be simplified
    if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
      targetIds[allTouches[0].identifier] = true;
      return [allTouches, allTouches];
    }
    var i,
      targetTouches,
      changedTouches = toArray(ev.changedTouches),
      changedTargetTouches = [],
      target = this.target;

    // get target touches from touches
    targetTouches = allTouches.filter(function (touch) {
      return hasParent(touch.target, target);
    });

    // collect touches
    if (type === INPUT_START) {
      i = 0;
      while (i < targetTouches.length) {
        targetIds[targetTouches[i].identifier] = true;
        i++;
      }
    }

    // filter changed touches to only contain touches that exist in the collected target ids
    i = 0;
    while (i < changedTouches.length) {
      if (targetIds[changedTouches[i].identifier]) {
        changedTargetTouches.push(changedTouches[i]);
      }

      // cleanup removed touches
      if (type & (INPUT_END | INPUT_CANCEL)) {
        delete targetIds[changedTouches[i].identifier];
      }
      i++;
    }
    if (!changedTargetTouches.length) {
      return;
    }
    return [
    // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
    uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true), changedTargetTouches];
  }

  /**
   * Combined touch and mouse input
   *
   * Touch has a higher priority then mouse, and while touching no mouse events are allowed.
   * This because touch devices also emit mouse events while doing a touch.
   *
   * @constructor
   * @extends Input
   */

  var DEDUP_TIMEOUT = 2500;
  var DEDUP_DISTANCE = 25;
  function TouchMouseInput() {
    Input.apply(this, arguments);
    var handler = bindFn(this.handler, this);
    this.touch = new TouchInput(this.manager, handler);
    this.mouse = new MouseInput(this.manager, handler);
    this.primaryTouch = null;
    this.lastTouches = [];
  }
  inherit(TouchMouseInput, Input, {
    /**
     * handle mouse and touch events
     * @param {Hammer} manager
     * @param {String} inputEvent
     * @param {Object} inputData
     */
    handler: function TMEhandler(manager, inputEvent, inputData) {
      var isTouch = inputData.pointerType == INPUT_TYPE_TOUCH,
        isMouse = inputData.pointerType == INPUT_TYPE_MOUSE;
      if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {
        return;
      }

      // when we're in a touch event, record touches to  de-dupe synthetic mouse event
      if (isTouch) {
        recordTouches.call(this, inputEvent, inputData);
      } else if (isMouse && isSyntheticEvent.call(this, inputData)) {
        return;
      }
      this.callback(manager, inputEvent, inputData);
    },
    /**
     * remove the event listeners
     */
    destroy: function destroy() {
      this.touch.destroy();
      this.mouse.destroy();
    }
  });
  function recordTouches(eventType, eventData) {
    if (eventType & INPUT_START) {
      this.primaryTouch = eventData.changedPointers[0].identifier;
      setLastTouch.call(this, eventData);
    } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
      setLastTouch.call(this, eventData);
    }
  }
  function setLastTouch(eventData) {
    var touch = eventData.changedPointers[0];
    if (touch.identifier === this.primaryTouch) {
      var lastTouch = {
        x: touch.clientX,
        y: touch.clientY
      };
      this.lastTouches.push(lastTouch);
      var lts = this.lastTouches;
      var removeLastTouch = function () {
        var i = lts.indexOf(lastTouch);
        if (i > -1) {
          lts.splice(i, 1);
        }
      };
      setTimeout(removeLastTouch, DEDUP_TIMEOUT);
    }
  }
  function isSyntheticEvent(eventData) {
    var x = eventData.srcEvent.clientX,
      y = eventData.srcEvent.clientY;
    for (var i = 0; i < this.lastTouches.length; i++) {
      var t = this.lastTouches[i];
      var dx = Math.abs(x - t.x),
        dy = Math.abs(y - t.y);
      if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {
        return true;
      }
    }
    return false;
  }
  var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
  var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined$1;

  // magical touchAction value
  var TOUCH_ACTION_COMPUTE = 'compute';
  var TOUCH_ACTION_AUTO = 'auto';
  var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
  var TOUCH_ACTION_NONE = 'none';
  var TOUCH_ACTION_PAN_X = 'pan-x';
  var TOUCH_ACTION_PAN_Y = 'pan-y';
  var TOUCH_ACTION_MAP = getTouchActionProps();

  /**
   * Touch Action
   * sets the touchAction property or uses the js alternative
   * @param {Manager} manager
   * @param {String} value
   * @constructor
   */
  function TouchAction(manager, value) {
    this.manager = manager;
    this.set(value);
  }
  TouchAction.prototype = {
    /**
     * set the touchAction value on the element or enable the polyfill
     * @param {String} value
     */
    set: function (value) {
      // find out the touch-action by the event handlers
      if (value == TOUCH_ACTION_COMPUTE) {
        value = this.compute();
      }
      if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {
        this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
      }
      this.actions = value.toLowerCase().trim();
    },
    /**
     * just re-set the touchAction value
     */
    update: function () {
      this.set(this.manager.options.touchAction);
    },
    /**
     * compute the value for the touchAction property based on the recognizer's settings
     * @returns {String} value
     */
    compute: function () {
      var actions = [];
      each(this.manager.recognizers, function (recognizer) {
        if (boolOrFn(recognizer.options.enable, [recognizer])) {
          actions = actions.concat(recognizer.getTouchAction());
        }
      });
      return cleanTouchActions(actions.join(' '));
    },
    /**
     * this method is called on each input cycle and provides the preventing of the browser behavior
     * @param {Object} input
     */
    preventDefaults: function (input) {
      var srcEvent = input.srcEvent;
      var direction = input.offsetDirection;

      // if the touch action did prevented once this session
      if (this.manager.session.prevented) {
        srcEvent.preventDefault();
        return;
      }
      var actions = this.actions;
      var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];
      var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];
      var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];
      if (hasNone) {
        //do not prevent defaults if this is a tap gesture

        var isTapPointer = input.pointers.length === 1;
        var isTapMovement = input.distance < 2;
        var isTapTouchTime = input.deltaTime < 250;
        if (isTapPointer && isTapMovement && isTapTouchTime) {
          return;
        }
      }
      if (hasPanX && hasPanY) {
        // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent
        return;
      }
      if (hasNone || hasPanY && direction & DIRECTION_HORIZONTAL || hasPanX && direction & DIRECTION_VERTICAL) {
        return this.preventSrc(srcEvent);
      }
    },
    /**
     * call preventDefault to prevent the browser's default behavior (scrolling in most cases)
     * @param {Object} srcEvent
     */
    preventSrc: function (srcEvent) {
      this.manager.session.prevented = true;
      srcEvent.preventDefault();
    }
  };

  /**
   * when the touchActions are collected they are not a valid value, so we need to clean things up. *
   * @param {String} actions
   * @returns {*}
   */
  function cleanTouchActions(actions) {
    // none
    if (inStr(actions, TOUCH_ACTION_NONE)) {
      return TOUCH_ACTION_NONE;
    }
    var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
    var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);

    // if both pan-x and pan-y are set (different recognizers
    // for different directions, e.g. horizontal pan but vertical swipe?)
    // we need none (as otherwise with pan-x pan-y combined none of these
    // recognizers will work, since the browser would handle all panning
    if (hasPanX && hasPanY) {
      return TOUCH_ACTION_NONE;
    }

    // pan-x OR pan-y
    if (hasPanX || hasPanY) {
      return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
    }

    // manipulation
    if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
      return TOUCH_ACTION_MANIPULATION;
    }
    return TOUCH_ACTION_AUTO;
  }
  function getTouchActionProps() {
    if (!NATIVE_TOUCH_ACTION) {
      return false;
    }
    var touchMap = {};
    var cssSupports = window.CSS && window.CSS.supports;
    ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function (val) {
      // If css.supports is not supported but there is native touch-action assume it supports
      // all values. This is the case for IE 10 and 11.
      touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;
    });
    return touchMap;
  }

  /**
   * Recognizer flow explained; *
   * All recognizers have the initial state of POSSIBLE when a input session starts.
   * The definition of a input session is from the first input until the last input, with all it's movement in it. *
   * Example session for mouse-input: mousedown -> mousemove -> mouseup
   *
   * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
   * which determines with state it should be.
   *
   * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
   * POSSIBLE to give it another change on the next cycle.
   *
   *               Possible
   *                  |
   *            +-----+---------------+
   *            |                     |
   *      +-----+-----+               |
   *      |           |               |
   *   Failed      Cancelled          |
   *                          +-------+------+
   *                          |              |
   *                      Recognized       Began
   *                                         |
   *                                      Changed
   *                                         |
   *                                  Ended/Recognized
   */
  var STATE_POSSIBLE = 1;
  var STATE_BEGAN = 2;
  var STATE_CHANGED = 4;
  var STATE_ENDED = 8;
  var STATE_RECOGNIZED = STATE_ENDED;
  var STATE_CANCELLED = 16;
  var STATE_FAILED = 32;

  /**
   * Recognizer
   * Every recognizer needs to extend from this class.
   * @constructor
   * @param {Object} options
   */
  function Recognizer(options) {
    this.options = assign({}, this.defaults, options || {});
    this.id = uniqueId();
    this.manager = null;

    // default is enable true
    this.options.enable = ifUndefined(this.options.enable, true);
    this.state = STATE_POSSIBLE;
    this.simultaneous = {};
    this.requireFail = [];
  }
  Recognizer.prototype = {
    /**
     * @virtual
     * @type {Object}
     */
    defaults: {},
    /**
     * set options
     * @param {Object} options
     * @return {Recognizer}
     */
    set: function (options) {
      assign(this.options, options);

      // also update the touchAction, in case something changed about the directions/enabled state
      this.manager && this.manager.touchAction.update();
      return this;
    },
    /**
     * recognize simultaneous with an other recognizer.
     * @param {Recognizer} otherRecognizer
     * @returns {Recognizer} this
     */
    recognizeWith: function (otherRecognizer) {
      if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
        return this;
      }
      var simultaneous = this.simultaneous;
      otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
      if (!simultaneous[otherRecognizer.id]) {
        simultaneous[otherRecognizer.id] = otherRecognizer;
        otherRecognizer.recognizeWith(this);
      }
      return this;
    },
    /**
     * drop the simultaneous link. it doesnt remove the link on the other recognizer.
     * @param {Recognizer} otherRecognizer
     * @returns {Recognizer} this
     */
    dropRecognizeWith: function (otherRecognizer) {
      if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
        return this;
      }
      otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
      delete this.simultaneous[otherRecognizer.id];
      return this;
    },
    /**
     * recognizer can only run when an other is failing
     * @param {Recognizer} otherRecognizer
     * @returns {Recognizer} this
     */
    requireFailure: function (otherRecognizer) {
      if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
        return this;
      }
      var requireFail = this.requireFail;
      otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
      if (inArray(requireFail, otherRecognizer) === -1) {
        requireFail.push(otherRecognizer);
        otherRecognizer.requireFailure(this);
      }
      return this;
    },
    /**
     * drop the requireFailure link. it does not remove the link on the other recognizer.
     * @param {Recognizer} otherRecognizer
     * @returns {Recognizer} this
     */
    dropRequireFailure: function (otherRecognizer) {
      if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
        return this;
      }
      otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
      var index = inArray(this.requireFail, otherRecognizer);
      if (index > -1) {
        this.requireFail.splice(index, 1);
      }
      return this;
    },
    /**
     * has require failures boolean
     * @returns {boolean}
     */
    hasRequireFailures: function () {
      return this.requireFail.length > 0;
    },
    /**
     * if the recognizer can recognize simultaneous with an other recognizer
     * @param {Recognizer} otherRecognizer
     * @returns {Boolean}
     */
    canRecognizeWith: function (otherRecognizer) {
      return !!this.simultaneous[otherRecognizer.id];
    },
    /**
     * You should use `tryEmit` instead of `emit` directly to check
     * that all the needed recognizers has failed before emitting.
     * @param {Object} input
     */
    emit: function (input) {
      var self = this;
      var state = this.state;
      function emit(event) {
        self.manager.emit(event, input);
      }

      // 'panstart' and 'panmove'
      if (state < STATE_ENDED) {
        emit(self.options.event + stateStr(state));
      }
      emit(self.options.event); // simple 'eventName' events

      if (input.additionalEvent) {
        // additional event(panleft, panright, pinchin, pinchout...)
        emit(input.additionalEvent);
      }

      // panend and pancancel
      if (state >= STATE_ENDED) {
        emit(self.options.event + stateStr(state));
      }
    },
    /**
     * Check that all the require failure recognizers has failed,
     * if true, it emits a gesture event,
     * otherwise, setup the state to FAILED.
     * @param {Object} input
     */
    tryEmit: function (input) {
      if (this.canEmit()) {
        return this.emit(input);
      }
      // it's failing anyway
      this.state = STATE_FAILED;
    },
    /**
     * can we emit?
     * @returns {boolean}
     */
    canEmit: function () {
      var i = 0;
      while (i < this.requireFail.length) {
        if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
          return false;
        }
        i++;
      }
      return true;
    },
    /**
     * update the recognizer
     * @param {Object} inputData
     */
    recognize: function (inputData) {
      // make a new copy of the inputData
      // so we can change the inputData without messing up the other recognizers
      var inputDataClone = assign({}, inputData);

      // is is enabled and allow recognizing?
      if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
        this.reset();
        this.state = STATE_FAILED;
        return;
      }

      // reset when we've reached the end
      if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
        this.state = STATE_POSSIBLE;
      }
      this.state = this.process(inputDataClone);

      // the recognizer has recognized a gesture
      // so trigger an event
      if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
        this.tryEmit(inputDataClone);
      }
    },
    /**
     * return the state of the recognizer
     * the actual recognizing happens in this method
     * @virtual
     * @param {Object} inputData
     * @returns {Const} STATE
     */
    process: function (inputData) {},
    // jshint ignore:line

    /**
     * return the preferred touch-action
     * @virtual
     * @returns {Array}
     */
    getTouchAction: function () {},
    /**
     * called when the gesture isn't allowed to recognize
     * like when another is being recognized or it is disabled
     * @virtual
     */
    reset: function () {}
  };

  /**
   * get a usable string, used as event postfix
   * @param {Const} state
   * @returns {String} state
   */
  function stateStr(state) {
    if (state & STATE_CANCELLED) {
      return 'cancel';
    } else if (state & STATE_ENDED) {
      return 'end';
    } else if (state & STATE_CHANGED) {
      return 'move';
    } else if (state & STATE_BEGAN) {
      return 'start';
    }
    return '';
  }

  /**
   * direction cons to string
   * @param {Const} direction
   * @returns {String}
   */
  function directionStr(direction) {
    if (direction == DIRECTION_DOWN) {
      return 'down';
    } else if (direction == DIRECTION_UP) {
      return 'up';
    } else if (direction == DIRECTION_LEFT) {
      return 'left';
    } else if (direction == DIRECTION_RIGHT) {
      return 'right';
    }
    return '';
  }

  /**
   * get a recognizer by name if it is bound to a manager
   * @param {Recognizer|String} otherRecognizer
   * @param {Recognizer} recognizer
   * @returns {Recognizer}
   */
  function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
    var manager = recognizer.manager;
    if (manager) {
      return manager.get(otherRecognizer);
    }
    return otherRecognizer;
  }

  /**
   * This recognizer is just used as a base for the simple attribute recognizers.
   * @constructor
   * @extends Recognizer
   */
  function AttrRecognizer() {
    Recognizer.apply(this, arguments);
  }
  inherit(AttrRecognizer, Recognizer, {
    /**
     * @namespace
     * @memberof AttrRecognizer
     */
    defaults: {
      /**
       * @type {Number}
       * @default 1
       */
      pointers: 1
    },
    /**
     * Used to check if it the recognizer receives valid input, like input.distance > 10.
     * @memberof AttrRecognizer
     * @param {Object} input
     * @returns {Boolean} recognized
     */
    attrTest: function (input) {
      var optionPointers = this.options.pointers;
      return optionPointers === 0 || input.pointers.length === optionPointers;
    },
    /**
     * Process the input and return the state for the recognizer
     * @memberof AttrRecognizer
     * @param {Object} input
     * @returns {*} State
     */
    process: function (input) {
      var state = this.state;
      var eventType = input.eventType;
      var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
      var isValid = this.attrTest(input);

      // on cancel input and we've recognized before, return STATE_CANCELLED
      if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
        return state | STATE_CANCELLED;
      } else if (isRecognized || isValid) {
        if (eventType & INPUT_END) {
          return state | STATE_ENDED;
        } else if (!(state & STATE_BEGAN)) {
          return STATE_BEGAN;
        }
        return state | STATE_CHANGED;
      }
      return STATE_FAILED;
    }
  });

  /**
   * Pan
   * Recognized when the pointer is down and moved in the allowed direction.
   * @constructor
   * @extends AttrRecognizer
   */
  function PanRecognizer() {
    AttrRecognizer.apply(this, arguments);
    this.pX = null;
    this.pY = null;
  }
  inherit(PanRecognizer, AttrRecognizer, {
    /**
     * @namespace
     * @memberof PanRecognizer
     */
    defaults: {
      event: 'pan',
      threshold: 10,
      pointers: 1,
      direction: DIRECTION_ALL
    },
    getTouchAction: function () {
      var direction = this.options.direction;
      var actions = [];
      if (direction & DIRECTION_HORIZONTAL) {
        actions.push(TOUCH_ACTION_PAN_Y);
      }
      if (direction & DIRECTION_VERTICAL) {
        actions.push(TOUCH_ACTION_PAN_X);
      }
      return actions;
    },
    directionTest: function (input) {
      var options = this.options;
      var hasMoved = true;
      var distance = input.distance;
      var direction = input.direction;
      var x = input.deltaX;
      var y = input.deltaY;

      // lock to axis?
      if (!(direction & options.direction)) {
        if (options.direction & DIRECTION_HORIZONTAL) {
          direction = x === 0 ? DIRECTION_NONE : x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
          hasMoved = x != this.pX;
          distance = Math.abs(input.deltaX);
        } else {
          direction = y === 0 ? DIRECTION_NONE : y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
          hasMoved = y != this.pY;
          distance = Math.abs(input.deltaY);
        }
      }
      input.direction = direction;
      return hasMoved && distance > options.threshold && direction & options.direction;
    },
    attrTest: function (input) {
      return AttrRecognizer.prototype.attrTest.call(this, input) && (this.state & STATE_BEGAN || !(this.state & STATE_BEGAN) && this.directionTest(input));
    },
    emit: function (input) {
      this.pX = input.deltaX;
      this.pY = input.deltaY;
      var direction = directionStr(input.direction);
      if (direction) {
        input.additionalEvent = this.options.event + direction;
      }
      this._super.emit.call(this, input);
    }
  });

  /**
   * Pinch
   * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
   * @constructor
   * @extends AttrRecognizer
   */
  function PinchRecognizer() {
    AttrRecognizer.apply(this, arguments);
  }
  inherit(PinchRecognizer, AttrRecognizer, {
    /**
     * @namespace
     * @memberof PinchRecognizer
     */
    defaults: {
      event: 'pinch',
      threshold: 0,
      pointers: 2
    },
    getTouchAction: function () {
      return [TOUCH_ACTION_NONE];
    },
    attrTest: function (input) {
      return this._super.attrTest.call(this, input) && (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
    },
    emit: function (input) {
      if (input.scale !== 1) {
        var inOut = input.scale < 1 ? 'in' : 'out';
        input.additionalEvent = this.options.event + inOut;
      }
      this._super.emit.call(this, input);
    }
  });

  /**
   * Press
   * Recognized when the pointer is down for x ms without any movement.
   * @constructor
   * @extends Recognizer
   */
  function PressRecognizer() {
    Recognizer.apply(this, arguments);
    this._timer = null;
    this._input = null;
  }
  inherit(PressRecognizer, Recognizer, {
    /**
     * @namespace
     * @memberof PressRecognizer
     */
    defaults: {
      event: 'press',
      pointers: 1,
      time: 251,
      // minimal time of the pointer to be pressed
      threshold: 9 // a minimal movement is ok, but keep it low
    },
    getTouchAction: function () {
      return [TOUCH_ACTION_AUTO];
    },
    process: function (input) {
      var options = this.options;
      var validPointers = input.pointers.length === options.pointers;
      var validMovement = input.distance < options.threshold;
      var validTime = input.deltaTime > options.time;
      this._input = input;

      // we only allow little movement
      // and we've reached an end event, so a tap is possible
      if (!validMovement || !validPointers || input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime) {
        this.reset();
      } else if (input.eventType & INPUT_START) {
        this.reset();
        this._timer = setTimeoutContext(function () {
          this.state = STATE_RECOGNIZED;
          this.tryEmit();
        }, options.time, this);
      } else if (input.eventType & INPUT_END) {
        return STATE_RECOGNIZED;
      }
      return STATE_FAILED;
    },
    reset: function () {
      clearTimeout(this._timer);
    },
    emit: function (input) {
      if (this.state !== STATE_RECOGNIZED) {
        return;
      }
      if (input && input.eventType & INPUT_END) {
        this.manager.emit(this.options.event + 'up', input);
      } else {
        this._input.timeStamp = now();
        this.manager.emit(this.options.event, this._input);
      }
    }
  });

  /**
   * Rotate
   * Recognized when two or more pointer are moving in a circular motion.
   * @constructor
   * @extends AttrRecognizer
   */
  function RotateRecognizer() {
    AttrRecognizer.apply(this, arguments);
  }
  inherit(RotateRecognizer, AttrRecognizer, {
    /**
     * @namespace
     * @memberof RotateRecognizer
     */
    defaults: {
      event: 'rotate',
      threshold: 0,
      pointers: 2
    },
    getTouchAction: function () {
      return [TOUCH_ACTION_NONE];
    },
    attrTest: function (input) {
      return this._super.attrTest.call(this, input) && (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
    }
  });

  /**
   * Swipe
   * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
   * @constructor
   * @extends AttrRecognizer
   */
  function SwipeRecognizer() {
    AttrRecognizer.apply(this, arguments);
  }
  inherit(SwipeRecognizer, AttrRecognizer, {
    /**
     * @namespace
     * @memberof SwipeRecognizer
     */
    defaults: {
      event: 'swipe',
      threshold: 10,
      velocity: 0.3,
      direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
      pointers: 1
    },
    getTouchAction: function () {
      return PanRecognizer.prototype.getTouchAction.call(this);
    },
    attrTest: function (input) {
      var direction = this.options.direction;
      var velocity;
      if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
        velocity = input.overallVelocity;
      } else if (direction & DIRECTION_HORIZONTAL) {
        velocity = input.overallVelocityX;
      } else if (direction & DIRECTION_VERTICAL) {
        velocity = input.overallVelocityY;
      }
      return this._super.attrTest.call(this, input) && direction & input.offsetDirection && input.distance > this.options.threshold && input.maxPointers == this.options.pointers && abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
    },
    emit: function (input) {
      var direction = directionStr(input.offsetDirection);
      if (direction) {
        this.manager.emit(this.options.event + direction, input);
      }
      this.manager.emit(this.options.event, input);
    }
  });

  /**
   * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
   * between the given interval and position. The delay option can be used to recognize multi-taps without firing
   * a single tap.
   *
   * The eventData from the emitted event contains the property `tapCount`, which contains the amount of
   * multi-taps being recognized.
   * @constructor
   * @extends Recognizer
   */
  function TapRecognizer() {
    Recognizer.apply(this, arguments);

    // previous time and center,
    // used for tap counting
    this.pTime = false;
    this.pCenter = false;
    this._timer = null;
    this._input = null;
    this.count = 0;
  }
  inherit(TapRecognizer, Recognizer, {
    /**
     * @namespace
     * @memberof PinchRecognizer
     */
    defaults: {
      event: 'tap',
      pointers: 1,
      taps: 1,
      interval: 300,
      // max time between the multi-tap taps
      time: 250,
      // max time of the pointer to be down (like finger on the screen)
      threshold: 9,
      // a minimal movement is ok, but keep it low
      posThreshold: 10 // a multi-tap can be a bit off the initial position
    },
    getTouchAction: function () {
      return [TOUCH_ACTION_MANIPULATION];
    },
    process: function (input) {
      var options = this.options;
      var validPointers = input.pointers.length === options.pointers;
      var validMovement = input.distance < options.threshold;
      var validTouchTime = input.deltaTime < options.time;
      this.reset();
      if (input.eventType & INPUT_START && this.count === 0) {
        return this.failTimeout();
      }

      // we only allow little movement
      // and we've reached an end event, so a tap is possible
      if (validMovement && validTouchTime && validPointers) {
        if (input.eventType != INPUT_END) {
          return this.failTimeout();
        }
        var validInterval = this.pTime ? input.timeStamp - this.pTime < options.interval : true;
        var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
        this.pTime = input.timeStamp;
        this.pCenter = input.center;
        if (!validMultiTap || !validInterval) {
          this.count = 1;
        } else {
          this.count += 1;
        }
        this._input = input;

        // if tap count matches we have recognized it,
        // else it has began recognizing...
        var tapCount = this.count % options.taps;
        if (tapCount === 0) {
          // no failing requirements, immediately trigger the tap event
          // or wait as long as the multitap interval to trigger
          if (!this.hasRequireFailures()) {
            return STATE_RECOGNIZED;
          } else {
            this._timer = setTimeoutContext(function () {
              this.state = STATE_RECOGNIZED;
              this.tryEmit();
            }, options.interval, this);
            return STATE_BEGAN;
          }
        }
      }
      return STATE_FAILED;
    },
    failTimeout: function () {
      this._timer = setTimeoutContext(function () {
        this.state = STATE_FAILED;
      }, this.options.interval, this);
      return STATE_FAILED;
    },
    reset: function () {
      clearTimeout(this._timer);
    },
    emit: function () {
      if (this.state == STATE_RECOGNIZED) {
        this._input.tapCount = this.count;
        this.manager.emit(this.options.event, this._input);
      }
    }
  });

  /**
   * Simple way to create a manager with a default set of recognizers.
   * @param {HTMLElement} element
   * @param {Object} [options]
   * @constructor
   */
  function Hammer(element, options) {
    options = options || {};
    options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
    return new Manager(element, options);
  }

  /**
   * @const {string}
   */
  Hammer.VERSION = '2.0.7';

  /**
   * default settings
   * @namespace
   */
  Hammer.defaults = {
    /**
     * set if DOM events are being triggered.
     * But this is slower and unused by simple implementations, so disabled by default.
     * @type {Boolean}
     * @default false
     */
    domEvents: false,
    /**
     * The value for the touchAction property/fallback.
     * When set to `compute` it will magically set the correct value based on the added recognizers.
     * @type {String}
     * @default compute
     */
    touchAction: TOUCH_ACTION_COMPUTE,
    /**
     * @type {Boolean}
     * @default true
     */
    enable: true,
    /**
     * EXPERIMENTAL FEATURE -- can be removed/changed
     * Change the parent input target element.
     * If Null, then it is being set the to main element.
     * @type {Null|EventTarget}
     * @default null
     */
    inputTarget: null,
    /**
     * force an input class
     * @type {Null|Function}
     * @default null
     */
    inputClass: null,
    /**
     * Default recognizer setup when calling `Hammer()`
     * When creating a new Manager these will be skipped.
     * @type {Array}
     */
    preset: [
    // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
    [RotateRecognizer, {
      enable: false
    }], [PinchRecognizer, {
      enable: false
    }, ['rotate']], [SwipeRecognizer, {
      direction: DIRECTION_HORIZONTAL
    }], [PanRecognizer, {
      direction: DIRECTION_HORIZONTAL
    }, ['swipe']], [TapRecognizer], [TapRecognizer, {
      event: 'doubletap',
      taps: 2
    }, ['tap']], [PressRecognizer]],
    /**
     * Some CSS properties can be used to improve the working of Hammer.
     * Add them to this method and they will be set when creating a new Manager.
     * @namespace
     */
    cssProps: {
      /**
       * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
       * @type {String}
       * @default 'none'
       */
      userSelect: 'none',
      /**
       * Disable the Windows Phone grippers when pressing an element.
       * @type {String}
       * @default 'none'
       */
      touchSelect: 'none',
      /**
       * Disables the default callout shown when you touch and hold a touch target.
       * On iOS, when you touch and hold a touch target such as a link, Safari displays
       * a callout containing information about the link. This property allows you to disable that callout.
       * @type {String}
       * @default 'none'
       */
      touchCallout: 'none',
      /**
       * Specifies whether zooming is enabled. Used by IE10>
       * @type {String}
       * @default 'none'
       */
      contentZooming: 'none',
      /**
       * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
       * @type {String}
       * @default 'none'
       */
      userDrag: 'none',
      /**
       * Overrides the highlight color shown when the user taps a link or a JavaScript
       * clickable element in iOS. This property obeys the alpha value, if specified.
       * @type {String}
       * @default 'rgba(0,0,0,0)'
       */
      tapHighlightColor: 'rgba(0,0,0,0)'
    }
  };
  var STOP = 1;
  var FORCED_STOP = 2;

  /**
   * Manager
   * @param {HTMLElement} element
   * @param {Object} [options]
   * @constructor
   */
  function Manager(element, options) {
    this.options = assign({}, Hammer.defaults, options || {});
    this.options.inputTarget = this.options.inputTarget || element;
    this.handlers = {};
    this.session = {};
    this.recognizers = [];
    this.oldCssProps = {};
    this.element = element;
    this.input = createInputInstance(this);
    this.touchAction = new TouchAction(this, this.options.touchAction);
    toggleCssProps(this, true);
    each(this.options.recognizers, function (item) {
      var recognizer = this.add(new item[0](item[1]));
      item[2] && recognizer.recognizeWith(item[2]);
      item[3] && recognizer.requireFailure(item[3]);
    }, this);
  }
  Manager.prototype = {
    /**
     * set options
     * @param {Object} options
     * @returns {Manager}
     */
    set: function (options) {
      assign(this.options, options);

      // Options that need a little more setup
      if (options.touchAction) {
        this.touchAction.update();
      }
      if (options.inputTarget) {
        // Clean up existing event listeners and reinitialize
        this.input.destroy();
        this.input.target = options.inputTarget;
        this.input.init();
      }
      return this;
    },
    /**
     * stop recognizing for this session.
     * This session will be discarded, when a new [input]start event is fired.
     * When forced, the recognizer cycle is stopped immediately.
     * @param {Boolean} [force]
     */
    stop: function (force) {
      this.session.stopped = force ? FORCED_STOP : STOP;
    },
    /**
     * run the recognizers!
     * called by the inputHandler function on every movement of the pointers (touches)
     * it walks through all the recognizers and tries to detect the gesture that is being made
     * @param {Object} inputData
     */
    recognize: function (inputData) {
      var session = this.session;
      if (session.stopped) {
        return;
      }

      // run the touch-action polyfill
      this.touchAction.preventDefaults(inputData);
      var recognizer;
      var recognizers = this.recognizers;

      // this holds the recognizer that is being recognized.
      // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED
      // if no recognizer is detecting a thing, it is set to `null`
      var curRecognizer = session.curRecognizer;

      // reset when the last recognizer is recognized
      // or when we're in a new session
      if (!curRecognizer || curRecognizer && curRecognizer.state & STATE_RECOGNIZED) {
        curRecognizer = session.curRecognizer = null;
      }
      var i = 0;
      while (i < recognizers.length) {
        recognizer = recognizers[i];

        // find out if we are allowed try to recognize the input for this one.
        // 1.   allow if the session is NOT forced stopped (see the .stop() method)
        // 2.   allow if we still haven't recognized a gesture in this session, or the this recognizer is the one
        //      that is being recognized.
        // 3.   allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.
        //      this can be setup with the `recognizeWith()` method on the recognizer.
        if (session.stopped !== FORCED_STOP && (
        // 1
        !curRecognizer || recognizer == curRecognizer ||
        // 2
        recognizer.canRecognizeWith(curRecognizer))) {
          // 3
          recognizer.recognize(inputData);
        } else {
          recognizer.reset();
        }

        // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the
        // current active recognizer. but only if we don't already have an active recognizer
        if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
          curRecognizer = session.curRecognizer = recognizer;
        }
        i++;
      }
    },
    /**
     * get a recognizer by its event name.
     * @param {Recognizer|String} recognizer
     * @returns {Recognizer|Null}
     */
    get: function (recognizer) {
      if (recognizer instanceof Recognizer) {
        return recognizer;
      }
      var recognizers = this.recognizers;
      for (var i = 0; i < recognizers.length; i++) {
        if (recognizers[i].options.event == recognizer) {
          return recognizers[i];
        }
      }
      return null;
    },
    /**
     * add a recognizer to the manager
     * existing recognizers with the same event name will be removed
     * @param {Recognizer} recognizer
     * @returns {Recognizer|Manager}
     */
    add: function (recognizer) {
      if (invokeArrayArg(recognizer, 'add', this)) {
        return this;
      }

      // remove existing
      var existing = this.get(recognizer.options.event);
      if (existing) {
        this.remove(existing);
      }
      this.recognizers.push(recognizer);
      recognizer.manager = this;
      this.touchAction.update();
      return recognizer;
    },
    /**
     * remove a recognizer by name or instance
     * @param {Recognizer|String} recognizer
     * @returns {Manager}
     */
    remove: function (recognizer) {
      if (invokeArrayArg(recognizer, 'remove', this)) {
        return this;
      }
      recognizer = this.get(recognizer);

      // let's make sure this recognizer exists
      if (recognizer) {
        var recognizers = this.recognizers;
        var index = inArray(recognizers, recognizer);
        if (index !== -1) {
          recognizers.splice(index, 1);
          this.touchAction.update();
        }
      }
      return this;
    },
    /**
     * bind event
     * @param {String} events
     * @param {Function} handler
     * @returns {EventEmitter} this
     */
    on: function (events, handler) {
      if (events === undefined$1) {
        return;
      }
      if (handler === undefined$1) {
        return;
      }
      var handlers = this.handlers;
      each(splitStr(events), function (event) {
        handlers[event] = handlers[event] || [];
        handlers[event].push(handler);
      });
      return this;
    },
    /**
     * unbind event, leave emit blank to remove all handlers
     * @param {String} events
     * @param {Function} [handler]
     * @returns {EventEmitter} this
     */
    off: function (events, handler) {
      if (events === undefined$1) {
        return;
      }
      var handlers = this.handlers;
      each(splitStr(events), function (event) {
        if (!handler) {
          delete handlers[event];
        } else {
          handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
        }
      });
      return this;
    },
    /**
     * emit event to the listeners
     * @param {String} event
     * @param {Object} data
     */
    emit: function (event, data) {
      // we also want to trigger dom events
      if (this.options.domEvents) {
        triggerDomEvent(event, data);
      }

      // no handlers, so skip it all
      var handlers = this.handlers[event] && this.handlers[event].slice();
      if (!handlers || !handlers.length) {
        return;
      }
      data.type = event;
      data.preventDefault = function () {
        data.srcEvent.preventDefault();
      };
      var i = 0;
      while (i < handlers.length) {
        handlers[i](data);
        i++;
      }
    },
    /**
     * destroy the manager and unbinds all events
     * it doesn't unbind dom events, that is the user own responsibility
     */
    destroy: function () {
      this.element && toggleCssProps(this, false);
      this.handlers = {};
      this.session = {};
      this.input.destroy();
      this.element = null;
    }
  };

  /**
   * add/remove the css properties as defined in manager.options.cssProps
   * @param {Manager} manager
   * @param {Boolean} add
   */
  function toggleCssProps(manager, add) {
    var element = manager.element;
    if (!element.style) {
      return;
    }
    var prop;
    each(manager.options.cssProps, function (value, name) {
      prop = prefixed(element.style, name);
      if (add) {
        manager.oldCssProps[prop] = element.style[prop];
        element.style[prop] = value;
      } else {
        element.style[prop] = manager.oldCssProps[prop] || '';
      }
    });
    if (!add) {
      manager.oldCssProps = {};
    }
  }

  /**
   * trigger dom event
   * @param {String} event
   * @param {Object} data
   */
  function triggerDomEvent(event, data) {
    var gestureEvent = document.createEvent('Event');
    gestureEvent.initEvent(event, true, true);
    gestureEvent.gesture = data;
    data.target.dispatchEvent(gestureEvent);
  }
  assign(Hammer, {
    INPUT_START: INPUT_START,
    INPUT_MOVE: INPUT_MOVE,
    INPUT_END: INPUT_END,
    INPUT_CANCEL: INPUT_CANCEL,
    STATE_POSSIBLE: STATE_POSSIBLE,
    STATE_BEGAN: STATE_BEGAN,
    STATE_CHANGED: STATE_CHANGED,
    STATE_ENDED: STATE_ENDED,
    STATE_RECOGNIZED: STATE_RECOGNIZED,
    STATE_CANCELLED: STATE_CANCELLED,
    STATE_FAILED: STATE_FAILED,
    DIRECTION_NONE: DIRECTION_NONE,
    DIRECTION_LEFT: DIRECTION_LEFT,
    DIRECTION_RIGHT: DIRECTION_RIGHT,
    DIRECTION_UP: DIRECTION_UP,
    DIRECTION_DOWN: DIRECTION_DOWN,
    DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
    DIRECTION_VERTICAL: DIRECTION_VERTICAL,
    DIRECTION_ALL: DIRECTION_ALL,
    Manager: Manager,
    Input: Input,
    TouchAction: TouchAction,
    TouchInput: TouchInput,
    MouseInput: MouseInput,
    PointerEventInput: PointerEventInput,
    TouchMouseInput: TouchMouseInput,
    SingleTouchInput: SingleTouchInput,
    Recognizer: Recognizer,
    AttrRecognizer: AttrRecognizer,
    Tap: TapRecognizer,
    Pan: PanRecognizer,
    Swipe: SwipeRecognizer,
    Pinch: PinchRecognizer,
    Rotate: RotateRecognizer,
    Press: PressRecognizer,
    on: addEventListeners,
    off: removeEventListeners,
    each: each,
    merge: merge,
    extend: extend,
    assign: assign,
    inherit: inherit,
    bindFn: bindFn,
    prefixed: prefixed
  });

  // this prevents errors when Hammer is loaded in the presence of an AMD
  //  style loader but by script tag, not by the loader.
  var freeGlobal = typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}; // jshint ignore:line
  freeGlobal.Hammer = Hammer;
  if (typeof undefined$1 === 'function' && undefined$1.amd) {
    undefined$1(function () {
      return Hammer;
    });
  } else if (module.exports) {
    module.exports = Hammer;
  } else {
    window[exportName] = Hammer;
  }
})(window, document, 'Hammer');
});

/*!
 * better-scroll / better-scroll
 * (c) 2016-2023 ustbhuangyi
 * Released under the MIT License.
 */
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */

var extendStatics = function (d, b) {
  extendStatics = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (d, b) {
    d.__proto__ = b;
  } || function (d, b) {
    for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
  };
  return extendStatics(d, b);
};
function __extends(d, b) {
  extendStatics(d, b);
  function __() {
    this.constructor = d;
  }
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function () {
  __assign = Object.assign || function __assign(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];
      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
    }
    return t;
  };
  return __assign.apply(this, arguments);
};
function __awaiter(thisArg, _arguments, P, generator) {
  function adopt(value) {
    return value instanceof P ? value : new P(function (resolve) {
      resolve(value);
    });
  }
  return new (P || (P = Promise))(function (resolve, reject) {
    function fulfilled(value) {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    }
    function rejected(value) {
      try {
        step(generator["throw"](value));
      } catch (e) {
        reject(e);
      }
    }
    function step(result) {
      result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
    }
    step((generator = generator.apply(thisArg, _arguments || [])).next());
  });
}
function __generator(thisArg, body) {
  var _ = {
      label: 0,
      sent: function () {
        if (t[0] & 1) throw t[1];
        return t[1];
      },
      trys: [],
      ops: []
    },
    f,
    y,
    t,
    g;
  return g = {
    next: verb(0),
    "throw": verb(1),
    "return": verb(2)
  }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
    return this;
  }), g;
  function verb(n) {
    return function (v) {
      return step([n, v]);
    };
  }
  function step(op) {
    if (f) throw new TypeError("Generator is already executing.");
    while (_) try {
      if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
      if (y = 0, t) op = [op[0] & 2, t.value];
      switch (op[0]) {
        case 0:
        case 1:
          t = op;
          break;
        case 4:
          _.label++;
          return {
            value: op[1],
            done: false
          };
        case 5:
          _.label++;
          y = op[1];
          op = [0];
          continue;
        case 7:
          op = _.ops.pop();
          _.trys.pop();
          continue;
        default:
          if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
            _ = 0;
            continue;
          }
          if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
            _.label = op[1];
            break;
          }
          if (op[0] === 6 && _.label < t[1]) {
            _.label = t[1];
            t = op;
            break;
          }
          if (t && _.label < t[2]) {
            _.label = t[2];
            _.ops.push(op);
            break;
          }
          if (t[2]) _.ops.pop();
          _.trys.pop();
          continue;
      }
      op = body.call(thisArg, _);
    } catch (e) {
      op = [6, e];
      y = 0;
    } finally {
      f = t = 0;
    }
    if (op[0] & 5) throw op[1];
    return {
      value: op[0] ? op[1] : void 0,
      done: true
    };
  }
}
function __spreadArrays() {
  for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
  return r;
}
var propertiesConfig$7 = [{
  sourceKey: 'scroller.scrollBehaviorX.currentPos',
  key: 'x'
}, {
  sourceKey: 'scroller.scrollBehaviorY.currentPos',
  key: 'y'
}, {
  sourceKey: 'scroller.scrollBehaviorX.hasScroll',
  key: 'hasHorizontalScroll'
}, {
  sourceKey: 'scroller.scrollBehaviorY.hasScroll',
  key: 'hasVerticalScroll'
}, {
  sourceKey: 'scroller.scrollBehaviorX.contentSize',
  key: 'scrollerWidth'
}, {
  sourceKey: 'scroller.scrollBehaviorY.contentSize',
  key: 'scrollerHeight'
}, {
  sourceKey: 'scroller.scrollBehaviorX.maxScrollPos',
  key: 'maxScrollX'
}, {
  sourceKey: 'scroller.scrollBehaviorY.maxScrollPos',
  key: 'maxScrollY'
}, {
  sourceKey: 'scroller.scrollBehaviorX.minScrollPos',
  key: 'minScrollX'
}, {
  sourceKey: 'scroller.scrollBehaviorY.minScrollPos',
  key: 'minScrollY'
}, {
  sourceKey: 'scroller.scrollBehaviorX.movingDirection',
  key: 'movingDirectionX'
}, {
  sourceKey: 'scroller.scrollBehaviorY.movingDirection',
  key: 'movingDirectionY'
}, {
  sourceKey: 'scroller.scrollBehaviorX.direction',
  key: 'directionX'
}, {
  sourceKey: 'scroller.scrollBehaviorY.direction',
  key: 'directionY'
}, {
  sourceKey: 'scroller.actions.enabled',
  key: 'enabled'
}, {
  sourceKey: 'scroller.animater.pending',
  key: 'pending'
}, {
  sourceKey: 'scroller.animater.stop',
  key: 'stop'
}, {
  sourceKey: 'scroller.scrollTo',
  key: 'scrollTo'
}, {
  sourceKey: 'scroller.scrollBy',
  key: 'scrollBy'
}, {
  sourceKey: 'scroller.scrollToElement',
  key: 'scrollToElement'
}, {
  sourceKey: 'scroller.resetPosition',
  key: 'resetPosition'
}];
function warn(msg) {
  console.error("[BScroll warn]: " + msg);
}
function assert(condition, msg) {
  if (!condition) {
    throw new Error('[BScroll] ' + msg);
  }
}

// ssr support
var inBrowser = typeof window !== 'undefined';
var ua = inBrowser && navigator.userAgent.toLowerCase();
var isWeChatDevTools = !!(ua && /wechatdevtools/.test(ua));
var isAndroid = ua && ua.indexOf('android') > 0;
/* istanbul ignore next */
var isIOSBadVersion = function () {
  if (typeof ua === 'string') {
    var regex = /os (\d\d?_\d(_\d)?)/;
    var matches = regex.exec(ua);
    if (!matches) return false;
    var parts = matches[1].split('_').map(function (item) {
      return parseInt(item, 10);
    });
    // ios version >= 13.4 issue 982
    return !!(parts[0] === 13 && parts[1] >= 4);
  }
  return false;
}();
/* istanbul ignore next */
var supportsPassive = false;
/* istanbul ignore next */
if (inBrowser) {
  var EventName = 'test-passive';
  try {
    var opts = {};
    Object.defineProperty(opts, 'passive', {
      get: function () {
        supportsPassive = true;
      }
    }); // https://github.com/facebook/flow/issues/285
    window.addEventListener(EventName, function () {}, opts);
  } catch (e) {}
}
function getNow() {
  return window.performance && window.performance.now && window.performance.timing ? window.performance.now() + window.performance.timing.navigationStart : +new Date();
}
var extend = function (target, source) {
  for (var key in source) {
    target[key] = source[key];
  }
  return target;
};
function isUndef(v) {
  return v === undefined || v === null;
}
function getDistance(x, y) {
  return Math.sqrt(x * x + y * y);
}
function between(x, min, max) {
  if (x < min) {
    return min;
  }
  if (x > max) {
    return max;
  }
  return x;
}
function findIndex(ary, fn) {
  if (ary.findIndex) {
    return ary.findIndex(fn);
  }
  var index = -1;
  ary.some(function (item, i, ary) {
    var ret = fn(item, i, ary);
    if (ret) {
      index = i;
      return ret;
    }
  });
  return index;
}
var elementStyle = inBrowser && document.createElement('div').style;
var vendor = function () {
  /* istanbul ignore if  */
  if (!inBrowser) {
    return false;
  }
  var transformNames = [{
    key: 'standard',
    value: 'transform'
  }, {
    key: 'webkit',
    value: 'webkitTransform'
  }, {
    key: 'Moz',
    value: 'MozTransform'
  }, {
    key: 'O',
    value: 'OTransform'
  }, {
    key: 'ms',
    value: 'msTransform'
  }];
  for (var _i = 0, transformNames_1 = transformNames; _i < transformNames_1.length; _i++) {
    var obj = transformNames_1[_i];
    if (elementStyle[obj.value] !== undefined) {
      return obj.key;
    }
  }
  /* istanbul ignore next  */
  return false;
}();
/* istanbul ignore next  */
function prefixStyle(style) {
  if (vendor === false) {
    return style;
  }
  if (vendor === 'standard') {
    if (style === 'transitionEnd') {
      return 'transitionend';
    }
    return style;
  }
  return vendor + style.charAt(0).toUpperCase() + style.substr(1);
}
function getElement(el) {
  return typeof el === 'string' ? document.querySelector(el) : el;
}
function addEvent(el, type, fn, capture) {
  var useCapture = supportsPassive ? {
    passive: false,
    capture: !!capture
  } : !!capture;
  el.addEventListener(type, fn, useCapture);
}
function removeEvent(el, type, fn, capture) {
  el.removeEventListener(type, fn, {
    capture: !!capture
  });
}
function maybePrevent(e) {
  if (e.cancelable) {
    e.preventDefault();
  }
}
function offset(el) {
  var left = 0;
  var top = 0;
  while (el) {
    left -= el.offsetLeft;
    top -= el.offsetTop;
    el = el.offsetParent;
  }
  return {
    left: left,
    top: top
  };
}
function offsetToBody(el) {
  var rect = el.getBoundingClientRect();
  return {
    left: -(rect.left + window.pageXOffset),
    top: -(rect.top + window.pageYOffset)
  };
}
var cssVendor = vendor && vendor !== 'standard' ? '-' + vendor.toLowerCase() + '-' : '';
var transform = prefixStyle('transform');
var transition = prefixStyle('transition');
var hasPerspective = inBrowser && prefixStyle('perspective') in elementStyle;
// fix issue #361
var hasTouch = inBrowser && ('ontouchstart' in window || isWeChatDevTools);
var hasTransition = inBrowser && transition in elementStyle;
var style = {
  transform: transform,
  transition: transition,
  transitionTimingFunction: prefixStyle('transitionTimingFunction'),
  transitionDuration: prefixStyle('transitionDuration'),
  transitionDelay: prefixStyle('transitionDelay'),
  transformOrigin: prefixStyle('transformOrigin'),
  transitionEnd: prefixStyle('transitionEnd'),
  transitionProperty: prefixStyle('transitionProperty')
};
var eventTypeMap = {
  touchstart: 1,
  touchmove: 1,
  touchend: 1,
  touchcancel: 1,
  mousedown: 2,
  mousemove: 2,
  mouseup: 2
};
function getRect(el) {
  /* istanbul ignore if  */
  if (el instanceof window.SVGElement) {
    var rect = el.getBoundingClientRect();
    return {
      top: rect.top,
      left: rect.left,
      width: rect.width,
      height: rect.height
    };
  } else {
    return {
      top: el.offsetTop,
      left: el.offsetLeft,
      width: el.offsetWidth,
      height: el.offsetHeight
    };
  }
}
function preventDefaultExceptionFn(el, exceptions) {
  for (var i in exceptions) {
    if (exceptions[i].test(el[i])) {
      return true;
    }
  }
  return false;
}
var tagExceptionFn = preventDefaultExceptionFn;
function tap(e, eventName) {
  var ev = document.createEvent('Event');
  ev.initEvent(eventName, true, true);
  ev.pageX = e.pageX;
  ev.pageY = e.pageY;
  e.target.dispatchEvent(ev);
}
function click(e, event) {
  if (event === void 0) {
    event = 'click';
  }
  var eventSource;
  if (e.type === 'mouseup') {
    eventSource = e;
  } else if (e.type === 'touchend' || e.type === 'touchcancel') {
    eventSource = e.changedTouches[0];
  }
  var posSrc = {};
  if (eventSource) {
    posSrc.screenX = eventSource.screenX || 0;
    posSrc.screenY = eventSource.screenY || 0;
    posSrc.clientX = eventSource.clientX || 0;
    posSrc.clientY = eventSource.clientY || 0;
  }
  var ev;
  var bubbles = true;
  var cancelable = true;
  var ctrlKey = e.ctrlKey,
    shiftKey = e.shiftKey,
    altKey = e.altKey,
    metaKey = e.metaKey;
  var pressedKeysMap = {
    ctrlKey: ctrlKey,
    shiftKey: shiftKey,
    altKey: altKey,
    metaKey: metaKey
  };
  if (typeof MouseEvent !== 'undefined') {
    try {
      ev = new MouseEvent(event, extend(__assign({
        bubbles: bubbles,
        cancelable: cancelable
      }, pressedKeysMap), posSrc));
    } catch (e) {
      /* istanbul ignore next */
      createEvent();
    }
  } else {
    createEvent();
  }
  function createEvent() {
    ev = document.createEvent('Event');
    ev.initEvent(event, bubbles, cancelable);
    extend(ev, posSrc);
  }
  // forwardedTouchEvent set to true in case of the conflict with fastclick
  ev.forwardedTouchEvent = true;
  ev._constructed = true;
  e.target.dispatchEvent(ev);
}
function dblclick(e) {
  click(e, 'dblclick');
}
function prepend(el, target) {
  var firstChild = target.firstChild;
  if (firstChild) {
    before(el, firstChild);
  } else {
    target.appendChild(el);
  }
}
function before(el, target) {
  var parentNode = target.parentNode;
  parentNode.insertBefore(el, target);
}
function removeChild(el, child) {
  el.removeChild(child);
}
function hasClass(el, className) {
  var reg = new RegExp('(^|\\s)' + className + '(\\s|$)');
  return reg.test(el.className);
}
function HTMLCollectionToArray(el) {
  return Array.prototype.slice.call(el, 0);
}
function getClientSize(el) {
  return {
    width: el.clientWidth,
    height: el.clientHeight
  };
}
var ease = {
  // easeOutQuint
  swipe: {
    style: 'cubic-bezier(0.23, 1, 0.32, 1)',
    fn: function (t) {
      return 1 + --t * t * t * t * t;
    }
  },
  // easeOutQuard
  swipeBounce: {
    style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',
    fn: function (t) {
      return t * (2 - t);
    }
  },
  // easeOutQuart
  bounce: {
    style: 'cubic-bezier(0.165, 0.84, 0.44, 1)',
    fn: function (t) {
      return 1 - --t * t * t * t;
    }
  }
};
var DEFAULT_INTERVAL = 1000 / 60;
var windowCompat = inBrowser && window;
/* istanbul ignore next */
function noop$1() {}
var requestAnimationFrame$1 = function () {
  /* istanbul ignore if  */
  if (!inBrowser) {
    return noop$1;
  }
  return windowCompat.requestAnimationFrame || windowCompat.webkitRequestAnimationFrame || windowCompat.mozRequestAnimationFrame || windowCompat.oRequestAnimationFrame ||
  // if all else fails, use setTimeout
  function (callback) {
    return window.setTimeout(callback, callback.interval || DEFAULT_INTERVAL); // make interval as precise as possible.
  };
}();
var cancelAnimationFrame$1 = function () {
  /* istanbul ignore if  */
  if (!inBrowser) {
    return noop$1;
  }
  return windowCompat.cancelAnimationFrame || windowCompat.webkitCancelAnimationFrame || windowCompat.mozCancelAnimationFrame || windowCompat.oCancelAnimationFrame || function (id) {
    window.clearTimeout(id);
  };
}();

/* istanbul ignore next */
var noop = function (val) {};
var sharedPropertyDefinition = {
  enumerable: true,
  configurable: true,
  get: noop,
  set: noop
};
var getProperty = function (obj, key) {
  var keys = key.split('.');
  for (var i = 0; i < keys.length - 1; i++) {
    obj = obj[keys[i]];
    if (typeof obj !== 'object' || !obj) return;
  }
  var lastKey = keys.pop();
  if (typeof obj[lastKey] === 'function') {
    return function () {
      return obj[lastKey].apply(obj, arguments);
    };
  } else {
    return obj[lastKey];
  }
};
var setProperty = function (obj, key, value) {
  var keys = key.split('.');
  var temp;
  for (var i = 0; i < keys.length - 1; i++) {
    temp = keys[i];
    if (!obj[temp]) obj[temp] = {};
    obj = obj[temp];
  }
  obj[keys.pop()] = value;
};
function propertiesProxy(target, sourceKey, key) {
  sharedPropertyDefinition.get = function proxyGetter() {
    return getProperty(this, sourceKey);
  };
  sharedPropertyDefinition.set = function proxySetter(val) {
    setProperty(this, sourceKey, val);
  };
  Object.defineProperty(target, key, sharedPropertyDefinition);
}
var EventEmitter = /** @class */function () {
  function EventEmitter(names) {
    this.events = {};
    this.eventTypes = {};
    this.registerType(names);
  }
  EventEmitter.prototype.on = function (type, fn, context) {
    if (context === void 0) {
      context = this;
    }
    this.hasType(type);
    if (!this.events[type]) {
      this.events[type] = [];
    }
    this.events[type].push([fn, context]);
    return this;
  };
  EventEmitter.prototype.once = function (type, fn, context) {
    var _this = this;
    if (context === void 0) {
      context = this;
    }
    this.hasType(type);
    var magic = function () {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      _this.off(type, magic);
      var ret = fn.apply(context, args);
      if (ret === true) {
        return ret;
      }
    };
    magic.fn = fn;
    this.on(type, magic);
    return this;
  };
  EventEmitter.prototype.off = function (type, fn) {
    if (!type && !fn) {
      this.events = {};
      return this;
    }
    if (type) {
      this.hasType(type);
      if (!fn) {
        this.events[type] = [];
        return this;
      }
      var events = this.events[type];
      if (!events) {
        return this;
      }
      var count = events.length;
      while (count--) {
        if (events[count][0] === fn || events[count][0] && events[count][0].fn === fn) {
          events.splice(count, 1);
        }
      }
      return this;
    }
  };
  EventEmitter.prototype.trigger = function (type) {
    var args = [];
    for (var _i = 1; _i < arguments.length; _i++) {
      args[_i - 1] = arguments[_i];
    }
    this.hasType(type);
    var events = this.events[type];
    if (!events) {
      return;
    }
    var len = events.length;
    var eventsCopy = __spreadArrays(events);
    var ret;
    for (var i = 0; i < len; i++) {
      var event_1 = eventsCopy[i];
      var fn = event_1[0],
        context = event_1[1];
      if (fn) {
        ret = fn.apply(context, args);
        if (ret === true) {
          return ret;
        }
      }
    }
  };
  EventEmitter.prototype.registerType = function (names) {
    var _this = this;
    names.forEach(function (type) {
      _this.eventTypes[type] = type;
    });
  };
  EventEmitter.prototype.destroy = function () {
    this.events = {};
    this.eventTypes = {};
  };
  EventEmitter.prototype.hasType = function (type) {
    var types = this.eventTypes;
    var isType = types[type] === type;
    if (!isType) {
      warn("EventEmitter has used unknown event type: \"" + type + "\", should be oneof [" + ("" + Object.keys(types).map(function (_) {
        return JSON.stringify(_);
      })) + "]");
    }
  };
  return EventEmitter;
}();
var EventRegister = /** @class */function () {
  function EventRegister(wrapper, events) {
    this.wrapper = wrapper;
    this.events = events;
    this.addDOMEvents();
  }
  EventRegister.prototype.destroy = function () {
    this.removeDOMEvents();
    this.events = [];
  };
  EventRegister.prototype.addDOMEvents = function () {
    this.handleDOMEvents(addEvent);
  };
  EventRegister.prototype.removeDOMEvents = function () {
    this.handleDOMEvents(removeEvent);
  };
  EventRegister.prototype.handleDOMEvents = function (eventOperation) {
    var _this = this;
    var wrapper = this.wrapper;
    this.events.forEach(function (event) {
      eventOperation(wrapper, event.name, _this, !!event.capture);
    });
  };
  EventRegister.prototype.handleEvent = function (e) {
    var eventType = e.type;
    this.events.some(function (event) {
      if (event.name === eventType) {
        event.handler(e);
        return true;
      }
      return false;
    });
  };
  return EventRegister;
}();
var CustomOptions = /** @class */function () {
  function CustomOptions() {}
  return CustomOptions;
}();
var OptionsConstructor = /** @class */function (_super) {
  __extends(OptionsConstructor, _super);
  function OptionsConstructor() {
    var _this = _super.call(this) || this;
    _this.startX = 0;
    _this.startY = 0;
    _this.scrollX = false;
    _this.scrollY = true;
    _this.freeScroll = false;
    _this.directionLockThreshold = 0;
    _this.eventPassthrough = "" /* None */;
    _this.click = false;
    _this.dblclick = false;
    _this.tap = '';
    _this.bounce = {
      top: true,
      bottom: true,
      left: true,
      right: true
    };
    _this.bounceTime = 800;
    _this.momentum = true;
    _this.momentumLimitTime = 300;
    _this.momentumLimitDistance = 15;
    _this.swipeTime = 2500;
    _this.swipeBounceTime = 500;
    _this.deceleration = 0.0015;
    _this.flickLimitTime = 200;
    _this.flickLimitDistance = 100;
    _this.resizePolling = 60;
    _this.probeType = 0 /* Default */;
    _this.stopPropagation = false;
    _this.preventDefault = true;
    _this.preventDefaultException = {
      tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT|AUDIO)$/
    };
    _this.tagException = {
      tagName: /^TEXTAREA$/
    };
    _this.HWCompositing = true;
    _this.useTransition = true;
    _this.bindToWrapper = false;
    _this.bindToTarget = false;
    _this.disableMouse = hasTouch;
    _this.disableTouch = !hasTouch;
    _this.autoBlur = true;
    _this.autoEndDistance = 5;
    _this.outOfBoundaryDampingFactor = 1 / 3;
    _this.specifiedIndexAsContent = 0;
    _this.quadrant = 1 /* First */;
    return _this;
  }
  OptionsConstructor.prototype.merge = function (options) {
    if (!options) return this;
    for (var key in options) {
      if (key === 'bounce') {
        this.bounce = this.resolveBounce(options[key]);
        continue;
      }
      this[key] = options[key];
    }
    return this;
  };
  OptionsConstructor.prototype.process = function () {
    this.translateZ = this.HWCompositing && hasPerspective ? ' translateZ(1px)' : '';
    this.useTransition = this.useTransition && hasTransition;
    this.preventDefault = !this.eventPassthrough && this.preventDefault;
    // If you want eventPassthrough I have to lock one of the axes
    this.scrollX = this.eventPassthrough === "horizontal" /* Horizontal */ ? false : this.scrollX;
    this.scrollY = this.eventPassthrough === "vertical" /* Vertical */ ? false : this.scrollY;
    // With eventPassthrough we also need lockDirection mechanism
    this.freeScroll = this.freeScroll && !this.eventPassthrough;
    // force true when freeScroll is true
    this.scrollX = this.freeScroll ? true : this.scrollX;
    this.scrollY = this.freeScroll ? true : this.scrollY;
    this.directionLockThreshold = this.eventPassthrough ? 0 : this.directionLockThreshold;
    return this;
  };
  OptionsConstructor.prototype.resolveBounce = function (bounceOptions) {
    var DEFAULT_BOUNCE = {
      top: true,
      right: true,
      bottom: true,
      left: true
    };
    var NEGATED_BOUNCE = {
      top: false,
      right: false,
      bottom: false,
      left: false
    };
    var ret;
    if (typeof bounceOptions === 'object') {
      ret = extend(DEFAULT_BOUNCE, bounceOptions);
    } else {
      ret = bounceOptions ? DEFAULT_BOUNCE : NEGATED_BOUNCE;
    }
    return ret;
  };
  return OptionsConstructor;
}(CustomOptions);
var ActionsHandler = /** @class */function () {
  function ActionsHandler(wrapper, options) {
    this.wrapper = wrapper;
    this.options = options;
    this.hooks = new EventEmitter(['beforeStart', 'start', 'move', 'end', 'click']);
    this.handleDOMEvents();
  }
  ActionsHandler.prototype.handleDOMEvents = function () {
    var _a = this.options,
      bindToWrapper = _a.bindToWrapper,
      disableMouse = _a.disableMouse,
      disableTouch = _a.disableTouch,
      click = _a.click;
    var wrapper = this.wrapper;
    var target = bindToWrapper ? wrapper : window;
    var wrapperEvents = [];
    var targetEvents = [];
    var shouldRegisterTouch = !disableTouch;
    var shouldRegisterMouse = !disableMouse;
    if (click) {
      wrapperEvents.push({
        name: 'click',
        handler: this.click.bind(this),
        capture: true
      });
    }
    if (shouldRegisterTouch) {
      wrapperEvents.push({
        name: 'touchstart',
        handler: this.start.bind(this)
      });
      targetEvents.push({
        name: 'touchmove',
        handler: this.move.bind(this)
      }, {
        name: 'touchend',
        handler: this.end.bind(this)
      }, {
        name: 'touchcancel',
        handler: this.end.bind(this)
      });
    }
    if (shouldRegisterMouse) {
      wrapperEvents.push({
        name: 'mousedown',
        handler: this.start.bind(this)
      });
      targetEvents.push({
        name: 'mousemove',
        handler: this.move.bind(this)
      }, {
        name: 'mouseup',
        handler: this.end.bind(this)
      });
    }
    this.wrapperEventRegister = new EventRegister(wrapper, wrapperEvents);
    this.targetEventRegister = new EventRegister(target, targetEvents);
  };
  ActionsHandler.prototype.beforeHandler = function (e, type) {
    var _a = this.options,
      preventDefault = _a.preventDefault,
      stopPropagation = _a.stopPropagation,
      preventDefaultException = _a.preventDefaultException;
    var preventDefaultConditions = {
      start: function () {
        return preventDefault && !preventDefaultExceptionFn(e.target, preventDefaultException);
      },
      end: function () {
        return preventDefault && !preventDefaultExceptionFn(e.target, preventDefaultException);
      },
      move: function () {
        return preventDefault;
      }
    };
    if (preventDefaultConditions[type]()) {
      e.preventDefault();
    }
    if (stopPropagation) {
      e.stopPropagation();
    }
  };
  ActionsHandler.prototype.setInitiated = function (type) {
    if (type === void 0) {
      type = 0;
    }
    this.initiated = type;
  };
  ActionsHandler.prototype.start = function (e) {
    var _eventType = eventTypeMap[e.type];
    if (this.initiated && this.initiated !== _eventType) {
      return;
    }
    this.setInitiated(_eventType);
    // if textarea or other html tags in options.tagException is manipulated
    // do not make bs scroll
    if (tagExceptionFn(e.target, this.options.tagException)) {
      this.setInitiated();
      return;
    }
    // only allow mouse left button
    if (_eventType === 2 /* Mouse */ && e.button !== 0 /* Left */) return;
    if (this.hooks.trigger(this.hooks.eventTypes.beforeStart, e)) {
      return;
    }
    this.beforeHandler(e, 'start');
    var point = e.touches ? e.touches[0] : e;
    this.pointX = point.pageX;
    this.pointY = point.pageY;
    this.hooks.trigger(this.hooks.eventTypes.start, e);
  };
  ActionsHandler.prototype.move = function (e) {
    if (eventTypeMap[e.type] !== this.initiated) {
      return;
    }
    this.beforeHandler(e, 'move');
    var point = e.touches ? e.touches[0] : e;
    var deltaX = point.pageX - this.pointX;
    var deltaY = point.pageY - this.pointY;
    this.pointX = point.pageX;
    this.pointY = point.pageY;
    if (this.hooks.trigger(this.hooks.eventTypes.move, {
      deltaX: deltaX,
      deltaY: deltaY,
      e: e
    })) {
      return;
    }
    // auto end when out of viewport
    var scrollLeft = document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft;
    var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
    var pX = this.pointX - scrollLeft;
    var pY = this.pointY - scrollTop;
    var autoEndDistance = this.options.autoEndDistance;
    if (pX > document.documentElement.clientWidth - autoEndDistance || pY > document.documentElement.clientHeight - autoEndDistance || pX < autoEndDistance || pY < autoEndDistance) {
      this.end(e);
    }
  };
  ActionsHandler.prototype.end = function (e) {
    if (eventTypeMap[e.type] !== this.initiated) {
      return;
    }
    this.setInitiated();
    this.beforeHandler(e, 'end');
    this.hooks.trigger(this.hooks.eventTypes.end, e);
  };
  ActionsHandler.prototype.click = function (e) {
    this.hooks.trigger(this.hooks.eventTypes.click, e);
  };
  ActionsHandler.prototype.setContent = function (content) {
    if (content !== this.wrapper) {
      this.wrapper = content;
      this.rebindDOMEvents();
    }
  };
  ActionsHandler.prototype.rebindDOMEvents = function () {
    this.wrapperEventRegister.destroy();
    this.targetEventRegister.destroy();
    this.handleDOMEvents();
  };
  ActionsHandler.prototype.destroy = function () {
    this.wrapperEventRegister.destroy();
    this.targetEventRegister.destroy();
    this.hooks.destroy();
  };
  return ActionsHandler;
}();
var translaterMetaData = {
  x: ['translateX', 'px'],
  y: ['translateY', 'px']
};
var Translater = /** @class */function () {
  function Translater(content) {
    this.setContent(content);
    this.hooks = new EventEmitter(['beforeTranslate', 'translate']);
  }
  Translater.prototype.getComputedPosition = function () {
    var cssStyle = window.getComputedStyle(this.content, null);
    var matrix = cssStyle[style.transform].split(')')[0].split(', ');
    var x = +(matrix[12] || matrix[4]) || 0;
    var y = +(matrix[13] || matrix[5]) || 0;
    return {
      x: x,
      y: y
    };
  };
  Translater.prototype.translate = function (point) {
    var transformStyle = [];
    Object.keys(point).forEach(function (key) {
      if (!translaterMetaData[key]) {
        return;
      }
      var transformFnName = translaterMetaData[key][0];
      if (transformFnName) {
        var transformFnArgUnit = translaterMetaData[key][1];
        var transformFnArg = point[key];
        transformStyle.push(transformFnName + "(" + transformFnArg + transformFnArgUnit + ")");
      }
    });
    this.hooks.trigger(this.hooks.eventTypes.beforeTranslate, transformStyle, point);
    this.style[style.transform] = transformStyle.join(' ');
    this.hooks.trigger(this.hooks.eventTypes.translate, point);
  };
  Translater.prototype.setContent = function (content) {
    if (this.content !== content) {
      this.content = content;
      this.style = content.style;
    }
  };
  Translater.prototype.destroy = function () {
    this.hooks.destroy();
  };
  return Translater;
}();
var Base = /** @class */function () {
  function Base(content, translater, options) {
    this.translater = translater;
    this.options = options;
    this.timer = 0;
    this.hooks = new EventEmitter(['move', 'end', 'beforeForceStop', 'forceStop', 'callStop', 'time', 'timeFunction']);
    this.setContent(content);
  }
  Base.prototype.translate = function (endPoint) {
    this.translater.translate(endPoint);
  };
  Base.prototype.setPending = function (pending) {
    this.pending = pending;
  };
  Base.prototype.setForceStopped = function (forceStopped) {
    this.forceStopped = forceStopped;
  };
  Base.prototype.setCallStop = function (called) {
    this.callStopWhenPending = called;
  };
  Base.prototype.setContent = function (content) {
    if (this.content !== content) {
      this.content = content;
      this.style = content.style;
      this.stop();
    }
  };
  Base.prototype.clearTimer = function () {
    if (this.timer) {
      cancelAnimationFrame$1(this.timer);
      this.timer = 0;
    }
  };
  Base.prototype.destroy = function () {
    this.hooks.destroy();
    cancelAnimationFrame$1(this.timer);
  };
  return Base;
}();

// iOS 13.6 - 14.x, window.getComputedStyle sometimes will get wrong transform value
// when bs use transition mode
// eg: translateY -100px -> -200px, when the last frame which is about to scroll to -200px
// window.getComputedStyle(this.content) will calculate transformY to be -100px(startPoint)
// it is weird
// so we should validate position caculated by 'window.getComputedStyle'
var isValidPostion = function (startPoint, endPoint, currentPos, prePos) {
  var computeDirection = function (endValue, startValue) {
    var delta = endValue - startValue;
    var direction = delta > 0 ? -1 /* Negative */ : delta < 0 ? 1 /* Positive */ : 0 /* Default */;
    return direction;
  };
  var directionX = computeDirection(endPoint.x, startPoint.x);
  var directionY = computeDirection(endPoint.y, startPoint.y);
  var deltaX = currentPos.x - prePos.x;
  var deltaY = currentPos.y - prePos.y;
  return directionX * deltaX <= 0 && directionY * deltaY <= 0;
};
var Transition = /** @class */function (_super) {
  __extends(Transition, _super);
  function Transition() {
    return _super !== null && _super.apply(this, arguments) || this;
  }
  Transition.prototype.startProbe = function (startPoint, endPoint) {
    var _this = this;
    var prePos = startPoint;
    var probe = function () {
      var pos = _this.translater.getComputedPosition();
      if (isValidPostion(startPoint, endPoint, pos, prePos)) {
        _this.hooks.trigger(_this.hooks.eventTypes.move, pos);
      }
      // call bs.stop() should not dispatch end hook again.
      // forceStop hook will do this.
      /* istanbul ignore if  */
      if (!_this.pending) {
        if (_this.callStopWhenPending) {
          _this.callStopWhenPending = false;
        } else {
          // transition ends should dispatch end hook.
          _this.hooks.trigger(_this.hooks.eventTypes.end, pos);
        }
      }
      prePos = pos;
      if (_this.pending) {
        _this.timer = requestAnimationFrame$1(probe);
      }
    };
    // when manually call bs.stop(), then bs.scrollTo()
    // we should reset callStopWhenPending to dispatch end hook
    if (this.callStopWhenPending) {
      this.setCallStop(false);
    }
    cancelAnimationFrame$1(this.timer);
    probe();
  };
  Transition.prototype.transitionTime = function (time) {
    if (time === void 0) {
      time = 0;
    }
    this.style[style.transitionDuration] = time + 'ms';
    this.hooks.trigger(this.hooks.eventTypes.time, time);
  };
  Transition.prototype.transitionTimingFunction = function (easing) {
    this.style[style.transitionTimingFunction] = easing;
    this.hooks.trigger(this.hooks.eventTypes.timeFunction, easing);
  };
  Transition.prototype.transitionProperty = function () {
    this.style[style.transitionProperty] = style.transform;
  };
  Transition.prototype.move = function (startPoint, endPoint, time, easingFn) {
    this.setPending(time > 0);
    this.transitionTimingFunction(easingFn);
    this.transitionProperty();
    this.transitionTime(time);
    this.translate(endPoint);
    var isRealtimeProbeType = this.options.probeType === 3 /* Realtime */;
    if (time && isRealtimeProbeType) {
      this.startProbe(startPoint, endPoint);
    }
    // if we change content's transformY in a tick
    // such as: 0 -> 50px -> 0
    // transitionend will not be triggered
    // so we forceupdate by reflow
    if (!time) {
      this._reflow = this.content.offsetHeight;
      if (isRealtimeProbeType) {
        this.hooks.trigger(this.hooks.eventTypes.move, endPoint);
      }
      this.hooks.trigger(this.hooks.eventTypes.end, endPoint);
    }
  };
  Transition.prototype.doStop = function () {
    var pending = this.pending;
    this.setForceStopped(false);
    this.setCallStop(false);
    // still in transition
    if (pending) {
      this.setPending(false);
      cancelAnimationFrame$1(this.timer);
      var _a = this.translater.getComputedPosition(),
        x = _a.x,
        y = _a.y;
      this.transitionTime();
      this.translate({
        x: x,
        y: y
      });
      this.setForceStopped(true);
      this.setCallStop(true);
      this.hooks.trigger(this.hooks.eventTypes.forceStop, {
        x: x,
        y: y
      });
    }
    return pending;
  };
  Transition.prototype.stop = function () {
    var stopFromTransition = this.doStop();
    if (stopFromTransition) {
      this.hooks.trigger(this.hooks.eventTypes.callStop);
    }
  };
  return Transition;
}(Base);
var Animation = /** @class */function (_super) {
  __extends(Animation, _super);
  function Animation() {
    return _super !== null && _super.apply(this, arguments) || this;
  }
  Animation.prototype.move = function (startPoint, endPoint, time, easingFn) {
    // time is 0
    if (!time) {
      this.translate(endPoint);
      if (this.options.probeType === 3 /* Realtime */) {
        this.hooks.trigger(this.hooks.eventTypes.move, endPoint);
      }
      this.hooks.trigger(this.hooks.eventTypes.end, endPoint);
      return;
    }
    this.animate(startPoint, endPoint, time, easingFn);
  };
  Animation.prototype.animate = function (startPoint, endPoint, duration, easingFn) {
    var _this = this;
    var startTime = getNow();
    var destTime = startTime + duration;
    var isRealtimeProbeType = this.options.probeType === 3 /* Realtime */;
    var step = function () {
      var now = getNow();
      // js animation end
      if (now >= destTime) {
        _this.translate(endPoint);
        if (isRealtimeProbeType) {
          _this.hooks.trigger(_this.hooks.eventTypes.move, endPoint);
        }
        _this.hooks.trigger(_this.hooks.eventTypes.end, endPoint);
        return;
      }
      now = (now - startTime) / duration;
      var easing = easingFn(now);
      var newPoint = {};
      Object.keys(endPoint).forEach(function (key) {
        var startValue = startPoint[key];
        var endValue = endPoint[key];
        newPoint[key] = (endValue - startValue) * easing + startValue;
      });
      _this.translate(newPoint);
      if (isRealtimeProbeType) {
        _this.hooks.trigger(_this.hooks.eventTypes.move, newPoint);
      }
      if (_this.pending) {
        _this.timer = requestAnimationFrame$1(step);
      }
      // call bs.stop() should not dispatch end hook again.
      // forceStop hook will do this.
      /* istanbul ignore if  */
      if (!_this.pending) {
        if (_this.callStopWhenPending) {
          _this.callStopWhenPending = false;
        } else {
          // raf ends should dispatch end hook.
          _this.hooks.trigger(_this.hooks.eventTypes.end, endPoint);
        }
      }
    };
    this.setPending(true);
    // when manually call bs.stop(), then bs.scrollTo()
    // we should reset callStopWhenPending to dispatch end hook
    if (this.callStopWhenPending) {
      this.setCallStop(false);
    }
    cancelAnimationFrame$1(this.timer);
    step();
  };
  Animation.prototype.doStop = function () {
    var pending = this.pending;
    this.setForceStopped(false);
    this.setCallStop(false);
    // still in requestFrameAnimation
    if (pending) {
      this.setPending(false);
      cancelAnimationFrame$1(this.timer);
      var pos = this.translater.getComputedPosition();
      this.setForceStopped(true);
      this.setCallStop(true);
      this.hooks.trigger(this.hooks.eventTypes.forceStop, pos);
    }
    return pending;
  };
  Animation.prototype.stop = function () {
    var stopFromAnimation = this.doStop();
    if (stopFromAnimation) {
      this.hooks.trigger(this.hooks.eventTypes.callStop);
    }
  };
  return Animation;
}(Base);
function createAnimater(element, translater, options) {
  var useTransition = options.useTransition;
  var animaterOptions = {};
  Object.defineProperty(animaterOptions, 'probeType', {
    enumerable: true,
    configurable: false,
    get: function () {
      return options.probeType;
    }
  });
  if (useTransition) {
    return new Transition(element, translater, animaterOptions);
  } else {
    return new Animation(element, translater, animaterOptions);
  }
}
var Behavior = /** @class */function () {
  function Behavior(wrapper, content, options) {
    this.wrapper = wrapper;
    this.options = options;
    this.hooks = new EventEmitter(['beforeComputeBoundary', 'computeBoundary', 'momentum', 'end', 'ignoreHasScroll']);
    this.refresh(content);
  }
  Behavior.prototype.start = function () {
    this.dist = 0;
    this.setMovingDirection(0 /* Default */);
    this.setDirection(0 /* Default */);
  };
  Behavior.prototype.move = function (delta) {
    delta = this.hasScroll ? delta : 0;
    this.setMovingDirection(delta);
    return this.performDampingAlgorithm(delta, this.options.outOfBoundaryDampingFactor);
  };
  Behavior.prototype.setMovingDirection = function (delta) {
    this.movingDirection = delta > 0 ? -1 /* Negative */ : delta < 0 ? 1 /* Positive */ : 0 /* Default */;
  };
  Behavior.prototype.setDirection = function (delta) {
    this.direction = delta > 0 ? -1 /* Negative */ : delta < 0 ? 1 /* Positive */ : 0 /* Default */;
  };
  Behavior.prototype.performDampingAlgorithm = function (delta, dampingFactor) {
    var newPos = this.currentPos + delta;
    // Slow down or stop if outside of the boundaries
    if (newPos > this.minScrollPos || newPos < this.maxScrollPos) {
      if (newPos > this.minScrollPos && this.options.bounces[0] || newPos < this.maxScrollPos && this.options.bounces[1]) {
        newPos = this.currentPos + delta * dampingFactor;
      } else {
        newPos = newPos > this.minScrollPos ? this.minScrollPos : this.maxScrollPos;
      }
    }
    return newPos;
  };
  Behavior.prototype.end = function (duration) {
    var momentumInfo = {
      duration: 0
    };
    var absDist = Math.abs(this.currentPos - this.startPos);
    // start momentum animation if needed
    if (this.options.momentum && duration < this.options.momentumLimitTime && absDist > this.options.momentumLimitDistance) {
      var wrapperSize = this.direction === -1 /* Negative */ && this.options.bounces[0] || this.direction === 1 /* Positive */ && this.options.bounces[1] ? this.wrapperSize : 0;
      momentumInfo = this.hasScroll ? this.momentum(this.currentPos, this.startPos, duration, this.maxScrollPos, this.minScrollPos, wrapperSize, this.options) : {
        destination: this.currentPos,
        duration: 0
      };
    } else {
      this.hooks.trigger(this.hooks.eventTypes.end, momentumInfo);
    }
    return momentumInfo;
  };
  Behavior.prototype.momentum = function (current, start, time, lowerMargin, upperMargin, wrapperSize, options) {
    if (options === void 0) {
      options = this.options;
    }
    var distance = current - start;
    var speed = Math.abs(distance) / time;
    var deceleration = options.deceleration,
      swipeBounceTime = options.swipeBounceTime,
      swipeTime = options.swipeTime;
    var duration = Math.min(swipeTime, speed * 2 / deceleration);
    var momentumData = {
      destination: current + speed * speed / deceleration * (distance < 0 ? -1 : 1),
      duration: duration,
      rate: 15
    };
    this.hooks.trigger(this.hooks.eventTypes.momentum, momentumData, distance);
    if (momentumData.destination < lowerMargin) {
      momentumData.destination = wrapperSize ? Math.max(lowerMargin - wrapperSize / 4, lowerMargin - wrapperSize / momentumData.rate * speed) : lowerMargin;
      momentumData.duration = swipeBounceTime;
    } else if (momentumData.destination > upperMargin) {
      momentumData.destination = wrapperSize ? Math.min(upperMargin + wrapperSize / 4, upperMargin + wrapperSize / momentumData.rate * speed) : upperMargin;
      momentumData.duration = swipeBounceTime;
    }
    momentumData.destination = Math.round(momentumData.destination);
    return momentumData;
  };
  Behavior.prototype.updateDirection = function () {
    var absDist = this.currentPos - this.absStartPos;
    this.setDirection(absDist);
  };
  Behavior.prototype.refresh = function (content) {
    var _a = this.options.rect,
      size = _a.size,
      position = _a.position;
    var isWrapperStatic = window.getComputedStyle(this.wrapper, null).position === 'static';
    // Force reflow
    var wrapperRect = getRect(this.wrapper);
    // use client is more fair than offset
    this.wrapperSize = this.wrapper[size === 'width' ? 'clientWidth' : 'clientHeight'];
    this.setContent(content);
    var contentRect = getRect(this.content);
    this.contentSize = contentRect[size];
    this.relativeOffset = contentRect[position];
    /* istanbul ignore if  */
    if (isWrapperStatic) {
      this.relativeOffset -= wrapperRect[position];
    }
    this.computeBoundary();
    this.setDirection(0 /* Default */);
  };
  Behavior.prototype.setContent = function (content) {
    if (content !== this.content) {
      this.content = content;
      this.resetState();
    }
  };
  Behavior.prototype.resetState = function () {
    this.currentPos = 0;
    this.startPos = 0;
    this.dist = 0;
    this.setDirection(0 /* Default */);
    this.setMovingDirection(0 /* Default */);
    this.resetStartPos();
  };
  Behavior.prototype.computeBoundary = function () {
    this.hooks.trigger(this.hooks.eventTypes.beforeComputeBoundary);
    var boundary = {
      minScrollPos: 0,
      maxScrollPos: this.wrapperSize - this.contentSize
    };
    if (boundary.maxScrollPos < 0) {
      boundary.maxScrollPos -= this.relativeOffset;
      if (this.options.specifiedIndexAsContent === 0) {
        boundary.minScrollPos = -this.relativeOffset;
      }
    }
    this.hooks.trigger(this.hooks.eventTypes.computeBoundary, boundary);
    this.minScrollPos = boundary.minScrollPos;
    this.maxScrollPos = boundary.maxScrollPos;
    this.hasScroll = this.options.scrollable && this.maxScrollPos < this.minScrollPos;
    if (!this.hasScroll && this.minScrollPos < this.maxScrollPos) {
      this.maxScrollPos = this.minScrollPos;
      this.contentSize = this.wrapperSize;
    }
  };
  Behavior.prototype.updatePosition = function (pos) {
    this.currentPos = pos;
  };
  Behavior.prototype.getCurrentPos = function () {
    return this.currentPos;
  };
  Behavior.prototype.checkInBoundary = function () {
    var position = this.adjustPosition(this.currentPos);
    var inBoundary = position === this.getCurrentPos();
    return {
      position: position,
      inBoundary: inBoundary
    };
  };
  // adjust position when out of boundary
  Behavior.prototype.adjustPosition = function (pos) {
    if (!this.hasScroll && !this.hooks.trigger(this.hooks.eventTypes.ignoreHasScroll)) {
      pos = this.minScrollPos;
    } else if (pos > this.minScrollPos) {
      pos = this.minScrollPos;
    } else if (pos < this.maxScrollPos) {
      pos = this.maxScrollPos;
    }
    return pos;
  };
  Behavior.prototype.updateStartPos = function () {
    this.startPos = this.currentPos;
  };
  Behavior.prototype.updateAbsStartPos = function () {
    this.absStartPos = this.currentPos;
  };
  Behavior.prototype.resetStartPos = function () {
    this.updateStartPos();
    this.updateAbsStartPos();
  };
  Behavior.prototype.getAbsDist = function (delta) {
    this.dist += delta;
    return Math.abs(this.dist);
  };
  Behavior.prototype.destroy = function () {
    this.hooks.destroy();
  };
  return Behavior;
}();
var _a, _b, _c, _d;
var PassthroughHandlers = (_a = {}, _a["yes" /* Yes */] = function (e) {
  return true;
}, _a["no" /* No */] = function (e) {
  maybePrevent(e);
  return false;
}, _a);
var DirectionMap = (_b = {}, _b["horizontal" /* Horizontal */] = (_c = {}, _c["yes" /* Yes */] = "horizontal" /* Horizontal */, _c["no" /* No */] = "vertical" /* Vertical */, _c), _b["vertical" /* Vertical */] = (_d = {}, _d["yes" /* Yes */] = "vertical" /* Vertical */, _d["no" /* No */] = "horizontal" /* Horizontal */, _d), _b);
var DirectionLockAction = /** @class */function () {
  function DirectionLockAction(directionLockThreshold, freeScroll, eventPassthrough) {
    this.directionLockThreshold = directionLockThreshold;
    this.freeScroll = freeScroll;
    this.eventPassthrough = eventPassthrough;
    this.reset();
  }
  DirectionLockAction.prototype.reset = function () {
    this.directionLocked = "" /* Default */;
  };
  DirectionLockAction.prototype.checkMovingDirection = function (absDistX, absDistY, e) {
    this.computeDirectionLock(absDistX, absDistY);
    return this.handleEventPassthrough(e);
  };
  DirectionLockAction.prototype.adjustDelta = function (deltaX, deltaY) {
    if (this.directionLocked === "horizontal" /* Horizontal */) {
      deltaY = 0;
    } else if (this.directionLocked === "vertical" /* Vertical */) {
      deltaX = 0;
    }
    return {
      deltaX: deltaX,
      deltaY: deltaY
    };
  };
  DirectionLockAction.prototype.computeDirectionLock = function (absDistX, absDistY) {
    // If you are scrolling in one direction, lock it
    if (this.directionLocked === "" /* Default */ && !this.freeScroll) {
      if (absDistX > absDistY + this.directionLockThreshold) {
        this.directionLocked = "horizontal" /* Horizontal */; // lock horizontally
      } else if (absDistY >= absDistX + this.directionLockThreshold) {
        this.directionLocked = "vertical" /* Vertical */; // lock vertically
      } else {
        this.directionLocked = "none" /* None */; // no lock
      }
    }
  };
  DirectionLockAction.prototype.handleEventPassthrough = function (e) {
    var handleMap = DirectionMap[this.directionLocked];
    if (handleMap) {
      if (this.eventPassthrough === handleMap["yes" /* Yes */]) {
        return PassthroughHandlers["yes" /* Yes */](e);
      } else if (this.eventPassthrough === handleMap["no" /* No */]) {
        return PassthroughHandlers["no" /* No */](e);
      }
    }
    return false;
  };
  return DirectionLockAction;
}();
var applyQuadrantTransformation = function (deltaX, deltaY, quadrant) {
  if (quadrant === 2 /* Second */) {
    return [deltaY, -deltaX];
  } else if (quadrant === 3 /* Third */) {
    return [-deltaX, -deltaY];
  } else if (quadrant === 4 /* Forth */) {
    return [-deltaY, deltaX];
  } else {
    return [deltaX, deltaY];
  }
};
var ScrollerActions = /** @class */function () {
  function ScrollerActions(scrollBehaviorX, scrollBehaviorY, actionsHandler, animater, options) {
    this.hooks = new EventEmitter(['start', 'beforeMove', 'scrollStart', 'scroll', 'beforeEnd', 'end', 'scrollEnd', 'contentNotMoved', 'detectMovingDirection', 'coordinateTransformation']);
    this.scrollBehaviorX = scrollBehaviorX;
    this.scrollBehaviorY = scrollBehaviorY;
    this.actionsHandler = actionsHandler;
    this.animater = animater;
    this.options = options;
    this.directionLockAction = new DirectionLockAction(options.directionLockThreshold, options.freeScroll, options.eventPassthrough);
    this.enabled = true;
    this.bindActionsHandler();
  }
  ScrollerActions.prototype.bindActionsHandler = function () {
    var _this = this;
    // [mouse|touch]start event
    this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.start, function (e) {
      if (!_this.enabled) return true;
      return _this.handleStart(e);
    });
    // [mouse|touch]move event
    this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.move, function (_a) {
      var deltaX = _a.deltaX,
        deltaY = _a.deltaY,
        e = _a.e;
      if (!_this.enabled) return true;
      var _b = applyQuadrantTransformation(deltaX, deltaY, _this.options.quadrant),
        transformateDeltaX = _b[0],
        transformateDeltaY = _b[1];
      var transformateDeltaData = {
        deltaX: transformateDeltaX,
        deltaY: transformateDeltaY
      };
      _this.hooks.trigger(_this.hooks.eventTypes.coordinateTransformation, transformateDeltaData);
      return _this.handleMove(transformateDeltaData.deltaX, transformateDeltaData.deltaY, e);
    });
    // [mouse|touch]end event
    this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.end, function (e) {
      if (!_this.enabled) return true;
      return _this.handleEnd(e);
    });
    // click
    this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.click, function (e) {
      // handle native click event
      if (_this.enabled && !e._constructed) {
        _this.handleClick(e);
      }
    });
  };
  ScrollerActions.prototype.handleStart = function (e) {
    var timestamp = getNow();
    this.fingerMoved = false;
    this.contentMoved = false;
    this.startTime = timestamp;
    this.directionLockAction.reset();
    this.scrollBehaviorX.start();
    this.scrollBehaviorY.start();
    // force stopping last transition or animation
    this.animater.doStop();
    this.scrollBehaviorX.resetStartPos();
    this.scrollBehaviorY.resetStartPos();
    this.hooks.trigger(this.hooks.eventTypes.start, e);
  };
  ScrollerActions.prototype.handleMove = function (deltaX, deltaY, e) {
    if (this.hooks.trigger(this.hooks.eventTypes.beforeMove, e)) {
      return;
    }
    var absDistX = this.scrollBehaviorX.getAbsDist(deltaX);
    var absDistY = this.scrollBehaviorY.getAbsDist(deltaY);
    var timestamp = getNow();
    // We need to move at least momentumLimitDistance pixels
    // for the scrolling to initiate
    if (this.checkMomentum(absDistX, absDistY, timestamp)) {
      return true;
    }
    if (this.directionLockAction.checkMovingDirection(absDistX, absDistY, e)) {
      this.actionsHandler.setInitiated();
      return true;
    }
    var delta = this.directionLockAction.adjustDelta(deltaX, deltaY);
    var prevX = this.scrollBehaviorX.getCurrentPos();
    var newX = this.scrollBehaviorX.move(delta.deltaX);
    var prevY = this.scrollBehaviorY.getCurrentPos();
    var newY = this.scrollBehaviorY.move(delta.deltaY);
    if (this.hooks.trigger(this.hooks.eventTypes.detectMovingDirection)) {
      return;
    }
    if (!this.fingerMoved) {
      this.fingerMoved = true;
    }
    var positionChanged = newX !== prevX || newY !== prevY;
    if (!this.contentMoved && !positionChanged) {
      this.hooks.trigger(this.hooks.eventTypes.contentNotMoved);
    }
    if (!this.contentMoved && positionChanged) {
      this.contentMoved = true;
      this.hooks.trigger(this.hooks.eventTypes.scrollStart);
    }
    if (this.contentMoved && positionChanged) {
      this.animater.translate({
        x: newX,
        y: newY
      });
      this.dispatchScroll(timestamp);
    }
  };
  ScrollerActions.prototype.dispatchScroll = function (timestamp) {
    // dispatch scroll in interval time
    if (timestamp - this.startTime > this.options.momentumLimitTime) {
      // refresh time and starting position to initiate a momentum
      this.startTime = timestamp;
      this.scrollBehaviorX.updateStartPos();
      this.scrollBehaviorY.updateStartPos();
      if (this.options.probeType === 1 /* Throttle */) {
        this.hooks.trigger(this.hooks.eventTypes.scroll, this.getCurrentPos());
      }
    }
    // dispatch scroll all the time
    if (this.options.probeType > 1 /* Throttle */) {
      this.hooks.trigger(this.hooks.eventTypes.scroll, this.getCurrentPos());
    }
  };
  ScrollerActions.prototype.checkMomentum = function (absDistX, absDistY, timestamp) {
    return timestamp - this.endTime > this.options.momentumLimitTime && absDistY < this.options.momentumLimitDistance && absDistX < this.options.momentumLimitDistance;
  };
  ScrollerActions.prototype.handleEnd = function (e) {
    if (this.hooks.trigger(this.hooks.eventTypes.beforeEnd, e)) {
      return;
    }
    var currentPos = this.getCurrentPos();
    this.scrollBehaviorX.updateDirection();
    this.scrollBehaviorY.updateDirection();
    if (this.hooks.trigger(this.hooks.eventTypes.end, e, currentPos)) {
      return true;
    }
    currentPos = this.ensureIntegerPos(currentPos);
    this.animater.translate(currentPos);
    this.endTime = getNow();
    var duration = this.endTime - this.startTime;
    this.hooks.trigger(this.hooks.eventTypes.scrollEnd, currentPos, duration);
  };
  ScrollerActions.prototype.ensureIntegerPos = function (currentPos) {
    this.ensuringInteger = true;
    var x = currentPos.x,
      y = currentPos.y;
    var _a = this.scrollBehaviorX,
      minScrollPosX = _a.minScrollPos,
      maxScrollPosX = _a.maxScrollPos;
    var _b = this.scrollBehaviorY,
      minScrollPosY = _b.minScrollPos,
      maxScrollPosY = _b.maxScrollPos;
    x = x > 0 ? Math.ceil(x) : Math.floor(x);
    y = y > 0 ? Math.ceil(y) : Math.floor(y);
    x = between(x, maxScrollPosX, minScrollPosX);
    y = between(y, maxScrollPosY, minScrollPosY);
    return {
      x: x,
      y: y
    };
  };
  ScrollerActions.prototype.handleClick = function (e) {
    if (!preventDefaultExceptionFn(e.target, this.options.preventDefaultException)) {
      maybePrevent(e);
      e.stopPropagation();
    }
  };
  ScrollerActions.prototype.getCurrentPos = function () {
    return {
      x: this.scrollBehaviorX.getCurrentPos(),
      y: this.scrollBehaviorY.getCurrentPos()
    };
  };
  ScrollerActions.prototype.refresh = function () {
    this.endTime = 0;
  };
  ScrollerActions.prototype.destroy = function () {
    this.hooks.destroy();
  };
  return ScrollerActions;
}();
function createActionsHandlerOptions(bsOptions) {
  var options = ['click', 'bindToWrapper', 'disableMouse', 'disableTouch', 'preventDefault', 'stopPropagation', 'tagException', 'preventDefaultException', 'autoEndDistance'].reduce(function (prev, cur) {
    prev[cur] = bsOptions[cur];
    return prev;
  }, {});
  return options;
}
function createBehaviorOptions(bsOptions, extraProp, bounces, rect) {
  var options = ['momentum', 'momentumLimitTime', 'momentumLimitDistance', 'deceleration', 'swipeBounceTime', 'swipeTime', 'outOfBoundaryDampingFactor', 'specifiedIndexAsContent'].reduce(function (prev, cur) {
    prev[cur] = bsOptions[cur];
    return prev;
  }, {});
  // add extra property
  options.scrollable = !!bsOptions[extraProp];
  options.bounces = bounces;
  options.rect = rect;
  return options;
}
function bubbling(source, target, events) {
  events.forEach(function (event) {
    var sourceEvent;
    var targetEvent;
    if (typeof event === 'string') {
      sourceEvent = targetEvent = event;
    } else {
      sourceEvent = event.source;
      targetEvent = event.target;
    }
    source.on(sourceEvent, function () {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      return target.trigger.apply(target, __spreadArrays([targetEvent], args));
    });
  });
}
function isSamePoint(startPoint, endPoint) {
  // keys of startPoint and endPoint should be equal
  var keys = Object.keys(startPoint);
  for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
    var key = keys_1[_i];
    if (startPoint[key] !== endPoint[key]) return false;
  }
  return true;
}
var MIN_SCROLL_DISTANCE = 1;
var Scroller = /** @class */function () {
  function Scroller(wrapper, content, options) {
    this.wrapper = wrapper;
    this.content = content;
    this.resizeTimeout = 0;
    this.hooks = new EventEmitter(['beforeStart', 'beforeMove', 'beforeScrollStart', 'scrollStart', 'scroll', 'beforeEnd', 'scrollEnd', 'resize', 'touchEnd', 'end', 'flick', 'scrollCancel', 'momentum', 'scrollTo', 'minDistanceScroll', 'scrollToElement', 'beforeRefresh']);
    this.options = options;
    var _a = this.options.bounce,
      left = _a.left,
      right = _a.right,
      top = _a.top,
      bottom = _a.bottom;
    // direction X
    this.scrollBehaviorX = new Behavior(wrapper, content, createBehaviorOptions(options, 'scrollX', [left, right], {
      size: 'width',
      position: 'left'
    }));
    // direction Y
    this.scrollBehaviorY = new Behavior(wrapper, content, createBehaviorOptions(options, 'scrollY', [top, bottom], {
      size: 'height',
      position: 'top'
    }));
    this.translater = new Translater(this.content);
    this.animater = createAnimater(this.content, this.translater, this.options);
    this.actionsHandler = new ActionsHandler(this.options.bindToTarget ? this.content : wrapper, createActionsHandlerOptions(this.options));
    this.actions = new ScrollerActions(this.scrollBehaviorX, this.scrollBehaviorY, this.actionsHandler, this.animater, this.options);
    var resizeHandler = this.resize.bind(this);
    this.resizeRegister = new EventRegister(window, [{
      name: 'orientationchange',
      handler: resizeHandler
    }, {
      name: 'resize',
      handler: resizeHandler
    }]);
    this.registerTransitionEnd();
    this.init();
  }
  Scroller.prototype.init = function () {
    var _this = this;
    this.bindTranslater();
    this.bindAnimater();
    this.bindActions();
    // enable pointer events when scrolling ends
    this.hooks.on(this.hooks.eventTypes.scrollEnd, function () {
      _this.togglePointerEvents(true);
    });
  };
  Scroller.prototype.registerTransitionEnd = function () {
    this.transitionEndRegister = new EventRegister(this.content, [{
      name: style.transitionEnd,
      handler: this.transitionEnd.bind(this)
    }]);
  };
  Scroller.prototype.bindTranslater = function () {
    var _this = this;
    var hooks = this.translater.hooks;
    hooks.on(hooks.eventTypes.beforeTranslate, function (transformStyle) {
      if (_this.options.translateZ) {
        transformStyle.push(_this.options.translateZ);
      }
    });
    // disable pointer events when scrolling
    hooks.on(hooks.eventTypes.translate, function (pos) {
      var prevPos = _this.getCurrentPos();
      _this.updatePositions(pos);
      // scrollEnd will dispatch when scroll is force stopping in touchstart handler
      // so in touchend handler, don't toggle pointer-events
      if (_this.actions.ensuringInteger === true) {
        _this.actions.ensuringInteger = false;
        return;
      }
      // a valid translate
      if (pos.x !== prevPos.x || pos.y !== prevPos.y) {
        _this.togglePointerEvents(false);
      }
    });
  };
  Scroller.prototype.bindAnimater = function () {
    var _this = this;
    // reset position
    this.animater.hooks.on(this.animater.hooks.eventTypes.end, function (pos) {
      if (!_this.resetPosition(_this.options.bounceTime)) {
        _this.animater.setPending(false);
        _this.hooks.trigger(_this.hooks.eventTypes.scrollEnd, pos);
      }
    });
    bubbling(this.animater.hooks, this.hooks, [{
      source: this.animater.hooks.eventTypes.move,
      target: this.hooks.eventTypes.scroll
    }, {
      source: this.animater.hooks.eventTypes.forceStop,
      target: this.hooks.eventTypes.scrollEnd
    }]);
  };
  Scroller.prototype.bindActions = function () {
    var _this = this;
    var actions = this.actions;
    bubbling(actions.hooks, this.hooks, [{
      source: actions.hooks.eventTypes.start,
      target: this.hooks.eventTypes.beforeStart
    }, {
      source: actions.hooks.eventTypes.start,
      target: this.hooks.eventTypes.beforeScrollStart
    }, {
      source: actions.hooks.eventTypes.beforeMove,
      target: this.hooks.eventTypes.beforeMove
    }, {
      source: actions.hooks.eventTypes.scrollStart,
      target: this.hooks.eventTypes.scrollStart
    }, {
      source: actions.hooks.eventTypes.scroll,
      target: this.hooks.eventTypes.scroll
    }, {
      source: actions.hooks.eventTypes.beforeEnd,
      target: this.hooks.eventTypes.beforeEnd
    }]);
    actions.hooks.on(actions.hooks.eventTypes.end, function (e, pos) {
      _this.hooks.trigger(_this.hooks.eventTypes.touchEnd, pos);
      if (_this.hooks.trigger(_this.hooks.eventTypes.end, pos)) {
        return true;
      }
      // check if it is a click operation
      if (!actions.fingerMoved) {
        _this.hooks.trigger(_this.hooks.eventTypes.scrollCancel);
        if (_this.checkClick(e)) {
          return true;
        }
      }
      // reset if we are outside of the boundaries
      if (_this.resetPosition(_this.options.bounceTime, ease.bounce)) {
        _this.animater.setForceStopped(false);
        return true;
      }
    });
    actions.hooks.on(actions.hooks.eventTypes.scrollEnd, function (pos, duration) {
      var deltaX = Math.abs(pos.x - _this.scrollBehaviorX.startPos);
      var deltaY = Math.abs(pos.y - _this.scrollBehaviorY.startPos);
      if (_this.checkFlick(duration, deltaX, deltaY)) {
        _this.animater.setForceStopped(false);
        _this.hooks.trigger(_this.hooks.eventTypes.flick);
        return;
      }
      if (_this.momentum(pos, duration)) {
        _this.animater.setForceStopped(false);
        return;
      }
      if (actions.contentMoved) {
        _this.hooks.trigger(_this.hooks.eventTypes.scrollEnd, pos);
      }
      if (_this.animater.forceStopped) {
        _this.animater.setForceStopped(false);
      }
    });
  };
  Scroller.prototype.checkFlick = function (duration, deltaX, deltaY) {
    var flickMinMovingDistance = 1; // distinguish flick from click
    if (this.hooks.events.flick.length > 1 && duration < this.options.flickLimitTime && deltaX < this.options.flickLimitDistance && deltaY < this.options.flickLimitDistance && (deltaY > flickMinMovingDistance || deltaX > flickMinMovingDistance)) {
      return true;
    }
  };
  Scroller.prototype.momentum = function (pos, duration) {
    var meta = {
      time: 0,
      easing: ease.swiper,
      newX: pos.x,
      newY: pos.y
    };
    // start momentum animation if needed
    var momentumX = this.scrollBehaviorX.end(duration);
    var momentumY = this.scrollBehaviorY.end(duration);
    meta.newX = isUndef(momentumX.destination) ? meta.newX : momentumX.destination;
    meta.newY = isUndef(momentumY.destination) ? meta.newY : momentumY.destination;
    meta.time = Math.max(momentumX.duration, momentumY.duration);
    this.hooks.trigger(this.hooks.eventTypes.momentum, meta, this);
    // when x or y changed, do momentum animation now!
    if (meta.newX !== pos.x || meta.newY !== pos.y) {
      // change easing function when scroller goes out of the boundaries
      if (meta.newX > this.scrollBehaviorX.minScrollPos || meta.newX < this.scrollBehaviorX.maxScrollPos || meta.newY > this.scrollBehaviorY.minScrollPos || meta.newY < this.scrollBehaviorY.maxScrollPos) {
        meta.easing = ease.swipeBounce;
      }
      this.scrollTo(meta.newX, meta.newY, meta.time, meta.easing);
      return true;
    }
  };
  Scroller.prototype.checkClick = function (e) {
    var cancelable = {
      preventClick: this.animater.forceStopped
    };
    // we scrolled less than momentumLimitDistance pixels
    if (this.hooks.trigger(this.hooks.eventTypes.checkClick)) {
      this.animater.setForceStopped(false);
      return true;
    }
    if (!cancelable.preventClick) {
      var _dblclick = this.options.dblclick;
      var dblclickTrigged = false;
      if (_dblclick && this.lastClickTime) {
        var _a = _dblclick.delay,
          delay = _a === void 0 ? 300 : _a;
        if (getNow() - this.lastClickTime < delay) {
          dblclickTrigged = true;
          dblclick(e);
        }
      }
      if (this.options.tap) {
        tap(e, this.options.tap);
      }
      if (this.options.click && !preventDefaultExceptionFn(e.target, this.options.preventDefaultException)) {
        click(e);
      }
      this.lastClickTime = dblclickTrigged ? null : getNow();
      return true;
    }
    return false;
  };
  Scroller.prototype.resize = function () {
    var _this = this;
    if (!this.actions.enabled) {
      return;
    }
    // fix a scroll problem under Android condition
    /* istanbul ignore if  */
    if (isAndroid) {
      this.wrapper.scrollTop = 0;
    }
    clearTimeout(this.resizeTimeout);
    this.resizeTimeout = window.setTimeout(function () {
      _this.hooks.trigger(_this.hooks.eventTypes.resize);
    }, this.options.resizePolling);
  };
  /* istanbul ignore next */
  Scroller.prototype.transitionEnd = function (e) {
    if (e.target !== this.content || !this.animater.pending) {
      return;
    }
    var animater = this.animater;
    animater.transitionTime();
    if (!this.resetPosition(this.options.bounceTime, ease.bounce)) {
      this.animater.setPending(false);
      if (this.options.probeType !== 3 /* Realtime */) {
        this.hooks.trigger(this.hooks.eventTypes.scrollEnd, this.getCurrentPos());
      }
    }
  };
  Scroller.prototype.togglePointerEvents = function (enabled) {
    if (enabled === void 0) {
      enabled = true;
    }
    var el = this.content.children.length ? this.content.children : [this.content];
    var pointerEvents = enabled ? 'auto' : 'none';
    for (var i = 0; i < el.length; i++) {
      var node = el[i];
      // ignore BetterScroll instance's wrapper DOM
      /* istanbul ignore if  */
      if (node.isBScrollContainer) {
        continue;
      }
      node.style.pointerEvents = pointerEvents;
    }
  };
  Scroller.prototype.refresh = function (content) {
    var contentChanged = this.setContent(content);
    this.hooks.trigger(this.hooks.eventTypes.beforeRefresh);
    this.scrollBehaviorX.refresh(content);
    this.scrollBehaviorY.refresh(content);
    if (contentChanged) {
      this.translater.setContent(content);
      this.animater.setContent(content);
      this.transitionEndRegister.destroy();
      this.registerTransitionEnd();
      if (this.options.bindToTarget) {
        this.actionsHandler.setContent(content);
      }
    }
    this.actions.refresh();
    this.wrapperOffset = offset(this.wrapper);
  };
  Scroller.prototype.setContent = function (content) {
    var contentChanged = content !== this.content;
    if (contentChanged) {
      this.content = content;
    }
    return contentChanged;
  };
  Scroller.prototype.scrollBy = function (deltaX, deltaY, time, easing) {
    if (time === void 0) {
      time = 0;
    }
    var _a = this.getCurrentPos(),
      x = _a.x,
      y = _a.y;
    easing = !easing ? ease.bounce : easing;
    deltaX += x;
    deltaY += y;
    this.scrollTo(deltaX, deltaY, time, easing);
  };
  Scroller.prototype.scrollTo = function (x, y, time, easing, extraTransform) {
    if (time === void 0) {
      time = 0;
    }
    if (easing === void 0) {
      easing = ease.bounce;
    }
    if (extraTransform === void 0) {
      extraTransform = {
        start: {},
        end: {}
      };
    }
    var easingFn = this.options.useTransition ? easing.style : easing.fn;
    var currentPos = this.getCurrentPos();
    var startPoint = __assign({
      x: currentPos.x,
      y: currentPos.y
    }, extraTransform.start);
    var endPoint = __assign({
      x: x,
      y: y
    }, extraTransform.end);
    this.hooks.trigger(this.hooks.eventTypes.scrollTo, endPoint);
    // it is an useless move
    if (isSamePoint(startPoint, endPoint)) return;
    var deltaX = Math.abs(endPoint.x - startPoint.x);
    var deltaY = Math.abs(endPoint.y - startPoint.y);
    // considering of browser compatibility for decimal transform value
    // force translating immediately
    if (deltaX < MIN_SCROLL_DISTANCE && deltaY < MIN_SCROLL_DISTANCE) {
      time = 0;
      this.hooks.trigger(this.hooks.eventTypes.minDistanceScroll);
    }
    this.animater.move(startPoint, endPoint, time, easingFn);
  };
  Scroller.prototype.scrollToElement = function (el, time, offsetX, offsetY, easing) {
    var targetEle = getElement(el);
    var pos = offset(targetEle);
    var getOffset = function (offset, size, wrapperSize) {
      if (typeof offset === 'number') {
        return offset;
      }
      // if offsetX/Y are true we center the element to the screen
      return offset ? Math.round(size / 2 - wrapperSize / 2) : 0;
    };
    offsetX = getOffset(offsetX, targetEle.offsetWidth, this.wrapper.offsetWidth);
    offsetY = getOffset(offsetY, targetEle.offsetHeight, this.wrapper.offsetHeight);
    var getPos = function (pos, wrapperPos, offset, scrollBehavior) {
      pos -= wrapperPos;
      pos = scrollBehavior.adjustPosition(pos - offset);
      return pos;
    };
    pos.left = getPos(pos.left, this.wrapperOffset.left, offsetX, this.scrollBehaviorX);
    pos.top = getPos(pos.top, this.wrapperOffset.top, offsetY, this.scrollBehaviorY);
    if (this.hooks.trigger(this.hooks.eventTypes.scrollToElement, targetEle, pos)) {
      return;
    }
    this.scrollTo(pos.left, pos.top, time, easing);
  };
  Scroller.prototype.resetPosition = function (time, easing) {
    if (time === void 0) {
      time = 0;
    }
    if (easing === void 0) {
      easing = ease.bounce;
    }
    var _a = this.scrollBehaviorX.checkInBoundary(),
      x = _a.position,
      xInBoundary = _a.inBoundary;
    var _b = this.scrollBehaviorY.checkInBoundary(),
      y = _b.position,
      yInBoundary = _b.inBoundary;
    if (xInBoundary && yInBoundary) {
      return false;
    }
    /* istanbul ignore if  */
    if (isIOSBadVersion) {
      // fix ios 13.4 bouncing
      // see it in issues 982
      this.reflow();
    }
    // out of boundary
    this.scrollTo(x, y, time, easing);
    return true;
  };
  /* istanbul ignore next */
  Scroller.prototype.reflow = function () {
    this._reflow = this.content.offsetHeight;
  };
  Scroller.prototype.updatePositions = function (pos) {
    this.scrollBehaviorX.updatePosition(pos.x);
    this.scrollBehaviorY.updatePosition(pos.y);
  };
  Scroller.prototype.getCurrentPos = function () {
    return this.actions.getCurrentPos();
  };
  Scroller.prototype.enable = function () {
    this.actions.enabled = true;
  };
  Scroller.prototype.disable = function () {
    cancelAnimationFrame$1(this.animater.timer);
    this.actions.enabled = false;
  };
  Scroller.prototype.destroy = function () {
    var _this = this;
    var keys = ['resizeRegister', 'transitionEndRegister', 'actionsHandler', 'actions', 'hooks', 'animater', 'translater', 'scrollBehaviorX', 'scrollBehaviorY'];
    keys.forEach(function (key) {
      return _this[key].destroy();
    });
  };
  return Scroller;
}();
var BScrollConstructor = /** @class */function (_super) {
  __extends(BScrollConstructor, _super);
  function BScrollConstructor(el, options) {
    var _this = _super.call(this, ['refresh', 'contentChanged', 'enable', 'disable', 'beforeScrollStart', 'scrollStart', 'scroll', 'scrollEnd', 'scrollCancel', 'touchEnd', 'flick', 'destroy']) || this;
    var wrapper = getElement(el);
    if (!wrapper) {
      warn('Can not resolve the wrapper DOM.');
      return _this;
    }
    _this.plugins = {};
    _this.options = new OptionsConstructor().merge(options).process();
    if (!_this.setContent(wrapper).valid) {
      return _this;
    }
    _this.hooks = new EventEmitter(['refresh', 'enable', 'disable', 'destroy', 'beforeInitialScrollTo', 'contentChanged']);
    _this.init(wrapper);
    return _this;
  }
  BScrollConstructor.use = function (ctor) {
    var name = ctor.pluginName;
    var installed = BScrollConstructor.plugins.some(function (plugin) {
      return ctor === plugin.ctor;
    });
    if (installed) return BScrollConstructor;
    if (isUndef(name)) {
      warn("Plugin Class must specify plugin's name in static property by 'pluginName' field.");
      return BScrollConstructor;
    }
    BScrollConstructor.pluginsMap[name] = true;
    BScrollConstructor.plugins.push({
      name: name,
      applyOrder: ctor.applyOrder,
      ctor: ctor
    });
    return BScrollConstructor;
  };
  BScrollConstructor.prototype.setContent = function (wrapper) {
    var contentChanged = false;
    var valid = true;
    var content = wrapper.children[this.options.specifiedIndexAsContent];
    if (!content) {
      warn('The wrapper need at least one child element to be content element to scroll.');
      valid = false;
    } else {
      contentChanged = this.content !== content;
      if (contentChanged) {
        this.content = content;
      }
    }
    return {
      valid: valid,
      contentChanged: contentChanged
    };
  };
  BScrollConstructor.prototype.init = function (wrapper) {
    var _this = this;
    this.wrapper = wrapper;
    // mark wrapper to recognize bs instance by DOM attribute
    wrapper.isBScrollContainer = true;
    this.scroller = new Scroller(wrapper, this.content, this.options);
    this.scroller.hooks.on(this.scroller.hooks.eventTypes.resize, function () {
      _this.refresh();
    });
    this.eventBubbling();
    this.handleAutoBlur();
    this.enable();
    this.proxy(propertiesConfig$7);
    this.applyPlugins();
    // maybe boundary has changed, should refresh
    this.refreshWithoutReset(this.content);
    var _a = this.options,
      startX = _a.startX,
      startY = _a.startY;
    var position = {
      x: startX,
      y: startY
    };
    // maybe plugins want to control scroll position
    if (this.hooks.trigger(this.hooks.eventTypes.beforeInitialScrollTo, position)) {
      return;
    }
    this.scroller.scrollTo(position.x, position.y);
  };
  BScrollConstructor.prototype.applyPlugins = function () {
    var _this = this;
    var options = this.options;
    BScrollConstructor.plugins.sort(function (a, b) {
      var _a;
      var applyOrderMap = (_a = {}, _a["pre" /* Pre */] = -1, _a["post" /* Post */] = 1, _a);
      var aOrder = a.applyOrder ? applyOrderMap[a.applyOrder] : 0;
      var bOrder = b.applyOrder ? applyOrderMap[b.applyOrder] : 0;
      return aOrder - bOrder;
    }).forEach(function (item) {
      var ctor = item.ctor;
      if (options[item.name] && typeof ctor === 'function') {
        _this.plugins[item.name] = new ctor(_this);
      }
    });
  };
  BScrollConstructor.prototype.handleAutoBlur = function () {
    /* istanbul ignore if  */
    if (this.options.autoBlur) {
      this.on(this.eventTypes.beforeScrollStart, function () {
        var activeElement = document.activeElement;
        if (activeElement && (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA')) {
          activeElement.blur();
        }
      });
    }
  };
  BScrollConstructor.prototype.eventBubbling = function () {
    bubbling(this.scroller.hooks, this, [this.eventTypes.beforeScrollStart, this.eventTypes.scrollStart, this.eventTypes.scroll, this.eventTypes.scrollEnd, this.eventTypes.scrollCancel, this.eventTypes.touchEnd, this.eventTypes.flick]);
  };
  BScrollConstructor.prototype.refreshWithoutReset = function (content) {
    this.scroller.refresh(content);
    this.hooks.trigger(this.hooks.eventTypes.refresh, content);
    this.trigger(this.eventTypes.refresh, content);
  };
  BScrollConstructor.prototype.proxy = function (propertiesConfig) {
    var _this = this;
    propertiesConfig.forEach(function (_a) {
      var key = _a.key,
        sourceKey = _a.sourceKey;
      propertiesProxy(_this, sourceKey, key);
    });
  };
  BScrollConstructor.prototype.refresh = function () {
    var _a = this.setContent(this.wrapper),
      contentChanged = _a.contentChanged,
      valid = _a.valid;
    if (valid) {
      var content = this.content;
      this.refreshWithoutReset(content);
      if (contentChanged) {
        this.hooks.trigger(this.hooks.eventTypes.contentChanged, content);
        this.trigger(this.eventTypes.contentChanged, content);
      }
      this.scroller.resetPosition();
    }
  };
  BScrollConstructor.prototype.enable = function () {
    this.scroller.enable();
    this.hooks.trigger(this.hooks.eventTypes.enable);
    this.trigger(this.eventTypes.enable);
  };
  BScrollConstructor.prototype.disable = function () {
    this.scroller.disable();
    this.hooks.trigger(this.hooks.eventTypes.disable);
    this.trigger(this.eventTypes.disable);
  };
  BScrollConstructor.prototype.destroy = function () {
    this.hooks.trigger(this.hooks.eventTypes.destroy);
    this.trigger(this.eventTypes.destroy);
    this.scroller.destroy();
  };
  BScrollConstructor.prototype.eventRegister = function (names) {
    this.registerType(names);
  };
  BScrollConstructor.plugins = [];
  BScrollConstructor.pluginsMap = {};
  return BScrollConstructor;
}(EventEmitter);
function createBScroll(el, options) {
  var bs = new BScrollConstructor(el, options);
  return bs;
}
createBScroll.use = BScrollConstructor.use;
createBScroll.plugins = BScrollConstructor.plugins;
createBScroll.pluginsMap = BScrollConstructor.pluginsMap;
var BScroll = createBScroll;
var MouseWheel = /** @class */function () {
  function MouseWheel(scroll) {
    this.scroll = scroll;
    this.wheelEndTimer = 0;
    this.wheelMoveTimer = 0;
    this.wheelStart = false;
    this.init();
  }
  MouseWheel.prototype.init = function () {
    this.handleBScroll();
    this.handleOptions();
    this.handleHooks();
    this.registerEvent();
  };
  MouseWheel.prototype.handleBScroll = function () {
    this.scroll.registerType(['alterOptions', 'mousewheelStart', 'mousewheelMove', 'mousewheelEnd']);
  };
  MouseWheel.prototype.handleOptions = function () {
    var userOptions = this.scroll.options.mouseWheel === true ? {} : this.scroll.options.mouseWheel;
    var defaultOptions = {
      speed: 20,
      invert: false,
      easeTime: 300,
      discreteTime: 400,
      throttleTime: 0,
      dampingFactor: 0.1
    };
    this.mouseWheelOpt = extend(defaultOptions, userOptions);
  };
  MouseWheel.prototype.handleHooks = function () {
    this.hooksFn = [];
    this.registerHooks(this.scroll.hooks, 'destroy', this.destroy);
  };
  MouseWheel.prototype.registerEvent = function () {
    this.eventRegister = new EventRegister(this.scroll.scroller.wrapper, [{
      name: 'wheel',
      handler: this.wheelHandler.bind(this)
    }, {
      name: 'mousewheel',
      handler: this.wheelHandler.bind(this)
    }, {
      name: 'DOMMouseScroll',
      handler: this.wheelHandler.bind(this)
    }]);
  };
  MouseWheel.prototype.registerHooks = function (hooks, name, handler) {
    hooks.on(name, handler, this);
    this.hooksFn.push([hooks, name, handler]);
  };
  MouseWheel.prototype.wheelHandler = function (e) {
    if (!this.scroll.enabled) {
      return;
    }
    this.beforeHandler(e);
    // start
    if (!this.wheelStart) {
      this.wheelStartHandler(e);
      this.wheelStart = true;
    }
    // move
    var delta = this.getWheelDelta(e);
    this.wheelMoveHandler(delta);
    // end
    this.wheelEndDetector(delta);
  };
  MouseWheel.prototype.wheelStartHandler = function (e) {
    this.cleanCache();
    var _a = this.scroll.scroller,
      scrollBehaviorX = _a.scrollBehaviorX,
      scrollBehaviorY = _a.scrollBehaviorY;
    scrollBehaviorX.setMovingDirection(0 /* Default */);
    scrollBehaviorY.setMovingDirection(0 /* Default */);
    scrollBehaviorX.setDirection(0 /* Default */);
    scrollBehaviorY.setDirection(0 /* Default */);
    this.scroll.trigger(this.scroll.eventTypes.alterOptions, this.mouseWheelOpt);
    this.scroll.trigger(this.scroll.eventTypes.mousewheelStart);
  };
  MouseWheel.prototype.cleanCache = function () {
    this.deltaCache = [];
  };
  MouseWheel.prototype.wheelMoveHandler = function (delta) {
    var _this = this;
    var _a = this.mouseWheelOpt,
      throttleTime = _a.throttleTime,
      dampingFactor = _a.dampingFactor;
    if (throttleTime && this.wheelMoveTimer) {
      this.deltaCache.push(delta);
    } else {
      var cachedDelta = this.deltaCache.reduce(function (prev, current) {
        return {
          x: prev.x + current.x,
          y: prev.y + current.y
        };
      }, {
        x: 0,
        y: 0
      });
      this.cleanCache();
      var _b = this.scroll.scroller,
        scrollBehaviorX = _b.scrollBehaviorX,
        scrollBehaviorY = _b.scrollBehaviorY;
      scrollBehaviorX.setMovingDirection(-delta.directionX);
      scrollBehaviorY.setMovingDirection(-delta.directionY);
      scrollBehaviorX.setDirection(delta.x);
      scrollBehaviorY.setDirection(delta.y);
      // when out of boundary, perform a damping scroll
      var newX = scrollBehaviorX.performDampingAlgorithm(Math.round(delta.x) + cachedDelta.x, dampingFactor);
      var newY = scrollBehaviorY.performDampingAlgorithm(Math.round(delta.y) + cachedDelta.x, dampingFactor);
      if (!this.scroll.trigger(this.scroll.eventTypes.mousewheelMove, {
        x: newX,
        y: newY
      })) {
        var easeTime = this.getEaseTime();
        if (newX !== this.scroll.x || newY !== this.scroll.y) {
          this.scroll.scrollTo(newX, newY, easeTime);
        }
      }
      if (throttleTime) {
        this.wheelMoveTimer = window.setTimeout(function () {
          _this.wheelMoveTimer = 0;
        }, throttleTime);
      }
    }
  };
  MouseWheel.prototype.wheelEndDetector = function (delta) {
    var _this = this;
    window.clearTimeout(this.wheelEndTimer);
    this.wheelEndTimer = window.setTimeout(function () {
      _this.wheelStart = false;
      window.clearTimeout(_this.wheelMoveTimer);
      _this.wheelMoveTimer = 0;
      _this.scroll.trigger(_this.scroll.eventTypes.mousewheelEnd, delta);
    }, this.mouseWheelOpt.discreteTime);
  };
  MouseWheel.prototype.getWheelDelta = function (e) {
    var _a = this.mouseWheelOpt,
      speed = _a.speed,
      invert = _a.invert;
    var wheelDeltaX = 0;
    var wheelDeltaY = 0;
    var direction = invert ? -1 /* Negative */ : 1 /* Positive */;
    switch (true) {
      case 'deltaX' in e:
        if (e.deltaMode === 1) {
          wheelDeltaX = -e.deltaX * speed;
          wheelDeltaY = -e.deltaY * speed;
        } else {
          wheelDeltaX = -e.deltaX;
          wheelDeltaY = -e.deltaY;
        }
        break;
      case 'wheelDeltaX' in e:
        wheelDeltaX = e.wheelDeltaX / 120 * speed;
        wheelDeltaY = e.wheelDeltaY / 120 * speed;
        break;
      case 'wheelDelta' in e:
        wheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * speed;
        break;
      case 'detail' in e:
        wheelDeltaX = wheelDeltaY = -e.detail / 3 * speed;
        break;
    }
    wheelDeltaX *= direction;
    wheelDeltaY *= direction;
    if (!this.scroll.hasVerticalScroll) {
      if (Math.abs(wheelDeltaY) > Math.abs(wheelDeltaX)) {
        wheelDeltaX = wheelDeltaY;
      }
      wheelDeltaY = 0;
    }
    if (!this.scroll.hasHorizontalScroll) {
      wheelDeltaX = 0;
    }
    var directionX = wheelDeltaX > 0 ? -1 /* Negative */ : wheelDeltaX < 0 ? 1 /* Positive */ : 0 /* Default */;
    var directionY = wheelDeltaY > 0 ? -1 /* Negative */ : wheelDeltaY < 0 ? 1 /* Positive */ : 0 /* Default */;
    return {
      x: wheelDeltaX,
      y: wheelDeltaY,
      directionX: directionX,
      directionY: directionY
    };
  };
  MouseWheel.prototype.beforeHandler = function (e) {
    var _a = this.scroll.options,
      preventDefault = _a.preventDefault,
      stopPropagation = _a.stopPropagation,
      preventDefaultException = _a.preventDefaultException;
    if (preventDefault && !preventDefaultExceptionFn(e.target, preventDefaultException)) {
      maybePrevent(e);
    }
    if (stopPropagation) {
      e.stopPropagation();
    }
  };
  MouseWheel.prototype.getEaseTime = function () {
    var SAFE_EASETIME = 100;
    var easeTime = this.mouseWheelOpt.easeTime;
    // scrollEnd event will be triggered in every calling of scrollTo when easeTime is too small
    // easeTime needs to be greater than 100
    if (easeTime < SAFE_EASETIME) {
      warn("easeTime should be greater than 100." + "If mouseWheel easeTime is too small," + "scrollEnd will be triggered many times.");
    }
    return Math.max(easeTime, SAFE_EASETIME);
  };
  MouseWheel.prototype.destroy = function () {
    this.eventRegister.destroy();
    window.clearTimeout(this.wheelEndTimer);
    window.clearTimeout(this.wheelMoveTimer);
    this.hooksFn.forEach(function (item) {
      var hooks = item[0];
      var hooksName = item[1];
      var handlerFn = item[2];
      hooks.off(hooksName, handlerFn);
    });
  };
  MouseWheel.pluginName = 'mouseWheel';
  MouseWheel.applyOrder = "pre" /* Pre */;
  return MouseWheel;
}();
var ObserveDOM = /** @class */function () {
  function ObserveDOM(scroll) {
    this.scroll = scroll;
    this.stopObserver = false;
    this.init();
  }
  ObserveDOM.prototype.init = function () {
    this.handleMutationObserver();
    this.handleHooks();
  };
  ObserveDOM.prototype.handleMutationObserver = function () {
    var _this = this;
    if (typeof MutationObserver !== 'undefined') {
      var timer_1 = 0;
      this.observer = new MutationObserver(function (mutations) {
        _this.mutationObserverHandler(mutations, timer_1);
      });
      this.startObserve(this.observer);
    } else {
      this.checkDOMUpdate();
    }
  };
  ObserveDOM.prototype.handleHooks = function () {
    var _this = this;
    this.hooksFn = [];
    this.registerHooks(this.scroll.hooks, this.scroll.hooks.eventTypes.contentChanged, function () {
      _this.stopObserve();
      // launch a new mutationObserver
      _this.handleMutationObserver();
    });
    this.registerHooks(this.scroll.hooks, this.scroll.hooks.eventTypes.enable, function () {
      if (_this.stopObserver) {
        _this.handleMutationObserver();
      }
    });
    this.registerHooks(this.scroll.hooks, this.scroll.hooks.eventTypes.disable, function () {
      _this.stopObserve();
    });
    this.registerHooks(this.scroll.hooks, this.scroll.hooks.eventTypes.destroy, function () {
      _this.destroy();
    });
  };
  ObserveDOM.prototype.mutationObserverHandler = function (mutations, timer) {
    var _this = this;
    if (this.shouldNotRefresh()) {
      return;
    }
    var immediateRefresh = false;
    var deferredRefresh = false;
    for (var i = 0; i < mutations.length; i++) {
      var mutation = mutations[i];
      if (mutation.type !== 'attributes') {
        immediateRefresh = true;
        break;
      } else {
        if (mutation.target !== this.scroll.scroller.content) {
          deferredRefresh = true;
          break;
        }
      }
    }
    if (immediateRefresh) {
      this.scroll.refresh();
    } else if (deferredRefresh) {
      // attributes changes too often
      clearTimeout(timer);
      timer = window.setTimeout(function () {
        if (!_this.shouldNotRefresh()) {
          _this.scroll.refresh();
        }
      }, 60);
    }
  };
  ObserveDOM.prototype.startObserve = function (observer) {
    var config = {
      attributes: true,
      childList: true,
      subtree: true
    };
    observer.observe(this.scroll.scroller.content, config);
  };
  ObserveDOM.prototype.shouldNotRefresh = function () {
    var scroller = this.scroll.scroller;
    var scrollBehaviorX = scroller.scrollBehaviorX,
      scrollBehaviorY = scroller.scrollBehaviorY;
    var outsideBoundaries = scrollBehaviorX.currentPos > scrollBehaviorX.minScrollPos || scrollBehaviorX.currentPos < scrollBehaviorX.maxScrollPos || scrollBehaviorY.currentPos > scrollBehaviorY.minScrollPos || scrollBehaviorY.currentPos < scrollBehaviorY.maxScrollPos;
    return scroller.animater.pending || outsideBoundaries;
  };
  ObserveDOM.prototype.checkDOMUpdate = function () {
    var _this = this;
    var content = this.scroll.scroller.content;
    var contentRect = getRect(content);
    var oldWidth = contentRect.width;
    var oldHeight = contentRect.height;
    var check = function () {
      if (_this.stopObserver) {
        return;
      }
      contentRect = getRect(content);
      var newWidth = contentRect.width;
      var newHeight = contentRect.height;
      if (oldWidth !== newWidth || oldHeight !== newHeight) {
        _this.scroll.refresh();
      }
      oldWidth = newWidth;
      oldHeight = newHeight;
      next();
    };
    var next = function () {
      setTimeout(function () {
        check();
      }, 1000);
    };
    next();
  };
  ObserveDOM.prototype.registerHooks = function (hooks, name, handler) {
    hooks.on(name, handler, this);
    this.hooksFn.push([hooks, name, handler]);
  };
  ObserveDOM.prototype.stopObserve = function () {
    this.stopObserver = true;
    if (this.observer) {
      this.observer.disconnect();
    }
  };
  ObserveDOM.prototype.destroy = function () {
    this.stopObserve();
    this.hooksFn.forEach(function (item) {
      var hooks = item[0];
      var hooksName = item[1];
      var handlerFn = item[2];
      hooks.off(hooksName, handlerFn);
    });
    this.hooksFn.length = 0;
  };
  ObserveDOM.pluginName = 'observeDOM';
  return ObserveDOM;
}();
var sourcePrefix$6 = 'plugins.pullDownRefresh';
var propertiesMap$6 = [{
  key: 'finishPullDown',
  name: 'finishPullDown'
}, {
  key: 'openPullDown',
  name: 'openPullDown'
}, {
  key: 'closePullDown',
  name: 'closePullDown'
}, {
  key: 'autoPullDownRefresh',
  name: 'autoPullDownRefresh'
}];
var propertiesConfig$6 = propertiesMap$6.map(function (item) {
  return {
    key: item.key,
    sourceKey: sourcePrefix$6 + "." + item.name
  };
});
var PULLING_DOWN_EVENT = 'pullingDown';
var ENTER_THRESHOLD_EVENT = 'enterThreshold';
var LEAVE_THRESHOLD_EVENT = 'leaveThreshold';
var PullDown = /** @class */function () {
  function PullDown(scroll) {
    this.scroll = scroll;
    this.pulling = 0 /* DEFAULT */;
    this.thresholdBoundary = 0 /* DEFAULT */;
    this.init();
  }
  PullDown.prototype.setPulling = function (status) {
    this.pulling = status;
  };
  PullDown.prototype.setThresholdBoundary = function (boundary) {
    this.thresholdBoundary = boundary;
  };
  PullDown.prototype.init = function () {
    this.handleBScroll();
    this.handleOptions(this.scroll.options.pullDownRefresh);
    this.handleHooks();
    this.watch();
  };
  PullDown.prototype.handleBScroll = function () {
    this.scroll.registerType([PULLING_DOWN_EVENT, ENTER_THRESHOLD_EVENT, LEAVE_THRESHOLD_EVENT]);
    this.scroll.proxy(propertiesConfig$6);
  };
  PullDown.prototype.handleOptions = function (userOptions) {
    if (userOptions === void 0) {
      userOptions = {};
    }
    userOptions = userOptions === true ? {} : userOptions;
    var defaultOptions = {
      threshold: 90,
      stop: 40
    };
    this.options = extend(defaultOptions, userOptions);
    this.scroll.options.probeType = 3 /* Realtime */;
  };
  PullDown.prototype.handleHooks = function () {
    var _this = this;
    this.hooksFn = [];
    var scroller = this.scroll.scroller;
    var scrollBehaviorY = scroller.scrollBehaviorY;
    this.currentMinScrollY = this.cachedOriginanMinScrollY = scrollBehaviorY.minScrollPos;
    this.registerHooks(this.scroll.hooks, this.scroll.hooks.eventTypes.contentChanged, function () {
      _this.finishPullDown();
    });
    this.registerHooks(scrollBehaviorY.hooks, scrollBehaviorY.hooks.eventTypes.computeBoundary, function (boundary) {
      // content is smaller than wrapper
      if (boundary.maxScrollPos > 0) {
        // allow scrolling when content is not full of wrapper
        boundary.maxScrollPos = -1;
      }
      boundary.minScrollPos = _this.currentMinScrollY;
    });
    // integrate with mousewheel
    if (this.hasMouseWheelPlugin()) {
      this.registerHooks(this.scroll, this.scroll.eventTypes.alterOptions, function (mouseWheelOptions) {
        var SANE_DISCRETE_TIME = 300;
        var SANE_EASE_TIME = 350;
        mouseWheelOptions.discreteTime = SANE_DISCRETE_TIME;
        // easeTime > discreteTime ensure goInto checkPullDown function
        mouseWheelOptions.easeTime = SANE_EASE_TIME;
      });
      this.registerHooks(this.scroll, this.scroll.eventTypes.mousewheelEnd, function () {
        // mouseWheel need trigger checkPullDown manually
        scroller.hooks.trigger(scroller.hooks.eventTypes.end);
      });
    }
  };
  PullDown.prototype.registerHooks = function (hooks, name, handler) {
    hooks.on(name, handler, this);
    this.hooksFn.push([hooks, name, handler]);
  };
  PullDown.prototype.hasMouseWheelPlugin = function () {
    return !!this.scroll.eventTypes.alterOptions;
  };
  PullDown.prototype.watch = function () {
    var scroller = this.scroll.scroller;
    this.watching = true;
    this.registerHooks(scroller.hooks, scroller.hooks.eventTypes.end, this.checkPullDown);
    this.registerHooks(this.scroll, this.scroll.eventTypes.scrollStart, this.resetStateBeforeScrollStart);
    this.registerHooks(this.scroll, this.scroll.eventTypes.scroll, this.checkLocationOfThresholdBoundary);
    if (this.hasMouseWheelPlugin()) {
      this.registerHooks(this.scroll, this.scroll.eventTypes.mousewheelStart, this.resetStateBeforeScrollStart);
    }
  };
  PullDown.prototype.resetStateBeforeScrollStart = function () {
    // current fetching pulldownRefresh has ended
    if (!this.isFetchingStatus()) {
      this.setPulling(1 /* MOVING */);
      this.setThresholdBoundary(0 /* DEFAULT */);
    }
  };
  PullDown.prototype.checkLocationOfThresholdBoundary = function () {
    // pulldownRefresh is in the phase of Moving
    if (this.pulling === 1 /* MOVING */) {
      var scroll_1 = this.scroll;
      // enter threshold boundary
      var enteredThresholdBoundary = this.thresholdBoundary !== 1 /* INSIDE */ && this.locateInsideThresholdBoundary();
      // leave threshold boundary
      var leftThresholdBoundary = this.thresholdBoundary !== 2 /* OUTSIDE */ && !this.locateInsideThresholdBoundary();
      if (enteredThresholdBoundary) {
        this.setThresholdBoundary(1 /* INSIDE */);
        scroll_1.trigger(ENTER_THRESHOLD_EVENT);
      }
      if (leftThresholdBoundary) {
        this.setThresholdBoundary(2 /* OUTSIDE */);
        scroll_1.trigger(LEAVE_THRESHOLD_EVENT);
      }
    }
  };
  PullDown.prototype.locateInsideThresholdBoundary = function () {
    return this.scroll.y <= this.options.threshold;
  };
  PullDown.prototype.unwatch = function () {
    var scroll = this.scroll;
    var scroller = scroll.scroller;
    this.watching = false;
    scroller.hooks.off(scroller.hooks.eventTypes.end, this.checkPullDown);
    scroll.off(scroll.eventTypes.scrollStart, this.resetStateBeforeScrollStart);
    scroll.off(scroll.eventTypes.scroll, this.checkLocationOfThresholdBoundary);
    if (this.hasMouseWheelPlugin()) {
      scroll.off(scroll.eventTypes.mousewheelStart, this.resetStateBeforeScrollStart);
    }
  };
  PullDown.prototype.checkPullDown = function () {
    var _a = this.options,
      threshold = _a.threshold,
      stop = _a.stop;
    // check if a real pull down action
    if (this.scroll.y < threshold) {
      return false;
    }
    if (this.pulling === 1 /* MOVING */) {
      this.modifyBehaviorYBoundary(stop);
      this.setPulling(2 /* FETCHING */);
      this.scroll.trigger(PULLING_DOWN_EVENT);
    }
    this.scroll.scrollTo(this.scroll.x, stop, this.scroll.options.bounceTime, ease.bounce);
    return this.isFetchingStatus();
  };
  PullDown.prototype.isFetchingStatus = function () {
    return this.pulling === 2 /* FETCHING */;
  };
  PullDown.prototype.modifyBehaviorYBoundary = function (stopDistance) {
    var scrollBehaviorY = this.scroll.scroller.scrollBehaviorY;
    // manually modify minScrollPos for a hang animation
    // to prevent from resetPosition
    this.cachedOriginanMinScrollY = scrollBehaviorY.minScrollPos;
    this.currentMinScrollY = stopDistance;
    scrollBehaviorY.computeBoundary();
  };
  PullDown.prototype.finishPullDown = function () {
    if (this.isFetchingStatus()) {
      var scrollBehaviorY = this.scroll.scroller.scrollBehaviorY;
      // restore minScrollY since the hang animation has ended
      this.currentMinScrollY = this.cachedOriginanMinScrollY;
      scrollBehaviorY.computeBoundary();
      this.setPulling(0 /* DEFAULT */);
      this.scroll.resetPosition(this.scroll.options.bounceTime, ease.bounce);
    }
  };
  // allow 'true' type is compat for beta version implements
  PullDown.prototype.openPullDown = function (config) {
    if (config === void 0) {
      config = {};
    }
    this.handleOptions(config);
    if (!this.watching) {
      this.watch();
    }
  };
  PullDown.prototype.closePullDown = function () {
    this.unwatch();
  };
  PullDown.prototype.autoPullDownRefresh = function () {
    var _a = this.options,
      threshold = _a.threshold,
      stop = _a.stop;
    if (this.isFetchingStatus() || !this.watching) {
      return;
    }
    this.modifyBehaviorYBoundary(stop);
    this.scroll.trigger(this.scroll.eventTypes.scrollStart);
    this.scroll.scrollTo(this.scroll.x, threshold);
    this.setPulling(2 /* FETCHING */);
    this.scroll.trigger(PULLING_DOWN_EVENT);
    this.scroll.scrollTo(this.scroll.x, stop, this.scroll.options.bounceTime, ease.bounce);
  };
  PullDown.pluginName = 'pullDownRefresh';
  return PullDown;
}();
var sourcePrefix$5 = 'plugins.pullUpLoad';
var propertiesMap$5 = [{
  key: 'finishPullUp',
  name: 'finishPullUp'
}, {
  key: 'openPullUp',
  name: 'openPullUp'
}, {
  key: 'closePullUp',
  name: 'closePullUp'
}, {
  key: 'autoPullUpLoad',
  name: 'autoPullUpLoad'
}];
var propertiesConfig$5 = propertiesMap$5.map(function (item) {
  return {
    key: item.key,
    sourceKey: sourcePrefix$5 + "." + item.name
  };
});
var PULL_UP_HOOKS_NAME = 'pullingUp';
var PullUp = /** @class */function () {
  function PullUp(scroll) {
    this.scroll = scroll;
    this.pulling = false;
    this.watching = false;
    this.init();
  }
  PullUp.prototype.init = function () {
    this.handleBScroll();
    this.handleOptions(this.scroll.options.pullUpLoad);
    this.handleHooks();
    this.watch();
  };
  PullUp.prototype.handleBScroll = function () {
    this.scroll.registerType([PULL_UP_HOOKS_NAME]);
    this.scroll.proxy(propertiesConfig$5);
  };
  PullUp.prototype.handleOptions = function (userOptions) {
    if (userOptions === void 0) {
      userOptions = {};
    }
    userOptions = userOptions === true ? {} : userOptions;
    var defaultOptions = {
      threshold: 0
    };
    this.options = extend(defaultOptions, userOptions);
    this.scroll.options.probeType = 3 /* Realtime */;
  };
  PullUp.prototype.handleHooks = function () {
    var _this = this;
    this.hooksFn = [];
    var scrollBehaviorY = this.scroll.scroller.scrollBehaviorY;
    this.registerHooks(this.scroll.hooks, this.scroll.hooks.eventTypes.contentChanged, function () {
      _this.finishPullUp();
    });
    this.registerHooks(scrollBehaviorY.hooks, scrollBehaviorY.hooks.eventTypes.computeBoundary, function (boundary) {
      // content is smaller than wrapper
      if (boundary.maxScrollPos > 0) {
        // allow scrolling when content is not full of wrapper
        boundary.maxScrollPos = -1;
      }
    });
  };
  PullUp.prototype.registerHooks = function (hooks, name, handler) {
    hooks.on(name, handler, this);
    this.hooksFn.push([hooks, name, handler]);
  };
  PullUp.prototype.watch = function () {
    if (this.watching) {
      return;
    }
    this.watching = true;
    this.registerHooks(this.scroll, this.scroll.eventTypes.scroll, this.checkPullUp);
  };
  PullUp.prototype.unwatch = function () {
    this.watching = false;
    this.scroll.off(this.scroll.eventTypes.scroll, this.checkPullUp);
  };
  PullUp.prototype.checkPullUp = function (pos) {
    var _this = this;
    var threshold = this.options.threshold;
    if (this.scroll.movingDirectionY === 1 /* Positive */ && pos.y <= this.scroll.maxScrollY + threshold) {
      this.pulling = true;
      // must reset pulling after scrollEnd
      this.scroll.once(this.scroll.eventTypes.scrollEnd, function () {
        _this.pulling = false;
      });
      this.unwatch();
      this.scroll.trigger(PULL_UP_HOOKS_NAME);
    }
  };
  PullUp.prototype.finishPullUp = function () {
    var _this = this;
    // reset Direction, fix #936
    this.scroll.scroller.scrollBehaviorY.setMovingDirection(0 /* Default */);
    if (this.pulling) {
      this.scroll.once(this.scroll.eventTypes.scrollEnd, function () {
        _this.watch();
      });
    } else {
      this.watch();
    }
  };
  // allow 'true' type is compat for beta version implements
  PullUp.prototype.openPullUp = function (config) {
    if (config === void 0) {
      config = {};
    }
    this.handleOptions(config);
    this.watch();
  };
  PullUp.prototype.closePullUp = function () {
    this.unwatch();
  };
  PullUp.prototype.autoPullUpLoad = function () {
    var threshold = this.options.threshold;
    var scrollBehaviorY = this.scroll.scroller.scrollBehaviorY;
    if (this.pulling || !this.watching) {
      return;
    }
    // simulate a pullUp action
    var NEGATIVE_VALUE = -1;
    var outOfBoundaryPos = scrollBehaviorY.maxScrollPos + threshold + NEGATIVE_VALUE;
    this.scroll.scroller.scrollBehaviorY.setMovingDirection(NEGATIVE_VALUE);
    this.scroll.scrollTo(this.scroll.x, outOfBoundaryPos, this.scroll.options.bounceTime);
  };
  PullUp.pluginName = 'pullUpLoad';
  return PullUp;
}();
var EventHandler = /** @class */function () {
  function EventHandler(indicator, options) {
    this.indicator = indicator;
    this.options = options;
    this.hooks = new EventEmitter(['touchStart', 'touchMove', 'touchEnd']);
    this.registerEvents();
  }
  EventHandler.prototype.registerEvents = function () {
    var _a = this.options,
      disableMouse = _a.disableMouse,
      disableTouch = _a.disableTouch;
    var startEvents = [];
    var moveEvents = [];
    var endEvents = [];
    if (!disableMouse) {
      startEvents.push({
        name: 'mousedown',
        handler: this.start.bind(this)
      });
      moveEvents.push({
        name: 'mousemove',
        handler: this.move.bind(this)
      });
      endEvents.push({
        name: 'mouseup',
        handler: this.end.bind(this)
      });
    }
    if (!disableTouch) {
      startEvents.push({
        name: 'touchstart',
        handler: this.start.bind(this)
      });
      moveEvents.push({
        name: 'touchmove',
        handler: this.move.bind(this)
      });
      endEvents.push({
        name: 'touchend',
        handler: this.end.bind(this)
      }, {
        name: 'touchcancel',
        handler: this.end.bind(this)
      });
    }
    this.startEventRegister = new EventRegister(this.indicator.indicatorEl, startEvents);
    this.moveEventRegister = new EventRegister(window, moveEvents);
    this.endEventRegister = new EventRegister(window, endEvents);
  };
  EventHandler.prototype.BScrollIsDisabled = function () {
    return !this.indicator.scroll.enabled;
  };
  EventHandler.prototype.start = function (e) {
    if (this.BScrollIsDisabled()) {
      return;
    }
    var point = e.touches ? e.touches[0] : e;
    maybePrevent(e);
    e.stopPropagation();
    this.initiated = true;
    this.lastPoint = point[this.indicator.keysMap.point];
    this.hooks.trigger(this.hooks.eventTypes.touchStart);
  };
  EventHandler.prototype.move = function (e) {
    if (!this.initiated) {
      return;
    }
    var point = e.touches ? e.touches[0] : e;
    var pointPos = point[this.indicator.keysMap.point];
    maybePrevent(e);
    e.stopPropagation();
    var delta = pointPos - this.lastPoint;
    this.lastPoint = pointPos;
    this.hooks.trigger(this.hooks.eventTypes.touchMove, delta);
  };
  EventHandler.prototype.end = function (e) {
    if (!this.initiated) {
      return;
    }
    this.initiated = false;
    maybePrevent(e);
    e.stopPropagation();
    this.hooks.trigger(this.hooks.eventTypes.touchEnd);
  };
  EventHandler.prototype.destroy = function () {
    this.startEventRegister.destroy();
    this.moveEventRegister.destroy();
    this.endEventRegister.destroy();
  };
  return EventHandler;
}();
var Indicator$1 = /** @class */function () {
  function Indicator(scroll, options) {
    this.scroll = scroll;
    this.options = options;
    this.hooksFn = [];
    this.wrapper = options.wrapper;
    this.direction = options.direction;
    this.indicatorEl = this.wrapper.children[0];
    this.keysMap = this.getKeysMap();
    this.handleFade();
    this.handleHooks();
  }
  Indicator.prototype.handleFade = function () {
    if (this.options.fade) {
      this.wrapper.style.opacity = '0';
    }
  };
  Indicator.prototype.handleHooks = function () {
    var _this = this;
    var _a = this.options,
      fade = _a.fade,
      interactive = _a.interactive,
      scrollbarTrackClickable = _a.scrollbarTrackClickable;
    var scroll = this.scroll;
    var scrollHooks = scroll.hooks;
    var translaterHooks = scroll.scroller.translater.hooks;
    var animaterHooks = scroll.scroller.animater.hooks;
    this.registerHooks(scrollHooks, scrollHooks.eventTypes.refresh, this.refresh);
    this.registerHooks(translaterHooks, translaterHooks.eventTypes.translate, function (pos) {
      var hasScrollKey = _this.keysMap.hasScroll;
      if (_this.scroll[hasScrollKey]) {
        _this.updatePosition(pos);
      }
    });
    this.registerHooks(animaterHooks, animaterHooks.eventTypes.time, this.transitionTime);
    this.registerHooks(animaterHooks, animaterHooks.eventTypes.timeFunction, this.transitionTimingFunction);
    if (fade) {
      this.registerHooks(scroll, scroll.eventTypes.scrollEnd, function () {
        _this.fade();
      });
      this.registerHooks(scroll, scroll.eventTypes.scrollStart, function () {
        _this.fade(true);
      });
      // for mousewheel event
      if (scroll.eventTypes.mousewheelStart && scroll.eventTypes.mousewheelEnd) {
        this.registerHooks(scroll, scroll.eventTypes.mousewheelStart, function () {
          _this.fade(true);
        });
        this.registerHooks(scroll, scroll.eventTypes.mousewheelMove, function () {
          _this.fade(true);
        });
        this.registerHooks(scroll, scroll.eventTypes.mousewheelEnd, function () {
          _this.fade();
        });
      }
    }
    if (interactive) {
      var _b = this.scroll.options,
        disableMouse = _b.disableMouse,
        disableTouch = _b.disableTouch;
      this.eventHandler = new EventHandler(this, {
        disableMouse: disableMouse,
        disableTouch: disableTouch
      });
      var eventHandlerHooks = this.eventHandler.hooks;
      this.registerHooks(eventHandlerHooks, eventHandlerHooks.eventTypes.touchStart, this.startHandler);
      this.registerHooks(eventHandlerHooks, eventHandlerHooks.eventTypes.touchMove, this.moveHandler);
      this.registerHooks(eventHandlerHooks, eventHandlerHooks.eventTypes.touchEnd, this.endHandler);
    }
    if (scrollbarTrackClickable) {
      this.bindClick();
    }
  };
  Indicator.prototype.registerHooks = function (hooks, name, handler) {
    hooks.on(name, handler, this);
    this.hooksFn.push([hooks, name, handler]);
  };
  Indicator.prototype.bindClick = function () {
    var wrapper = this.wrapper;
    this.clickEventRegister = new EventRegister(wrapper, [{
      name: 'click',
      handler: this.handleClick.bind(this)
    }]);
  };
  Indicator.prototype.handleClick = function (e) {
    var newPos = this.calculateclickOffsetPos(e);
    var _a = this.scroll,
      x = _a.x,
      y = _a.y;
    x = this.direction === "horizontal" /* Horizontal */ ? newPos : x;
    y = this.direction === "vertical" /* Vertical */ ? newPos : y;
    this.scroll.scrollTo(x, y, this.options.scrollbarTrackOffsetTime);
  };
  Indicator.prototype.calculateclickOffsetPos = function (e) {
    var _a = this.keysMap,
      poinKey = _a.point,
      domRectKey = _a.domRect;
    var scrollbarTrackOffsetType = this.options.scrollbarTrackOffsetType;
    var clickPointOffset = e[poinKey] - this.wrapperRect[domRectKey];
    var scrollToWhere = clickPointOffset < this.currentPos ? -1 /* Up */ : 1 /* Down */;
    var delta = 0;
    var currentPos = this.currentPos;
    if (scrollbarTrackOffsetType === "step" /* Step */) {
      delta = this.scrollInfo.baseSize * scrollToWhere;
    } else {
      delta = 0;
      currentPos = clickPointOffset;
    }
    return this.newPos(currentPos, delta, this.scrollInfo);
  };
  Indicator.prototype.getKeysMap = function () {
    if (this.direction === "vertical" /* Vertical */) {
      return {
        hasScroll: 'hasVerticalScroll',
        size: 'height',
        wrapperSize: 'clientHeight',
        scrollerSize: 'scrollerHeight',
        maxScrollPos: 'maxScrollY',
        pos: 'y',
        point: 'pageY',
        translateProperty: 'translateY',
        domRect: 'top'
      };
    }
    return {
      hasScroll: 'hasHorizontalScroll',
      size: 'width',
      wrapperSize: 'clientWidth',
      scrollerSize: 'scrollerWidth',
      maxScrollPos: 'maxScrollX',
      pos: 'x',
      point: 'pageX',
      translateProperty: 'translateX',
      domRect: 'left'
    };
  };
  Indicator.prototype.fade = function (visible) {
    var _a = this.options,
      fadeInTime = _a.fadeInTime,
      fadeOutTime = _a.fadeOutTime;
    var time = visible ? fadeInTime : fadeOutTime;
    var wrapper = this.wrapper;
    wrapper.style[style.transitionDuration] = time + 'ms';
    wrapper.style.opacity = visible ? '1' : '0';
  };
  Indicator.prototype.refresh = function () {
    var hasScrollKey = this.keysMap.hasScroll;
    var scroll = this.scroll;
    var x = scroll.x,
      y = scroll.y;
    this.wrapperRect = this.wrapper.getBoundingClientRect();
    if (this.canScroll(scroll[hasScrollKey])) {
      var _a = this.keysMap,
        wrapperSizeKey = _a.wrapperSize,
        scrollerSizeKey = _a.scrollerSize,
        maxScrollPosKey = _a.maxScrollPos;
      this.scrollInfo = this.refreshScrollInfo(this.wrapper[wrapperSizeKey], scroll[scrollerSizeKey], scroll[maxScrollPosKey], this.indicatorEl[wrapperSizeKey]);
      this.updatePosition({
        x: x,
        y: y
      });
    }
  };
  Indicator.prototype.transitionTime = function (time) {
    if (time === void 0) {
      time = 0;
    }
    this.indicatorEl.style[style.transitionDuration] = time + 'ms';
  };
  Indicator.prototype.transitionTimingFunction = function (easing) {
    this.indicatorEl.style[style.transitionTimingFunction] = easing;
  };
  Indicator.prototype.canScroll = function (hasScroll) {
    this.wrapper.style.display = hasScroll ? 'block' : 'none';
    return hasScroll;
  };
  Indicator.prototype.refreshScrollInfo = function (wrapperSize, scrollerSize, maxScrollPos, indicatorElSize) {
    var baseSize = Math.max(Math.round(wrapperSize * wrapperSize / (scrollerSize || wrapperSize || 1)), this.options.minSize);
    if (this.options.isCustom) {
      baseSize = indicatorElSize;
    }
    var maxIndicatorScrollPos = wrapperSize - baseSize;
    // sizeRatio is negative
    var sizeRatio = maxIndicatorScrollPos / maxScrollPos;
    return {
      baseSize: baseSize,
      maxScrollPos: maxIndicatorScrollPos,
      minScrollPos: 0,
      sizeRatio: sizeRatio
    };
  };
  Indicator.prototype.updatePosition = function (point) {
    var _a = this.caculatePosAndSize(point, this.scrollInfo),
      pos = _a.pos,
      size = _a.size;
    this.refreshStyle(size, pos);
    this.currentPos = pos;
  };
  Indicator.prototype.caculatePosAndSize = function (point, scrollInfo) {
    var posKey = this.keysMap.pos;
    var sizeRatio = scrollInfo.sizeRatio,
      baseSize = scrollInfo.baseSize,
      maxScrollPos = scrollInfo.maxScrollPos,
      minScrollPos = scrollInfo.minScrollPos;
    var minSize = this.options.minSize;
    var pos = Math.round(sizeRatio * point[posKey]);
    var size;
    // when out of boundary, slow down size reduction
    if (pos < minScrollPos) {
      size = Math.max(baseSize + pos * 3, minSize);
      pos = minScrollPos;
    } else if (pos > maxScrollPos) {
      size = Math.max(baseSize - (pos - maxScrollPos) * 3, minSize);
      pos = maxScrollPos + baseSize - size;
    } else {
      size = baseSize;
    }
    return {
      pos: pos,
      size: size
    };
  };
  Indicator.prototype.refreshStyle = function (size, pos) {
    var _a = this.keysMap,
      translatePropertyKey = _a.translateProperty,
      sizeKey = _a.size;
    var translateZ = this.scroll.options.translateZ;
    this.indicatorEl.style[sizeKey] = size + "px";
    this.indicatorEl.style[style.transform] = translatePropertyKey + "(" + pos + "px)" + translateZ;
  };
  Indicator.prototype.startHandler = function () {
    this.moved = false;
    this.startTime = getNow();
    this.transitionTime();
    this.scroll.scroller.hooks.trigger(this.scroll.scroller.hooks.eventTypes.beforeScrollStart);
  };
  Indicator.prototype.moveHandler = function (delta) {
    if (!this.moved && !this.indicatorNotMoved(delta)) {
      this.moved = true;
      this.scroll.scroller.hooks.trigger(this.scroll.scroller.hooks.eventTypes.scrollStart);
    }
    if (this.moved) {
      var newPos = this.newPos(this.currentPos, delta, this.scrollInfo);
      this.syncBScroll(newPos);
    }
  };
  Indicator.prototype.endHandler = function () {
    if (this.moved) {
      var _a = this.scroll,
        x = _a.x,
        y = _a.y;
      this.scroll.scroller.hooks.trigger(this.scroll.scroller.hooks.eventTypes.scrollEnd, {
        x: x,
        y: y
      });
    }
  };
  Indicator.prototype.indicatorNotMoved = function (delta) {
    var currentPos = this.currentPos;
    var _a = this.scrollInfo,
      maxScrollPos = _a.maxScrollPos,
      minScrollPos = _a.minScrollPos;
    var notMoved = currentPos === minScrollPos && delta <= 0 || currentPos === maxScrollPos && delta >= 0;
    return notMoved;
  };
  Indicator.prototype.syncBScroll = function (newPos) {
    var timestamp = getNow();
    var _a = this.scroll,
      x = _a.x,
      y = _a.y,
      options = _a.options,
      scroller = _a.scroller,
      maxScrollY = _a.maxScrollY,
      minScrollY = _a.minScrollY,
      maxScrollX = _a.maxScrollX,
      minScrollX = _a.minScrollX;
    var probeType = options.probeType,
      momentumLimitTime = options.momentumLimitTime;
    var position = {
      x: x,
      y: y
    };
    if (this.direction === "vertical" /* Vertical */) {
      position.y = between(newPos, maxScrollY, minScrollY);
    } else {
      position.x = between(newPos, maxScrollX, minScrollX);
    }
    scroller.translater.translate(position);
    // dispatch scroll in interval time
    if (timestamp - this.startTime > momentumLimitTime) {
      this.startTime = timestamp;
      if (probeType === 1 /* Throttle */) {
        scroller.hooks.trigger(scroller.hooks.eventTypes.scroll, position);
      }
    }
    // dispatch scroll all the time
    if (probeType > 1 /* Throttle */) {
      scroller.hooks.trigger(scroller.hooks.eventTypes.scroll, position);
    }
  };
  Indicator.prototype.newPos = function (currentPos, delta, scrollInfo) {
    var maxScrollPos = scrollInfo.maxScrollPos,
      sizeRatio = scrollInfo.sizeRatio,
      minScrollPos = scrollInfo.minScrollPos;
    var newPos = currentPos + delta;
    newPos = between(newPos, minScrollPos, maxScrollPos);
    return Math.round(newPos / sizeRatio);
  };
  Indicator.prototype.destroy = function () {
    var _a = this.options,
      interactive = _a.interactive,
      scrollbarTrackClickable = _a.scrollbarTrackClickable,
      isCustom = _a.isCustom;
    if (interactive) {
      this.eventHandler.destroy();
    }
    if (scrollbarTrackClickable) {
      this.clickEventRegister.destroy();
    }
    if (!isCustom) {
      this.wrapper.parentNode.removeChild(this.wrapper);
    }
    this.hooksFn.forEach(function (item) {
      var hooks = item[0];
      var hooksName = item[1];
      var handlerFn = item[2];
      hooks.off(hooksName, handlerFn);
    });
    this.hooksFn.length = 0;
  };
  return Indicator;
}();
var ScrollBar = /** @class */function () {
  function ScrollBar(scroll) {
    this.scroll = scroll;
    this.handleOptions();
    this.createIndicators();
    this.handleHooks();
  }
  ScrollBar.prototype.handleHooks = function () {
    var _this = this;
    var scroll = this.scroll;
    scroll.hooks.on(scroll.hooks.eventTypes.destroy, function () {
      for (var _i = 0, _a = _this.indicators; _i < _a.length; _i++) {
        var indicator = _a[_i];
        indicator.destroy();
      }
    });
  };
  ScrollBar.prototype.handleOptions = function () {
    var userOptions = this.scroll.options.scrollbar === true ? {} : this.scroll.options.scrollbar;
    var defaultOptions = {
      fade: true,
      fadeInTime: 250,
      fadeOutTime: 500,
      interactive: false,
      customElements: [],
      minSize: 8,
      scrollbarTrackClickable: false,
      scrollbarTrackOffsetType: "step" /* Step */,
      scrollbarTrackOffsetTime: 300
    };
    this.options = extend(defaultOptions, userOptions);
  };
  ScrollBar.prototype.createIndicators = function () {
    var indicatorOptions;
    var scroll = this.scroll;
    var indicators = [];
    var scrollDirectionConfigKeys = ['scrollX', 'scrollY'];
    var indicatorDirections = ["horizontal" /* Horizontal */, "vertical" /* Vertical */];
    var customScrollbarEls = this.options.customElements;
    for (var i = 0; i < scrollDirectionConfigKeys.length; i++) {
      var key = scrollDirectionConfigKeys[i];
      // wanna scroll in specified direction
      if (scroll.options[key]) {
        var customElement = customScrollbarEls.shift();
        var direction = indicatorDirections[i];
        var isCustom = false;
        var scrollbarWrapper = customElement ? customElement : this.createScrollbarElement(direction);
        // internal scrollbar
        if (scrollbarWrapper !== customElement) {
          scroll.wrapper.appendChild(scrollbarWrapper);
        } else {
          // custom scrollbar passed by users
          isCustom = true;
        }
        indicatorOptions = __assign(__assign({
          wrapper: scrollbarWrapper,
          direction: direction
        }, this.options), {
          isCustom: isCustom
        });
        indicators.push(new Indicator$1(scroll, indicatorOptions));
      }
    }
    this.indicators = indicators;
  };
  ScrollBar.prototype.createScrollbarElement = function (direction, scrollbarTrackClickable) {
    if (scrollbarTrackClickable === void 0) {
      scrollbarTrackClickable = this.options.scrollbarTrackClickable;
    }
    var scrollbarWrapperEl = document.createElement('div');
    var scrollbarIndicatorEl = document.createElement('div');
    scrollbarWrapperEl.style.cssText = 'position:absolute;z-index:9999;overflow:hidden;';
    scrollbarIndicatorEl.style.cssText = 'box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px;';
    scrollbarIndicatorEl.className = 'bscroll-indicator';
    if (direction === "horizontal" /* Horizontal */) {
      scrollbarWrapperEl.style.cssText += 'height:7px;left:2px;right:2px;bottom:0;';
      scrollbarIndicatorEl.style.height = '100%';
      scrollbarWrapperEl.className = 'bscroll-horizontal-scrollbar';
    } else {
      scrollbarWrapperEl.style.cssText += 'width:7px;bottom:2px;top:2px;right:1px;';
      scrollbarIndicatorEl.style.width = '100%';
      scrollbarWrapperEl.className = 'bscroll-vertical-scrollbar';
    }
    if (!scrollbarTrackClickable) {
      scrollbarWrapperEl.style.cssText += 'pointer-events:none;';
    }
    scrollbarWrapperEl.appendChild(scrollbarIndicatorEl);
    return scrollbarWrapperEl;
  };
  ScrollBar.pluginName = 'scrollbar';
  return ScrollBar;
}();
var BASE_PAGE = {
  pageX: 0,
  pageY: 0,
  x: 0,
  y: 0
};
var DEFAULT_PAGE_STATS = {
  x: 0,
  y: 0,
  width: 0,
  height: 0,
  cx: 0,
  cy: 0
};
var PagesMatrix = /** @class */function () {
  function PagesMatrix(scroll) {
    this.scroll = scroll;
    this.init();
  }
  PagesMatrix.prototype.init = function () {
    var scroller = this.scroll.scroller;
    var scrollBehaviorX = scroller.scrollBehaviorX,
      scrollBehaviorY = scroller.scrollBehaviorY;
    this.wrapperWidth = scrollBehaviorX.wrapperSize;
    this.wrapperHeight = scrollBehaviorY.wrapperSize;
    this.scrollerHeight = scrollBehaviorY.contentSize;
    this.scrollerWidth = scrollBehaviorX.contentSize;
    this.pages = this.buildPagesMatrix(this.wrapperWidth, this.wrapperHeight);
    this.pageLengthOfX = this.pages ? this.pages.length : 0;
    this.pageLengthOfY = this.pages && this.pages[0] ? this.pages[0].length : 0;
  };
  PagesMatrix.prototype.getPageStats = function (pageX, pageY) {
    // Returns the default Stats when no Stats are retrieved
    // Scene: When the `content` element is an empty bounding box, the return value of the `width/height` function of el.getBoundingClientRect is 0 and pages will be calculated as an empty array.
    // https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect
    return this.pages[pageX] && this.pages[pageX][pageY] ? this.pages[pageX][pageY] : DEFAULT_PAGE_STATS;
  };
  PagesMatrix.prototype.getNearestPageIndex = function (x, y) {
    var pageX = 0;
    var pageY = 0;
    var l = this.pages.length;
    for (; pageX < l - 1; pageX++) {
      if (x >= this.pages[pageX][0].cx) {
        break;
      }
    }
    l = this.pages[pageX] ? this.pages[pageX].length : 0;
    for (; pageY < l - 1; pageY++) {
      if (y >= this.pages[0][pageY].cy) {
        break;
      }
    }
    return {
      pageX: pageX,
      pageY: pageY
    };
  };
  // (n x 1) matrix for horizontal scroll or
  // (1 * n) matrix for vertical scroll
  PagesMatrix.prototype.buildPagesMatrix = function (stepX, stepY) {
    var pages = [];
    var x = 0;
    var y;
    var cx;
    var cy;
    var i = 0;
    var l;
    var maxScrollPosX = this.scroll.scroller.scrollBehaviorX.maxScrollPos;
    var maxScrollPosY = this.scroll.scroller.scrollBehaviorY.maxScrollPos;
    cx = Math.round(stepX / 2);
    cy = Math.round(stepY / 2);
    while (x > -this.scrollerWidth) {
      pages[i] = [];
      l = 0;
      y = 0;
      while (y > -this.scrollerHeight) {
        pages[i][l] = {
          x: Math.max(x, maxScrollPosX),
          y: Math.max(y, maxScrollPosY),
          width: stepX,
          height: stepY,
          cx: x - cx,
          cy: y - cy
        };
        y -= stepY;
        l++;
      }
      x -= stepX;
      i++;
    }
    return pages;
  };
  return PagesMatrix;
}();
var SlidePages = /** @class */function () {
  function SlidePages(scroll, slideOptions) {
    this.scroll = scroll;
    this.slideOptions = slideOptions;
    this.slideX = false;
    this.slideY = false;
    this.currentPage = extend({}, BASE_PAGE);
  }
  SlidePages.prototype.refresh = function () {
    this.pagesMatrix = new PagesMatrix(this.scroll);
    this.checkSlideLoop();
    this.currentPage = this.getAdjustedCurrentPage();
  };
  SlidePages.prototype.getAdjustedCurrentPage = function () {
    var _a = this.currentPage,
      pageX = _a.pageX,
      pageY = _a.pageY;
    // page index should be handled
    // because page counts may reduce
    pageX = Math.min(pageX, this.pagesMatrix.pageLengthOfX - 1);
    pageY = Math.min(pageY, this.pagesMatrix.pageLengthOfY - 1);
    // loop scene should also be respected
    // because clonedNode will cause pageLength increasing
    if (this.loopX) {
      pageX = Math.min(pageX, this.pagesMatrix.pageLengthOfX - 2);
    }
    if (this.loopY) {
      pageY = Math.min(pageY, this.pagesMatrix.pageLengthOfY - 2);
    }
    var _b = this.pagesMatrix.getPageStats(pageX, pageY),
      x = _b.x,
      y = _b.y;
    return {
      pageX: pageX,
      pageY: pageY,
      x: x,
      y: y
    };
  };
  SlidePages.prototype.setCurrentPage = function (newPage) {
    this.currentPage = newPage;
  };
  SlidePages.prototype.getInternalPage = function (pageX, pageY) {
    if (pageX >= this.pagesMatrix.pageLengthOfX) {
      pageX = this.pagesMatrix.pageLengthOfX - 1;
    } else if (pageX < 0) {
      pageX = 0;
    }
    if (pageY >= this.pagesMatrix.pageLengthOfY) {
      pageY = this.pagesMatrix.pageLengthOfY - 1;
    } else if (pageY < 0) {
      pageY = 0;
    }
    var _a = this.pagesMatrix.getPageStats(pageX, pageY),
      x = _a.x,
      y = _a.y;
    return {
      pageX: pageX,
      pageY: pageY,
      x: x,
      y: y
    };
  };
  SlidePages.prototype.getInitialPage = function (showFirstPage, firstInitialised) {
    if (showFirstPage === void 0) {
      showFirstPage = false;
    }
    if (firstInitialised === void 0) {
      firstInitialised = false;
    }
    var _a = this.slideOptions,
      startPageXIndex = _a.startPageXIndex,
      startPageYIndex = _a.startPageYIndex;
    var firstPageX = this.loopX ? 1 : 0;
    var firstPageY = this.loopY ? 1 : 0;
    var pageX = showFirstPage ? firstPageX : this.currentPage.pageX;
    var pageY = showFirstPage ? firstPageY : this.currentPage.pageY;
    if (firstInitialised) {
      pageX = this.loopX ? startPageXIndex + 1 : startPageXIndex;
      pageY = this.loopY ? startPageYIndex + 1 : startPageYIndex;
    } else {
      pageX = showFirstPage ? firstPageX : this.currentPage.pageX;
      pageY = showFirstPage ? firstPageY : this.currentPage.pageY;
    }
    var _b = this.pagesMatrix.getPageStats(pageX, pageY),
      x = _b.x,
      y = _b.y;
    return {
      pageX: pageX,
      pageY: pageY,
      x: x,
      y: y
    };
  };
  SlidePages.prototype.getExposedPage = function (page) {
    var exposedPage = extend({}, page);
    // only pageX or pageY need fix
    if (this.loopX) {
      exposedPage.pageX = this.fixedPage(exposedPage.pageX, this.pagesMatrix.pageLengthOfX - 2);
    }
    if (this.loopY) {
      exposedPage.pageY = this.fixedPage(exposedPage.pageY, this.pagesMatrix.pageLengthOfY - 2);
    }
    return exposedPage;
  };
  SlidePages.prototype.getExposedPageByPageIndex = function (pageIndexX, pageIndexY) {
    var page = {
      pageX: pageIndexX,
      pageY: pageIndexY
    };
    if (this.loopX) {
      page.pageX = pageIndexX + 1;
    }
    if (this.loopY) {
      page.pageY = pageIndexY + 1;
    }
    var _a = this.pagesMatrix.getPageStats(page.pageX, page.pageY),
      x = _a.x,
      y = _a.y;
    return {
      x: x,
      y: y,
      pageX: pageIndexX,
      pageY: pageIndexY
    };
  };
  SlidePages.prototype.getWillChangedPage = function (page) {
    page = extend({}, page);
    // Page need fix
    if (this.loopX) {
      page.pageX = this.fixedPage(page.pageX, this.pagesMatrix.pageLengthOfX - 2);
      page.x = this.pagesMatrix.getPageStats(page.pageX + 1, 0).x;
    }
    if (this.loopY) {
      page.pageY = this.fixedPage(page.pageY, this.pagesMatrix.pageLengthOfY - 2);
      page.y = this.pagesMatrix.getPageStats(0, page.pageY + 1).y;
    }
    return page;
  };
  SlidePages.prototype.fixedPage = function (page, realPageLen) {
    var pageIndex = [];
    for (var i = 0; i < realPageLen; i++) {
      pageIndex.push(i);
    }
    pageIndex.unshift(realPageLen - 1);
    pageIndex.push(0);
    return pageIndex[page];
  };
  SlidePages.prototype.getPageStats = function () {
    return this.pagesMatrix.getPageStats(this.currentPage.pageX, this.currentPage.pageY);
  };
  SlidePages.prototype.getValidPageIndex = function (x, y) {
    var lastX = this.pagesMatrix.pageLengthOfX - 1;
    var lastY = this.pagesMatrix.pageLengthOfY - 1;
    var firstX = 0;
    var firstY = 0;
    if (this.loopX) {
      x += 1;
      firstX = firstX + 1;
      lastX = lastX - 1;
    }
    if (this.loopY) {
      y += 1;
      firstY = firstY + 1;
      lastY = lastY - 1;
    }
    x = between(x, firstX, lastX);
    y = between(y, firstY, lastY);
    return {
      pageX: x,
      pageY: y
    };
  };
  SlidePages.prototype.nextPageIndex = function () {
    return this.getPageIndexByDirection("positive" /* Positive */);
  };
  SlidePages.prototype.prevPageIndex = function () {
    return this.getPageIndexByDirection("negative" /* Negative */);
  };
  SlidePages.prototype.getNearestPage = function (x, y) {
    var pageIndex = this.pagesMatrix.getNearestPageIndex(x, y);
    var pageX = pageIndex.pageX,
      pageY = pageIndex.pageY;
    var newX = this.pagesMatrix.getPageStats(pageX, 0).x;
    var newY = this.pagesMatrix.getPageStats(0, pageY).y;
    return {
      x: newX,
      y: newY,
      pageX: pageX,
      pageY: pageY
    };
  };
  SlidePages.prototype.getPageByDirection = function (page, directionX, directionY) {
    var pageX = page.pageX,
      pageY = page.pageY;
    if (pageX === this.currentPage.pageX) {
      pageX = between(pageX + directionX, 0, this.pagesMatrix.pageLengthOfX - 1);
    }
    if (pageY === this.currentPage.pageY) {
      pageY = between(pageY + directionY, 0, this.pagesMatrix.pageLengthOfY - 1);
    }
    var x = this.pagesMatrix.getPageStats(pageX, 0).x;
    var y = this.pagesMatrix.getPageStats(0, pageY).y;
    return {
      x: x,
      y: y,
      pageX: pageX,
      pageY: pageY
    };
  };
  SlidePages.prototype.resetLoopPage = function () {
    if (this.loopX) {
      if (this.currentPage.pageX === 0) {
        return {
          pageX: this.pagesMatrix.pageLengthOfX - 2,
          pageY: this.currentPage.pageY
        };
      }
      if (this.currentPage.pageX === this.pagesMatrix.pageLengthOfX - 1) {
        return {
          pageX: 1,
          pageY: this.currentPage.pageY
        };
      }
    }
    if (this.loopY) {
      if (this.currentPage.pageY === 0) {
        return {
          pageX: this.currentPage.pageX,
          pageY: this.pagesMatrix.pageLengthOfY - 2
        };
      }
      if (this.currentPage.pageY === this.pagesMatrix.pageLengthOfY - 1) {
        return {
          pageX: this.currentPage.pageX,
          pageY: 1
        };
      }
    }
  };
  SlidePages.prototype.getPageIndexByDirection = function (direction) {
    var x = this.currentPage.pageX;
    var y = this.currentPage.pageY;
    if (this.slideX) {
      x = direction === "negative" /* Negative */ ? x - 1 : x + 1;
    }
    if (this.slideY) {
      y = direction === "negative" /* Negative */ ? y - 1 : y + 1;
    }
    return {
      pageX: x,
      pageY: y
    };
  };
  SlidePages.prototype.checkSlideLoop = function () {
    this.wannaLoop = this.slideOptions.loop;
    if (this.pagesMatrix.pageLengthOfX > 1) {
      this.slideX = true;
    } else {
      this.slideX = false;
    }
    if (this.pagesMatrix.pages[0] && this.pagesMatrix.pageLengthOfY > 1) {
      this.slideY = true;
    } else {
      this.slideY = false;
    }
    this.loopX = this.wannaLoop && this.slideX;
    this.loopY = this.wannaLoop && this.slideY;
    if (this.slideX && this.slideY) {
      warn('slide does not support two direction at the same time.');
    }
  };
  return SlidePages;
}();
var sourcePrefix$4 = 'plugins.slide';
var propertiesMap$4 = [{
  key: 'next',
  name: 'next'
}, {
  key: 'prev',
  name: 'prev'
}, {
  key: 'goToPage',
  name: 'goToPage'
}, {
  key: 'getCurrentPage',
  name: 'getCurrentPage'
}, {
  key: 'startPlay',
  name: 'startPlay'
}, {
  key: 'pausePlay',
  name: 'pausePlay'
}];
var propertiesConfig$4 = propertiesMap$4.map(function (item) {
  return {
    key: item.key,
    sourceKey: sourcePrefix$4 + "." + item.name
  };
});
var samePage = function (p1, p2) {
  return p1.pageX === p2.pageX && p1.pageY === p2.pageY;
};
var Slide = /** @class */function () {
  function Slide(scroll) {
    this.scroll = scroll;
    this.cachedClonedPageDOM = [];
    this.resetLooping = false;
    this.autoplayTimer = 0;
    if (!this.satisfyInitialization()) {
      return;
    }
    this.init();
  }
  Slide.prototype.satisfyInitialization = function () {
    if (this.scroll.scroller.content.children.length <= 0) {
      warn("slide need at least one slide page to be initialised." + "please check your DOM layout.");
      return false;
    }
    return true;
  };
  Slide.prototype.init = function () {
    this.willChangeToPage = extend({}, BASE_PAGE);
    this.handleBScroll();
    this.handleOptions();
    this.handleHooks();
    this.createPages();
  };
  Slide.prototype.createPages = function () {
    this.pages = new SlidePages(this.scroll, this.options);
  };
  Slide.prototype.handleBScroll = function () {
    this.scroll.registerType(['slideWillChange', 'slidePageChanged']);
    this.scroll.proxy(propertiesConfig$4);
  };
  Slide.prototype.handleOptions = function () {
    var userOptions = this.scroll.options.slide === true ? {} : this.scroll.options.slide;
    var defaultOptions = {
      loop: true,
      threshold: 0.1,
      speed: 400,
      easing: ease.bounce,
      listenFlick: true,
      autoplay: true,
      interval: 3000,
      startPageXIndex: 0,
      startPageYIndex: 0
    };
    this.options = extend(defaultOptions, userOptions);
  };
  Slide.prototype.handleLoop = function (prevSlideContent) {
    var loop = this.options.loop;
    var slideContent = this.scroll.scroller.content;
    var currentSlidePagesLength = slideContent.children.length;
    // only should respect loop scene
    if (loop) {
      if (slideContent !== prevSlideContent) {
        this.resetLoopChangedStatus();
        this.removeClonedSlidePage(prevSlideContent);
        currentSlidePagesLength > 1 && this.cloneFirstAndLastSlidePage(slideContent);
      } else {
        // many pages reduce to one page
        if (currentSlidePagesLength === 3 && this.initialised) {
          this.removeClonedSlidePage(slideContent);
          this.moreToOnePageInLoop = true;
          this.oneToMorePagesInLoop = false;
        } else if (currentSlidePagesLength > 1) {
          // one page increases to many page
          if (this.initialised && this.cachedClonedPageDOM.length === 0) {
            this.oneToMorePagesInLoop = true;
            this.moreToOnePageInLoop = false;
          } else {
            this.removeClonedSlidePage(slideContent);
            this.resetLoopChangedStatus();
          }
          this.cloneFirstAndLastSlidePage(slideContent);
        } else {
          this.resetLoopChangedStatus();
        }
      }
    }
  };
  Slide.prototype.resetLoopChangedStatus = function () {
    this.moreToOnePageInLoop = false;
    this.oneToMorePagesInLoop = false;
  };
  Slide.prototype.handleHooks = function () {
    var _this = this;
    var scrollHooks = this.scroll.hooks;
    var scrollerHooks = this.scroll.scroller.hooks;
    var listenFlick = this.options.listenFlick;
    this.prevContent = this.scroll.scroller.content;
    this.hooksFn = [];
    // scroll
    this.registerHooks(this.scroll, this.scroll.eventTypes.beforeScrollStart, this.pausePlay);
    this.registerHooks(this.scroll, this.scroll.eventTypes.scrollEnd, this.modifyCurrentPage);
    this.registerHooks(this.scroll, this.scroll.eventTypes.scrollEnd, this.startPlay);
    // for mousewheel event
    if (this.scroll.eventTypes.mousewheelMove) {
      this.registerHooks(this.scroll, this.scroll.eventTypes.mousewheelMove, function () {
        // prevent default action of mousewheelMove
        return true;
      });
      this.registerHooks(this.scroll, this.scroll.eventTypes.mousewheelEnd, function (delta) {
        if (delta.directionX === 1 /* Positive */ || delta.directionY === 1 /* Positive */) {
          _this.next();
        }
        if (delta.directionX === -1 /* Negative */ || delta.directionY === -1 /* Negative */) {
          _this.prev();
        }
      });
    }
    // scrollHooks
    this.registerHooks(scrollHooks, scrollHooks.eventTypes.refresh, this.refreshHandler);
    this.registerHooks(scrollHooks, scrollHooks.eventTypes.destroy, this.destroy);
    // scroller
    this.registerHooks(scrollerHooks, scrollerHooks.eventTypes.beforeRefresh, function () {
      _this.handleLoop(_this.prevContent);
      _this.setSlideInlineStyle();
    });
    this.registerHooks(scrollerHooks, scrollerHooks.eventTypes.momentum, this.modifyScrollMetaHandler);
    this.registerHooks(scrollerHooks, scrollerHooks.eventTypes.scroll, this.scrollHandler);
    // a click operation will clearTimer, so restart a new one
    this.registerHooks(scrollerHooks, scrollerHooks.eventTypes.checkClick, this.startPlay);
    if (listenFlick) {
      this.registerHooks(scrollerHooks, scrollerHooks.eventTypes.flick, this.flickHandler);
    }
  };
  Slide.prototype.startPlay = function () {
    var _this = this;
    var _a = this.options,
      interval = _a.interval,
      autoplay = _a.autoplay;
    if (autoplay) {
      clearTimeout(this.autoplayTimer);
      this.autoplayTimer = window.setTimeout(function () {
        _this.next();
      }, interval);
    }
  };
  Slide.prototype.pausePlay = function () {
    if (this.options.autoplay) {
      clearTimeout(this.autoplayTimer);
    }
  };
  Slide.prototype.setSlideInlineStyle = function () {
    var styleConfigurations = [{
      direction: 'scrollX',
      sizeType: 'offsetWidth',
      styleType: 'width'
    }, {
      direction: 'scrollY',
      sizeType: 'offsetHeight',
      styleType: 'height'
    }];
    var _a = this.scroll.scroller,
      slideContent = _a.content,
      slideWrapper = _a.wrapper;
    var scrollOptions = this.scroll.options;
    styleConfigurations.forEach(function (_a) {
      var direction = _a.direction,
        sizeType = _a.sizeType,
        styleType = _a.styleType;
      // wanna scroll in this direction
      if (scrollOptions[direction]) {
        var size = slideWrapper[sizeType];
        var children = slideContent.children;
        var length_1 = children.length;
        for (var i = 0; i < length_1; i++) {
          var slidePageDOM = children[i];
          slidePageDOM.style[styleType] = size + 'px';
        }
        slideContent.style[styleType] = size * length_1 + 'px';
      }
    });
  };
  Slide.prototype.next = function (time, easing) {
    var _a = this.pages.nextPageIndex(),
      pageX = _a.pageX,
      pageY = _a.pageY;
    this.goTo(pageX, pageY, time, easing);
  };
  Slide.prototype.prev = function (time, easing) {
    var _a = this.pages.prevPageIndex(),
      pageX = _a.pageX,
      pageY = _a.pageY;
    this.goTo(pageX, pageY, time, easing);
  };
  Slide.prototype.goToPage = function (pageX, pageY, time, easing) {
    var pageIndex = this.pages.getValidPageIndex(pageX, pageY);
    this.goTo(pageIndex.pageX, pageIndex.pageY, time, easing);
  };
  Slide.prototype.getCurrentPage = function () {
    return this.exposedPage || this.pages.getInitialPage(false, true);
  };
  Slide.prototype.setCurrentPage = function (page) {
    this.pages.setCurrentPage(page);
    this.exposedPage = this.pages.getExposedPage(page);
  };
  Slide.prototype.nearestPage = function (x, y) {
    var _a = this.scroll.scroller,
      scrollBehaviorX = _a.scrollBehaviorX,
      scrollBehaviorY = _a.scrollBehaviorY;
    var maxScrollPosX = scrollBehaviorX.maxScrollPos,
      minScrollPosX = scrollBehaviorX.minScrollPos;
    var maxScrollPosY = scrollBehaviorY.maxScrollPos,
      minScrollPosY = scrollBehaviorY.minScrollPos;
    return this.pages.getNearestPage(between(x, maxScrollPosX, minScrollPosX), between(y, maxScrollPosY, minScrollPosY));
  };
  Slide.prototype.satisfyThreshold = function (x, y) {
    var _a = this.scroll.scroller,
      scrollBehaviorX = _a.scrollBehaviorX,
      scrollBehaviorY = _a.scrollBehaviorY;
    var satisfied = true;
    if (Math.abs(x - scrollBehaviorX.absStartPos) <= this.thresholdX && Math.abs(y - scrollBehaviorY.absStartPos) <= this.thresholdY) {
      satisfied = false;
    }
    return satisfied;
  };
  Slide.prototype.refreshHandler = function (content) {
    var _this = this;
    if (!this.satisfyInitialization()) {
      return;
    }
    this.pages.refresh();
    this.computeThreshold();
    var contentChanged = this.contentChanged = this.prevContent !== content;
    if (contentChanged) {
      this.prevContent = content;
    }
    var initPage = this.pages.getInitialPage(this.oneToMorePagesInLoop || this.moreToOnePageInLoop, contentChanged || !this.initialised);
    if (this.initialised) {
      this.goTo(initPage.pageX, initPage.pageY, 0);
    } else {
      this.registerHooks(this.scroll.hooks, this.scroll.hooks.eventTypes.beforeInitialScrollTo, function (position) {
        _this.initialised = true;
        position.x = initPage.x;
        position.y = initPage.y;
      });
    }
    this.startPlay();
  };
  Slide.prototype.computeThreshold = function () {
    var threshold = this.options.threshold;
    // Integer
    if (threshold % 1 === 0) {
      this.thresholdX = threshold;
      this.thresholdY = threshold;
    } else {
      // decimal
      var _a = this.pages.getPageStats(),
        width = _a.width,
        height = _a.height;
      this.thresholdX = Math.round(width * threshold);
      this.thresholdY = Math.round(height * threshold);
    }
  };
  Slide.prototype.cloneFirstAndLastSlidePage = function (slideContent) {
    var children = slideContent.children;
    var preprendDOM = children[children.length - 1].cloneNode(true);
    var appendDOM = children[0].cloneNode(true);
    prepend(preprendDOM, slideContent);
    slideContent.appendChild(appendDOM);
    this.cachedClonedPageDOM = [preprendDOM, appendDOM];
  };
  Slide.prototype.removeClonedSlidePage = function (slideContent) {
    // maybe slideContent has removed from DOM Tree
    var slidePages = slideContent && slideContent.children || [];
    if (slidePages.length) {
      this.cachedClonedPageDOM.forEach(function (el) {
        removeChild(slideContent, el);
      });
    }
    this.cachedClonedPageDOM = [];
  };
  Slide.prototype.modifyCurrentPage = function (point) {
    var _a = this.getCurrentPage(),
      prevExposedPageX = _a.pageX,
      prevExposedPageY = _a.pageY;
    var newPage = this.nearestPage(point.x, point.y);
    this.setCurrentPage(newPage);
    /* istanbul ignore if */
    if (this.contentChanged) {
      this.contentChanged = false;
      return true;
    }
    var _b = this.getCurrentPage(),
      currentExposedPageX = _b.pageX,
      currentExposedPageY = _b.pageY;
    this.pageWillChangeTo(newPage);
    // loop is true, and one page becomes many pages when call bs.refresh
    if (this.oneToMorePagesInLoop) {
      this.oneToMorePagesInLoop = false;
      return true;
    }
    // loop is true, and many page becomes one page when call bs.refresh
    // if prevPage > 0, dispatch slidePageChanged and scrollEnd events
    /* istanbul ignore if */
    if (this.moreToOnePageInLoop && prevExposedPageX === 0 && prevExposedPageY === 0) {
      this.moreToOnePageInLoop = false;
      return true;
    }
    if (prevExposedPageX !== currentExposedPageX || prevExposedPageY !== currentExposedPageY) {
      // only trust pageX & pageY when loop is true
      var page = this.pages.getExposedPageByPageIndex(currentExposedPageX, currentExposedPageY);
      this.scroll.trigger(this.scroll.eventTypes.slidePageChanged, page);
    }
    // triggered by resetLoop
    if (this.resetLooping) {
      this.resetLooping = false;
      return;
    }
    var changePage = this.pages.resetLoopPage();
    if (changePage) {
      this.resetLooping = true;
      this.goTo(changePage.pageX, changePage.pageY, 0);
      // stop user's scrollEnd
      // since it is a seamless scroll
      return true;
    }
  };
  Slide.prototype.goTo = function (pageX, pageY, time, easing) {
    var newPage = this.pages.getInternalPage(pageX, pageY);
    var scrollEasing = easing || this.options.easing || ease.bounce;
    var x = newPage.x,
      y = newPage.y;
    var deltaX = x - this.scroll.scroller.scrollBehaviorX.currentPos;
    var deltaY = y - this.scroll.scroller.scrollBehaviorY.currentPos;
    /* istanbul ignore if */
    if (!deltaX && !deltaY) {
      this.scroll.scroller.togglePointerEvents(true);
      return;
    }
    time = time === undefined ? this.getEaseTime(deltaX, deltaY) : time;
    this.scroll.scroller.scrollTo(x, y, time, scrollEasing);
  };
  Slide.prototype.flickHandler = function () {
    var _a = this.scroll.scroller,
      scrollBehaviorX = _a.scrollBehaviorX,
      scrollBehaviorY = _a.scrollBehaviorY;
    var currentPosX = scrollBehaviorX.currentPos,
      startPosX = scrollBehaviorX.startPos,
      directionX = scrollBehaviorX.direction;
    var currentPosY = scrollBehaviorY.currentPos,
      startPosY = scrollBehaviorY.startPos,
      directionY = scrollBehaviorY.direction;
    var _b = this.pages.currentPage,
      pageX = _b.pageX,
      pageY = _b.pageY;
    var time = this.getEaseTime(currentPosX - startPosX, currentPosY - startPosY);
    this.goTo(pageX + directionX, pageY + directionY, time);
  };
  Slide.prototype.getEaseTime = function (deltaX, deltaY) {
    return this.options.speed || Math.max(Math.max(Math.min(Math.abs(deltaX), 1000), Math.min(Math.abs(deltaY), 1000)), 300);
  };
  Slide.prototype.modifyScrollMetaHandler = function (scrollMeta) {
    var _a = this.scroll.scroller,
      scrollBehaviorX = _a.scrollBehaviorX,
      scrollBehaviorY = _a.scrollBehaviorY,
      animater = _a.animater;
    var newX = scrollMeta.newX;
    var newY = scrollMeta.newY;
    var newPage = this.satisfyThreshold(newX, newY) || animater.forceStopped ? this.pages.getPageByDirection(this.nearestPage(newX, newY), scrollBehaviorX.direction, scrollBehaviorY.direction) : this.pages.currentPage;
    scrollMeta.time = this.getEaseTime(scrollMeta.newX - newPage.x, scrollMeta.newY - newPage.y);
    scrollMeta.newX = newPage.x;
    scrollMeta.newY = newPage.y;
    scrollMeta.easing = this.options.easing || ease.bounce;
  };
  Slide.prototype.scrollHandler = function (_a) {
    var x = _a.x,
      y = _a.y;
    if (this.satisfyThreshold(x, y)) {
      var newPage = this.nearestPage(x, y);
      this.pageWillChangeTo(newPage);
    }
  };
  Slide.prototype.pageWillChangeTo = function (newPage) {
    var changeToPage = this.pages.getWillChangedPage(newPage);
    if (!samePage(this.willChangeToPage, changeToPage)) {
      this.willChangeToPage = changeToPage;
      this.scroll.trigger(this.scroll.eventTypes.slideWillChange, this.willChangeToPage);
    }
  };
  Slide.prototype.registerHooks = function (hooks, name, handler) {
    hooks.on(name, handler, this);
    this.hooksFn.push([hooks, name, handler]);
  };
  Slide.prototype.destroy = function () {
    var slideContent = this.scroll.scroller.content;
    var _a = this.options,
      loop = _a.loop,
      autoplay = _a.autoplay;
    if (loop) {
      this.removeClonedSlidePage(slideContent);
    }
    if (autoplay) {
      clearTimeout(this.autoplayTimer);
    }
    this.hooksFn.forEach(function (item) {
      var hooks = item[0];
      var hooksName = item[1];
      var handlerFn = item[2];
      if (hooks.eventTypes[hooksName]) {
        hooks.off(hooksName, handlerFn);
      }
    });
    this.hooksFn.length = 0;
  };
  Slide.pluginName = 'slide';
  return Slide;
}();
var sourcePrefix$3 = 'plugins.wheel';
var propertiesMap$3 = [{
  key: 'wheelTo',
  name: 'wheelTo'
}, {
  key: 'getSelectedIndex',
  name: 'getSelectedIndex'
}, {
  key: 'restorePosition',
  name: 'restorePosition'
}];
var propertiesConfig$3 = propertiesMap$3.map(function (item) {
  return {
    key: item.key,
    sourceKey: sourcePrefix$3 + "." + item.name
  };
});
var WHEEL_INDEX_CHANGED_EVENT_NAME = 'wheelIndexChanged';
var CONSTANTS = {
  rate: 4
};
var Wheel = /** @class */function () {
  function Wheel(scroll) {
    this.scroll = scroll;
    this.init();
  }
  Wheel.prototype.init = function () {
    this.handleBScroll();
    this.handleOptions();
    this.handleHooks();
    // init boundary for Wheel
    this.refreshBoundary();
    this.setSelectedIndex(this.options.selectedIndex);
  };
  Wheel.prototype.handleBScroll = function () {
    this.scroll.proxy(propertiesConfig$3);
    this.scroll.registerType([WHEEL_INDEX_CHANGED_EVENT_NAME]);
  };
  Wheel.prototype.handleOptions = function () {
    var userOptions = this.scroll.options.wheel === true ? {} : this.scroll.options.wheel;
    var defaultOptions = {
      wheelWrapperClass: 'wheel-scroll',
      wheelItemClass: 'wheel-item',
      rotate: 25,
      adjustTime: 400,
      selectedIndex: 0,
      wheelDisabledItemClass: 'wheel-disabled-item'
    };
    this.options = extend(defaultOptions, userOptions);
  };
  Wheel.prototype.handleHooks = function () {
    var _this = this;
    var scroll = this.scroll;
    var scroller = this.scroll.scroller;
    var actionsHandler = scroller.actionsHandler,
      scrollBehaviorX = scroller.scrollBehaviorX,
      scrollBehaviorY = scroller.scrollBehaviorY,
      animater = scroller.animater;
    var prevContent = scroller.content;
    // BScroll
    scroll.on(scroll.eventTypes.scrollEnd, function (position) {
      var index = _this.findNearestValidWheel(position.y).index;
      if (scroller.animater.forceStopped && !_this.isAdjustingPosition) {
        _this.target = _this.items[index];
        // since stopped from an animation.
        // prevent user's scrollEnd callback triggered twice
        return true;
      } else {
        _this.setSelectedIndex(index);
        if (_this.isAdjustingPosition) {
          _this.isAdjustingPosition = false;
        }
      }
    });
    // BScroll.hooks
    this.scroll.hooks.on(this.scroll.hooks.eventTypes.refresh, function (content) {
      if (content !== prevContent) {
        prevContent = content;
        _this.setSelectedIndex(_this.options.selectedIndex, true);
      }
      // rotate all wheel-items
      // because position may not change
      _this.rotateX(_this.scroll.y);
      // check we are stop at a disable item or not
      _this.wheelTo(_this.selectedIndex, 0);
    });
    this.scroll.hooks.on(this.scroll.hooks.eventTypes.beforeInitialScrollTo, function (position) {
      // selectedIndex has higher priority than bs.options.startY
      position.x = 0;
      position.y = -(_this.selectedIndex * _this.itemHeight);
    });
    // Scroller
    scroller.hooks.on(scroller.hooks.eventTypes.checkClick, function () {
      var index = HTMLCollectionToArray(_this.items).indexOf(_this.target);
      if (index === -1) return true;
      _this.wheelTo(index, _this.options.adjustTime, ease.swipe);
      return true;
    });
    scroller.hooks.on(scroller.hooks.eventTypes.scrollTo, function (endPoint) {
      endPoint.y = _this.findNearestValidWheel(endPoint.y).y;
    });
    // when content is scrolling
    // click wheel-item DOM repeatedly and crazily will cause scrollEnd not triggered
    // so reset forceStopped
    scroller.hooks.on(scroller.hooks.eventTypes.minDistanceScroll, function () {
      var animater = scroller.animater;
      if (animater.forceStopped === true) {
        animater.forceStopped = false;
      }
    });
    scroller.hooks.on(scroller.hooks.eventTypes.scrollToElement, function (el, pos) {
      if (!hasClass(el, _this.options.wheelItemClass)) {
        return true;
      } else {
        pos.top = _this.findNearestValidWheel(pos.top).y;
      }
    });
    // ActionsHandler
    actionsHandler.hooks.on(actionsHandler.hooks.eventTypes.beforeStart, function (e) {
      _this.target = e.target;
    });
    // ScrollBehaviorX
    // Wheel has no x direction now
    scrollBehaviorX.hooks.on(scrollBehaviorX.hooks.eventTypes.computeBoundary, function (boundary) {
      boundary.maxScrollPos = 0;
      boundary.minScrollPos = 0;
    });
    // ScrollBehaviorY
    scrollBehaviorY.hooks.on(scrollBehaviorY.hooks.eventTypes.computeBoundary, function (boundary) {
      _this.items = _this.scroll.scroller.content.children;
      _this.checkWheelAllDisabled();
      _this.itemHeight = _this.items.length > 0 ? scrollBehaviorY.contentSize / _this.items.length : 0;
      boundary.maxScrollPos = -_this.itemHeight * (_this.items.length - 1);
      boundary.minScrollPos = 0;
    });
    scrollBehaviorY.hooks.on(scrollBehaviorY.hooks.eventTypes.momentum, function (momentumInfo) {
      momentumInfo.rate = CONSTANTS.rate;
      momentumInfo.destination = _this.findNearestValidWheel(momentumInfo.destination).y;
    });
    scrollBehaviorY.hooks.on(scrollBehaviorY.hooks.eventTypes.end, function (momentumInfo) {
      var validWheel = _this.findNearestValidWheel(scrollBehaviorY.currentPos);
      momentumInfo.destination = validWheel.y;
      momentumInfo.duration = _this.options.adjustTime;
    });
    // Animater
    animater.hooks.on(animater.hooks.eventTypes.time, function (time) {
      _this.transitionDuration(time);
    });
    animater.hooks.on(animater.hooks.eventTypes.timeFunction, function (easing) {
      _this.timeFunction(easing);
    });
    // bs.stop() to make wheel stop at a correct position when pending
    animater.hooks.on(animater.hooks.eventTypes.callStop, function () {
      var index = _this.findNearestValidWheel(_this.scroll.y).index;
      _this.isAdjustingPosition = true;
      _this.wheelTo(index, 0);
    });
    // Translater
    animater.translater.hooks.on(animater.translater.hooks.eventTypes.translate, function (endPoint) {
      _this.rotateX(endPoint.y);
    });
  };
  Wheel.prototype.refreshBoundary = function () {
    var _a = this.scroll.scroller,
      scrollBehaviorX = _a.scrollBehaviorX,
      scrollBehaviorY = _a.scrollBehaviorY,
      content = _a.content;
    scrollBehaviorX.refresh(content);
    scrollBehaviorY.refresh(content);
  };
  Wheel.prototype.setSelectedIndex = function (index, contentChanged) {
    if (contentChanged === void 0) {
      contentChanged = false;
    }
    var prevSelectedIndex = this.selectedIndex;
    this.selectedIndex = index;
    // if content DOM changed, should not trigger event
    if (prevSelectedIndex !== index && !contentChanged) {
      this.scroll.trigger(WHEEL_INDEX_CHANGED_EVENT_NAME, index);
    }
  };
  Wheel.prototype.getSelectedIndex = function () {
    return this.selectedIndex;
  };
  Wheel.prototype.wheelTo = function (index, time, ease) {
    if (index === void 0) {
      index = 0;
    }
    if (time === void 0) {
      time = 0;
    }
    var y = -index * this.itemHeight;
    this.scroll.scrollTo(0, y, time, ease);
  };
  Wheel.prototype.restorePosition = function () {
    // bs is scrolling
    var isPending = this.scroll.pending;
    if (isPending) {
      var selectedIndex = this.getSelectedIndex();
      this.scroll.scroller.animater.clearTimer();
      this.wheelTo(selectedIndex, 0);
    }
  };
  Wheel.prototype.transitionDuration = function (time) {
    for (var i = 0; i < this.items.length; i++) {
      this.items[i].style[style.transitionDuration] = time + 'ms';
    }
  };
  Wheel.prototype.timeFunction = function (easing) {
    for (var i = 0; i < this.items.length; i++) {
      this.items[i].style[style.transitionTimingFunction] = easing;
    }
  };
  Wheel.prototype.rotateX = function (y) {
    var _a = this.options.rotate,
      rotate = _a === void 0 ? 25 : _a;
    for (var i = 0; i < this.items.length; i++) {
      var deg = rotate * (y / this.itemHeight + i);
      // Too small value is invalid in some phones, issue 1026
      var SafeDeg = deg.toFixed(3);
      this.items[i].style[style.transform] = "rotateX(" + SafeDeg + "deg)";
    }
  };
  Wheel.prototype.findNearestValidWheel = function (y) {
    y = y > 0 ? 0 : y < this.scroll.maxScrollY ? this.scroll.maxScrollY : y;
    var currentIndex = Math.abs(Math.round(-y / this.itemHeight));
    var cacheIndex = currentIndex;
    var items = this.items;
    var wheelDisabledItemClassName = this.options.wheelDisabledItemClass;
    // implement web native select element
    // first, check whether there is a enable item whose index is smaller than currentIndex
    // then, check whether there is a enable item whose index is bigger than currentIndex
    // otherwise, there are all disabled items, just keep currentIndex unchange
    while (currentIndex >= 0) {
      if (!hasClass(items[currentIndex], wheelDisabledItemClassName)) {
        break;
      }
      currentIndex--;
    }
    if (currentIndex < 0) {
      currentIndex = cacheIndex;
      while (currentIndex <= items.length - 1) {
        if (!hasClass(items[currentIndex], wheelDisabledItemClassName)) {
          break;
        }
        currentIndex++;
      }
    }
    // keep it unchange when all the items are disabled
    if (currentIndex === items.length) {
      currentIndex = cacheIndex;
    }
    // when all the items are disabled, selectedIndex should always be -1
    return {
      index: this.wheelItemsAllDisabled ? -1 : currentIndex,
      y: -currentIndex * this.itemHeight
    };
  };
  Wheel.prototype.checkWheelAllDisabled = function () {
    var wheelDisabledItemClassName = this.options.wheelDisabledItemClass;
    var items = this.items;
    this.wheelItemsAllDisabled = true;
    for (var i = 0; i < items.length; i++) {
      if (!hasClass(items[i], wheelDisabledItemClassName)) {
        this.wheelItemsAllDisabled = false;
        break;
      }
    }
  };
  Wheel.pluginName = 'wheel';
  return Wheel;
}();
var sourcePrefix$2 = 'plugins.zoom';
var propertiesMap$2 = [{
  key: 'zoomTo',
  name: 'zoomTo'
}];
var propertiesConfig$2 = propertiesMap$2.map(function (item) {
  return {
    key: item.key,
    sourceKey: sourcePrefix$2 + "." + item.name
  };
});
var TWO_FINGERS = 2;
var RAW_SCALE = 1;
var Zoom = /** @class */function () {
  function Zoom(scroll) {
    this.scroll = scroll;
    this.scale = RAW_SCALE;
    this.prevScale = 1;
    this.init();
  }
  Zoom.prototype.init = function () {
    this.handleBScroll();
    this.handleOptions();
    this.handleHooks();
    this.tryInitialZoomTo(this.zoomOpt);
  };
  Zoom.prototype.zoomTo = function (scale, x, y, bounceTime) {
    var _a = this.resolveOrigin(x, y),
      originX = _a.originX,
      originY = _a.originY;
    var origin = {
      x: originX,
      y: originY,
      baseScale: this.scale
    };
    this._doZoomTo(scale, origin, bounceTime, true);
  };
  Zoom.prototype.handleBScroll = function () {
    this.scroll.proxy(propertiesConfig$2);
    this.scroll.registerType(['beforeZoomStart', 'zoomStart', 'zooming', 'zoomEnd']);
  };
  Zoom.prototype.handleOptions = function () {
    var userOptions = this.scroll.options.zoom === true ? {} : this.scroll.options.zoom;
    var defaultOptions = {
      start: 1,
      min: 1,
      max: 4,
      initialOrigin: [0, 0],
      minimalZoomDistance: 5,
      bounceTime: 800
    };
    this.zoomOpt = extend(defaultOptions, userOptions);
  };
  Zoom.prototype.handleHooks = function () {
    var _this = this;
    var scroll = this.scroll;
    var scroller = this.scroll.scroller;
    this.wrapper = this.scroll.scroller.wrapper;
    this.setTransformOrigin(this.scroll.scroller.content);
    var scrollBehaviorX = scroller.scrollBehaviorX;
    var scrollBehaviorY = scroller.scrollBehaviorY;
    this.hooksFn = [];
    // BScroll
    this.registerHooks(scroll.hooks, scroll.hooks.eventTypes.contentChanged, function (content) {
      _this.setTransformOrigin(content);
      _this.scale = RAW_SCALE;
      _this.tryInitialZoomTo(_this.zoomOpt);
    });
    this.registerHooks(scroll.hooks, scroll.hooks.eventTypes.beforeInitialScrollTo, function () {
      // if perform a zoom action, we should prevent initial scroll when initialised
      if (_this.zoomOpt.start !== RAW_SCALE) {
        return true;
      }
    });
    // enlarge boundary
    this.registerHooks(scrollBehaviorX.hooks, scrollBehaviorX.hooks.eventTypes.beforeComputeBoundary, function () {
      // content may change, don't cache it's size
      var contentSize = getRect(_this.scroll.scroller.content);
      scrollBehaviorX.contentSize = Math.floor(contentSize.width * _this.scale);
    });
    this.registerHooks(scrollBehaviorY.hooks, scrollBehaviorY.hooks.eventTypes.beforeComputeBoundary, function () {
      // content may change, don't cache it's size
      var contentSize = getRect(_this.scroll.scroller.content);
      scrollBehaviorY.contentSize = Math.floor(contentSize.height * _this.scale);
    });
    // touch event
    this.registerHooks(scroller.actions.hooks, scroller.actions.hooks.eventTypes.start, function (e) {
      var numberOfFingers = e.touches && e.touches.length || 0;
      _this.fingersOperation(numberOfFingers);
      if (numberOfFingers === TWO_FINGERS) {
        _this.zoomStart(e);
      }
    });
    this.registerHooks(scroller.actions.hooks, scroller.actions.hooks.eventTypes.beforeMove, function (e) {
      var numberOfFingers = e.touches && e.touches.length || 0;
      _this.fingersOperation(numberOfFingers);
      if (numberOfFingers === TWO_FINGERS) {
        _this.zoom(e);
        return true;
      }
    });
    this.registerHooks(scroller.actions.hooks, scroller.actions.hooks.eventTypes.beforeEnd, function (e) {
      var numberOfFingers = _this.fingersOperation();
      if (numberOfFingers === TWO_FINGERS) {
        _this.zoomEnd();
        return true;
      }
    });
    this.registerHooks(scroller.translater.hooks, scroller.translater.hooks.eventTypes.beforeTranslate, function (transformStyle, point) {
      var scale = point.scale ? point.scale : _this.prevScale;
      _this.prevScale = scale;
      transformStyle.push("scale(" + scale + ")");
    });
    this.registerHooks(scroller.hooks, scroller.hooks.eventTypes.scrollEnd, function () {
      if (_this.fingersOperation() === TWO_FINGERS) {
        _this.scroll.trigger(_this.scroll.eventTypes.zoomEnd, {
          scale: _this.scale
        });
      }
    });
    this.registerHooks(this.scroll.hooks, 'destroy', this.destroy);
  };
  Zoom.prototype.setTransformOrigin = function (content) {
    content.style[style.transformOrigin] = '0 0';
  };
  Zoom.prototype.tryInitialZoomTo = function (options) {
    var start = options.start,
      initialOrigin = options.initialOrigin;
    var _a = this.scroll.scroller,
      scrollBehaviorX = _a.scrollBehaviorX,
      scrollBehaviorY = _a.scrollBehaviorY;
    if (start !== RAW_SCALE) {
      // Movable plugin may wanna modify minScrollPos or maxScrollPos
      // so we force Movable to caculate them
      this.resetBoundaries([scrollBehaviorX, scrollBehaviorY]);
      this.zoomTo(start, initialOrigin[0], initialOrigin[1], 0);
    }
  };
  // getter or setter operation
  Zoom.prototype.fingersOperation = function (amounts) {
    if (typeof amounts === 'number') {
      this.numberOfFingers = amounts;
    } else {
      return this.numberOfFingers;
    }
  };
  Zoom.prototype._doZoomTo = function (scale, origin, time, useCurrentPos) {
    var _this = this;
    if (time === void 0) {
      time = this.zoomOpt.bounceTime;
    }
    if (useCurrentPos === void 0) {
      useCurrentPos = false;
    }
    var _a = this.zoomOpt,
      min = _a.min,
      max = _a.max;
    var fromScale = this.scale;
    var toScale = between(scale, min, max);
    (function () {
      if (time === 0) {
        _this.scroll.trigger(_this.scroll.eventTypes.zooming, {
          scale: toScale
        });
        return;
      }
      if (time > 0) {
        var timer_1;
        var startTime_1 = getNow();
        var endTime_1 = startTime_1 + time;
        var scheduler_1 = function () {
          var now = getNow();
          if (now >= endTime_1) {
            _this.scroll.trigger(_this.scroll.eventTypes.zooming, {
              scale: toScale
            });
            cancelAnimationFrame$1(timer_1);
            return;
          }
          var ratio = ease.bounce.fn((now - startTime_1) / time);
          var currentScale = ratio * (toScale - fromScale) + fromScale;
          _this.scroll.trigger(_this.scroll.eventTypes.zooming, {
            scale: currentScale
          });
          timer_1 = requestAnimationFrame$1(scheduler_1);
        };
        // start scheduler job
        scheduler_1();
      }
    })();
    // suppose you are zooming by two fingers
    this.fingersOperation(2);
    this._zoomTo(toScale, fromScale, origin, time, useCurrentPos);
  };
  Zoom.prototype._zoomTo = function (toScale, fromScale, origin, time, useCurrentPos) {
    if (useCurrentPos === void 0) {
      useCurrentPos = false;
    }
    var ratio = toScale / origin.baseScale;
    this.setScale(toScale);
    var scroller = this.scroll.scroller;
    var scrollBehaviorX = scroller.scrollBehaviorX,
      scrollBehaviorY = scroller.scrollBehaviorY;
    this.resetBoundaries([scrollBehaviorX, scrollBehaviorY]);
    // position is restrained in boundary
    var newX = this.getNewPos(origin.x, ratio, scrollBehaviorX, true, useCurrentPos);
    var newY = this.getNewPos(origin.y, ratio, scrollBehaviorY, true, useCurrentPos);
    if (scrollBehaviorX.currentPos !== Math.round(newX) || scrollBehaviorY.currentPos !== Math.round(newY) || toScale !== fromScale) {
      scroller.scrollTo(newX, newY, time, ease.bounce, {
        start: {
          scale: fromScale
        },
        end: {
          scale: toScale
        }
      });
    }
  };
  Zoom.prototype.resolveOrigin = function (x, y) {
    var _a = this.scroll.scroller,
      scrollBehaviorX = _a.scrollBehaviorX,
      scrollBehaviorY = _a.scrollBehaviorY;
    var resolveFormula = {
      left: function () {
        return 0;
      },
      top: function () {
        return 0;
      },
      right: function () {
        return scrollBehaviorX.contentSize;
      },
      bottom: function () {
        return scrollBehaviorY.contentSize;
      },
      center: function (index) {
        var baseSize = index === 0 ? scrollBehaviorX.contentSize : scrollBehaviorY.contentSize;
        return baseSize / 2;
      }
    };
    return {
      originX: typeof x === 'number' ? x : resolveFormula[x](0),
      originY: typeof y === 'number' ? y : resolveFormula[y](1)
    };
  };
  Zoom.prototype.zoomStart = function (e) {
    var firstFinger = e.touches[0];
    var secondFinger = e.touches[1];
    this.startDistance = this.getFingerDistance(e);
    this.startScale = this.scale;
    var _a = offsetToBody(this.wrapper),
      left = _a.left,
      top = _a.top;
    this.origin = {
      x: Math.abs(firstFinger.pageX + secondFinger.pageX) / 2 + left - this.scroll.x,
      y: Math.abs(firstFinger.pageY + secondFinger.pageY) / 2 + top - this.scroll.y,
      baseScale: this.startScale
    };
    this.scroll.trigger(this.scroll.eventTypes.beforeZoomStart);
  };
  Zoom.prototype.zoom = function (e) {
    var currentDistance = this.getFingerDistance(e);
    // at least minimalZoomDistance pixels for the zoom to initiate
    if (!this.zoomed && Math.abs(currentDistance - this.startDistance) < this.zoomOpt.minimalZoomDistance) {
      return;
    }
    // when out of boundary , perform a damping algorithm
    var endScale = this.dampingScale(currentDistance / this.startDistance * this.startScale);
    var ratio = endScale / this.startScale;
    this.setScale(endScale);
    if (!this.zoomed) {
      this.zoomed = true;
      this.scroll.trigger(this.scroll.eventTypes.zoomStart);
    }
    var scroller = this.scroll.scroller;
    var scrollBehaviorX = scroller.scrollBehaviorX,
      scrollBehaviorY = scroller.scrollBehaviorY;
    var x = this.getNewPos(this.origin.x, ratio, scrollBehaviorX, false, false);
    var y = this.getNewPos(this.origin.y, ratio, scrollBehaviorY, false, false);
    this.scroll.trigger(this.scroll.eventTypes.zooming, {
      scale: this.scale
    });
    scroller.translater.translate({
      x: x,
      y: y,
      scale: endScale
    });
  };
  Zoom.prototype.zoomEnd = function () {
    if (!this.zoomed) return;
    // if out of boundary, do rebound!
    if (this.shouldRebound()) {
      this._doZoomTo(this.scale, this.origin, this.zoomOpt.bounceTime);
      return;
    }
    this.scroll.trigger(this.scroll.eventTypes.zoomEnd, {
      scale: this.scale
    });
  };
  Zoom.prototype.getFingerDistance = function (e) {
    var firstFinger = e.touches[0];
    var secondFinger = e.touches[1];
    var deltaX = Math.abs(firstFinger.pageX - secondFinger.pageX);
    var deltaY = Math.abs(firstFinger.pageY - secondFinger.pageY);
    return getDistance(deltaX, deltaY);
  };
  Zoom.prototype.shouldRebound = function () {
    var _a = this.zoomOpt,
      min = _a.min,
      max = _a.max;
    var currentScale = this.scale;
    // scale exceeded!
    if (currentScale !== between(currentScale, min, max)) {
      return true;
    }
    var _b = this.scroll.scroller,
      scrollBehaviorX = _b.scrollBehaviorX,
      scrollBehaviorY = _b.scrollBehaviorY;
    // enlarge boundaries manually when zoom is end
    this.resetBoundaries([scrollBehaviorX, scrollBehaviorY]);
    var xInBoundary = scrollBehaviorX.checkInBoundary().inBoundary;
    var yInBoundary = scrollBehaviorX.checkInBoundary().inBoundary;
    return !(xInBoundary && yInBoundary);
  };
  Zoom.prototype.dampingScale = function (scale) {
    var _a = this.zoomOpt,
      min = _a.min,
      max = _a.max;
    if (scale < min) {
      scale = 0.5 * min * Math.pow(2.0, scale / min);
    } else if (scale > max) {
      scale = 2.0 * max * Math.pow(0.5, max / scale);
    }
    return scale;
  };
  Zoom.prototype.setScale = function (scale) {
    this.scale = scale;
  };
  Zoom.prototype.resetBoundaries = function (scrollBehaviorPairs) {
    scrollBehaviorPairs.forEach(function (behavior) {
      return behavior.computeBoundary();
    });
  };
  Zoom.prototype.getNewPos = function (origin, lastScale, scrollBehavior, shouldInBoundary, useCurrentPos) {
    if (useCurrentPos === void 0) {
      useCurrentPos = false;
    }
    var newPos = origin - origin * lastScale + (useCurrentPos ? scrollBehavior.currentPos : scrollBehavior.startPos);
    if (shouldInBoundary) {
      newPos = between(newPos, scrollBehavior.maxScrollPos, scrollBehavior.minScrollPos);
    }
    // maxScrollPos or minScrollPos maybe a negative or positive digital
    return newPos > 0 ? Math.floor(newPos) : Math.ceil(newPos);
  };
  Zoom.prototype.registerHooks = function (hooks, name, handler) {
    hooks.on(name, handler, this);
    this.hooksFn.push([hooks, name, handler]);
  };
  Zoom.prototype.destroy = function () {
    this.hooksFn.forEach(function (item) {
      var hooks = item[0];
      var hooksName = item[1];
      var handlerFn = item[2];
      hooks.off(hooksName, handlerFn);
    });
    this.hooksFn.length = 0;
  };
  Zoom.pluginName = 'zoom';
  return Zoom;
}();
var BScrollFamily = /** @class */function () {
  function BScrollFamily(scroll) {
    this.ancestors = [];
    this.descendants = [];
    this.hooksManager = [];
    this.analyzed = false;
    this.selfScroll = scroll;
  }
  BScrollFamily.create = function (scroll) {
    return new BScrollFamily(scroll);
  };
  BScrollFamily.prototype.hasAncestors = function (bscrollFamily) {
    var index = findIndex(this.ancestors, function (_a) {
      var item = _a[0];
      return item === bscrollFamily;
    });
    return index > -1;
  };
  BScrollFamily.prototype.hasDescendants = function (bscrollFamily) {
    var index = findIndex(this.descendants, function (_a) {
      var item = _a[0];
      return item === bscrollFamily;
    });
    return index > -1;
  };
  BScrollFamily.prototype.addAncestor = function (bscrollFamily, distance) {
    var ancestors = this.ancestors;
    ancestors.push([bscrollFamily, distance]);
    // by ascend
    ancestors.sort(function (a, b) {
      return a[1] - b[1];
    });
  };
  BScrollFamily.prototype.addDescendant = function (bscrollFamily, distance) {
    var descendants = this.descendants;
    descendants.push([bscrollFamily, distance]);
    // by ascend
    descendants.sort(function (a, b) {
      return a[1] - b[1];
    });
  };
  BScrollFamily.prototype.removeAncestor = function (bscrollFamily) {
    var ancestors = this.ancestors;
    if (ancestors.length) {
      var index = findIndex(this.ancestors, function (_a) {
        var item = _a[0];
        return item === bscrollFamily;
      });
      if (index > -1) {
        return ancestors.splice(index, 1);
      }
    }
  };
  BScrollFamily.prototype.removeDescendant = function (bscrollFamily) {
    var descendants = this.descendants;
    if (descendants.length) {
      var index = findIndex(this.descendants, function (_a) {
        var item = _a[0];
        return item === bscrollFamily;
      });
      if (index > -1) {
        return descendants.splice(index, 1);
      }
    }
  };
  BScrollFamily.prototype.registerHooks = function (hook, eventType, handler) {
    hook.on(eventType, handler);
    this.hooksManager.push([hook, eventType, handler]);
  };
  BScrollFamily.prototype.setAnalyzed = function (flag) {
    if (flag === void 0) {
      flag = false;
    }
    this.analyzed = flag;
  };
  BScrollFamily.prototype.purge = function () {
    var _this = this;
    // remove self from graph
    this.ancestors.forEach(function (_a) {
      var bscrollFamily = _a[0];
      bscrollFamily.removeDescendant(_this);
    });
    this.descendants.forEach(function (_a) {
      var bscrollFamily = _a[0];
      bscrollFamily.removeAncestor(_this);
    });
    // remove all hook handlers
    this.hooksManager.forEach(function (_a) {
      var hooks = _a[0],
        eventType = _a[1],
        handler = _a[2];
      hooks.off(eventType, handler);
    });
    this.hooksManager = [];
  };
  return BScrollFamily;
}();
var sourcePrefix$1 = 'plugins.nestedScroll';
var propertiesMap$1 = [{
  key: 'purgeNestedScroll',
  name: 'purgeNestedScroll'
}];
var propertiesConfig$1 = propertiesMap$1.map(function (item) {
  return {
    key: item.key,
    sourceKey: sourcePrefix$1 + "." + item.name
  };
});
var DEFAUL_GROUP_ID = 'INTERNAL_NESTED_SCROLL';
var forceScrollStopHandler = function (scrolls) {
  scrolls.forEach(function (scroll) {
    if (scroll.pending) {
      scroll.stop();
      scroll.resetPosition();
    }
  });
};
var enableScrollHander = function (scrolls) {
  scrolls.forEach(function (scroll) {
    scroll.enable();
  });
};
var disableScrollHander = function (scrolls, currentScroll) {
  scrolls.forEach(function (scroll) {
    if (scroll.hasHorizontalScroll === currentScroll.hasHorizontalScroll || scroll.hasVerticalScroll === currentScroll.hasVerticalScroll) {
      scroll.disable();
    }
  });
};
var syncTouchstartData = function (scrolls) {
  scrolls.forEach(function (scroll) {
    var _a = scroll.scroller,
      actions = _a.actions,
      scrollBehaviorX = _a.scrollBehaviorX,
      scrollBehaviorY = _a.scrollBehaviorY;
    // prevent click triggering many times
    actions.fingerMoved = true;
    actions.contentMoved = false;
    actions.directionLockAction.reset();
    scrollBehaviorX.start();
    scrollBehaviorY.start();
    scrollBehaviorX.resetStartPos();
    scrollBehaviorY.resetStartPos();
    actions.startTime = +new Date();
  });
};
var isOutOfBoundary = function (scroll) {
  var hasHorizontalScroll = scroll.hasHorizontalScroll,
    hasVerticalScroll = scroll.hasVerticalScroll,
    x = scroll.x,
    y = scroll.y,
    minScrollX = scroll.minScrollX,
    maxScrollX = scroll.maxScrollX,
    minScrollY = scroll.minScrollY,
    maxScrollY = scroll.maxScrollY,
    movingDirectionX = scroll.movingDirectionX,
    movingDirectionY = scroll.movingDirectionY;
  var ret = false;
  var outOfLeftBoundary = x >= minScrollX && movingDirectionX === -1 /* Negative */;
  var outOfRightBoundary = x <= maxScrollX && movingDirectionX === 1 /* Positive */;
  var outOfTopBoundary = y >= minScrollY && movingDirectionY === -1 /* Negative */;
  var outOfBottomBoundary = y <= maxScrollY && movingDirectionY === 1 /* Positive */;
  if (hasVerticalScroll) {
    ret = outOfTopBoundary || outOfBottomBoundary;
  } else if (hasHorizontalScroll) {
    ret = outOfLeftBoundary || outOfRightBoundary;
  }
  return ret;
};
var isResettingPosition = function (scroll) {
  var hasHorizontalScroll = scroll.hasHorizontalScroll,
    hasVerticalScroll = scroll.hasVerticalScroll,
    x = scroll.x,
    y = scroll.y,
    minScrollX = scroll.minScrollX,
    maxScrollX = scroll.maxScrollX,
    minScrollY = scroll.minScrollY,
    maxScrollY = scroll.maxScrollY;
  var ret = false;
  var outOfLeftBoundary = x > minScrollX;
  var outOfRightBoundary = x < maxScrollX;
  var outOfTopBoundary = y > minScrollY;
  var outOfBottomBoundary = y < maxScrollY;
  if (hasVerticalScroll) {
    ret = outOfTopBoundary || outOfBottomBoundary;
  } else if (hasHorizontalScroll) {
    ret = outOfLeftBoundary || outOfRightBoundary;
  }
  return ret;
};
var resetPositionHandler = function (scroll) {
  scroll.scroller.reflow();
  scroll.resetPosition(0 /* Immediately */);
};
var calculateDistance = function (childNode, parentNode) {
  var distance = 0;
  var parent = childNode.parentNode;
  while (parent && parent !== parentNode) {
    distance++;
    parent = parent.parentNode;
  }
  return distance;
};
var NestedScroll = /** @class */function () {
  function NestedScroll(scroll) {
    var groupId = this.handleOptions(scroll);
    var instance = NestedScroll.instancesMap[groupId];
    if (!instance) {
      instance = NestedScroll.instancesMap[groupId] = this;
      instance.store = [];
      instance.hooksFn = [];
    }
    instance.init(scroll);
    return instance;
  }
  NestedScroll.getAllNestedScrolls = function () {
    var instancesMap = NestedScroll.instancesMap;
    return Object.keys(instancesMap).map(function (key) {
      return instancesMap[key];
    });
  };
  NestedScroll.purgeAllNestedScrolls = function () {
    var nestedScrolls = NestedScroll.getAllNestedScrolls();
    nestedScrolls.forEach(function (ns) {
      return ns.purgeNestedScroll();
    });
  };
  NestedScroll.prototype.handleOptions = function (scroll) {
    var userOptions = scroll.options.nestedScroll === true ? {} : scroll.options.nestedScroll;
    var defaultOptions = {
      groupId: DEFAUL_GROUP_ID
    };
    this.options = extend(defaultOptions, userOptions);
    var groupIdType = typeof this.options.groupId;
    if (groupIdType !== 'string' && groupIdType !== 'number') {
      warn('groupId must be string or number for NestedScroll plugin');
    }
    return this.options.groupId;
  };
  NestedScroll.prototype.init = function (scroll) {
    scroll.proxy(propertiesConfig$1);
    this.addBScroll(scroll);
    this.buildBScrollGraph();
    this.analyzeBScrollGraph();
    this.ensureEventInvokeSequence();
    this.handleHooks(scroll);
  };
  NestedScroll.prototype.handleHooks = function (scroll) {
    var _this = this;
    this.registerHooks(scroll.hooks, scroll.hooks.eventTypes.destroy, function () {
      _this.deleteScroll(scroll);
    });
  };
  NestedScroll.prototype.deleteScroll = function (scroll) {
    var wrapper = scroll.wrapper;
    wrapper.isBScrollContainer = undefined;
    var store = this.store;
    var hooksFn = this.hooksFn;
    var i = findIndex(store, function (bscrollFamily) {
      return bscrollFamily.selfScroll === scroll;
    });
    if (i > -1) {
      var bscrollFamily = store[i];
      bscrollFamily.purge();
      store.splice(i, 1);
    }
    var k = findIndex(hooksFn, function (_a) {
      var hooks = _a[0];
      return hooks === scroll.hooks;
    });
    if (k > -1) {
      var _a = hooksFn[k],
        hooks = _a[0],
        eventType = _a[1],
        handler = _a[2];
      hooks.off(eventType, handler);
      hooksFn.splice(k, 1);
    }
  };
  NestedScroll.prototype.addBScroll = function (scroll) {
    this.store.push(BScrollFamily.create(scroll));
  };
  NestedScroll.prototype.buildBScrollGraph = function () {
    var store = this.store;
    var bf1;
    var bf2;
    var wrapper1;
    var wrapper2;
    var len = this.store.length;
    // build graph
    for (var i = 0; i < len; i++) {
      bf1 = store[i];
      wrapper1 = bf1.selfScroll.wrapper;
      for (var j = 0; j < len; j++) {
        bf2 = store[j];
        wrapper2 = bf2.selfScroll.wrapper;
        // same bs
        if (bf1 === bf2) continue;
        if (!wrapper1.contains(wrapper2)) continue;
        // bs1 contains bs2
        var distance = calculateDistance(wrapper2, wrapper1);
        if (!bf1.hasDescendants(bf2)) {
          bf1.addDescendant(bf2, distance);
        }
        if (!bf2.hasAncestors(bf1)) {
          bf2.addAncestor(bf1, distance);
        }
      }
    }
  };
  NestedScroll.prototype.analyzeBScrollGraph = function () {
    this.store.forEach(function (bscrollFamily) {
      if (bscrollFamily.analyzed) {
        return;
      }
      var ancestors = bscrollFamily.ancestors,
        descendants = bscrollFamily.descendants,
        currentScroll = bscrollFamily.selfScroll;
      var beforeScrollStartHandler = function () {
        // always get the latest scroll
        var ancestorScrolls = ancestors.map(function (_a) {
          var bscrollFamily = _a[0];
          return bscrollFamily.selfScroll;
        });
        var descendantScrolls = descendants.map(function (_a) {
          var bscrollFamily = _a[0];
          return bscrollFamily.selfScroll;
        });
        forceScrollStopHandler(__spreadArrays(ancestorScrolls, descendantScrolls));
        if (isResettingPosition(currentScroll)) {
          resetPositionHandler(currentScroll);
        }
        syncTouchstartData(ancestorScrolls);
        disableScrollHander(ancestorScrolls, currentScroll);
      };
      var touchEndHandler = function () {
        var ancestorScrolls = ancestors.map(function (_a) {
          var bscrollFamily = _a[0];
          return bscrollFamily.selfScroll;
        });
        var descendantScrolls = descendants.map(function (_a) {
          var bscrollFamily = _a[0];
          return bscrollFamily.selfScroll;
        });
        enableScrollHander(__spreadArrays(ancestorScrolls, descendantScrolls));
      };
      bscrollFamily.registerHooks(currentScroll, currentScroll.eventTypes.beforeScrollStart, beforeScrollStartHandler);
      bscrollFamily.registerHooks(currentScroll, currentScroll.eventTypes.touchEnd, touchEndHandler);
      var selfActionsHooks = currentScroll.scroller.actions.hooks;
      bscrollFamily.registerHooks(selfActionsHooks, selfActionsHooks.eventTypes.detectMovingDirection, function () {
        var ancestorScrolls = ancestors.map(function (_a) {
          var bscrollFamily = _a[0];
          return bscrollFamily.selfScroll;
        });
        var parentScroll = ancestorScrolls[0];
        var otherAncestorScrolls = ancestorScrolls.slice(1);
        var contentMoved = currentScroll.scroller.actions.contentMoved;
        var isTopScroll = ancestorScrolls.length === 0;
        if (contentMoved) {
          disableScrollHander(ancestorScrolls, currentScroll);
        } else if (!isTopScroll) {
          if (isOutOfBoundary(currentScroll)) {
            disableScrollHander([currentScroll], currentScroll);
            if (parentScroll) {
              enableScrollHander([parentScroll]);
            }
            disableScrollHander(otherAncestorScrolls, currentScroll);
            return true;
          }
        }
      });
      bscrollFamily.setAnalyzed(true);
    });
  };
  // make sure touchmove|touchend invoke from child to parent
  NestedScroll.prototype.ensureEventInvokeSequence = function () {
    var copied = this.store.slice();
    var sequencedScroll = copied.sort(function (a, b) {
      return a.descendants.length - b.descendants.length;
    });
    sequencedScroll.forEach(function (bscrollFamily) {
      var scroll = bscrollFamily.selfScroll;
      scroll.scroller.actionsHandler.rebindDOMEvents();
    });
  };
  NestedScroll.prototype.registerHooks = function (hooks, name, handler) {
    hooks.on(name, handler, this);
    this.hooksFn.push([hooks, name, handler]);
  };
  NestedScroll.prototype.purgeNestedScroll = function () {
    var groupId = this.options.groupId;
    this.store.forEach(function (bscrollFamily) {
      bscrollFamily.purge();
    });
    this.store = [];
    this.hooksFn.forEach(function (_a) {
      var hooks = _a[0],
        eventType = _a[1],
        handler = _a[2];
      hooks.off(eventType, handler);
    });
    this.hooksFn = [];
    delete NestedScroll.instancesMap[groupId];
  };
  NestedScroll.pluginName = 'nestedScroll';
  NestedScroll.instancesMap = {};
  return NestedScroll;
}();
var PRE_NUM = 10;
var POST_NUM = 30;
var IndexCalculator = /** @class */function () {
  function IndexCalculator(wrapperHeight, tombstoneHeight) {
    this.wrapperHeight = wrapperHeight;
    this.tombstoneHeight = tombstoneHeight;
    this.lastDirection = 1 /* DOWN */;
    this.lastPos = 0;
  }
  IndexCalculator.prototype.calculate = function (pos, list) {
    var offset = pos - this.lastPos;
    this.lastPos = pos;
    var direction = this.getDirection(offset);
    // important! start index is much more important than end index.
    var start = this.calculateIndex(0, pos, list);
    var end = this.calculateIndex(start, pos + this.wrapperHeight, list);
    if (direction === 1 /* DOWN */) {
      start -= PRE_NUM;
      end += POST_NUM;
    } else {
      start -= POST_NUM;
      end += PRE_NUM;
    }
    if (start < 0) {
      start = 0;
    }
    return {
      start: start,
      end: end
    };
  };
  IndexCalculator.prototype.getDirection = function (offset) {
    var direction;
    if (offset > 0) {
      direction = 1 /* DOWN */;
    } else if (offset < 0) {
      direction = 0 /* UP */;
    } else {
      return this.lastDirection;
    }
    this.lastDirection = direction;
    return direction;
  };
  IndexCalculator.prototype.calculateIndex = function (start, offset, list) {
    if (offset <= 0) {
      return start;
    }
    var i = start;
    var startPos = list[i] && list[i].pos !== -1 ? list[i].pos : 0;
    var lastPos = startPos;
    var tombstone = 0;
    while (i < list.length && list[i].pos < offset) {
      lastPos = list[i].pos;
      i++;
    }
    if (i === list.length) {
      tombstone = Math.floor((offset - lastPos) / this.tombstoneHeight);
    }
    i += tombstone;
    return i;
  };
  IndexCalculator.prototype.resetState = function () {
    this.lastDirection = 1 /* DOWN */;
    this.lastPos = 0;
  };
  return IndexCalculator;
}();
var ListItem = /** @class */function () {
  function ListItem() {
    this.data = null;
    this.dom = null;
    this.tombstone = null;
    this.width = 0;
    this.height = 0;
    this.pos = 0;
  }
  return ListItem;
}();
var DataManager = /** @class */function () {
  function DataManager(list, fetchFn, onFetchFinish) {
    this.fetchFn = fetchFn;
    this.onFetchFinish = onFetchFinish;
    this.loadedNum = 0;
    this.fetching = false;
    this.hasMore = true;
    this.list = list || [];
  }
  DataManager.prototype.update = function (end) {
    return __awaiter(this, void 0, void 0, function () {
      var len;
      return __generator(this, function (_a) {
        if (!this.hasMore) {
          end = Math.min(end, this.list.length);
        }
        // add data placeholder
        if (end > this.list.length) {
          len = end - this.list.length;
          this.addEmptyData(len);
        }
        // tslint:disable-next-line: no-floating-promises
        return [2 /*return*/, this.checkToFetch(end)];
      });
    });
  };
  DataManager.prototype.add = function (data) {
    for (var i = 0; i < data.length; i++) {
      if (!this.list[this.loadedNum]) {
        this.list[this.loadedNum] = {
          data: data[i]
        };
      } else {
        this.list[this.loadedNum] = __assign(__assign({}, this.list[this.loadedNum]), {
          data: data[i]
        });
      }
      this.loadedNum++;
    }
    return this.list;
  };
  DataManager.prototype.addEmptyData = function (len) {
    for (var i = 0; i < len; i++) {
      this.list.push(new ListItem());
    }
    return this.list;
  };
  DataManager.prototype.fetch = function (len) {
    return __awaiter(this, void 0, void 0, function () {
      var data;
      return __generator(this, function (_a) {
        switch (_a.label) {
          case 0:
            if (this.fetching) {
              return [2 /*return*/, []];
            }
            this.fetching = true;
            return [4 /*yield*/, this.fetchFn(len)];
          case 1:
            data = _a.sent();
            this.fetching = false;
            return [2 /*return*/, data];
        }
      });
    });
  };
  DataManager.prototype.checkToFetch = function (end) {
    return __awaiter(this, void 0, void 0, function () {
      var min, newData, currentEnd;
      return __generator(this, function (_a) {
        switch (_a.label) {
          case 0:
            if (!this.hasMore) {
              return [2 /*return*/];
            }
            if (end <= this.loadedNum) {
              return [2 /*return*/];
            }
            min = end - this.loadedNum;
            return [4 /*yield*/, this.fetch(min)];
          case 1:
            newData = _a.sent();
            if (newData instanceof Array && newData.length) {
              this.add(newData);
              currentEnd = this.onFetchFinish(this.list, true);
              return [2 /*return*/, this.checkToFetch(currentEnd)];
            } else if (typeof newData === 'boolean' && newData === false) {
              this.hasMore = false;
              this.list.splice(this.loadedNum);
              this.onFetchFinish(this.list, false);
            }
            return [2 /*return*/];
        }
      });
    });
  };
  DataManager.prototype.getList = function () {
    return this.list;
  };
  DataManager.prototype.resetState = function () {
    this.loadedNum = 0;
    this.fetching = false;
    this.hasMore = true;
    this.list = [];
  };
  return DataManager;
}();
var Tombstone = /** @class */function () {
  function Tombstone(create) {
    this.create = create;
    this.cached = [];
    this.width = 0;
    this.height = 0;
    this.initialed = false;
    this.getSize();
  }
  Tombstone.isTombstone = function (el) {
    if (el && el.classList) {
      return el.classList.contains('tombstone');
    }
    return false;
  };
  Tombstone.prototype.getSize = function () {
    if (!this.initialed) {
      var tombstone = this.create();
      tombstone.style.position = 'absolute';
      document.body.appendChild(tombstone);
      tombstone.style.display = '';
      this.height = tombstone.offsetHeight;
      this.width = tombstone.offsetWidth;
      document.body.removeChild(tombstone);
      this.cached.push(tombstone);
    }
  };
  Tombstone.prototype.getOne = function () {
    var tombstone = this.cached.pop();
    if (tombstone) {
      var tombstoneStyle = tombstone.style;
      tombstoneStyle.display = '';
      tombstoneStyle.opacity = '1';
      tombstoneStyle[style.transform] = '';
      tombstoneStyle[style.transition] = '';
      return tombstone;
    }
    return this.create();
  };
  Tombstone.prototype.recycle = function (tombstones) {
    for (var _i = 0, tombstones_1 = tombstones; _i < tombstones_1.length; _i++) {
      var tombstone = tombstones_1[_i];
      tombstone.style.display = 'none';
      this.cached.push(tombstone);
    }
    return this.cached;
  };
  Tombstone.prototype.recycleOne = function (tombstone) {
    this.cached.push(tombstone);
    return this.cached;
  };
  return Tombstone;
}();
var ANIMATION_DURATION_MS = 200;
var DomManager = /** @class */function () {
  function DomManager(content, renderFn, tombstone) {
    this.renderFn = renderFn;
    this.tombstone = tombstone;
    this.unusedDom = [];
    this.timers = [];
    this.setContent(content);
  }
  DomManager.prototype.update = function (list, start, end) {
    if (start >= list.length) {
      start = list.length - 1;
    }
    if (end > list.length) {
      end = list.length;
    }
    this.collectUnusedDom(list, start, end);
    this.createDom(list, start, end);
    this.cacheHeight(list, start, end);
    var _a = this.positionDom(list, start, end),
      startPos = _a.startPos,
      startDelta = _a.startDelta,
      endPos = _a.endPos;
    return {
      start: start,
      startPos: startPos,
      startDelta: startDelta,
      end: end,
      endPos: endPos
    };
  };
  DomManager.prototype.collectUnusedDom = function (list, start, end) {
    // TODO optimise
    for (var i = 0; i < list.length; i++) {
      if (i === start) {
        i = end - 1;
        continue;
      }
      if (list[i].dom) {
        var dom = list[i].dom;
        if (Tombstone.isTombstone(dom)) {
          this.tombstone.recycleOne(dom);
          dom.style.display = 'none';
        } else {
          this.unusedDom.push(dom);
        }
        list[i].dom = null;
      }
    }
    return list;
  };
  DomManager.prototype.createDom = function (list, start, end) {
    for (var i = start; i < end; i++) {
      var dom = list[i].dom;
      var data = list[i].data;
      if (dom) {
        if (Tombstone.isTombstone(dom) && data) {
          list[i].tombstone = dom;
          list[i].dom = null;
        } else {
          continue;
        }
      }
      dom = data ? this.renderFn(data, this.unusedDom.pop()) : this.tombstone.getOne();
      dom.style.position = 'absolute';
      list[i].dom = dom;
      list[i].pos = -1;
      this.content.appendChild(dom);
    }
  };
  DomManager.prototype.cacheHeight = function (list, start, end) {
    for (var i = start; i < end; i++) {
      if (list[i].data && !list[i].height) {
        list[i].height = list[i].dom.offsetHeight;
      }
    }
  };
  DomManager.prototype.positionDom = function (list, start, end) {
    var _this = this;
    var tombstoneEles = [];
    var _a = this.getStartPos(list, start, end),
      startPos = _a.start,
      startDelta = _a.delta;
    var pos = startPos;
    for (var i = start; i < end; i++) {
      var tombstone = list[i].tombstone;
      if (tombstone) {
        var tombstoneStyle = tombstone.style;
        tombstoneStyle[style.transition] = cssVendor + "transform " + ANIMATION_DURATION_MS + "ms, opacity " + ANIMATION_DURATION_MS + "ms";
        tombstoneStyle[style.transform] = "translateY(" + pos + "px)";
        tombstoneStyle.opacity = '0';
        list[i].tombstone = null;
        tombstoneEles.push(tombstone);
      }
      if (list[i].dom && list[i].pos !== pos) {
        list[i].dom.style[style.transform] = "translateY(" + pos + "px)";
        list[i].pos = pos;
      }
      pos += list[i].height || this.tombstone.height;
    }
    var timerId = window.setTimeout(function () {
      _this.tombstone.recycle(tombstoneEles);
    }, ANIMATION_DURATION_MS);
    this.timers.push(timerId);
    return {
      startPos: startPos,
      startDelta: startDelta,
      endPos: pos
    };
  };
  DomManager.prototype.getStartPos = function (list, start, end) {
    if (list[start] && list[start].pos !== -1) {
      return {
        start: list[start].pos,
        delta: 0
      };
    }
    // TODO optimise
    var pos = list[0].pos === -1 ? 0 : list[0].pos;
    for (var i_1 = 0; i_1 < start; i_1++) {
      pos += list[i_1].height || this.tombstone.height;
    }
    var originPos = pos;
    var i;
    for (i = start; i < end; i++) {
      if (!Tombstone.isTombstone(list[i].dom) && list[i].pos !== -1) {
        pos = list[i].pos;
        break;
      }
    }
    var x = i;
    if (x < end) {
      while (x > start) {
        pos -= list[x - 1].height;
        x--;
      }
    }
    var delta = originPos - pos;
    return {
      start: pos,
      delta: delta
    };
  };
  DomManager.prototype.removeTombstone = function () {
    var tombstones = this.content.querySelectorAll('.tombstone');
    for (var i = tombstones.length - 1; i >= 0; i--) {
      this.content.removeChild(tombstones[i]);
    }
  };
  DomManager.prototype.setContent = function (content) {
    if (content !== this.content) {
      this.content = content;
    }
  };
  DomManager.prototype.destroy = function () {
    this.removeTombstone();
    this.timers.forEach(function (id) {
      clearTimeout(id);
    });
  };
  DomManager.prototype.resetState = function () {
    this.destroy();
    this.timers = [];
    this.unusedDom = [];
  };
  return DomManager;
}();
var EXTRA_SCROLL_Y = -2000;
var InfinityScroll = /** @class */function () {
  function InfinityScroll(scroll) {
    this.scroll = scroll;
    this.start = 0;
    this.end = 0;
    this.init();
  }
  InfinityScroll.prototype.init = function () {
    var _this = this;
    this.handleOptions();
    var _a = this.options,
      fetchFn = _a.fetch,
      renderFn = _a.render,
      createTombstoneFn = _a.createTombstone;
    this.tombstone = new Tombstone(createTombstoneFn);
    this.indexCalculator = new IndexCalculator(this.scroll.scroller.scrollBehaviorY.wrapperSize, this.tombstone.height);
    this.domManager = new DomManager(this.scroll.scroller.content, renderFn, this.tombstone);
    this.dataManager = new DataManager([], fetchFn, this.onFetchFinish.bind(this));
    this.scroll.on(this.scroll.eventTypes.destroy, this.destroy, this);
    this.scroll.on(this.scroll.eventTypes.scroll, this.update, this);
    this.scroll.on(this.scroll.eventTypes.contentChanged, function (content) {
      _this.domManager.setContent(content);
      _this.indexCalculator.resetState();
      _this.domManager.resetState();
      _this.dataManager.resetState();
      _this.update({
        y: 0
      });
    });
    var scrollBehaviorY = this.scroll.scroller.scrollBehaviorY;
    scrollBehaviorY.hooks.on(scrollBehaviorY.hooks.eventTypes.computeBoundary, this.modifyBoundary, this);
    this.update({
      y: 0
    });
  };
  InfinityScroll.prototype.modifyBoundary = function (boundary) {
    // manually set position to allow scroll
    boundary.maxScrollPos = EXTRA_SCROLL_Y;
  };
  InfinityScroll.prototype.handleOptions = function () {
    // narrow down type to an object
    var infinityOptions = this.scroll.options.infinity;
    if (infinityOptions) {
      if (typeof infinityOptions.fetch !== 'function') {
        warn('Infinity plugin need fetch Function to new data.');
      }
      if (typeof infinityOptions.render !== 'function') {
        warn('Infinity plugin need render Function to render each item.');
      }
      if (typeof infinityOptions.render !== 'function') {
        warn('Infinity plugin need createTombstone Function to create tombstone.');
      }
      this.options = infinityOptions;
    }
    this.scroll.options.probeType = 3 /* Realtime */;
  };
  InfinityScroll.prototype.update = function (pos) {
    var position = Math.round(-pos.y);
    // important! calculate start/end index to render
    var _a = this.indexCalculator.calculate(position, this.dataManager.getList()),
      start = _a.start,
      end = _a.end;
    this.start = start;
    this.end = end;
    // tslint:disable-next-line: no-floating-promises
    this.dataManager.update(end);
    this.updateDom(this.dataManager.getList());
  };
  InfinityScroll.prototype.onFetchFinish = function (list, hasMore) {
    var end = this.updateDom(list).end;
    if (!hasMore) {
      this.domManager.removeTombstone();
      this.scroll.scroller.animater.stop();
      this.scroll.resetPosition();
    }
    // tslint:disable-next-line: no-floating-promises
    return end;
  };
  InfinityScroll.prototype.updateDom = function (list) {
    var _a = this.domManager.update(list, this.start, this.end),
      end = _a.end,
      startPos = _a.startPos,
      endPos = _a.endPos,
      startDelta = _a.startDelta;
    if (startDelta) {
      this.scroll.minScrollY = startDelta;
    }
    if (endPos > this.scroll.maxScrollY) {
      this.scroll.maxScrollY = -(endPos - this.scroll.scroller.scrollBehaviorY.wrapperSize);
    }
    return {
      end: end,
      startPos: startPos,
      endPos: endPos
    };
  };
  InfinityScroll.prototype.destroy = function () {
    var _a = this.scroll.scroller,
      content = _a.content,
      scrollBehaviorY = _a.scrollBehaviorY;
    while (content.firstChild) {
      content.removeChild(content.firstChild);
    }
    this.domManager.destroy();
    this.scroll.off('scroll', this.update);
    this.scroll.off('destroy', this.destroy);
    scrollBehaviorY.hooks.off(scrollBehaviorY.hooks.eventTypes.computeBoundary);
  };
  InfinityScroll.pluginName = 'infinity';
  return InfinityScroll;
}();
var sourcePrefix = 'plugins.movable';
var propertiesMap = [{
  key: 'putAt',
  name: 'putAt'
}];
var propertiesConfig = propertiesMap.map(function (item) {
  return {
    key: item.key,
    sourceKey: sourcePrefix + "." + item.name
  };
});
var Movable = /** @class */function () {
  function Movable(scroll) {
    this.scroll = scroll;
    this.handleBScroll();
    this.handleHooks();
  }
  Movable.prototype.handleBScroll = function () {
    this.scroll.proxy(propertiesConfig);
  };
  Movable.prototype.handleHooks = function () {
    var _this = this;
    this.hooksFn = [];
    var _a = this.scroll.scroller,
      scrollBehaviorX = _a.scrollBehaviorX,
      scrollBehaviorY = _a.scrollBehaviorY;
    var computeBoundary = function (boundary, behavior) {
      if (boundary.maxScrollPos > 0) {
        // content is smaller than wrapper
        boundary.minScrollPos = behavior.wrapperSize - behavior.contentSize;
        boundary.maxScrollPos = 0;
      }
    };
    this.registerHooks(scrollBehaviorX.hooks, scrollBehaviorX.hooks.eventTypes.ignoreHasScroll, function () {
      return true;
    });
    this.registerHooks(scrollBehaviorX.hooks, scrollBehaviorX.hooks.eventTypes.computeBoundary, function (boundary) {
      computeBoundary(boundary, scrollBehaviorX);
    });
    this.registerHooks(scrollBehaviorY.hooks, scrollBehaviorY.hooks.eventTypes.ignoreHasScroll, function () {
      return true;
    });
    this.registerHooks(scrollBehaviorY.hooks, scrollBehaviorY.hooks.eventTypes.computeBoundary, function (boundary) {
      computeBoundary(boundary, scrollBehaviorY);
    });
    this.registerHooks(this.scroll.hooks, this.scroll.hooks.eventTypes.destroy, function () {
      _this.destroy();
    });
  };
  Movable.prototype.putAt = function (x, y, time, easing) {
    if (time === void 0) {
      time = this.scroll.options.bounceTime;
    }
    if (easing === void 0) {
      easing = ease.bounce;
    }
    var position = this.resolvePostion(x, y);
    this.scroll.scrollTo(position.x, position.y, time, easing);
  };
  Movable.prototype.resolvePostion = function (x, y) {
    var _a = this.scroll.scroller,
      scrollBehaviorX = _a.scrollBehaviorX,
      scrollBehaviorY = _a.scrollBehaviorY;
    var resolveFormula = {
      left: function () {
        return 0;
      },
      top: function () {
        return 0;
      },
      right: function () {
        return scrollBehaviorX.minScrollPos;
      },
      bottom: function () {
        return scrollBehaviorY.minScrollPos;
      },
      center: function (index) {
        var baseSize = index === 0 ? scrollBehaviorX.minScrollPos : scrollBehaviorY.minScrollPos;
        return baseSize / 2;
      }
    };
    return {
      x: typeof x === 'number' ? x : resolveFormula[x](0),
      y: typeof y === 'number' ? y : resolveFormula[y](1)
    };
  };
  Movable.prototype.destroy = function () {
    this.hooksFn.forEach(function (item) {
      var hooks = item[0];
      var hooksName = item[1];
      var handlerFn = item[2];
      hooks.off(hooksName, handlerFn);
    });
    this.hooksFn.length = 0;
  };
  Movable.prototype.registerHooks = function (hooks, name, handler) {
    hooks.on(name, handler, this);
    this.hooksFn.push([hooks, name, handler]);
  };
  Movable.pluginName = 'movable';
  Movable.applyOrder = "pre" /* Pre */;
  return Movable;
}();
var isImageTag = function (el) {
  return el.tagName.toLowerCase() === 'img';
};
var ObserveImage = /** @class */function () {
  function ObserveImage(scroll) {
    this.scroll = scroll;
    this.refreshTimer = 0;
    this.init();
  }
  ObserveImage.prototype.init = function () {
    this.handleOptions(this.scroll.options.observeImage);
    this.bindEventsToWrapper();
  };
  ObserveImage.prototype.handleOptions = function (userOptions) {
    if (userOptions === void 0) {
      userOptions = {};
    }
    userOptions = userOptions === true ? {} : userOptions;
    var defaultOptions = {
      debounceTime: 100
    };
    this.options = extend(defaultOptions, userOptions);
  };
  ObserveImage.prototype.bindEventsToWrapper = function () {
    var wrapper = this.scroll.scroller.wrapper;
    this.imageLoadEventRegister = new EventRegister(wrapper, [{
      name: 'load',
      handler: this.load.bind(this),
      capture: true
    }]);
    this.imageErrorEventRegister = new EventRegister(wrapper, [{
      name: 'error',
      handler: this.load.bind(this),
      capture: true
    }]);
  };
  ObserveImage.prototype.load = function (e) {
    var _this = this;
    var target = e.target;
    var debounceTime = this.options.debounceTime;
    if (target && isImageTag(target)) {
      if (debounceTime === 0) {
        this.scroll.refresh();
      } else {
        clearTimeout(this.refreshTimer);
        this.refreshTimer = window.setTimeout(function () {
          _this.scroll.refresh();
        }, this.options.debounceTime);
      }
    }
  };
  ObserveImage.pluginName = 'observeImage';
  return ObserveImage;
}();
var resolveRatioOption = function (ratioConfig) {
  var ret = {
    ratioX: 0,
    ratioY: 0
  };
  /* istanbul ignore if  */
  if (!ratioConfig) {
    return ret;
  }
  if (typeof ratioConfig === 'number') {
    ret.ratioX = ret.ratioY = ratioConfig;
  } else if (typeof ratioConfig === 'object' && ratioConfig) {
    ret.ratioX = ratioConfig.x || 0;
    ret.ratioY = ratioConfig.y || 0;
  }
  return ret;
};
var handleBubbleAndCancelable = function (e) {
  maybePrevent(e);
  e.stopPropagation();
};
var Indicator = /** @class */function () {
  function Indicator(scroll, options) {
    this.scroll = scroll;
    this.options = options;
    this.currentPos = {
      x: 0,
      y: 0
    };
    this.hooksFn = [];
    this.handleDOM();
    this.handleHooks();
    this.handleInteractive();
  }
  Indicator.prototype.handleDOM = function () {
    var _a = this.options,
      relationElement = _a.relationElement,
      _b = _a.relationElementHandleElementIndex,
      relationElementHandleElementIndex = _b === void 0 ? 0 : _b;
    this.wrapper = relationElement;
    this.indicatorEl = this.wrapper.children[relationElementHandleElementIndex];
  };
  Indicator.prototype.handleHooks = function () {
    var _this = this;
    var scroll = this.scroll;
    var scrollHooks = scroll.hooks;
    var translaterHooks = scroll.scroller.translater.hooks;
    var animaterHooks = scroll.scroller.animater.hooks;
    this.registerHooks(scrollHooks, scrollHooks.eventTypes.refresh, this.refresh);
    this.registerHooks(translaterHooks, translaterHooks.eventTypes.translate, function (pos) {
      _this.updatePosition(pos);
    });
    this.registerHooks(animaterHooks, animaterHooks.eventTypes.time, this.transitionTime);
    this.registerHooks(animaterHooks, animaterHooks.eventTypes.timeFunction, this.transitionTimingFunction);
  };
  Indicator.prototype.transitionTime = function (time) {
    if (time === void 0) {
      time = 0;
    }
    this.indicatorEl.style[style.transitionDuration] = time + 'ms';
  };
  Indicator.prototype.transitionTimingFunction = function (easing) {
    this.indicatorEl.style[style.transitionTimingFunction] = easing;
  };
  Indicator.prototype.handleInteractive = function () {
    if (this.options.interactive !== false) {
      this.registerEvents();
    }
  };
  Indicator.prototype.registerHooks = function (hooks, name, handler) {
    hooks.on(name, handler, this);
    this.hooksFn.push([hooks, name, handler]);
  };
  Indicator.prototype.registerEvents = function () {
    var _a = this.scroll.options,
      disableMouse = _a.disableMouse,
      disableTouch = _a.disableTouch;
    var startEvents = [];
    var moveEvents = [];
    var endEvents = [];
    if (!disableMouse) {
      startEvents.push({
        name: 'mousedown',
        handler: this.start.bind(this)
      });
      moveEvents.push({
        name: 'mousemove',
        handler: this.move.bind(this)
      });
      endEvents.push({
        name: 'mouseup',
        handler: this.end.bind(this)
      });
    }
    if (!disableTouch) {
      startEvents.push({
        name: 'touchstart',
        handler: this.start.bind(this)
      });
      moveEvents.push({
        name: 'touchmove',
        handler: this.move.bind(this)
      });
      endEvents.push({
        name: 'touchend',
        handler: this.end.bind(this)
      }, {
        name: 'touchcancel',
        handler: this.end.bind(this)
      });
    }
    this.startEventRegister = new EventRegister(this.indicatorEl, startEvents);
    this.moveEventRegister = new EventRegister(window, moveEvents);
    this.endEventRegister = new EventRegister(window, endEvents);
  };
  Indicator.prototype.refresh = function () {
    var _a = this.scroll,
      x = _a.x,
      y = _a.y,
      hasHorizontalScroll = _a.hasHorizontalScroll,
      hasVerticalScroll = _a.hasVerticalScroll,
      maxBScrollX = _a.maxScrollX,
      maxBScrollY = _a.maxScrollY;
    var _b = resolveRatioOption(this.options.ratio),
      ratioX = _b.ratioX,
      ratioY = _b.ratioY;
    var _c = getClientSize(this.wrapper),
      wrapperWidth = _c.width,
      wrapperHeight = _c.height;
    var _d = getRect(this.indicatorEl),
      indicatorWidth = _d.width,
      indicatorHeight = _d.height;
    if (hasHorizontalScroll) {
      this.maxScrollX = wrapperWidth - indicatorWidth;
      this.translateXSign = this.maxScrollX > 0 ? -1 /* Positive */ : 1 /* NotPositive */;
      this.minScrollX = 0;
      // ensure positive
      this.ratioX = ratioX ? ratioX : Math.abs(this.maxScrollX / maxBScrollX);
    }
    if (hasVerticalScroll) {
      this.maxScrollY = wrapperHeight - indicatorHeight;
      this.translateYSign = this.maxScrollY > 0 ? -1 /* Positive */ : 1 /* NotPositive */;
      this.minScrollY = 0;
      this.ratioY = ratioY ? ratioY : Math.abs(this.maxScrollY / maxBScrollY);
    }
    this.updatePosition({
      x: x,
      y: y
    });
  };
  Indicator.prototype.start = function (e) {
    if (this.BScrollIsDisabled()) {
      return;
    }
    var point = e.touches ? e.touches[0] : e;
    handleBubbleAndCancelable(e);
    this.initiated = true;
    this.moved = false;
    this.lastPointX = point.pageX;
    this.lastPointY = point.pageY;
    this.startTime = getNow();
    this.scroll.scroller.hooks.trigger(this.scroll.scroller.hooks.eventTypes.beforeScrollStart);
  };
  Indicator.prototype.BScrollIsDisabled = function () {
    return !this.scroll.enabled;
  };
  Indicator.prototype.move = function (e) {
    if (!this.initiated) {
      return;
    }
    var point = e.touches ? e.touches[0] : e;
    var pointX = point.pageX;
    var pointY = point.pageY;
    handleBubbleAndCancelable(e);
    var deltaX = pointX - this.lastPointX;
    var deltaY = pointY - this.lastPointY;
    this.lastPointX = pointX;
    this.lastPointY = pointY;
    if (!this.moved && !this.indicatorNotMoved(deltaX, deltaY)) {
      this.moved = true;
      this.scroll.scroller.hooks.trigger(this.scroll.scroller.hooks.eventTypes.scrollStart);
    }
    if (this.moved) {
      var newPos = this.getBScrollPosByRatio(this.currentPos, deltaX, deltaY);
      this.syncBScroll(newPos);
    }
  };
  Indicator.prototype.end = function (e) {
    if (!this.initiated) {
      return;
    }
    this.initiated = false;
    handleBubbleAndCancelable(e);
    if (this.moved) {
      var _a = this.scroll,
        x = _a.x,
        y = _a.y;
      this.scroll.scroller.hooks.trigger(this.scroll.scroller.hooks.eventTypes.scrollEnd, {
        x: x,
        y: y
      });
    }
  };
  Indicator.prototype.getBScrollPosByRatio = function (currentPos, deltaX, deltaY) {
    var currentX = currentPos.x,
      currentY = currentPos.y;
    var _a = this.scroll,
      hasHorizontalScroll = _a.hasHorizontalScroll,
      hasVerticalScroll = _a.hasVerticalScroll,
      BScrollMinScrollX = _a.minScrollX,
      BScrollMaxScrollX = _a.maxScrollX,
      BScrollMinScrollY = _a.minScrollY,
      BScrollMaxScrollY = _a.maxScrollY;
    var _b = this.scroll,
      x = _b.x,
      y = _b.y;
    if (hasHorizontalScroll) {
      var newPosX = between(currentX + deltaX, Math.min(this.minScrollX, this.maxScrollX), Math.max(this.minScrollX, this.maxScrollX));
      var roundX = Math.round(newPosX / this.ratioX * this.translateXSign);
      x = between(roundX, BScrollMaxScrollX, BScrollMinScrollX);
    }
    if (hasVerticalScroll) {
      var newPosY = between(currentY + deltaY, Math.min(this.minScrollY, this.maxScrollY), Math.max(this.minScrollY, this.maxScrollY));
      var roundY = Math.round(newPosY / this.ratioY * this.translateYSign);
      y = between(roundY, BScrollMaxScrollY, BScrollMinScrollY);
    }
    return {
      x: x,
      y: y
    };
  };
  Indicator.prototype.indicatorNotMoved = function (deltaX, deltaY) {
    var _a = this.currentPos,
      x = _a.x,
      y = _a.y;
    var xNotMoved = x === this.minScrollX && deltaX <= 0 || x === this.maxScrollX && deltaX >= 0;
    var yNotMoved = y === this.minScrollY && deltaY <= 0 || y === this.maxScrollY && deltaY >= 0;
    return xNotMoved && yNotMoved;
  };
  Indicator.prototype.syncBScroll = function (newPos) {
    var timestamp = getNow();
    var _a = this.scroll,
      options = _a.options,
      scroller = _a.scroller;
    var probeType = options.probeType,
      momentumLimitTime = options.momentumLimitTime;
    scroller.translater.translate(newPos);
    // dispatch scroll in interval time
    if (timestamp - this.startTime > momentumLimitTime) {
      this.startTime = timestamp;
      if (probeType === 1 /* Throttle */) {
        scroller.hooks.trigger(scroller.hooks.eventTypes.scroll, newPos);
      }
    }
    // dispatch scroll all the time
    if (probeType > 1 /* Throttle */) {
      scroller.hooks.trigger(scroller.hooks.eventTypes.scroll, newPos);
    }
  };
  Indicator.prototype.updatePosition = function (BScrollPos) {
    var newIndicatorPos = this.getIndicatorPosByRatio(BScrollPos);
    this.applyTransformProperty(newIndicatorPos);
    this.currentPos = __assign({}, newIndicatorPos);
  };
  Indicator.prototype.applyTransformProperty = function (pos) {
    var translateZ = this.scroll.options.translateZ;
    var transformProperties = ["translateX(" + pos.x + "px)", "translateY(" + pos.y + "px)", "" + translateZ];
    this.indicatorEl.style[style.transform] = transformProperties.join(' ');
  };
  Indicator.prototype.getIndicatorPosByRatio = function (BScrollPos) {
    var x = BScrollPos.x,
      y = BScrollPos.y;
    var _a = this.scroll,
      hasHorizontalScroll = _a.hasHorizontalScroll,
      hasVerticalScroll = _a.hasVerticalScroll;
    var position = __assign({}, this.currentPos);
    if (hasHorizontalScroll) {
      var roundX = Math.round(this.ratioX * x * this.translateXSign);
      // maybe maxScrollX is negative
      position.x = between(roundX, Math.min(this.minScrollX, this.maxScrollX), Math.max(this.minScrollX, this.maxScrollX));
    }
    if (hasVerticalScroll) {
      var roundY = Math.round(this.ratioY * y * this.translateYSign);
      // maybe maxScrollY is negative
      position.y = between(roundY, Math.min(this.minScrollY, this.maxScrollY), Math.max(this.minScrollY, this.maxScrollY));
    }
    return position;
  };
  Indicator.prototype.destroy = function () {
    if (this.options.interactive !== false) {
      this.startEventRegister.destroy();
      this.moveEventRegister.destroy();
      this.endEventRegister.destroy();
    }
    this.hooksFn.forEach(function (item) {
      var hooks = item[0];
      var hooksName = item[1];
      var handlerFn = item[2];
      hooks.off(hooksName, handlerFn);
    });
    this.hooksFn.length = 0;
  };
  return Indicator;
}();
var Indicators = /** @class */function () {
  function Indicators(scroll) {
    this.scroll = scroll;
    this.options = [];
    this.indicators = [];
    this.handleOptions();
    this.handleHooks();
  }
  Indicators.prototype.handleOptions = function () {
    var UserIndicatorsOptions = this.scroll.options.indicators;
    assert(Array.isArray(UserIndicatorsOptions), "'indicators' must be an array.");
    for (var _i = 0, UserIndicatorsOptions_1 = UserIndicatorsOptions; _i < UserIndicatorsOptions_1.length; _i++) {
      var indicatorOptions = UserIndicatorsOptions_1[_i];
      assert(!!indicatorOptions.relationElement, "'relationElement' must be a HTMLElement.");
      this.createIndicators(indicatorOptions);
    }
  };
  Indicators.prototype.createIndicators = function (options) {
    this.indicators.push(new Indicator(this.scroll, options));
  };
  Indicators.prototype.handleHooks = function () {
    var _this = this;
    var scrollHooks = this.scroll.hooks;
    scrollHooks.on(scrollHooks.eventTypes.destroy, function () {
      for (var _i = 0, _a = _this.indicators; _i < _a.length; _i++) {
        var indicator = _a[_i];
        indicator.destroy();
      }
      _this.indicators = [];
    });
  };
  Indicators.pluginName = 'indicators';
  return Indicators;
}();
BScroll.use(MouseWheel).use(ObserveDOM).use(PullDown).use(PullUp).use(ScrollBar).use(Slide).use(Wheel).use(Zoom).use(NestedScroll).use(InfinityScroll).use(Movable).use(ObserveImage).use(Indicators);

//
var script$1_ = {
  name: 'PreviewLooseLeaf',
  props: {
    looseLeaf: Object,
    businessType: String,
    // 业务类型：looseLeaf，textBook
    looseLeafId: {
      type: String,
      default: ''
    },
    pTitle: {
      type: String,
      default: ''
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    officePreviewPath: {
      type: String,
      default: ''
    },
    readerType: {
      type: String,
      default: 'reader'
    },
    pageType: {
      type: String,
      default: 'h5'
    },
    // 页面类型：取值h5、pc、pad
    CompList: Array,
    textDomList: Array,
    textBookList: Array,
    isTrial: {
      // 是否为试读模式
      type: Boolean,
      default: false
    },
    trialText: {
      // 试读结束提示语
      type: String,
      default: '<p>--- 试读结束 ---</p>'
    },
    isShowAi: {
      type: String,
      default: '1'
    },
    userType: {
      // 用户类型，可选teacher、student
      type: String,
      default: 'teacher'
    },
    resourcesList: {
      //教师资源列表
      type: Array,
      default: () => []
    },
    teacherNoteList: {
      //本章节教师笔记列表
      type: Array,
      default: () => []
    },
    studentNoteList: {
      //本章节教师笔记列表
      type: Array,
      default: () => []
    },
    highlightList: {
      //本章节高亮列表
      type: Array,
      default: () => []
    },
    isShowTeacherResource: {
      // 是否显示教师资源
      type: Boolean,
      default: false
    },
    isCopyUrl: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      xmlCompList: [],
      looseLeafData: {},
      title: '',
      showEmpty: false,
      inlineWordsModal: {
        title: '',
        visible: false,
        content: ''
      },
      mouseOverGroupIndex: -1,
      readerBoxId: `readerbox_#_${new Date().getTime()}`,
      hammerManager: null,
      bscroll: null,
      startIndex: 0,
      endIndex: 20,
      isInitialLoad: true,
      //是否是初次加载
      isScrollMore: true,
      isScrollDown: true,
      //是否向下滚动
      pageHeight: this.CompList.length * 600,
      //页面总高度
      contnetHeight: 0,
      //当前显示内容的高度
      paddingTop: 0,
      //顶部占位高度
      paddingBottom: 0,
      //底部占位高度
      endTime: 0
    };
  },
  provide() {
    return {
      getProviderUserType: () => this.userType,
      getProviderInsideIndex: () => this.mouseOverGroupIndex,
      getReaderBoxId: () => this.readerBoxId,
      getTeacherNoteList: () => this.teacherNoteList,
      getStudentNoteList: () => this.studentNoteList,
      getHighlightList: () => this.highlightList,
      getInitialLoad: () => this.isInitialLoad
    };
  },
  watch: {
    looseLeafId: {
      handler(newValue) {
        // if (newValue) {
        //   this.queryData()
        // }
      },
      immediate: true,
      deep: true
    },
    pTitle: {
      handler(newValue) {
        this.title = newValue;
      },
      immediate: true,
      deep: true
    }
  },
  computed: {
    contentStyle() {
      let data = {
        // height: this.CompList.length * 600 + 'px',
        height: this.pageHeight + 'px',
        padding: `${this.paddingTop}px 0px ${this.paddingBottom}px 0px`,
        justifyContent: this.isScrollDown ? 'flex-start' : 'flex-end'
      };
      return data;
    }
  },
  created() {
    // this.$nextTick(() => {
    //   setTimeout(() => {
    //     $('a').attr('target', '_self')
    //   }, 2000)
    //   window.inlineWordsShow = (uuid) => {
    //     const ele = document.getElementById(`words__${uuid}`)
    //     const { title = '', content = '' } = ele.dataset || {}
    //     this.inlineWordsModal = { title, content, visible: true }
    //   }
    // })
    // this.xmlCompList = this.CompList
    // setTimeout(() => {
    //   this.showDom = true
    // }, 1000)
  },
  mounted() {
    delete hammer.defaults.cssProps.userSelect;
    this.$nextTick(() => {
      let readerBox = document.getElementById(this.readerBoxId);
      let hammerManager = new hammer.Manager(readerBox, {
        touchAction: 'pan-y'
      });
      hammerManager.add(new hammer.Pan({
        event: 'panstart',
        pointers: 0,
        threshold: 0
      }));
      hammerManager.get('panstart').set({
        direction: hammer.DIRECTION_ALL
      });
      hammerManager.add(new hammer.Pan({
        event: 'panmove',
        pointers: 0,
        threshold: 5
      }).recognizeWith(hammerManager.get('panstart')));
      hammerManager.add(new hammer.Pan({
        event: 'panend',
        pointers: 1,
        threshold: 32
      }).recognizeWith(hammerManager.get('panstart')));
      hammerManager.on('panend', function (e) {
        // console.log("%c%s","font-size:2em;background: #00965E;color: #FFF",'Panend~~~',e)
      });
      this.hammerManager = hammerManager;
      setTimeout(() => {
        if (this.readerType !== 'loose-leaf') {
          this.initSlider();
          this.getPageHeight();
        } else {
          // this.endIndex = this.CompList.length
          this.endIndex = 50;
        }
      }, 1000);
      setTimeout(() => {
        this.isInitialLoad = false;
      }, 3000);
    });
  },
  methods: {
    goBack() {
      this.$emit('onGoBack');
    },
    handleMouseOver(e) {
      const path = e.composedPath();
      const groupTarget = path.find(item => item.classList && item.classList.contains('parent-group'));
      let id = groupTarget?.getAttribute('id') || '';
      this.mouseOverGroupIndex = id ? this.CompList.findIndex(item => item.location === id) : -1;
    },
    downloadFile(e) {
      this.$emit('downloadFile', e);
    },
    showFileReader(e) {
      this.$emit('showFileReader', e);
    },
    openTestPaper({
      info,
      showRobot
    }) {
      this.$emit('openTestPaper', {
        info: info,
        showRobot: showRobot
      });
    },
    openAIanalysis(e) {
      this.$emit('setanalysis', e);
    },
    clickComp(item) {
      // this.mouseOverGroupIndex = -1
      this.$emit('clickComp', item);
    },
    // 驼峰命名
    allCapital(value) {
      const matched = value.match(/[A-Z]+/);
      return matched && matched[0] === value;
    },
    // 添加教师资源
    addTeacherResources(item) {
      this.$emit('addTeacherResources', item);
    },
    // 短横线命名
    toKebabCase(value) {
      if (this.allCapital(value)) {
        return value.toLocaleLowerCase();
      }
      return value.charAt(0).toLowerCase() + value.slice(1).replace(/([A-Z])/g, '-$1').toLowerCase();
    },
    // 计算某个块中的教师资源数量
    getResourcesNumber(f) {
      let s = JSON.stringify(this.resourcesList);
      let r = s.indexOf(f);
      let c = 0;
      while (r != -1) {
        c++;
        r = s.indexOf(f, r + 1);
      }
      return c;
    },
    // 打开教师资源列表
    openTeacherResoucesList(item) {
      this.getResourcesNumber(item.location);
      setTimeout(() => {
        // if (num > 0) {
        this.$emit('openTeacherResoucesList', item);
        // }
      }, 300);
    },
    openHtml(data) {
      this.$emit('openHtml', data);
    },
    copyHtmlUrl(data) {
      this.$emit('copyHtmlUrl', data);
    },
    // 初始化BScroll
    initSlider() {
      this.bscroll = new BScroll(document.getElementById(this.readerBoxId), {
        scrollY: true,
        probeType: 3,
        stopPropagation: true,
        pullUpLoad: true,
        mouseWheel: true,
        preventDefault: false,
        bounce: false,
        stopPropagation: true
      });
      // 监听滚动事件
      this.bscroll.on('scroll', e => {
        if (this.endTime + 1000 < new Date().getTime()) {
          this.endTime = new Date().getTime();
          this.getPageHeight();
        }

        //向下滚动
        if (this.bscroll.movingDirectionY === 1) {
          if (!this.isScrollDown) {
            this.paddingTop = this.pageHeight - this.paddingBottom - this.contnetHeight;
            this.paddingBottom = 0;
          }
          this.isScrollDown = true;
          if (e.y - 1000 < -(this.contnetHeight + this.paddingTop) && this.isScrollMore) {
            let num = this.CompList.length - this.endIndex > 10 ? 10 : this.CompList.length - this.endIndex;
            if (num > 0) {
              let nodes = this.$refs.items || [];
              nodes.forEach((node, index) => {
                // 获取 真实DOM高度
                const {
                  height
                } = node.getBoundingClientRect();
                if (index < num) {
                  this.paddingTop += height;
                }
              });
              this.bscroll.stop();
              this.bscroll.disable();
              this.startIndex += num;
              this.loadMore('down', num);
            }
          }
        } else {
          if (this.isScrollDown) {
            this.paddingBottom = this.pageHeight - this.paddingTop - this.contnetHeight;
            this.paddingTop = 0;
          }
          this.isScrollDown = false;
          if (e.y + 1000 > -(this.pageHeight - (this.contnetHeight + this.paddingBottom)) && this.isScrollMore) {
            let num = this.startIndex > 10 ? 10 : this.startIndex;
            if (num > 0) {
              let nodes = this.$refs.items || [];
              let paddingBottom = 0;
              nodes.forEach((node, index) => {
                // 获取 真实DOM高度
                const {
                  height
                } = node.getBoundingClientRect();
                if (nodes.length - index <= num) {
                  paddingBottom += height;
                }
              });
              this.paddingBottom += paddingBottom;
              this.bscroll.stop();
              this.bscroll.disable();
              this.endIndex -= num;
              this.loadMore('up', num);
            }
          }
        }
      });
      this.bscroll.on('scrollEnd', e => {
        this.bscroll.refresh(); //重新计算 BetterScroll
      });
    },
    // 加载更多
    loadMore(direction) {
      this.getPageHeight();
      if (this.isScrollMore) {
        this.isScrollMore = false;
        let num = 0;
        if (direction == 'down') {
          num = this.CompList.length - this.endIndex > 10 ? 10 : this.CompList.length - this.endIndex;
          this.endIndex += num;
        } else if (direction == 'up') {
          num = this.startIndex > 10 ? 10 : this.startIndex;
          this.startIndex -= num;
        }
        setTimeout(() => {
          this.isScrollMore = true;
          this.bscroll.enable();
          if (this.contnetHeight < 3000) {
            this.loadMore(direction, 0);
          }
        }, 300);
      }
    },
    // 获取页面高度
    getPageHeight() {
      let contnetHeight = 0;
      this.$nextTick(() => {
        let nodes = this.$refs.items;
        nodes.forEach(node => {
          // 获取 真实DOM高度
          const {
            height
          } = node.getBoundingClientRect();
          contnetHeight += height;
        });
        this.contnetHeight = contnetHeight;
        if (this.endIndex === this.CompList.length && this.isScrollDown) {
          this.pageHeight = this.paddingTop + this.contnetHeight;
        } else if (this.startIndex === 0 && !this.isScrollDown) {
          this.pageHeight = this.paddingBottom + this.contnetHeight;
        }
        // if (!this.isScrollDown) {
        //   if (this.pageHeight - this.paddingBottom < this.contnetHeight) {
        //     console.log('aaaaaaaaaaaaaaaa')
        //     this.pageHeight += 8000
        //     this.bscroll.refresh() //重新计算 BetterScroll
        //     this.bscroll.stop()
        //     this.bscroll.disable()
        //     this.bscroll.scrollTo(0, -8000, 0)
        //     setTimeout(() => {
        //       this.bscroll.enable()
        //     }, 200)
        //   }
        // }
      });
    },
    // 加载更多后滚动到加载前的位置
    scrollToElement(scrollItem, top) {
      this.$nextTick(() => {
        this.bscroll.finishPullUp(); //上拉加载动作结束,
        this.bscroll.scrollToElement(scrollItem, 0, 0, -top);
        this.$emit('initObserver');
      });
    },
    // 跳转到指定位置
    jumpTo(componentIndex, type, scrollId, callback) {
      let num = this.CompList.length - this.endIndex > 10 ? 10 : this.CompList.length - this.endIndex;
      if (componentIndex < 20) {
        this.startIndex = 0;
        this.endIndex = 20;
      } else if (this.CompList.length - componentIndex > 20 && componentIndex > 10) {
        this.startIndex = componentIndex - 10;
        this.endIndex = componentIndex + 10;
      } else if (this.CompList.length - componentIndex < 20) {
        this.endIndex = this.CompList.length;
        this.startIndex = this.CompList.length > 20 ? this.CompList.length - 20 : 0;
      }
      this.paddingTop = this.startIndex * 600;
      this.bscroll.scrollTo(0, -(this.startIndex * 600), 0);
      this.getPageHeight();
      if (num > 0) {
        this.$nextTick(() => {
          this.bscroll.finishPullUp(); //上拉加载动作结束,
          let scrollItem = document.getElementById('scroll-item-' + componentIndex);
          if (scrollItem) {
            let offsetTop = scrollItem.getBoundingClientRect().top;
            setTimeout(() => {
              if (scrollItem) {
                if (type == 'id') {
                  top = document.getElementById(scrollId) ? document.getElementById(scrollId)?.getBoundingClientRect().top : offsetTop;
                }
                this.bscroll.scrollToElement(scrollItem, 0, 0, -20);
                this.$emit('initObserver');
                this.$nextTick(() => {
                  let top2 = 0;
                  if (type == 'id') {
                    top2 = document.getElementById(scrollId) ? document.getElementById(scrollId)?.getBoundingClientRect().top : 0;
                  }
                  this.bscroll.scrollToElement(scrollItem, 0, 0, top2 - 128);
                  if (callback && typeof callback === 'function') {
                    callback();
                  }
                });
              }
            }, 500);
          }
        });
      }
    }
  }
};

/* script */
const __vue_script__$1_ = script$1_;
/* template */
var __vue_render__$1_ = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "xml-reader-window-box xml-reader-window-Preview-dom",
      attrs: { id: _vm.readerBoxId },
      on: { mouseover: _vm.handleMouseOver },
    },
    [
      _c("xml-watermark-bg", [
        _c("div", { staticClass: "content" }, [
          _c(
            "div",
            { staticClass: "text-books-content", style: _vm.contentStyle },
            _vm._l(
              _vm.CompList.slice(_vm.startIndex, _vm.endIndex),
              function (item, index) {
                return _c(
                  "div",
                  {
                    key: item.xmlCompRef,
                    ref: "items",
                    refInFor: true,
                    staticClass: "xml-parent-group-block",
                    class: item.chapterId,
                    attrs: {
                      componentIndex: item.componentIndex,
                      id: "scroll-item-" + item.componentIndex,
                    },
                    on: {
                      mousedown: function ($event) {
                        return _vm.clickComp(item)
                      },
                      touchstart: function ($event) {
                        return _vm.clickComp(item)
                      },
                    },
                  },
                  [
                    _c(_vm.toKebabCase(item.componentsName) + "-render", {
                      ref: item.xmlCompRef,
                      refInFor: true,
                      tag: "component",
                      attrs: {
                        id: item.location,
                        location: item.location,
                        componentIndex: item.componentIndex,
                        mode: "preview",
                        "page-type": _vm.pageType,
                        "p-group-data": item.data.pGroupData,
                        "current-rule": item,
                        "rule-index": item.componentIndex,
                        "extend-params": item.data.extendParams,
                        resourceBasisPath: _vm.resourceBasisPath,
                        officePreviewPath: _vm.officePreviewPath,
                        reader: true,
                        isShowAi: _vm.isShowAi,
                        isCopyUrl: _vm.isCopyUrl,
                      },
                      on: {
                        setanalysis: _vm.openAIanalysis,
                        downloadFileUrl: _vm.downloadFile,
                        showFileReader: _vm.showFileReader,
                        openTestPaper: _vm.openTestPaper,
                        openHtml: _vm.openHtml,
                        copyHtmlUrl: _vm.copyHtmlUrl,
                      },
                    }),
                    _vm._v(" "),
                    _vm.getResourcesNumber(item.location) > 0 &&
                    _vm.isShowTeacherResource
                      ? [
                          _c(
                            "div",
                            {
                              staticClass: "teacher-resources-number-h5",
                              on: {
                                click: function ($event) {
                                  return _vm.openTeacherResoucesList(item)
                                },
                              },
                            },
                            [
                              _c("span", { staticClass: "number" }, [
                                _vm._v(
                                  _vm._s(_vm.getResourcesNumber(item.location))
                                ),
                              ]),
                            ]
                          ),
                        ]
                      : _vm._e(),
                  ],
                  2
                )
              }
            ),
            0
          ),
          _vm._v(" "),
          _vm.isTrial && _vm.endIndex >= _vm.CompList.length
            ? _c("div", {
                staticClass: "the-end-of-the-trial",
                domProps: { innerHTML: _vm._s(_vm.trialText) },
              })
            : _vm._e(),
        ]),
      ]),
    ],
    1
  )
};
var __vue_staticRenderFns__$1_ = [];
__vue_render__$1_._withStripped = true;

  /* style */
  const __vue_inject_styles__$1_ = undefined;
  /* scoped */
  const __vue_scope_id__$1_ = "data-v-8682cf5a";
  /* module identifier */
  const __vue_module_identifier__$1_ = undefined;
  /* functional template */
  const __vue_is_functional_template__$1_ = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1_ = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1_, staticRenderFns: __vue_staticRenderFns__$1_ },
    __vue_inject_styles__$1_,
    __vue_script__$1_,
    __vue_scope_id__$1_,
    __vue_is_functional_template__$1_,
    __vue_module_identifier__$1_,
    false,
    undefined,
    undefined,
    undefined
  );

const ReaderComponents = [__vue_component__$1$, __vue_component__$1_, __vue_component__$25];
var XmlReader = {
  // install,
  ...ReaderComponents
};

//
var script$1Z = {
  mixins: [singleGroupMixin],
  name: 'titleThirdLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      numberTextDataName: 'numberTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
    console.log('此方法接收块儿点击事件，事件传递块相关参数=1111111=2=', this.groupData);
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    /**
     * 更新块数据
     * @param dataName  数据name
     * @param blockData 数据值
     */
    updateBlockData(dataName, blockData) {
      this.groupData[dataName] = blockData;
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1Z = script$1Z;
/* template */
var __vue_render__$1Z = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-third-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c("div", { staticClass: "title-left" }, [
              _c(
                "span",
                { staticClass: "title-number" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.numberTextDataName],
                      "block-data-name": _vm.numberTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      "rule-index": _vm.ruleIndex,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "title-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1Z = [];
__vue_render__$1Z._withStripped = true;

  /* style */
  const __vue_inject_styles__$1Z = undefined;
  /* scoped */
  const __vue_scope_id__$1Z = "data-v-616d10ee";
  /* module identifier */
  const __vue_module_identifier__$1Z = undefined;
  /* functional template */
  const __vue_is_functional_template__$1Z = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1Z = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1Z, staticRenderFns: __vue_staticRenderFns__$1Z },
    __vue_inject_styles__$1Z,
    __vue_script__$1Z,
    __vue_scope_id__$1Z,
    __vue_is_functional_template__$1Z,
    __vue_module_identifier__$1Z,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1Y = {
  mixins: [singleGroupMixin],
  name: 'titleFirstLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
    console.log(this.groupData);
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1Y = script$1Y;
/* template */
var __vue_render__$1Y = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-first-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-left-img" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1Y = [];
__vue_render__$1Y._withStripped = true;

  /* style */
  const __vue_inject_styles__$1Y = undefined;
  /* scoped */
  const __vue_scope_id__$1Y = "data-v-0bbb4f3a";
  /* module identifier */
  const __vue_module_identifier__$1Y = undefined;
  /* functional template */
  const __vue_is_functional_template__$1Y = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1Y = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1Y, staticRenderFns: __vue_staticRenderFns__$1Y },
    __vue_inject_styles__$1Y,
    __vue_script__$1Y,
    __vue_scope_id__$1Y,
    __vue_is_functional_template__$1Y,
    __vue_module_identifier__$1Y,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1X = {
  mixins: [singleGroupMixin],
  name: 'titleSixthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      numberTextDataName: 'numberTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1X = script$1X;
/* template */
var __vue_render__$1X = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-sixth-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c("div", { staticClass: "title-left-div" }, [
              _c(
                "div",
                { staticClass: "title-number" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.numberTextDataName],
                      "block-data-name": _vm.numberTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container-left",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c("div", { staticClass: "title-left-line" }),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "title-right-div" },
              [
                _c("div", { staticClass: "title-right-line1" }),
                _vm._v(" "),
                _c("div", { staticClass: "title-right-line2" }),
                _vm._v(" "),
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container-right",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
                _vm._v(" "),
                _c("div", { staticClass: "title-right-line3" }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1X = [];
__vue_render__$1X._withStripped = true;

  /* style */
  const __vue_inject_styles__$1X = undefined;
  /* scoped */
  const __vue_scope_id__$1X = "data-v-2c084d29";
  /* module identifier */
  const __vue_module_identifier__$1X = undefined;
  /* functional template */
  const __vue_is_functional_template__$1X = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1X = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1X, staticRenderFns: __vue_staticRenderFns__$1X },
    __vue_inject_styles__$1X,
    __vue_script__$1X,
    __vue_scope_id__$1X,
    __vue_is_functional_template__$1X,
    __vue_module_identifier__$1X,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1W = {
  mixins: [singleGroupMixin],
  name: 'titleSemicircleLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1W = script$1W;
/* template */
var __vue_render__$1W = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-semicircle-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-left-img" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1W = [];
__vue_render__$1W._withStripped = true;

  /* style */
  const __vue_inject_styles__$1W = undefined;
  /* scoped */
  const __vue_scope_id__$1W = "data-v-3af6d3d2";
  /* module identifier */
  const __vue_module_identifier__$1W = undefined;
  /* functional template */
  const __vue_is_functional_template__$1W = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1W = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1W, staticRenderFns: __vue_staticRenderFns__$1W },
    __vue_inject_styles__$1W,
    __vue_script__$1W,
    __vue_scope_id__$1W,
    __vue_is_functional_template__$1W,
    __vue_module_identifier__$1W,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1V = {
  mixins: [singleGroupMixin],
  name: 'titleRectangleLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1V = script$1V;
/* template */
var __vue_render__$1V = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-rectangle-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-left-img" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1V = [];
__vue_render__$1V._withStripped = true;

  /* style */
  const __vue_inject_styles__$1V = undefined;
  /* scoped */
  const __vue_scope_id__$1V = "data-v-fbf24244";
  /* module identifier */
  const __vue_module_identifier__$1V = undefined;
  /* functional template */
  const __vue_is_functional_template__$1V = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1V = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1V, staticRenderFns: __vue_staticRenderFns__$1V },
    __vue_inject_styles__$1V,
    __vue_script__$1V,
    __vue_scope_id__$1V,
    __vue_is_functional_template__$1V,
    __vue_module_identifier__$1V,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1U = {
  mixins: [singleGroupMixin],
  name: 'titleYellowtheme1LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1U = script$1U;
/* template */
var __vue_render__$1U = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Yellowtheme1-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "left-image" },
              [
                _c("xml-image-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                    "block-data-name": _vm.imageBlockDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "show-title": false,
                    "container-class": "image-container",
                    resourceBasisPath: _vm.resourceBasisPath,
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                  },
                  on: { blockclick: _vm.handleBlockClick },
                }),
                _vm._v(" "),
                _c("div", { staticClass: "jiantou1" }),
                _vm._v(" "),
                _c("div", { staticClass: "jiantou2" }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "right-top-bg" }, [
              _c("div", { staticClass: "zhuangshi" }, [
                _c("div", { staticClass: "line1" }),
                _vm._v(" "),
                _c("div", { staticClass: "line2" }),
              ]),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "rigth-titlebox" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1U = [];
__vue_render__$1U._withStripped = true;

  /* style */
  const __vue_inject_styles__$1U = undefined;
  /* scoped */
  const __vue_scope_id__$1U = "data-v-462bc6a8";
  /* module identifier */
  const __vue_module_identifier__$1U = undefined;
  /* functional template */
  const __vue_is_functional_template__$1U = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1U = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1U, staticRenderFns: __vue_staticRenderFns__$1U },
    __vue_inject_styles__$1U,
    __vue_script__$1U,
    __vue_scope_id__$1U,
    __vue_is_functional_template__$1U,
    __vue_module_identifier__$1U,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1T = {
  mixins: [singleGroupMixin],
  name: 'titleYellowtheme2LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1T = script$1T;
/* template */
var __vue_render__$1T = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Yellowtheme2-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c("div", { staticClass: "left-icon" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1T = [];
__vue_render__$1T._withStripped = true;

  /* style */
  const __vue_inject_styles__$1T = undefined;
  /* scoped */
  const __vue_scope_id__$1T = "data-v-7487515c";
  /* module identifier */
  const __vue_module_identifier__$1T = undefined;
  /* functional template */
  const __vue_is_functional_template__$1T = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1T = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1T, staticRenderFns: __vue_staticRenderFns__$1T },
    __vue_inject_styles__$1T,
    __vue_script__$1T,
    __vue_scope_id__$1T,
    __vue_is_functional_template__$1T,
    __vue_module_identifier__$1T,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1S = {
  mixins: [singleGroupMixin],
  name: 'titleYellowtheme4LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1S = script$1S;
/* template */
var __vue_render__$1S = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Yellowtheme4-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1S = [];
__vue_render__$1S._withStripped = true;

  /* style */
  const __vue_inject_styles__$1S = undefined;
  /* scoped */
  const __vue_scope_id__$1S = "data-v-59bc5a3c";
  /* module identifier */
  const __vue_module_identifier__$1S = undefined;
  /* functional template */
  const __vue_is_functional_template__$1S = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1S = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1S, staticRenderFns: __vue_staticRenderFns__$1S },
    __vue_inject_styles__$1S,
    __vue_script__$1S,
    __vue_scope_id__$1S,
    __vue_is_functional_template__$1S,
    __vue_module_identifier__$1S,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1R = {
  mixins: [singleGroupMixin],
  name: 'titleYellowtheme5LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1R = script$1R;
/* template */
var __vue_render__$1R = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Yellowtheme5-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c("div", { staticClass: "left-img" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "right-img" }),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1R = [];
__vue_render__$1R._withStripped = true;

  /* style */
  const __vue_inject_styles__$1R = undefined;
  /* scoped */
  const __vue_scope_id__$1R = "data-v-df779e1c";
  /* module identifier */
  const __vue_module_identifier__$1R = undefined;
  /* functional template */
  const __vue_is_functional_template__$1R = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1R = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1R, staticRenderFns: __vue_staticRenderFns__$1R },
    __vue_inject_styles__$1R,
    __vue_script__$1R,
    __vue_scope_id__$1R,
    __vue_is_functional_template__$1R,
    __vue_module_identifier__$1R,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1Q = {
  mixins: [singleGroupMixin],
  name: 'titleYellowtheme6LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1Q = script$1Q;
/* template */
var __vue_render__$1Q = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Yellowtheme6-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c("div", { staticClass: "zhuangshi1" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "zhuangshi2" }),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1Q = [];
__vue_render__$1Q._withStripped = true;

  /* style */
  const __vue_inject_styles__$1Q = undefined;
  /* scoped */
  const __vue_scope_id__$1Q = "data-v-15d1c71c";
  /* module identifier */
  const __vue_module_identifier__$1Q = undefined;
  /* functional template */
  const __vue_is_functional_template__$1Q = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1Q = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1Q, staticRenderFns: __vue_staticRenderFns__$1Q },
    __vue_inject_styles__$1Q,
    __vue_script__$1Q,
    __vue_scope_id__$1Q,
    __vue_is_functional_template__$1Q,
    __vue_module_identifier__$1Q,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1P = {
  mixins: [singleGroupMixin],
  name: 'titleFifteenLibraryRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  isUnPrefix: true,
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1P = script$1P;
/* template */
var __vue_render__$1P = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-fifteen-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "left-image" },
              [
                _c("xml-image-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                    "block-data-name": _vm.imageBlockDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "show-title": false,
                    "container-class": "image-container",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                  },
                  on: { blockclick: _vm.handleBlockClick },
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1P = [];
__vue_render__$1P._withStripped = true;

  /* style */
  const __vue_inject_styles__$1P = undefined;
  /* scoped */
  const __vue_scope_id__$1P = "data-v-6a63b0c0";
  /* module identifier */
  const __vue_module_identifier__$1P = undefined;
  /* functional template */
  const __vue_is_functional_template__$1P = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1P = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1P, staticRenderFns: __vue_staticRenderFns__$1P },
    __vue_inject_styles__$1P,
    __vue_script__$1P,
    __vue_scope_id__$1P,
    __vue_is_functional_template__$1P,
    __vue_module_identifier__$1P,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1O = {
  mixins: [singleGroupMixin],
  name: 'titleThirteenthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1O = script$1O;
/* template */
var __vue_render__$1O = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-thirteenth-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "topleft" }),
              _vm._v(" "),
              _c("div", { staticClass: "topborder" }, [
                _c("div", { staticClass: "topborder-left" }, [
                  _c("div", { staticClass: "Line1" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "Line2" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "block" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "block" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "block" }),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "topborder-right" }, [
                  _c("div", { staticClass: "Line3" }),
                ]),
              ]),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "bottomborder" }, [
                _c("div", { staticClass: "Line1" }),
                _vm._v(" "),
                _c("div", { staticClass: "block" }),
                _vm._v(" "),
                _c("div", { staticClass: "block" }),
                _vm._v(" "),
                _c("div", { staticClass: "Line2" }),
                _vm._v(" "),
                _c("div", { staticClass: "Line3" }),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "rightbottom" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1O = [];
__vue_render__$1O._withStripped = true;

  /* style */
  const __vue_inject_styles__$1O = undefined;
  /* scoped */
  const __vue_scope_id__$1O = "data-v-1966f0fb";
  /* module identifier */
  const __vue_module_identifier__$1O = undefined;
  /* functional template */
  const __vue_is_functional_template__$1O = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1O = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1O, staticRenderFns: __vue_staticRenderFns__$1O },
    __vue_inject_styles__$1O,
    __vue_script__$1O,
    __vue_scope_id__$1O,
    __vue_is_functional_template__$1O,
    __vue_module_identifier__$1O,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1N = {
  mixins: [singleGroupMixin],
  name: 'titleTwelfthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      numberTextDataName: 'numberTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    /**
     * 更新块数据
     * @param dataName  数据name
     * @param blockData 数据值
     */
    updateBlockData(dataName, blockData) {
      this.groupData[dataName] = blockData;
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1N = script$1N;
/* template */
var __vue_render__$1N = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-twelfth-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c("div", { staticClass: "title-left" }, [
              _c(
                "span",
                { staticClass: "title-number" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.numberTextDataName],
                      "block-data-name": _vm.numberTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      "rule-index": _vm.ruleIndex,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "title-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1N = [];
__vue_render__$1N._withStripped = true;

  /* style */
  const __vue_inject_styles__$1N = undefined;
  /* scoped */
  const __vue_scope_id__$1N = "data-v-721237c7";
  /* module identifier */
  const __vue_module_identifier__$1N = undefined;
  /* functional template */
  const __vue_is_functional_template__$1N = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1N = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1N, staticRenderFns: __vue_staticRenderFns__$1N },
    __vue_inject_styles__$1N,
    __vue_script__$1N,
    __vue_scope_id__$1N,
    __vue_is_functional_template__$1N,
    __vue_module_identifier__$1N,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1M = {
  mixins: [singleGroupMixin],
  name: 'titleGreentheme1LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1M = script$1M;
/* template */
var __vue_render__$1M = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Greentheme1-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "left-image" },
              [
                _c("xml-image-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                    "block-data-name": _vm.imageBlockDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "show-title": false,
                    "container-class": "image-container",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                  },
                  on: { blockclick: _vm.handleBlockClick },
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "right-top-bg" }, [
              _c("div", { staticClass: "zhuangshi" }, [
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
              ]),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "rigth-titlebox" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1M = [];
__vue_render__$1M._withStripped = true;

  /* style */
  const __vue_inject_styles__$1M = undefined;
  /* scoped */
  const __vue_scope_id__$1M = "data-v-3706def2";
  /* module identifier */
  const __vue_module_identifier__$1M = undefined;
  /* functional template */
  const __vue_is_functional_template__$1M = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1M = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1M, staticRenderFns: __vue_staticRenderFns__$1M },
    __vue_inject_styles__$1M,
    __vue_script__$1M,
    __vue_scope_id__$1M,
    __vue_is_functional_template__$1M,
    __vue_module_identifier__$1M,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1L = {
  mixins: [singleGroupMixin],
  name: 'titleGreentheme2LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1L = script$1L;
/* template */
var __vue_render__$1L = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Greentheme2-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "left-image" },
              [
                _c("xml-image-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                    "block-data-name": _vm.imageBlockDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "show-title": false,
                    "container-class": "image-container",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                  },
                  on: { blockclick: _vm.handleBlockClick },
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "right-top-bg" }, [
              _c("div", { staticClass: "top-zhuangshi" }, [
                _c("div", [
                  _c("div", [
                    _c("div", { staticClass: "top-jiantou" }),
                    _vm._v(" "),
                    _c("div", { staticClass: "bottom-jiantou" }),
                  ]),
                  _vm._v(" "),
                  _c("div", [
                    _c("div", { staticClass: "top-jiantou" }),
                    _vm._v(" "),
                    _c("div", { staticClass: "bottom-jiantou" }),
                  ]),
                ]),
              ]),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "rigth-titlebox" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c("div", { staticClass: "bottomzhuangshi" }),
            ]),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1L = [];
__vue_render__$1L._withStripped = true;

  /* style */
  const __vue_inject_styles__$1L = undefined;
  /* scoped */
  const __vue_scope_id__$1L = "data-v-5442cbe5";
  /* module identifier */
  const __vue_module_identifier__$1L = undefined;
  /* functional template */
  const __vue_is_functional_template__$1L = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1L = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1L, staticRenderFns: __vue_staticRenderFns__$1L },
    __vue_inject_styles__$1L,
    __vue_script__$1L,
    __vue_scope_id__$1L,
    __vue_is_functional_template__$1L,
    __vue_module_identifier__$1L,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1K = {
  mixins: [singleGroupMixin],
  name: 'titleGreentheme3LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1K = script$1K;
/* template */
var __vue_render__$1K = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Greentheme3-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
                _vm._v(" "),
                _c("div", { staticClass: "right-top-bg" }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1K = [];
__vue_render__$1K._withStripped = true;

  /* style */
  const __vue_inject_styles__$1K = undefined;
  /* scoped */
  const __vue_scope_id__$1K = "data-v-478188c1";
  /* module identifier */
  const __vue_module_identifier__$1K = undefined;
  /* functional template */
  const __vue_is_functional_template__$1K = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1K = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1K, staticRenderFns: __vue_staticRenderFns__$1K },
    __vue_inject_styles__$1K,
    __vue_script__$1K,
    __vue_scope_id__$1K,
    __vue_is_functional_template__$1K,
    __vue_module_identifier__$1K,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1J = {
  mixins: [singleGroupMixin],
  name: 'titleGreentheme4LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1J = script$1J;
/* template */
var __vue_render__$1J = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Greentheme4-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "cont-box" }, [
            _c("div", { staticClass: "title-container" }, [
              _c("div", { staticClass: "right-top-bg" }),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1J = [];
__vue_render__$1J._withStripped = true;

  /* style */
  const __vue_inject_styles__$1J = undefined;
  /* scoped */
  const __vue_scope_id__$1J = "data-v-5fcb6934";
  /* module identifier */
  const __vue_module_identifier__$1J = undefined;
  /* functional template */
  const __vue_is_functional_template__$1J = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1J = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1J, staticRenderFns: __vue_staticRenderFns__$1J },
    __vue_inject_styles__$1J,
    __vue_script__$1J,
    __vue_scope_id__$1J,
    __vue_is_functional_template__$1J,
    __vue_module_identifier__$1J,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1I = {
  mixins: [singleGroupMixin],
  name: 'titleGreentheme6LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1I = script$1I;
/* template */
var __vue_render__$1I = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Greentheme6-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-left-img" }, [
                _c("div", { staticClass: "line" }),
                _vm._v(" "),
                _c("div", { staticClass: "block1" }),
                _vm._v(" "),
                _c("div", { staticClass: "block1" }),
              ]),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }, [
                _c("div", { staticClass: "block1" }),
                _vm._v(" "),
                _c("div", { staticClass: "block1" }),
                _vm._v(" "),
                _c("div", { staticClass: "line" }),
              ]),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1I = [];
__vue_render__$1I._withStripped = true;

  /* style */
  const __vue_inject_styles__$1I = undefined;
  /* scoped */
  const __vue_scope_id__$1I = "data-v-11ebcaf6";
  /* module identifier */
  const __vue_module_identifier__$1I = undefined;
  /* functional template */
  const __vue_is_functional_template__$1I = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1I = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1I, staticRenderFns: __vue_staticRenderFns__$1I },
    __vue_inject_styles__$1I,
    __vue_script__$1I,
    __vue_scope_id__$1I,
    __vue_is_functional_template__$1I,
    __vue_module_identifier__$1I,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1H = {
  mixins: [singleGroupMixin],
  name: 'titleNineteenLibraryRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1H = script$1H;
/* template */
var __vue_render__$1H = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-nineteen-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container-box" }, [
            _c(
              "div",
              { staticClass: "title-container" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1H = [];
__vue_render__$1H._withStripped = true;

  /* style */
  const __vue_inject_styles__$1H = undefined;
  /* scoped */
  const __vue_scope_id__$1H = "data-v-1ff758ed";
  /* module identifier */
  const __vue_module_identifier__$1H = undefined;
  /* functional template */
  const __vue_is_functional_template__$1H = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1H = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1H, staticRenderFns: __vue_staticRenderFns__$1H },
    __vue_inject_styles__$1H,
    __vue_script__$1H,
    __vue_scope_id__$1H,
    __vue_is_functional_template__$1H,
    __vue_module_identifier__$1H,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1G = {
  mixins: [singleGroupMixin],
  name: 'titleHexagonLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1G = script$1G;
/* template */
var __vue_render__$1G = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-hexagon-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-left-img" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1G = [];
__vue_render__$1G._withStripped = true;

  /* style */
  const __vue_inject_styles__$1G = undefined;
  /* scoped */
  const __vue_scope_id__$1G = "data-v-4ccfd1c2";
  /* module identifier */
  const __vue_module_identifier__$1G = undefined;
  /* functional template */
  const __vue_is_functional_template__$1G = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1G = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1G, staticRenderFns: __vue_staticRenderFns__$1G },
    __vue_inject_styles__$1G,
    __vue_script__$1G,
    __vue_scope_id__$1G,
    __vue_is_functional_template__$1G,
    __vue_module_identifier__$1G,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1F = {
  mixins: [singleGroupMixin],
  name: 'titleFourteenLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1F = script$1F;
/* template */
var __vue_render__$1F = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-fourteen-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "cont-box" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1F = [];
__vue_render__$1F._withStripped = true;

  /* style */
  const __vue_inject_styles__$1F = undefined;
  /* scoped */
  const __vue_scope_id__$1F = "data-v-70644668";
  /* module identifier */
  const __vue_module_identifier__$1F = undefined;
  /* functional template */
  const __vue_is_functional_template__$1F = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1F = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1F, staticRenderFns: __vue_staticRenderFns__$1F },
    __vue_inject_styles__$1F,
    __vue_script__$1F,
    __vue_scope_id__$1F,
    __vue_is_functional_template__$1F,
    __vue_module_identifier__$1F,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1E = {
  mixins: [singleGroupMixin],
  name: 'titleSeventeenLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1E = script$1E;
/* template */
var __vue_render__$1E = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-seventeen-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "left-image" },
              [
                _c("xml-image-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                    "block-data-name": _vm.imageBlockDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "show-title": false,
                    "container-class": "image-container",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                  },
                  on: { blockclick: _vm.handleBlockClick },
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("div", { staticClass: "zhuanshi" }, [
                  _c("div", { staticClass: "line1" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "line2" }),
                ]),
                _vm._v(" "),
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1E = [];
__vue_render__$1E._withStripped = true;

  /* style */
  const __vue_inject_styles__$1E = undefined;
  /* scoped */
  const __vue_scope_id__$1E = "data-v-25cdd27e";
  /* module identifier */
  const __vue_module_identifier__$1E = undefined;
  /* functional template */
  const __vue_is_functional_template__$1E = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1E = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1E, staticRenderFns: __vue_staticRenderFns__$1E },
    __vue_inject_styles__$1E,
    __vue_script__$1E,
    __vue_scope_id__$1E,
    __vue_is_functional_template__$1E,
    __vue_module_identifier__$1E,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1D = {
  mixins: [singleGroupMixin],
  name: 'titleSixteenLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1D = script$1D;
/* template */
var __vue_render__$1D = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-sixteen-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "left-image" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "right-icon" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1D = [];
__vue_render__$1D._withStripped = true;

  /* style */
  const __vue_inject_styles__$1D = undefined;
  /* scoped */
  const __vue_scope_id__$1D = "data-v-7e1af04c";
  /* module identifier */
  const __vue_module_identifier__$1D = undefined;
  /* functional template */
  const __vue_is_functional_template__$1D = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1D = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1D, staticRenderFns: __vue_staticRenderFns__$1D },
    __vue_inject_styles__$1D,
    __vue_script__$1D,
    __vue_scope_id__$1D,
    __vue_is_functional_template__$1D,
    __vue_module_identifier__$1D,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1C = {
  mixins: [singleGroupMixin],
  name: 'titleKnowledgeLibraryRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      numberTextDataName: 'numberTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1C = script$1C;
/* template */
var __vue_render__$1C = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Knowledge-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "left-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.numberTextDataName],
                    "block-data-name": _vm.numberTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "rigth-titlebox" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1C = [];
__vue_render__$1C._withStripped = true;

  /* style */
  const __vue_inject_styles__$1C = undefined;
  /* scoped */
  const __vue_scope_id__$1C = "data-v-548bec52";
  /* module identifier */
  const __vue_module_identifier__$1C = undefined;
  /* functional template */
  const __vue_is_functional_template__$1C = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1C = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1C, staticRenderFns: __vue_staticRenderFns__$1C },
    __vue_inject_styles__$1C,
    __vue_script__$1C,
    __vue_scope_id__$1C,
    __vue_is_functional_template__$1C,
    __vue_module_identifier__$1C,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1B = {
  mixins: [singleGroupMixin],
  name: 'titleFifthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1B = script$1B;
/* template */
var __vue_render__$1B = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-fifth-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-bottom" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }, [
                _c("div"),
                _vm._v(" "),
                _c("div"),
              ]),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1B = [];
__vue_render__$1B._withStripped = true;

  /* style */
  const __vue_inject_styles__$1B = undefined;
  /* scoped */
  const __vue_scope_id__$1B = "data-v-ae2ed048";
  /* module identifier */
  const __vue_module_identifier__$1B = undefined;
  /* functional template */
  const __vue_is_functional_template__$1B = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1B = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1B, staticRenderFns: __vue_staticRenderFns__$1B },
    __vue_inject_styles__$1B,
    __vue_script__$1B,
    __vue_scope_id__$1B,
    __vue_is_functional_template__$1B,
    __vue_module_identifier__$1B,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1A = {
  mixins: [singleGroupMixin],
  name: 'titleTriangleLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1A = script$1A;
/* template */
var __vue_render__$1A = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-triangle-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-left-img" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1A = [];
__vue_render__$1A._withStripped = true;

  /* style */
  const __vue_inject_styles__$1A = undefined;
  /* scoped */
  const __vue_scope_id__$1A = "data-v-7cd7413e";
  /* module identifier */
  const __vue_module_identifier__$1A = undefined;
  /* functional template */
  const __vue_is_functional_template__$1A = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1A = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1A, staticRenderFns: __vue_staticRenderFns__$1A },
    __vue_inject_styles__$1A,
    __vue_script__$1A,
    __vue_scope_id__$1A,
    __vue_is_functional_template__$1A,
    __vue_module_identifier__$1A,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1z = {
  mixins: [singleGroupMixin],
  name: 'titleRedtheme1LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1z = script$1z;
/* template */
var __vue_render__$1z = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Redtheme1-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "title-bg" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1z = [];
__vue_render__$1z._withStripped = true;

  /* style */
  const __vue_inject_styles__$1z = undefined;
  /* scoped */
  const __vue_scope_id__$1z = "data-v-5af78a7d";
  /* module identifier */
  const __vue_module_identifier__$1z = undefined;
  /* functional template */
  const __vue_is_functional_template__$1z = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1z = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1z, staticRenderFns: __vue_staticRenderFns__$1z },
    __vue_inject_styles__$1z,
    __vue_script__$1z,
    __vue_scope_id__$1z,
    __vue_is_functional_template__$1z,
    __vue_module_identifier__$1z,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1y = {
  mixins: [singleGroupMixin],
  name: 'titleRedtheme2LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1y = script$1y;
/* template */
var __vue_render__$1y = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Redtheme2-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1y = [];
__vue_render__$1y._withStripped = true;

  /* style */
  const __vue_inject_styles__$1y = undefined;
  /* scoped */
  const __vue_scope_id__$1y = "data-v-5abd9437";
  /* module identifier */
  const __vue_module_identifier__$1y = undefined;
  /* functional template */
  const __vue_is_functional_template__$1y = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1y = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1y, staticRenderFns: __vue_staticRenderFns__$1y },
    __vue_inject_styles__$1y,
    __vue_script__$1y,
    __vue_scope_id__$1y,
    __vue_is_functional_template__$1y,
    __vue_module_identifier__$1y,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1x = {
  mixins: [singleGroupMixin],
  name: 'titleRedtheme3LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName1: 'titleTextData1',
      titleTextDataName2: 'titleTextData2',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1x = script$1x;
/* template */
var __vue_render__$1x = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Redtheme3-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "suptitle" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName1],
                  "block-data-name": _vm.titleTextDataName1,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName2],
                  "block-data-name": _vm.titleTextDataName2,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1x = [];
__vue_render__$1x._withStripped = true;

  /* style */
  const __vue_inject_styles__$1x = undefined;
  /* scoped */
  const __vue_scope_id__$1x = "data-v-4031660d";
  /* module identifier */
  const __vue_module_identifier__$1x = undefined;
  /* functional template */
  const __vue_is_functional_template__$1x = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1x = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1x, staticRenderFns: __vue_staticRenderFns__$1x },
    __vue_inject_styles__$1x,
    __vue_script__$1x,
    __vue_scope_id__$1x,
    __vue_is_functional_template__$1x,
    __vue_module_identifier__$1x,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1w = {
  mixins: [singleGroupMixin],
  name: 'titleRedtheme4LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      titleTextDataName2: 'titleTextData2',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1w = script$1w;
/* template */
var __vue_render__$1w = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-Redtheme4-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "left-icon" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "right-icon" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1w = [];
__vue_render__$1w._withStripped = true;

  /* style */
  const __vue_inject_styles__$1w = undefined;
  /* scoped */
  const __vue_scope_id__$1w = "data-v-eb3fc7ec";
  /* module identifier */
  const __vue_module_identifier__$1w = undefined;
  /* functional template */
  const __vue_is_functional_template__$1w = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1w = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1w, staticRenderFns: __vue_staticRenderFns__$1w },
    __vue_inject_styles__$1w,
    __vue_script__$1w,
    __vue_scope_id__$1w,
    __vue_is_functional_template__$1w,
    __vue_module_identifier__$1w,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1v = {
  mixins: [singleGroupMixin],
  name: 'titleThirtyoneLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1v = script$1v;
/* template */
var __vue_render__$1v = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-thirtyone-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1v = [];
__vue_render__$1v._withStripped = true;

  /* style */
  const __vue_inject_styles__$1v = undefined;
  /* scoped */
  const __vue_scope_id__$1v = "data-v-f815e140";
  /* module identifier */
  const __vue_module_identifier__$1v = undefined;
  /* functional template */
  const __vue_is_functional_template__$1v = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1v = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1v, staticRenderFns: __vue_staticRenderFns__$1v },
    __vue_inject_styles__$1v,
    __vue_script__$1v,
    __vue_scope_id__$1v,
    __vue_is_functional_template__$1v,
    __vue_module_identifier__$1v,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1u = {
  mixins: [singleGroupMixin],
  name: 'titleThirtytwoLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1u = script$1u;
/* template */
var __vue_render__$1u = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-thirtytwo-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1u = [];
__vue_render__$1u._withStripped = true;

  /* style */
  const __vue_inject_styles__$1u = undefined;
  /* scoped */
  const __vue_scope_id__$1u = "data-v-7fa3800c";
  /* module identifier */
  const __vue_module_identifier__$1u = undefined;
  /* functional template */
  const __vue_is_functional_template__$1u = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1u = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1u, staticRenderFns: __vue_staticRenderFns__$1u },
    __vue_inject_styles__$1u,
    __vue_script__$1u,
    __vue_scope_id__$1u,
    __vue_is_functional_template__$1u,
    __vue_module_identifier__$1u,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1t = {
  mixins: [singleGroupMixin],
  name: 'titleThirtythreeLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1t = script$1t;
/* template */
var __vue_render__$1t = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-thirtythree-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "main-con" }, [
            _c("div", { staticClass: "left-block" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "title-container" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1t = [];
__vue_render__$1t._withStripped = true;

  /* style */
  const __vue_inject_styles__$1t = undefined;
  /* scoped */
  const __vue_scope_id__$1t = "data-v-0fd18780";
  /* module identifier */
  const __vue_module_identifier__$1t = undefined;
  /* functional template */
  const __vue_is_functional_template__$1t = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1t = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1t, staticRenderFns: __vue_staticRenderFns__$1t },
    __vue_inject_styles__$1t,
    __vue_script__$1t,
    __vue_scope_id__$1t,
    __vue_is_functional_template__$1t,
    __vue_module_identifier__$1t,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1s = {
  mixins: [singleGroupMixin],
  name: 'titleThirtyfourLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1s = script$1s;
/* template */
var __vue_render__$1s = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-thirtyfour-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1s = [];
__vue_render__$1s._withStripped = true;

  /* style */
  const __vue_inject_styles__$1s = undefined;
  /* scoped */
  const __vue_scope_id__$1s = "data-v-2ddea684";
  /* module identifier */
  const __vue_module_identifier__$1s = undefined;
  /* functional template */
  const __vue_is_functional_template__$1s = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1s = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1s, staticRenderFns: __vue_staticRenderFns__$1s },
    __vue_inject_styles__$1s,
    __vue_script__$1s,
    __vue_scope_id__$1s,
    __vue_is_functional_template__$1s,
    __vue_module_identifier__$1s,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1r = {
  mixins: [singleGroupMixin],
  name: 'titleThirtyfiveLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      titleTextDataName2: 'titleTextData2',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1r = script$1r;
/* template */
var __vue_render__$1r = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-thirtyfive-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "title-container" }, [
            _c(
              "div",
              { staticClass: "suptitle-box" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", [
              _c(
                "div",
                { staticClass: "subtitle-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName2],
                      "block-data-name": _vm.titleTextDataName2,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1r = [];
__vue_render__$1r._withStripped = true;

  /* style */
  const __vue_inject_styles__$1r = undefined;
  /* scoped */
  const __vue_scope_id__$1r = "data-v-6d51a022";
  /* module identifier */
  const __vue_module_identifier__$1r = undefined;
  /* functional template */
  const __vue_is_functional_template__$1r = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1r = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1r, staticRenderFns: __vue_staticRenderFns__$1r },
    __vue_inject_styles__$1r,
    __vue_script__$1r,
    __vue_scope_id__$1r,
    __vue_is_functional_template__$1r,
    __vue_module_identifier__$1r,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1q = {
  mixins: [singleGroupMixin],
  name: 'titleThirtysixLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1q = script$1q;
/* template */
var __vue_render__$1q = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-thirtysix-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "left-line" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "right-line" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1q = [];
__vue_render__$1q._withStripped = true;

  /* style */
  const __vue_inject_styles__$1q = undefined;
  /* scoped */
  const __vue_scope_id__$1q = "data-v-276ebb8b";
  /* module identifier */
  const __vue_module_identifier__$1q = undefined;
  /* functional template */
  const __vue_is_functional_template__$1q = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1q = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1q, staticRenderFns: __vue_staticRenderFns__$1q },
    __vue_inject_styles__$1q,
    __vue_script__$1q,
    __vue_scope_id__$1q,
    __vue_is_functional_template__$1q,
    __vue_module_identifier__$1q,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1p = {
  mixins: [singleGroupMixin],
  name: 'titleThirtysevenLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1p = script$1p;
/* template */
var __vue_render__$1p = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-thirtyseven-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("div", { staticClass: "left-line" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "right-line" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1p = [];
__vue_render__$1p._withStripped = true;

  /* style */
  const __vue_inject_styles__$1p = undefined;
  /* scoped */
  const __vue_scope_id__$1p = "data-v-26ceee4c";
  /* module identifier */
  const __vue_module_identifier__$1p = undefined;
  /* functional template */
  const __vue_is_functional_template__$1p = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1p = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1p, staticRenderFns: __vue_staticRenderFns__$1p },
    __vue_inject_styles__$1p,
    __vue_script__$1p,
    __vue_scope_id__$1p,
    __vue_is_functional_template__$1p,
    __vue_module_identifier__$1p,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1o = {
  mixins: [singleGroupMixin],
  name: 'titleThirtyeightLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '标题',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1o = script$1o;
/* template */
var __vue_render__$1o = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-title-thirtyeight-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "title-container" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1o = [];
__vue_render__$1o._withStripped = true;

  /* style */
  const __vue_inject_styles__$1o = undefined;
  /* scoped */
  const __vue_scope_id__$1o = "data-v-168fe6f7";
  /* module identifier */
  const __vue_module_identifier__$1o = undefined;
  /* functional template */
  const __vue_is_functional_template__$1o = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1o = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1o, staticRenderFns: __vue_staticRenderFns__$1o },
    __vue_inject_styles__$1o,
    __vue_script__$1o,
    __vue_scope_id__$1o,
    __vue_is_functional_template__$1o,
    __vue_module_identifier__$1o,
    false,
    undefined,
    undefined,
    undefined
  );

const TitleComponents$3 = [__vue_component__$1Z, __vue_component__$1Y, __vue_component__$1X, __vue_component__$1V, __vue_component__$1W, __vue_component__$1U, __vue_component__$1T, __vue_component__$1S, __vue_component__$1R, __vue_component__$1Q, __vue_component__$1P, __vue_component__$1O, __vue_component__$1N, __vue_component__$1M, __vue_component__$1L, __vue_component__$1K, __vue_component__$1J, __vue_component__$1I, __vue_component__$1H, __vue_component__$1G, __vue_component__$1F, __vue_component__$1E, __vue_component__$1D, __vue_component__$1C, __vue_component__$1B, __vue_component__$1A, __vue_component__$1z, __vue_component__$1y, __vue_component__$1x, __vue_component__$1w, __vue_component__$1v, __vue_component__$1u, __vue_component__$1t, __vue_component__$1s, __vue_component__$1r, __vue_component__$1q, __vue_component__$1p, __vue_component__$1o];
var XmlTitleLibrary = {
  // install,
  ...TitleComponents$3
};

//
/**
 * 单图片组合
 */
var script$1n = {
  name: 'paragraphFirstLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1n = script$1n;
/* template */
var __vue_render__$1n = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-first-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "rotate-container" }, [
            _c(
              "div",
              { staticClass: "rotate-container-inner" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName],
                    "block-data-name": _vm.titleTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
          _vm._v(" "),
          _c("xml-text-render", {
            attrs: {
              "p-block-data": _vm.groupData[_vm.bodyTextDataName],
              "block-data-name": _vm.bodyTextDataName,
              "extend-params": _vm.extendParams,
              "current-rule": _vm.currentRule,
              "rule-index": _vm.ruleIndex,
              "container-class": "text-body-container",
              "editor-class": "editor",
              mode: _vm.mode,
              "page-type": _vm.pageType,
              resourceBasisPath: _vm.resourceBasisPath,
              scopedSlots: { $scopedSlots: _vm.$scopedSlots },
            },
            on: {
              blockclick: _vm.handleBlockClick,
              groupDataChange: _vm.groupDataChange,
            },
            scopedSlots: _vm._u(
              [
                _vm._l(_vm.$scopedSlots, function (index, name) {
                  return {
                    key: name,
                    fn: function (deliver) {
                      return [_vm._t(name, null, null, deliver)]
                    },
                  }
                }),
              ],
              null,
              true
            ),
          }),
        ],
        1
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1n = [];
__vue_render__$1n._withStripped = true;

  /* style */
  const __vue_inject_styles__$1n = undefined;
  /* scoped */
  const __vue_scope_id__$1n = "data-v-0f9b7819";
  /* module identifier */
  const __vue_module_identifier__$1n = undefined;
  /* functional template */
  const __vue_is_functional_template__$1n = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1n = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1n, staticRenderFns: __vue_staticRenderFns__$1n },
    __vue_inject_styles__$1n,
    __vue_script__$1n,
    __vue_scope_id__$1n,
    __vue_is_functional_template__$1n,
    __vue_module_identifier__$1n,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$1m = {
  name: 'paragraphSecondLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1m = script$1m;
/* template */
var __vue_render__$1m = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-second-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "paragraph-second-title" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-top-border" }),
              _vm._v(" "),
              _c("div", { staticClass: "title-left-border" }),
            ],
            1
          ),
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1m = [];
__vue_render__$1m._withStripped = true;

  /* style */
  const __vue_inject_styles__$1m = undefined;
  /* scoped */
  const __vue_scope_id__$1m = "data-v-210be2d0";
  /* module identifier */
  const __vue_module_identifier__$1m = undefined;
  /* functional template */
  const __vue_is_functional_template__$1m = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1m = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1m, staticRenderFns: __vue_staticRenderFns__$1m },
    __vue_inject_styles__$1m,
    __vue_script__$1m,
    __vue_scope_id__$1m,
    __vue_is_functional_template__$1m,
    __vue_module_identifier__$1m,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$1l = {
  name: 'paragraphThirdLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1l = script$1l;
/* template */
var __vue_render__$1l = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-third-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1l = [];
__vue_render__$1l._withStripped = true;

  /* style */
  const __vue_inject_styles__$1l = undefined;
  /* scoped */
  const __vue_scope_id__$1l = "data-v-2c2b19b0";
  /* module identifier */
  const __vue_module_identifier__$1l = undefined;
  /* functional template */
  const __vue_is_functional_template__$1l = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1l = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1l, staticRenderFns: __vue_staticRenderFns__$1l },
    __vue_inject_styles__$1l,
    __vue_script__$1l,
    __vue_scope_id__$1l,
    __vue_is_functional_template__$1l,
    __vue_module_identifier__$1l,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$1k = {
  name: 'paragraphQuadrangleLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1k = script$1k;
/* template */
var __vue_render__$1k = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-quadrangle-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin1" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin2" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin3" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin4" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin5" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin6" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin7" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-lin8" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1k = [];
__vue_render__$1k._withStripped = true;

  /* style */
  const __vue_inject_styles__$1k = undefined;
  /* scoped */
  const __vue_scope_id__$1k = "data-v-19de44ac";
  /* module identifier */
  const __vue_module_identifier__$1k = undefined;
  /* functional template */
  const __vue_is_functional_template__$1k = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1k = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1k, staticRenderFns: __vue_staticRenderFns__$1k },
    __vue_inject_styles__$1k,
    __vue_script__$1k,
    __vue_scope_id__$1k,
    __vue_is_functional_template__$1k,
    __vue_module_identifier__$1k,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$1j = {
  name: 'paragraphIsoscelesLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1j = script$1j;
/* template */
var __vue_render__$1j = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-isosceles-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "circle" }),
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
          _vm._v(" "),
          _c("div", { staticClass: "shape" }, [
            _c("div", { staticClass: "triangle" }),
            _vm._v(" "),
            _c("div", { staticClass: "triangle2" }),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1j = [];
__vue_render__$1j._withStripped = true;

  /* style */
  const __vue_inject_styles__$1j = undefined;
  /* scoped */
  const __vue_scope_id__$1j = "data-v-cabc471e";
  /* module identifier */
  const __vue_module_identifier__$1j = undefined;
  /* functional template */
  const __vue_is_functional_template__$1j = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1j = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1j, staticRenderFns: __vue_staticRenderFns__$1j },
    __vue_inject_styles__$1j,
    __vue_script__$1j,
    __vue_scope_id__$1j,
    __vue_is_functional_template__$1j,
    __vue_module_identifier__$1j,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$1i = {
  name: 'paragraphNinthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。

      bodyTextDataName2: 'bodyTextData',
      titleTextDataName2: 'titleTextData2',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1i = script$1i;
/* template */
var __vue_render__$1i = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-ninth-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "paragraph-row-box" },
            [
              _c(
                "div",
                { staticClass: "text-body-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName2],
                      "block-data-name": _vm.bodyTextDataName2,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                  _vm._v(" "),
                  _c("div", { staticClass: "circle2" }),
                ],
                1
              ),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName2],
                  "block-data-name": _vm.titleTextDataName2,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1i = [];
__vue_render__$1i._withStripped = true;

  /* style */
  const __vue_inject_styles__$1i = undefined;
  /* scoped */
  const __vue_scope_id__$1i = "data-v-419af222";
  /* module identifier */
  const __vue_module_identifier__$1i = undefined;
  /* functional template */
  const __vue_is_functional_template__$1i = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1i = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1i, staticRenderFns: __vue_staticRenderFns__$1i },
    __vue_inject_styles__$1i,
    __vue_script__$1i,
    __vue_scope_id__$1i,
    __vue_is_functional_template__$1i,
    __vue_module_identifier__$1i,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$1h = {
  name: 'ParagraphEighthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      bodyTextDataName2: 'bodyTextData2',
      bodyTextDataName3: 'bodyTextData3',
      titleTextDataName: 'titleTextData',
      titleTextDataName2: 'titleTextData2',
      titleTextDataName3: 'titleTextData3',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1h = script$1h;
/* template */
var __vue_render__$1h = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-eighth-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "paragraph-row-box" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "text-body-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                      "block-data-name": _vm.bodyTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                  _vm._v(" "),
                  _c("div", { staticClass: "circle" }),
                ],
                1
              ),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1h = [];
__vue_render__$1h._withStripped = true;

  /* style */
  const __vue_inject_styles__$1h = undefined;
  /* scoped */
  const __vue_scope_id__$1h = "data-v-015ad6c8";
  /* module identifier */
  const __vue_module_identifier__$1h = undefined;
  /* functional template */
  const __vue_is_functional_template__$1h = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1h = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1h, staticRenderFns: __vue_staticRenderFns__$1h },
    __vue_inject_styles__$1h,
    __vue_script__$1h,
    __vue_scope_id__$1h,
    __vue_is_functional_template__$1h,
    __vue_module_identifier__$1h,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$1g = {
  name: 'paragraphTenthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      numberTextDataName: 'numberTextData',
      bodyTextDataName: 'bodyTextData',
      bodyTextDataName2: 'bodyTextData2',
      bodyTextDataName3: 'bodyTextData3',
      titleTextDataName: 'titleTextData',
      titleTextDataName2: 'titleTextData2',
      titleTextDataName3: 'titleTextData3',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1g = script$1g;
/* template */
var __vue_render__$1g = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-tenth-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "paragraph-suptitle-box" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.numberTextDataName],
                  "block-data-name": _vm.numberTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container-left",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
          _vm._v(" "),
          _c("div", { staticClass: "paragraph-row-box" }, [
            _c(
              "div",
              { staticClass: "paragraph-subtitle-box" },
              [
                _c("div", { staticClass: "subtitle-left-dec" }),
                _vm._v(" "),
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName2],
                    "block-data-name": _vm.titleTextDataName2,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "text-body-box" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1g = [];
__vue_render__$1g._withStripped = true;

  /* style */
  const __vue_inject_styles__$1g = undefined;
  /* scoped */
  const __vue_scope_id__$1g = "data-v-b2782ccc";
  /* module identifier */
  const __vue_module_identifier__$1g = undefined;
  /* functional template */
  const __vue_is_functional_template__$1g = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1g = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1g, staticRenderFns: __vue_staticRenderFns__$1g },
    __vue_inject_styles__$1g,
    __vue_script__$1g,
    __vue_scope_id__$1g,
    __vue_is_functional_template__$1g,
    __vue_module_identifier__$1g,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$1f = {
  name: 'paragraphSixteenLibraryRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      numberTextDataName: 'numberTextData',
      bodyTextDataName: 'bodyTextData',
      bodyTextDataName2: 'bodyTextData2',
      bodyTextDataName3: 'bodyTextData3',
      titleTextDataName: 'titleTextData',
      titleTextDataName2: 'titleTextData2',
      titleTextDataName3: 'titleTextData3',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1f = script$1f;
/* template */
var __vue_render__$1f = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-sixteen-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "paragraph-row-box" }, [
            _c(
              "div",
              { staticClass: "paragraph-subtitle-box" },
              [
                _c("div", { staticClass: "subtitle-left-dec" }),
                _vm._v(" "),
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName3],
                    "block-data-name": _vm.titleTextDataName3,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "text-body-box" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName2],
                    "block-data-name": _vm.bodyTextDataName2,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1f = [];
__vue_render__$1f._withStripped = true;

  /* style */
  const __vue_inject_styles__$1f = undefined;
  /* scoped */
  const __vue_scope_id__$1f = "data-v-16c4c166";
  /* module identifier */
  const __vue_module_identifier__$1f = undefined;
  /* functional template */
  const __vue_is_functional_template__$1f = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1f = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1f, staticRenderFns: __vue_staticRenderFns__$1f },
    __vue_inject_styles__$1f,
    __vue_script__$1f,
    __vue_scope_id__$1f,
    __vue_is_functional_template__$1f,
    __vue_module_identifier__$1f,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$1e = {
  name: 'paragraphSeventhLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      numberTextDataName: 'numberTextData',
      bodyTextDataName: 'bodyTextData',
      bodyTextDataName2: 'bodyTextData2',
      bodyTextDataName3: 'bodyTextData3',
      titleTextDataName: 'titleTextData',
      titleTextDataName2: 'titleTextData2',
      titleTextDataName3: 'titleTextData3',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$1e = script$1e;
/* template */
var __vue_render__$1e = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-seventh-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "paragraph-suptitle-box" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.numberTextDataName],
                  "block-data-name": _vm.numberTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container-left",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "title-right-img" }),
            ],
            1
          ),
          _vm._v(" "),
          _c("div", { staticClass: "paragraph-row-box" }, [
            _c(
              "div",
              { staticClass: "paragraph-subtitle-box" },
              [
                _c("div", { staticClass: "subtitle-left-dec" }),
                _vm._v(" "),
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName2],
                    "block-data-name": _vm.titleTextDataName2,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "text-body-box" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "paragraph-subtitle-box" },
              [
                _c("div", { staticClass: "subtitle-left-dec" }),
                _vm._v(" "),
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.titleTextDataName3],
                    "block-data-name": _vm.titleTextDataName3,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "text-body-box" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName2],
                    "block-data-name": _vm.bodyTextDataName2,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1e = [];
__vue_render__$1e._withStripped = true;

  /* style */
  const __vue_inject_styles__$1e = undefined;
  /* scoped */
  const __vue_scope_id__$1e = "data-v-2f21aa0e";
  /* module identifier */
  const __vue_module_identifier__$1e = undefined;
  /* functional template */
  const __vue_is_functional_template__$1e = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1e = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1e, staticRenderFns: __vue_staticRenderFns__$1e },
    __vue_inject_styles__$1e,
    __vue_script__$1e,
    __vue_scope_id__$1e,
    __vue_is_functional_template__$1e,
    __vue_module_identifier__$1e,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$1d = {
  name: 'paragraphElevenLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1d = script$1d;
/* template */
var __vue_render__$1d = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-eleven-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text" }, [
            _c("div", { staticClass: "boder-top" }, [
              _c("div", { staticClass: "boder-top-line1" }),
              _vm._v(" "),
              _c("div", { staticClass: "boder-top-line2" }),
            ]),
            _vm._v(" "),
            _c("div", { staticClass: "boder-bottom" }, [
              _c("div", { staticClass: "boder-bottom-line1" }),
              _vm._v(" "),
              _c("div", { staticClass: "boder-bottom-line2" }),
            ]),
            _vm._v(" "),
            _c("div", { staticClass: "boder-left" }, [
              _c("div", { staticClass: "boder-left-line1" }),
              _vm._v(" "),
              _c("div", { staticClass: "boder-left-line2" }),
            ]),
            _vm._v(" "),
            _c("div", { staticClass: "boder-right" }, [
              _c("div", { staticClass: "boder-right-line1" }),
              _vm._v(" "),
              _c("div", { staticClass: "boder-right-line2" }),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "text-container" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1d = [];
__vue_render__$1d._withStripped = true;

  /* style */
  const __vue_inject_styles__$1d = undefined;
  /* scoped */
  const __vue_scope_id__$1d = "data-v-2801109a";
  /* module identifier */
  const __vue_module_identifier__$1d = undefined;
  /* functional template */
  const __vue_is_functional_template__$1d = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1d = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1d, staticRenderFns: __vue_staticRenderFns__$1d },
    __vue_inject_styles__$1d,
    __vue_script__$1d,
    __vue_scope_id__$1d,
    __vue_is_functional_template__$1d,
    __vue_module_identifier__$1d,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$1c = {
  name: 'paragraphThirteenLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1c = script$1c;
/* template */
var __vue_render__$1c = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-thirteen-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("div", { staticClass: "text-border-top" }),
              _vm._v(" "),
              _c("div", { staticClass: "text-border-bottom" }),
              _vm._v(" "),
              _c("div", { staticClass: "text-border-left" }),
              _vm._v(" "),
              _c("div", { staticClass: "text-border-right" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1c = [];
__vue_render__$1c._withStripped = true;

  /* style */
  const __vue_inject_styles__$1c = undefined;
  /* scoped */
  const __vue_scope_id__$1c = "data-v-0c5cb112";
  /* module identifier */
  const __vue_module_identifier__$1c = undefined;
  /* functional template */
  const __vue_is_functional_template__$1c = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1c = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1c, staticRenderFns: __vue_staticRenderFns__$1c },
    __vue_inject_styles__$1c,
    __vue_script__$1c,
    __vue_scope_id__$1c,
    __vue_is_functional_template__$1c,
    __vue_module_identifier__$1c,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$1b = {
  name: 'paragraphFourteenLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1b = script$1b;
/* template */
var __vue_render__$1b = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-fourteen-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("div", { staticClass: "right-image" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1b = [];
__vue_render__$1b._withStripped = true;

  /* style */
  const __vue_inject_styles__$1b = undefined;
  /* scoped */
  const __vue_scope_id__$1b = "data-v-2354f17b";
  /* module identifier */
  const __vue_module_identifier__$1b = undefined;
  /* functional template */
  const __vue_is_functional_template__$1b = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1b = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1b, staticRenderFns: __vue_staticRenderFns__$1b },
    __vue_inject_styles__$1b,
    __vue_script__$1b,
    __vue_scope_id__$1b,
    __vue_is_functional_template__$1b,
    __vue_module_identifier__$1b,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$1a = {
  name: 'paragraphGreentheme2LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$1a = script$1a;
/* template */
var __vue_render__$1a = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Greentheme2-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("div", { staticClass: "border-top" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-bg" }),
              _vm._v(" "),
              _c("div", { staticClass: "border-bottom" }),
              _vm._v(" "),
              _c("div", { staticClass: "border-right" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$1a = [];
__vue_render__$1a._withStripped = true;

  /* style */
  const __vue_inject_styles__$1a = undefined;
  /* scoped */
  const __vue_scope_id__$1a = "data-v-33a777b2";
  /* module identifier */
  const __vue_module_identifier__$1a = undefined;
  /* functional template */
  const __vue_is_functional_template__$1a = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1a = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1a, staticRenderFns: __vue_staticRenderFns__$1a },
    __vue_inject_styles__$1a,
    __vue_script__$1a,
    __vue_scope_id__$1a,
    __vue_is_functional_template__$1a,
    __vue_module_identifier__$1a,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$19 = {
  name: 'paragraphGreentheme3LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$19 = script$19;
/* template */
var __vue_render__$19 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Greentheme3-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-bg" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$19 = [];
__vue_render__$19._withStripped = true;

  /* style */
  const __vue_inject_styles__$19 = undefined;
  /* scoped */
  const __vue_scope_id__$19 = "data-v-58cff7e4";
  /* module identifier */
  const __vue_module_identifier__$19 = undefined;
  /* functional template */
  const __vue_is_functional_template__$19 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$19 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$19, staticRenderFns: __vue_staticRenderFns__$19 },
    __vue_inject_styles__$19,
    __vue_script__$19,
    __vue_scope_id__$19,
    __vue_is_functional_template__$19,
    __vue_module_identifier__$19,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$18 = {
  name: 'paragraphGreentheme4LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$18 = script$18;
/* template */
var __vue_render__$18 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Greentheme4-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("div", { staticClass: "body-text-bg1" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-bg2" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$18 = [];
__vue_render__$18._withStripped = true;

  /* style */
  const __vue_inject_styles__$18 = undefined;
  /* scoped */
  const __vue_scope_id__$18 = "data-v-44e2d7be";
  /* module identifier */
  const __vue_module_identifier__$18 = undefined;
  /* functional template */
  const __vue_is_functional_template__$18 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$18 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$18, staticRenderFns: __vue_staticRenderFns__$18 },
    __vue_inject_styles__$18,
    __vue_script__$18,
    __vue_scope_id__$18,
    __vue_is_functional_template__$18,
    __vue_module_identifier__$18,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$17 = {
  name: 'paragraphGreentheme5LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$17 = script$17;
/* template */
var __vue_render__$17 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Greentheme5-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("div", { staticClass: "body-text-bg1" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "border-top" }),
              _vm._v(" "),
              _c("div", { staticClass: "border-bottom" }),
              _vm._v(" "),
              _c("div", { staticClass: "border-left" }),
              _vm._v(" "),
              _c("div", { staticClass: "border-right" }),
              _vm._v(" "),
              _c("div", { staticClass: "body-text-bg2" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$17 = [];
__vue_render__$17._withStripped = true;

  /* style */
  const __vue_inject_styles__$17 = undefined;
  /* scoped */
  const __vue_scope_id__$17 = "data-v-7498d87a";
  /* module identifier */
  const __vue_module_identifier__$17 = undefined;
  /* functional template */
  const __vue_is_functional_template__$17 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$17 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$17, staticRenderFns: __vue_staticRenderFns__$17 },
    __vue_inject_styles__$17,
    __vue_script__$17,
    __vue_scope_id__$17,
    __vue_is_functional_template__$17,
    __vue_module_identifier__$17,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$16 = {
  name: 'paragraphYellowtheme1LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$16 = script$16;
/* template */
var __vue_render__$16 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Yellowtheme1-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "border-top" }, [
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
            ]),
            _vm._v(" "),
            _c("div", { staticClass: "border-bottom" }, [
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$16 = [];
__vue_render__$16._withStripped = true;

  /* style */
  const __vue_inject_styles__$16 = undefined;
  /* scoped */
  const __vue_scope_id__$16 = "data-v-cd87c008";
  /* module identifier */
  const __vue_module_identifier__$16 = undefined;
  /* functional template */
  const __vue_is_functional_template__$16 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$16 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$16, staticRenderFns: __vue_staticRenderFns__$16 },
    __vue_inject_styles__$16,
    __vue_script__$16,
    __vue_scope_id__$16,
    __vue_is_functional_template__$16,
    __vue_module_identifier__$16,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$15 = {
  name: 'paragraphYellowtheme2LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$15 = script$15;
/* template */
var __vue_render__$15 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Yellowtheme2-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "block1" }),
            _vm._v(" "),
            _c("div", { staticClass: "block2" }),
            _vm._v(" "),
            _c("div", { staticClass: "block3" }),
            _vm._v(" "),
            _c("div", { staticClass: "block4" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$15 = [];
__vue_render__$15._withStripped = true;

  /* style */
  const __vue_inject_styles__$15 = undefined;
  /* scoped */
  const __vue_scope_id__$15 = "data-v-36650002";
  /* module identifier */
  const __vue_module_identifier__$15 = undefined;
  /* functional template */
  const __vue_is_functional_template__$15 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$15 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$15, staticRenderFns: __vue_staticRenderFns__$15 },
    __vue_inject_styles__$15,
    __vue_script__$15,
    __vue_scope_id__$15,
    __vue_is_functional_template__$15,
    __vue_module_identifier__$15,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$14 = {
  name: 'paragraphYellowtheme3LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$14 = script$14;
/* template */
var __vue_render__$14 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Yellowtheme3-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "right-img" }, [_c("div")]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$14 = [];
__vue_render__$14._withStripped = true;

  /* style */
  const __vue_inject_styles__$14 = undefined;
  /* scoped */
  const __vue_scope_id__$14 = "data-v-d63dd730";
  /* module identifier */
  const __vue_module_identifier__$14 = undefined;
  /* functional template */
  const __vue_is_functional_template__$14 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$14 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$14, staticRenderFns: __vue_staticRenderFns__$14 },
    __vue_inject_styles__$14,
    __vue_script__$14,
    __vue_scope_id__$14,
    __vue_is_functional_template__$14,
    __vue_module_identifier__$14,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$13 = {
  name: 'paragraphYellowtheme4LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$13 = script$13;
/* template */
var __vue_render__$13 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Yellowtheme4-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "block1" }),
            _vm._v(" "),
            _c("div", { staticClass: "block2" }),
            _vm._v(" "),
            _c("div", { staticClass: "block3" }),
            _vm._v(" "),
            _c("div", { staticClass: "block4" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$13 = [];
__vue_render__$13._withStripped = true;

  /* style */
  const __vue_inject_styles__$13 = undefined;
  /* scoped */
  const __vue_scope_id__$13 = "data-v-6e190441";
  /* module identifier */
  const __vue_module_identifier__$13 = undefined;
  /* functional template */
  const __vue_is_functional_template__$13 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$13 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$13, staticRenderFns: __vue_staticRenderFns__$13 },
    __vue_inject_styles__$13,
    __vue_script__$13,
    __vue_scope_id__$13,
    __vue_is_functional_template__$13,
    __vue_module_identifier__$13,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$12 = {
  name: 'paragraphYellowtheme5LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$12 = script$12;
/* template */
var __vue_render__$12 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Yellowtheme5-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "left-img" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "right-img" }),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$12 = [];
__vue_render__$12._withStripped = true;

  /* style */
  const __vue_inject_styles__$12 = undefined;
  /* scoped */
  const __vue_scope_id__$12 = "data-v-0d6a3d0f";
  /* module identifier */
  const __vue_module_identifier__$12 = undefined;
  /* functional template */
  const __vue_is_functional_template__$12 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$12 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$12, staticRenderFns: __vue_staticRenderFns__$12 },
    __vue_inject_styles__$12,
    __vue_script__$12,
    __vue_scope_id__$12,
    __vue_is_functional_template__$12,
    __vue_module_identifier__$12,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$11 = {
  name: 'paragraphRedtheme1LibraryRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$11 = script$11;
/* template */
var __vue_render__$11 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Redtheme1-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$11 = [];
__vue_render__$11._withStripped = true;

  /* style */
  const __vue_inject_styles__$11 = undefined;
  /* scoped */
  const __vue_scope_id__$11 = "data-v-df5ee2ce";
  /* module identifier */
  const __vue_module_identifier__$11 = undefined;
  /* functional template */
  const __vue_is_functional_template__$11 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$11 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$11, staticRenderFns: __vue_staticRenderFns__$11 },
    __vue_inject_styles__$11,
    __vue_script__$11,
    __vue_scope_id__$11,
    __vue_is_functional_template__$11,
    __vue_module_identifier__$11,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$10 = {
  name: 'paragraphRedtheme2LibraryRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$10 = script$10;
/* template */
var __vue_render__$10 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Redtheme2-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "left-line" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "right-line" }),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$10 = [];
__vue_render__$10._withStripped = true;

  /* style */
  const __vue_inject_styles__$10 = undefined;
  /* scoped */
  const __vue_scope_id__$10 = "data-v-1c173882";
  /* module identifier */
  const __vue_module_identifier__$10 = undefined;
  /* functional template */
  const __vue_is_functional_template__$10 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$10 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$10, staticRenderFns: __vue_staticRenderFns__$10 },
    __vue_inject_styles__$10,
    __vue_script__$10,
    __vue_scope_id__$10,
    __vue_is_functional_template__$10,
    __vue_module_identifier__$10,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$$ = {
  name: 'paragraphRedtheme3LibraryRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$$ = script$$;
/* template */
var __vue_render__$$ = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Redtheme3-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "top-line" }),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "bottom-line" }),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$$ = [];
__vue_render__$$._withStripped = true;

  /* style */
  const __vue_inject_styles__$$ = undefined;
  /* scoped */
  const __vue_scope_id__$$ = "data-v-9f9f19c2";
  /* module identifier */
  const __vue_module_identifier__$$ = undefined;
  /* functional template */
  const __vue_is_functional_template__$$ = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$$ = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$$, staticRenderFns: __vue_staticRenderFns__$$ },
    __vue_inject_styles__$$,
    __vue_script__$$,
    __vue_scope_id__$$,
    __vue_is_functional_template__$$,
    __vue_module_identifier__$$,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$_ = {
  name: 'paragraphRedtheme4LibraryRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$_ = script$_;
/* template */
var __vue_render__$_ = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Redtheme4-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-title" }, [
            _c("div", { staticClass: "body-title-box" }, [
              _c(
                "div",
                { staticClass: "body-title-con" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                  _vm._v(" "),
                  _c("div", { staticClass: "triangle1" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "triangle2" }),
                ],
                1
              ),
            ]),
          ]),
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$_ = [];
__vue_render__$_._withStripped = true;

  /* style */
  const __vue_inject_styles__$_ = undefined;
  /* scoped */
  const __vue_scope_id__$_ = "data-v-089d2aac";
  /* module identifier */
  const __vue_module_identifier__$_ = undefined;
  /* functional template */
  const __vue_is_functional_template__$_ = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$_ = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$_, staticRenderFns: __vue_staticRenderFns__$_ },
    __vue_inject_styles__$_,
    __vue_script__$_,
    __vue_scope_id__$_,
    __vue_is_functional_template__$_,
    __vue_module_identifier__$_,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$Z = {
  name: 'paragraphRedtheme5LibraryRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$Z = script$Z;
/* template */
var __vue_render__$Z = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Redtheme5-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-box" }, [
            _c(
              "div",
              { staticClass: "body-text-bg" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$Z = [];
__vue_render__$Z._withStripped = true;

  /* style */
  const __vue_inject_styles__$Z = undefined;
  /* scoped */
  const __vue_scope_id__$Z = "data-v-7dc11b65";
  /* module identifier */
  const __vue_module_identifier__$Z = undefined;
  /* functional template */
  const __vue_is_functional_template__$Z = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$Z = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$Z, staticRenderFns: __vue_staticRenderFns__$Z },
    __vue_inject_styles__$Z,
    __vue_script__$Z,
    __vue_scope_id__$Z,
    __vue_is_functional_template__$Z,
    __vue_module_identifier__$Z,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$Y = {
  name: 'paragraphRedtheme6LibraryRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$Y = script$Y;
/* template */
var __vue_render__$Y = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Redtheme6-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-title" }, [
            _c("div", { staticClass: "body-title-box" }, [
              _c(
                "div",
                { staticClass: "body-title-con" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                  _vm._v(" "),
                  _c("div", { staticClass: "triangle1" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "triangle2" }),
                ],
                1
              ),
            ]),
          ]),
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$Y = [];
__vue_render__$Y._withStripped = true;

  /* style */
  const __vue_inject_styles__$Y = undefined;
  /* scoped */
  const __vue_scope_id__$Y = "data-v-0c1182a8";
  /* module identifier */
  const __vue_module_identifier__$Y = undefined;
  /* functional template */
  const __vue_is_functional_template__$Y = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$Y = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$Y, staticRenderFns: __vue_staticRenderFns__$Y },
    __vue_inject_styles__$Y,
    __vue_script__$Y,
    __vue_scope_id__$Y,
    __vue_is_functional_template__$Y,
    __vue_module_identifier__$Y,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$X = {
  name: 'paragraphRedtheme7LibraryRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      titleTextDataName: 'titleTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$X = script$X;
/* template */
var __vue_render__$X = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Redtheme7-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-title" }, [
            _c("div", { staticClass: "body-title-box" }, [
              _c(
                "div",
                { staticClass: "body-title-con" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                  _vm._v(" "),
                  _c("div", { staticClass: "triangle1" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "triangle2" }),
                ],
                1
              ),
            ]),
          ]),
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$X = [];
__vue_render__$X._withStripped = true;

  /* style */
  const __vue_inject_styles__$X = undefined;
  /* scoped */
  const __vue_scope_id__$X = "data-v-d77ce2b2";
  /* module identifier */
  const __vue_module_identifier__$X = undefined;
  /* functional template */
  const __vue_is_functional_template__$X = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$X = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$X, staticRenderFns: __vue_staticRenderFns__$X },
    __vue_inject_styles__$X,
    __vue_script__$X,
    __vue_scope_id__$X,
    __vue_is_functional_template__$X,
    __vue_module_identifier__$X,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$W = {
  name: 'paragraphFoldtheme1LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {},
      isFold: this.isExpand //是否折叠
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    isExpand: {
      //是否展开
      type: Boolean,
      default: false
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    },
    changepanel() {
      this.isFold = !this.isFold;
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$W = script$W;
/* template */
var __vue_render__$W = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Foldtheme1-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "top-style" }),
            _vm._v(" "),
            _c(
              "div",
              {
                staticClass: "body-text",
                class: !_vm.isFold ? "body-text-fold" : "",
              },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "seemore", on: { click: _vm.changepanel } },
              [
                _c("span", [_vm._v(_vm._s(!_vm.isFold ? "查看更多" : "折叠"))]),
                _vm._v(" "),
                !_vm.isFold
                  ? _c("i", { staticClass: "el-icon-d-arrow-left down" })
                  : _c("i", { staticClass: "el-icon-d-arrow-left up" }),
              ]
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$W = [];
__vue_render__$W._withStripped = true;

  /* style */
  const __vue_inject_styles__$W = undefined;
  /* scoped */
  const __vue_scope_id__$W = "data-v-3e188913";
  /* module identifier */
  const __vue_module_identifier__$W = undefined;
  /* functional template */
  const __vue_is_functional_template__$W = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$W = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$W, staticRenderFns: __vue_staticRenderFns__$W },
    __vue_inject_styles__$W,
    __vue_script__$W,
    __vue_scope_id__$W,
    __vue_is_functional_template__$W,
    __vue_module_identifier__$W,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$V = {
  name: 'paragraphFoldtheme2LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      titleTextDataName: 'titleTextData',
      groupData: {},
      isFold: this.isExpand //是否折叠
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    isExpand: {
      //是否展开
      type: Boolean,
      default: false
    }
  },
  created() {
    console.log(this.pGroupData, '组件内部');
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    },
    changepanel() {
      this.isFold = !this.isFold;
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$V = script$V;
/* template */
var __vue_render__$V = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Foldtheme2-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "top-title-style" }, [
              _c(
                "div",
                { staticClass: "title-body-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "seemore", on: { click: _vm.changepanel } },
                [
                  _c("span", [_vm._v(_vm._s(!_vm.isFold ? "更多" : "收起"))]),
                  _vm._v(" "),
                  !_vm.isFold
                    ? _c("i", { staticClass: "el-icon-d-arrow-left down" })
                    : _c("i", { staticClass: "el-icon-d-arrow-left up" }),
                ]
              ),
            ]),
            _vm._v(" "),
            _c(
              "div",
              {
                staticClass: "body-text",
                class: !_vm.isFold ? "body-text-fold" : "",
              },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$V = [];
__vue_render__$V._withStripped = true;

  /* style */
  const __vue_inject_styles__$V = undefined;
  /* scoped */
  const __vue_scope_id__$V = "data-v-acfd4c46";
  /* module identifier */
  const __vue_module_identifier__$V = undefined;
  /* functional template */
  const __vue_is_functional_template__$V = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$V = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$V, staticRenderFns: __vue_staticRenderFns__$V },
    __vue_inject_styles__$V,
    __vue_script__$V,
    __vue_scope_id__$V,
    __vue_is_functional_template__$V,
    __vue_module_identifier__$V,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$U = {
  name: 'paragraphFoldtheme3LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      titleTextDataName: 'titleTextData',
      groupData: {},
      isFold: this.isExpand //是否折叠
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    isExpand: {
      //是否展开
      type: Boolean,
      default: false
    }
  },
  created() {
    console.log(this.pGroupData, '组件内部');
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    },
    changepanel() {
      this.isFold = !this.isFold;
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$U = script$U;
/* template */
var __vue_render__$U = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Foldtheme2-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "top-title-style" }, [
              _c(
                "div",
                { staticClass: "title-body-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "seemore", on: { click: _vm.changepanel } },
                [
                  _c("span", [_vm._v(_vm._s(!_vm.isFold ? "更多" : "收起"))]),
                  _vm._v(" "),
                  !_vm.isFold
                    ? _c("i", { staticClass: "el-icon-d-arrow-left down" })
                    : _c("i", { staticClass: "el-icon-d-arrow-left up" }),
                ]
              ),
            ]),
            _vm._v(" "),
            _c(
              "div",
              {
                directives: [
                  {
                    name: "show",
                    rawName: "v-show",
                    value: _vm.isFold,
                    expression: "isFold",
                  },
                ],
                staticClass: "body-text",
                class: !_vm.isFold ? "body-text-fold" : "",
              },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$U = [];
__vue_render__$U._withStripped = true;

  /* style */
  const __vue_inject_styles__$U = undefined;
  /* scoped */
  const __vue_scope_id__$U = "data-v-e86d4042";
  /* module identifier */
  const __vue_module_identifier__$U = undefined;
  /* functional template */
  const __vue_is_functional_template__$U = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$U = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$U, staticRenderFns: __vue_staticRenderFns__$U },
    __vue_inject_styles__$U,
    __vue_script__$U,
    __vue_scope_id__$U,
    __vue_is_functional_template__$U,
    __vue_module_identifier__$U,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$T = {
  name: 'paragraphTabstheme1LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      bodyTextDataName2: 'bodyTextData2',
      bodyTextDataName3: 'bodyTextData3',
      bodyTextDataName4: 'bodyTextData4',
      titleTextDataName1: 'titleTextData1',
      titleTextDataName2: 'titleTextData2',
      titleTextDataName3: 'titleTextData3',
      titleTextDataName4: 'titleTextData4',
      groupData: {},
      tabslist: [],
      chooseindex: 0
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    clicktabs(e) {
      this.chooseindex = e;
    },
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    },
    changepanel() {
      this.isFold = !this.isFold;
    },
    addtabs() {
      console.log(this.groupData);
      // {html: "<p style='font-size: 16px;font-family: PingFang SC;font-weight: bold;color: #fff;'>这是一个标题</p>"}
      this.tabslist.push({
        html: "<p style='font-size: 16px;font-family: PingFang SC;font-weight: bold;color: #000;'>选项一</p>"
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$T = script$T;
/* template */
var __vue_render__$T = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Tabstheme1-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "body-text" }, [
              _c(
                "div",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: _vm.chooseindex == 0,
                      expression: "chooseindex==0",
                    },
                  ],
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                      "block-data-name": _vm.bodyTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: _vm.chooseindex == 1,
                      expression: "chooseindex==1",
                    },
                  ],
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName2],
                      "block-data-name": _vm.bodyTextDataName2,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: _vm.chooseindex == 2,
                      expression: "chooseindex==2",
                    },
                  ],
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName3],
                      "block-data-name": _vm.bodyTextDataName3,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: _vm.chooseindex == 3,
                      expression: "chooseindex==3",
                    },
                  ],
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName4],
                      "block-data-name": _vm.bodyTextDataName4,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]),
            _vm._v(" "),
            _c("div", { staticClass: "top-style" }, [
              _c(
                "div",
                {
                  class: _vm.chooseindex == 0 ? "active" : "",
                  on: {
                    click: function ($event) {
                      return _vm.clicktabs(0)
                    },
                  },
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName1],
                      "block-data-name": _vm.titleTextDataName1,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  class: _vm.chooseindex == 1 ? "active" : "",
                  on: {
                    click: function ($event) {
                      return _vm.clicktabs(1)
                    },
                  },
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName2],
                      "block-data-name": _vm.titleTextDataName2,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  class: _vm.chooseindex == 2 ? "active" : "",
                  on: {
                    click: function ($event) {
                      return _vm.clicktabs(2)
                    },
                  },
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName3],
                      "block-data-name": _vm.titleTextDataName3,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  class: _vm.chooseindex == 3 ? "active" : "",
                  on: {
                    click: function ($event) {
                      return _vm.clicktabs(3)
                    },
                  },
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName4],
                      "block-data-name": _vm.titleTextDataName4,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$T = [];
__vue_render__$T._withStripped = true;

  /* style */
  const __vue_inject_styles__$T = undefined;
  /* scoped */
  const __vue_scope_id__$T = "data-v-6a8e5129";
  /* module identifier */
  const __vue_module_identifier__$T = undefined;
  /* functional template */
  const __vue_is_functional_template__$T = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$T = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$T, staticRenderFns: __vue_staticRenderFns__$T },
    __vue_inject_styles__$T,
    __vue_script__$T,
    __vue_scope_id__$T,
    __vue_is_functional_template__$T,
    __vue_module_identifier__$T,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$S = {
  name: 'paragraphTabstheme2LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      bodyTextDataName2: 'bodyTextData2',
      bodyTextDataName3: 'bodyTextData3',
      bodyTextDataName4: 'bodyTextData4',
      titleTextDataName: 'titleTextData',
      titleTextDataName1: 'titleTextData1',
      titleTextDataName2: 'titleTextData2',
      titleTextDataName3: 'titleTextData3',
      titleTextDataName4: 'titleTextData4',
      groupData: {},
      tabslist: [],
      chooseindex: 0
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    clicktabs(e) {
      this.chooseindex = e;
    },
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    },
    changepanel() {
      this.isFold = !this.isFold;
    },
    addtabs() {
      console.log(this.groupData);
      // {html: "<p style='font-size: 16px;font-family: PingFang SC;font-weight: bold;color: #fff;'>这是一个标题</p>"}
      this.tabslist.push({
        html: "<p style='font-size: 16px;font-family: PingFang SC;font-weight: bold;color: #000;'>选项一</p>"
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$S = script$S;
/* template */
var __vue_render__$S = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Tabstheme2-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "suptitle" },
            [
              _c("div", { staticClass: "block1" }),
              _vm._v(" "),
              _c("div", { staticClass: "block2" }),
              _vm._v(" "),
              _c("div", { staticClass: "block3" }),
              _vm._v(" "),
              _c("div", { staticClass: "block4" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName],
                  "block-data-name": _vm.titleTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "top-style" }, [
              _c(
                "div",
                {
                  class: _vm.chooseindex == 0 ? "active" : "",
                  on: {
                    click: function ($event) {
                      return _vm.clicktabs(0)
                    },
                  },
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName1],
                      "block-data-name": _vm.titleTextDataName1,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  class: _vm.chooseindex == 1 ? "active" : "",
                  on: {
                    click: function ($event) {
                      return _vm.clicktabs(1)
                    },
                  },
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName2],
                      "block-data-name": _vm.titleTextDataName2,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  class: _vm.chooseindex == 2 ? "active" : "",
                  on: {
                    click: function ($event) {
                      return _vm.clicktabs(2)
                    },
                  },
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName3],
                      "block-data-name": _vm.titleTextDataName3,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  class: _vm.chooseindex == 3 ? "active" : "",
                  on: {
                    click: function ($event) {
                      return _vm.clicktabs(3)
                    },
                  },
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName4],
                      "block-data-name": _vm.titleTextDataName4,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]),
            _vm._v(" "),
            _c("div", { staticClass: "body-text" }, [
              _c(
                "div",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: _vm.chooseindex == 0,
                      expression: "chooseindex==0",
                    },
                  ],
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                      "block-data-name": _vm.bodyTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: _vm.chooseindex == 1,
                      expression: "chooseindex==1",
                    },
                  ],
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName2],
                      "block-data-name": _vm.bodyTextDataName2,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: _vm.chooseindex == 2,
                      expression: "chooseindex==2",
                    },
                  ],
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName3],
                      "block-data-name": _vm.bodyTextDataName3,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: _vm.chooseindex == 3,
                      expression: "chooseindex==3",
                    },
                  ],
                },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName4],
                      "block-data-name": _vm.bodyTextDataName4,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$S = [];
__vue_render__$S._withStripped = true;

  /* style */
  const __vue_inject_styles__$S = undefined;
  /* scoped */
  const __vue_scope_id__$S = "data-v-1a2e2690";
  /* module identifier */
  const __vue_module_identifier__$S = undefined;
  /* functional template */
  const __vue_is_functional_template__$S = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$S = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$S, staticRenderFns: __vue_staticRenderFns__$S },
    __vue_inject_styles__$S,
    __vue_script__$S,
    __vue_scope_id__$S,
    __vue_is_functional_template__$S,
    __vue_module_identifier__$S,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$R = {
  name: 'paragraphTabstheme3LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      titleTextDataName: 'titleTextData',
      titleTextDataName1: 'titleTextData1',
      groupData: {},
      tabslist: [],
      chooseindex: 0,
      timer: ''
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  watch: {
    pGroupData: {
      handler(newValue, oldValue) {
        this.$set(this.groupData, 'titleTextData', newValue.titleTextData);
        this.$set(this.groupData, 'bodyTextData', newValue.bodyTextData);
        this.handleLoad();
      },
      deep: true
    }
  },
  methods: {
    handleLoad() {
      this.timer = new Date().getTime();
    },
    clicktabs(e) {
      this.chooseindex = e;
    },
    addtabs() {
      // this.groupData.titleTextData.push({
      //       html: '<p style="font-size: 16px;font-family: PingFang SC;font-weight: bold;color: #000;">选项一</p>',
      // })
      // this.groupData.bodyTextData.push({
      //     html: '<p style="font-size: 16px;font-family: Microsoft YaHei;font-weight: 400;color: #333333;">夏天的风是蓝色的温柔。我时常仰望夏日天空，蓝得清澈。夏日的风，漫过无边无垠的往事，送来对未来的美好希望。</p>',
      // })
      this.$emit('addtabs', {
        ruleIndex: this.ruleIndex
      });
    },
    deltabs(index) {
      this.$emit('deltabs', {
        ruleIndex: this.ruleIndex,
        dataIndex: index
      });
      if (this.groupData.titleTextData.length == 0) {
        this.chooseindex = 0;
      } else {
        this.chooseindex = this.groupData.titleTextData.length - 1;
      }
    },
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data,
      dataIndex
    }) {
      console.log(ruleIndex, dataName, data);
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data,
        dataIndex
      });
    },
    changepanel() {
      this.isFold = !this.isFold;
    }
  },
  mounted() {}
};

var __$_require_assets_images_closeicon_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAbBJREFUOE99ks1qWkEUx//H61cWogvBRRaxCuqmbu4NClkJyaLrpts8QLtwH2mhD1Dool30CQLtE7RQhBDczBhfQMVFQUqSi+aKetF7T5mhN4yh6VnN+c/5zfmYQ3hkUspEGIaHlmU9Z+YUEf1i5kvHcW7NUDIdIcRLIvoA4GAniMhn5i+e53VardZC3T2AUsr3AN49rsD0U6kUlstlvtFo3GlQCHFKRN/UOR6PY7vd7vCxWEz7YRiCiH7atn1M3W43nslkJgD2FVSv1zEejzGbzXSw0qrVKlzXxXQ61RoRvaDBYHAUBMFVlCKbzaJcLmvY8zwNrddr7Rv2lvr9/htm/mSqCi4WiwiCAIvFApOJKmjHzklK2Qbw0ZQty0KtVkM6ncZwOMR8Pv8n+ArA1+hG9VSpVLBarXSfKrMq04SZuaMy5gH8BhBT01OZfN/HaDTSb+VyOZRKJe0bcFt/h5TyM4DXCiwUCg/TMwemzn/Bm0Qi8UyDvV5vL5lMXgOo/W8BALD6Ctu2v5ubk2fmCyI6fgJW7Zw5jvNjZ+WiYCHECRE5JkxE7mazuWg2m/eR/gfAL7CDWnQ6sgAAAABJRU5ErkJggg==";

var __$_require_assets_images_addtabicon_png__ = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAAAXNSR0IArs4c6QAABcZJREFUWEfNl01sE0cUx2c/vP5YDKyDiTfQ4FQogIlTJeFQIQSC5tAqiEOqlI9QoRxAqqoeWvXWSk7EBalSD60qtVZFDi0oCeJEWilSE8ipORQcZMWgiiihtfAmRl5EYuz9mJ3qbRnLcfxJe2Ck0Xq9Mzu/fe/Nm/9j0GvQmEYZCCEV5zAMQxp9H4yvC4IuPDIyYo8PhUL2NZFI0Ht78UQiYV8jkYh9rReqKkTx4rCw3+9nZmdnWZ/Px+zduxetrKzY89fW1kggECCqqpL29naSTqcJANULUxECAODLYXFVVVlN01jTNFlRFBm4ulwuZseOHbb1NU0j+Xye5HI5IgiCJYqi5ff7rWKYalYpC0EBEEJsKBRis9ksy3Ecx7IsZxgGizFmDxw44N21a5dP0zTr0aNHK6lUSuc4zrIsC5umiQFG13WcSqXANRZYpRLIJggKcOzYMTYej3NOp5PjeZ5zuVz8iRMnOpuami7wPP8OwzBvFMWUaVlWXNf1yYcPH/40Pz+fFkXRRAhh6IlEwqoGsgGiFGD79u18Lpfjjxw54t+3b98VjuP6awUzIWRd07QrExMT33McZ2SzWVOSJLMayAaI4eFhlrpAVVUeIeTo6+sLtbS0TDAMs7uR7Wea5q+3b9++uLq6ui4IgqGqKsBYAwMDVqlbChBghRs3brAQhJIk8bquOw4fPhwMBoNTDMMEGgGgY03T/OX69esX3G63BhYJBoPm7OzspvgoQFAr+Hw+LhAIOHK5nHNwcHCS47i3KwHcvXsXybKMWlpaKjLm8/kvx8bGvtN1XQe3QIyUWsOGoLEgyzIHVlBVVTh//vwHHo8nWs0C0WgU9fT02L1Sgxi5f/9+97179xSWZQ1qjeHhYQhWuxUgwBWKovAcxzmcTqcwNDT0G8uyXf8VAubn8/nLY2NjX4M1EEJGKpXCZSFGRka4PXv28D6fz7F///4329vbY7V2Qj2WAAjLsmKjo6O9giBoLpfLKHVJwRLRaJTPZrP8zp07HadOnRrwer0/1grGeiEQQubU1FTr8+fP1xRFMQKBgFkcFzYEBCWNB4SQ0NfX94nH47lcDAFBCL2edunSpU3DlpaW3orH40uZTMZ4/PixGYlEMN2qlSA+9Xg8keI3ZTIZBL24zczMoLa2NrsXNzjcStvi4uKhhYWFPytCwO6g7hBFUTh37tyHW7Zs+bbWVzfgDhKLxdpisVhGlmV9fX19szteblE7MB0Oh9Db23uoubl5+v+CIIT8dfXq1S5N03SMcfmYoNmSbtHW1lbXyZMn4wihqpmyXksYhjF67dq1z2CLplIpSFgQE4VTdUOyQgjxsizzgiAIZ8+e/cLpdH5ezRrj4+Po4MGDqKOjo9owoijK8enp6djq6qrR1dVlQOrelCfoDoHje3l5mbcsy9HZ2env6emZYxjGX8st1Z5jjG+Oj49fxBjrz549M0u3ZyFjwg/qEoQQR0/QM2fOvLd169af4b9XASGEJB88eHB8bm5uBVL2S5GDSwXOhlMU5BwVM5C+PR4Pf/r06SG32/3VK4AoT548eX9ycnIBUnWlw2uDJYqtAce5IAicKIp2Fu3v73/X6/V+U69rMMa/Ly4ufnTnzp1lt9ttghsymQyorLIyr6y8o7oCQF68eMGDvOvu7m4Kh8MfC4IwyDBMcxn3EELIfDab/eHWrVs3LcvSQUNomobD4TAupyPoO8pCwEMKAiqb6kwQuqIoOo4ePRoWRbGD53kJDiPDMFJPnz79Y2Zm5m+MMZYkydaW0EF1VwPY5A5KRusNAIFaI51O24pb13Vb9m/btg3uGUkCBoR0XSder5ckk0ni9/uxoiiW0+m06lHaFSGKYWjtUVz4eL1eqEWY3bv/lZ3JZBJJkkSgCKKLh0KhQgFUqxKrWQaWKwGh/JNlecNc+Gq6MIBVqzNK46kmRPGE0mKY1qa03CsEWoOFcUMQr5Kw6pnzWkD8AxrTd08+b0laAAAAAElFTkSuQmCC";

/* script */
const __vue_script__$R = script$R;
var __vue_render__$R = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Tabstheme3-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "suptitle" },
            [
              _c("div", { staticClass: "block1" }),
              _vm._v(" "),
              _c("div", { staticClass: "block2" }),
              _vm._v(" "),
              _c("div", { staticClass: "block3" }),
              _vm._v(" "),
              _c("div", { staticClass: "block4" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName1],
                  "block-data-name": _vm.titleTextDataName1,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c(
              "div",
              { staticClass: "top-style" },
              [
                _vm._l(_vm.groupData.titleTextData, function (item, k) {
                  return _c(
                    "div",
                    {
                      key: k,
                      class: _vm.chooseindex == k ? "active" : "",
                      on: {
                        click: function ($event) {
                          return _vm.clicktabs(k)
                        },
                      },
                    },
                    [
                      _c("xml-text-render", {
                        key: _vm.timer,
                        attrs: {
                          "p-block-data": item,
                          "block-data-name": _vm.titleTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "data-index": k,
                          "container-class": "text-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      }),
                      _vm._v(" "),
                      _vm.mode == "editor"
                        ? _c("img", {
                            staticClass: "deltabs",
                            attrs: {
                              src: __$_require_assets_images_closeicon_png__,
                            },
                            on: {
                              click: function ($event) {
                                return _vm.deltabs(k)
                              },
                            },
                          })
                        : _vm._e(),
                    ],
                    1
                  )
                }),
                _vm._v(" "),
                _vm.mode == "editor"
                  ? _c(
                      "span",
                      { staticClass: "addtabs", on: { click: _vm.addtabs } },
                      [
                        _c("img", {
                          attrs: {
                            src: __$_require_assets_images_addtabicon_png__,
                            alt: "",
                          },
                        }),
                      ]
                    )
                  : _vm._e(),
              ],
              2
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              _vm._l(_vm.groupData.bodyTextData, function (item, i) {
                return _c(
                  "div",
                  {
                    directives: [
                      {
                        name: "show",
                        rawName: "v-show",
                        value: _vm.chooseindex == i,
                        expression: "chooseindex==i",
                      },
                    ],
                    key: i,
                  },
                  [
                    _c("xml-text-render", {
                      key: _vm.timer,
                      attrs: {
                        "p-block-data": item,
                        "block-data-name": _vm.bodyTextDataName,
                        "extend-params": _vm.extendParams,
                        "current-rule": _vm.currentRule,
                        "rule-index": _vm.ruleIndex,
                        "data-index": i,
                        "container-class": "text-body-container",
                        "editor-class": "editor",
                        mode: _vm.mode,
                        "page-type": _vm.pageType,
                        scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                      },
                      on: {
                        blockclick: _vm.handleBlockClick,
                        groupDataChange: _vm.groupDataChange,
                      },
                      scopedSlots: _vm._u(
                        [
                          _vm._l(_vm.$scopedSlots, function (index, name) {
                            return {
                              key: name,
                              fn: function (deliver) {
                                return [_vm._t(name, null, null, deliver)]
                              },
                            }
                          }),
                        ],
                        null,
                        true
                      ),
                    }),
                  ],
                  1
                )
              }),
              0
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$R = [];
__vue_render__$R._withStripped = true;

  /* style */
  const __vue_inject_styles__$R = undefined;
  /* scoped */
  const __vue_scope_id__$R = "data-v-c8b7974a";
  /* module identifier */
  const __vue_module_identifier__$R = undefined;
  /* functional template */
  const __vue_is_functional_template__$R = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$R = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$R, staticRenderFns: __vue_staticRenderFns__$R },
    __vue_inject_styles__$R,
    __vue_script__$R,
    __vue_scope_id__$R,
    __vue_is_functional_template__$R,
    __vue_module_identifier__$R,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$Q = {
  name: 'paragraphTabstheme4LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      titleTextDataName: 'titleTextData',
      titleTextDataName1: 'titleTextData1',
      groupData: {},
      tabslist: [],
      chooseindex: 0,
      timer: ''
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  watch: {
    pGroupData: {
      handler(newValue, oldValue) {
        this.$set(this.groupData, 'titleTextData', newValue.titleTextData);
        this.$set(this.groupData, 'bodyTextData', newValue.bodyTextData);
        this.handleLoad();
      },
      deep: true
    }
  },
  methods: {
    handleLoad() {
      this.timer = new Date().getTime();
    },
    clicktabs(e) {
      this.chooseindex = e;
    },
    addtabs() {
      // this.groupData.titleTextData.push({
      //       html: '<p style="font-size: 16px;font-family: PingFang SC;font-weight: bold;color: #000;">选项一</p>',
      // })
      // this.groupData.bodyTextData.push({
      //     html: '<p style="font-size: 16px;font-family: Microsoft YaHei;font-weight: 400;color: #333333;">夏天的风是蓝色的温柔。我时常仰望夏日天空，蓝得清澈。夏日的风，漫过无边无垠的往事，送来对未来的美好希望。</p>',
      // })
      this.$emit('addtabs', {
        ruleIndex: this.ruleIndex
      });
    },
    deltabs(index) {
      this.$emit('deltabs', {
        ruleIndex: this.ruleIndex,
        dataIndex: index
      });
      if (this.groupData.titleTextData.length == 0) {
        this.chooseindex = 0;
      } else {
        this.chooseindex = this.groupData.titleTextData.length - 1;
      }
    },
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data,
      dataIndex
    }) {
      console.log(ruleIndex, dataName, data);
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data,
        dataIndex
      });
    },
    changepanel() {
      this.isFold = !this.isFold;
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$Q = script$Q;
var __vue_render__$Q = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Tabstheme4-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c(
              "div",
              { staticClass: "body-text" },
              _vm._l(_vm.groupData.bodyTextData, function (item, i) {
                return _c(
                  "div",
                  {
                    directives: [
                      {
                        name: "show",
                        rawName: "v-show",
                        value: _vm.chooseindex == i,
                        expression: "chooseindex==i",
                      },
                    ],
                    key: i,
                  },
                  [
                    _c("xml-text-render", {
                      key: _vm.timer,
                      attrs: {
                        "p-block-data": item,
                        "block-data-name": _vm.bodyTextDataName,
                        "extend-params": _vm.extendParams,
                        "current-rule": _vm.currentRule,
                        "rule-index": _vm.ruleIndex,
                        "data-index": i,
                        "container-class": "text-body-container",
                        "editor-class": "editor",
                        mode: _vm.mode,
                        "page-type": _vm.pageType,
                        scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                      },
                      on: {
                        blockclick: _vm.handleBlockClick,
                        groupDataChange: _vm.groupDataChange,
                      },
                      scopedSlots: _vm._u(
                        [
                          _vm._l(_vm.$scopedSlots, function (index, name) {
                            return {
                              key: name,
                              fn: function (deliver) {
                                return [_vm._t(name, null, null, deliver)]
                              },
                            }
                          }),
                        ],
                        null,
                        true
                      ),
                    }),
                  ],
                  1
                )
              }),
              0
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "top-style" },
              [
                _vm._l(_vm.groupData.titleTextData, function (item, k) {
                  return _c(
                    "div",
                    {
                      key: k,
                      class: _vm.chooseindex == k ? "active" : "",
                      on: {
                        click: function ($event) {
                          return _vm.clicktabs(k)
                        },
                      },
                    },
                    [
                      _c("xml-text-render", {
                        key: _vm.timer,
                        attrs: {
                          "p-block-data": item,
                          "block-data-name": _vm.titleTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "data-index": k,
                          "container-class": "text-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      }),
                      _vm._v(" "),
                      _vm.mode == "editor"
                        ? _c("img", {
                            staticClass: "deltabs",
                            attrs: {
                              src: __$_require_assets_images_closeicon_png__,
                            },
                            on: {
                              click: function ($event) {
                                return _vm.deltabs(k)
                              },
                            },
                          })
                        : _vm._e(),
                    ],
                    1
                  )
                }),
                _vm._v(" "),
                _vm.mode == "editor"
                  ? _c(
                      "span",
                      { staticClass: "addtabs", on: { click: _vm.addtabs } },
                      [
                        _c("img", {
                          attrs: {
                            src: __$_require_assets_images_addtabicon_png__,
                            alt: "",
                          },
                        }),
                      ]
                    )
                  : _vm._e(),
              ],
              2
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$Q = [];
__vue_render__$Q._withStripped = true;

  /* style */
  const __vue_inject_styles__$Q = undefined;
  /* scoped */
  const __vue_scope_id__$Q = "data-v-298fec4a";
  /* module identifier */
  const __vue_module_identifier__$Q = undefined;
  /* functional template */
  const __vue_is_functional_template__$Q = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$Q = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$Q, staticRenderFns: __vue_staticRenderFns__$Q },
    __vue_inject_styles__$Q,
    __vue_script__$Q,
    __vue_scope_id__$Q,
    __vue_is_functional_template__$Q,
    __vue_module_identifier__$Q,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$P = {
  name: 'paragraphSanQintheme1LibraryRender',
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$P = script$P;
/* template */
var __vue_render__$P = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-SanQintheme1-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c(
              "div",
              { staticClass: "body-text" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
                _vm._v(" "),
                _c("div", { staticClass: "left-top-image" }, [
                  _c("div", { staticClass: "left-bottom-block1" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "left-bottom-block2" }),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "left-bottom-image" }, [
                  _c("div", { staticClass: "left-bottom-block1" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "left-bottom-block2" }),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "right-top-image" }, [
                  _c("div", { staticClass: "left-bottom-block1" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "left-bottom-block2" }),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "right-bottom-image" }, [
                  _c("div", { staticClass: "left-bottom-block1" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "left-bottom-block2" }),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "top-line" }),
                _vm._v(" "),
                _c("div", { staticClass: "bottom-line" }),
                _vm._v(" "),
                _c("div", { staticClass: "left-line" }),
                _vm._v(" "),
                _c("div", { staticClass: "right-line" }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$P = [];
__vue_render__$P._withStripped = true;

  /* style */
  const __vue_inject_styles__$P = undefined;
  /* scoped */
  const __vue_scope_id__$P = "data-v-1ba22135";
  /* module identifier */
  const __vue_module_identifier__$P = undefined;
  /* functional template */
  const __vue_is_functional_template__$P = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$P = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$P, staticRenderFns: __vue_staticRenderFns__$P },
    __vue_inject_styles__$P,
    __vue_script__$P,
    __vue_scope_id__$P,
    __vue_is_functional_template__$P,
    __vue_module_identifier__$P,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$O = {
  mixins: [singleGroupMixin],
  name: 'paragraphTwelveLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$O = script$O;
/* template */
var __vue_render__$O = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-twelve-library-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("div", { staticClass: "left-top-img" }),
              _vm._v(" "),
              _c("div", { staticClass: "right-bottom-img" }),
              _vm._v(" "),
              _c("div", { staticClass: "left-top-clover" }, [
                _c(
                  "svg",
                  {
                    staticClass: "icon",
                    attrs: {
                      t: "1690358656753",
                      viewBox: "0 0 1024 1024",
                      version: "1.1",
                      xmlns: "http://www.w3.org/2000/svg",
                      "p-id": "8155",
                      width: "18",
                      height: "18",
                    },
                  },
                  [
                    _c("path", {
                      attrs: {
                        d: "M950.6 515.4c0.4-6 1.4-11.2 2.5-17.1 0 0 19.8-47.1-11.3-80.4-31.1-33.3-43.1-59.4-114.1-65-70.9-5.6-114-3-155 28.9-35.6 27.6-88.9 85.2-102.5 100.1-5-14.8-16.2-26.7-30.3-32.8 12.4-10.1 76.7-62.7 107.5-97.9 34.2-39.1 39.2-82 37.7-153.1s-26.9-84.6-58.3-117.6-79.6-15.9-79.6-15.9c-6.3 0.9-12 1.6-18.6 1.6v0.1c-6-0.4-11.3-1.3-17.1-2.3 0 0-47.4-19.1-80.2 12.5-32.8 31.6-58.8 44-63.3 115s-1.3 114 31.2 154.6c28.3 35.3 87.2 88.3 101.9 101.3-8.5 2.8-16.1 7.5-22.3 13.7-6.4 5.6-11.4 12.7-14.7 20.8-12-15.5-60.8-77.8-94.2-108.4-38.3-35.1-81-41.2-152.1-41.5-71.1-0.3-85.3 24.8-119 55.4-33.7 30.6-17.9 79.2-17.9 79.2 0.7 5.9 1.2 11.3 1.2 17.2H82c-0.5 6.5-1.6 12.1-2.9 18.4 0 0-20.2 46.9 10.5 80.5 30.8 33.6 42.5 59.8 113.4 66.1 70.9 6.3 114 4.1 155.3-27.3 37.2-28.3 94.1-88.9 105-100.6 5.2 14.5 16.3 26.4 30.7 32.4-15.8 12.6-76.8 61.9-106.8 95.5-34.6 38.8-40 81.6-39.3 152.7 0.8 71.1 26.1 84.9 57.2 118.2s79.4 16.7 79.4 16.7c5.9-0.7 11.2-1.4 17.2-1.4v0.1c6.5 0.4 12.1 1.4 18.4 2.6 0 0 47.2 19.6 80.3-11.7 33.1-31.3 59.2-43.4 64.4-114.4 5.2-71 2.4-114-29.6-154.9-28.1-35.8-87-89.8-101.1-102.5 7.7-2.8 14.7-7.3 20.4-13.1 5.9-5.2 10.6-11.6 13.8-18.9C580 537 629.9 599.5 663.8 630c38.6 34.8 81.4 40.4 152.5 40 71.1-0.4 85-25.7 118.5-56.6C968.3 582.5 952 534 952 534c-0.8-6.3-1.4-12-1.4-18.6z",
                        fill: _vm.groupData.themeColor,
                        "p-id": "8156",
                      },
                    }),
                  ]
                ),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "right-bottom-clover" }, [
                _c(
                  "svg",
                  {
                    staticClass: "icon",
                    attrs: {
                      t: "1690358656753",
                      viewBox: "0 0 1024 1024",
                      version: "1.1",
                      xmlns: "http://www.w3.org/2000/svg",
                      "p-id": "8155",
                      width: "18",
                      height: "18",
                    },
                  },
                  [
                    _c("path", {
                      attrs: {
                        d: "M950.6 515.4c0.4-6 1.4-11.2 2.5-17.1 0 0 19.8-47.1-11.3-80.4-31.1-33.3-43.1-59.4-114.1-65-70.9-5.6-114-3-155 28.9-35.6 27.6-88.9 85.2-102.5 100.1-5-14.8-16.2-26.7-30.3-32.8 12.4-10.1 76.7-62.7 107.5-97.9 34.2-39.1 39.2-82 37.7-153.1s-26.9-84.6-58.3-117.6-79.6-15.9-79.6-15.9c-6.3 0.9-12 1.6-18.6 1.6v0.1c-6-0.4-11.3-1.3-17.1-2.3 0 0-47.4-19.1-80.2 12.5-32.8 31.6-58.8 44-63.3 115s-1.3 114 31.2 154.6c28.3 35.3 87.2 88.3 101.9 101.3-8.5 2.8-16.1 7.5-22.3 13.7-6.4 5.6-11.4 12.7-14.7 20.8-12-15.5-60.8-77.8-94.2-108.4-38.3-35.1-81-41.2-152.1-41.5-71.1-0.3-85.3 24.8-119 55.4-33.7 30.6-17.9 79.2-17.9 79.2 0.7 5.9 1.2 11.3 1.2 17.2H82c-0.5 6.5-1.6 12.1-2.9 18.4 0 0-20.2 46.9 10.5 80.5 30.8 33.6 42.5 59.8 113.4 66.1 70.9 6.3 114 4.1 155.3-27.3 37.2-28.3 94.1-88.9 105-100.6 5.2 14.5 16.3 26.4 30.7 32.4-15.8 12.6-76.8 61.9-106.8 95.5-34.6 38.8-40 81.6-39.3 152.7 0.8 71.1 26.1 84.9 57.2 118.2s79.4 16.7 79.4 16.7c5.9-0.7 11.2-1.4 17.2-1.4v0.1c6.5 0.4 12.1 1.4 18.4 2.6 0 0 47.2 19.6 80.3-11.7 33.1-31.3 59.2-43.4 64.4-114.4 5.2-71 2.4-114-29.6-154.9-28.1-35.8-87-89.8-101.1-102.5 7.7-2.8 14.7-7.3 20.4-13.1 5.9-5.2 10.6-11.6 13.8-18.9C580 537 629.9 599.5 663.8 630c38.6 34.8 81.4 40.4 152.5 40 71.1-0.4 85-25.7 118.5-56.6C968.3 582.5 952 534 952 534c-0.8-6.3-1.4-12-1.4-18.6z",
                        fill: _vm.groupData.themeColor,
                        "p-id": "8156",
                      },
                    }),
                  ]
                ),
              ]),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$O = [];
__vue_render__$O._withStripped = true;

  /* style */
  const __vue_inject_styles__$O = undefined;
  /* scoped */
  const __vue_scope_id__$O = "data-v-ea4b7fcc";
  /* module identifier */
  const __vue_module_identifier__$O = undefined;
  /* functional template */
  const __vue_is_functional_template__$O = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$O = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$O, staticRenderFns: __vue_staticRenderFns__$O },
    __vue_inject_styles__$O,
    __vue_script__$O,
    __vue_scope_id__$O,
    __vue_is_functional_template__$O,
    __vue_module_identifier__$O,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$N = {
  name: 'paragraphFoldtheme4LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      titleTextDataName: 'titleTextData',
      groupData: {},
      isFold: this.isExpand //是否折叠
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    isExpand: {
      //是否展开
      type: Boolean,
      default: false
    }
  },
  created() {
    console.log(this.pGroupData, '组件内部');
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    },
    changepanel() {
      this.isFold = !this.isFold;
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$N = script$N;
/* template */
var __vue_render__$N = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Foldtheme4-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "top-title-style" }, [
              _c(
                "div",
                { staticClass: "title-body-box" },
                [
                  _c("div", { staticClass: "line" }),
                  _vm._v(" "),
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                  _vm._v(" "),
                  _c("div", { staticClass: "line" }),
                ],
                1
              ),
            ]),
            _vm._v(" "),
            _c("div", { staticClass: "body-text" }, [
              _c(
                "div",
                { class: !_vm.isFold ? "body-text-fold" : "" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                      "block-data-name": _vm.bodyTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "seemore", on: { click: _vm.changepanel } },
                [
                  _c("span", [
                    _vm._v(_vm._s(!_vm.isFold ? "查看更多" : "收起")),
                  ]),
                ]
              ),
            ]),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$N = [];
__vue_render__$N._withStripped = true;

  /* style */
  const __vue_inject_styles__$N = undefined;
  /* scoped */
  const __vue_scope_id__$N = "data-v-dde3a284";
  /* module identifier */
  const __vue_module_identifier__$N = undefined;
  /* functional template */
  const __vue_is_functional_template__$N = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$N = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$N, staticRenderFns: __vue_staticRenderFns__$N },
    __vue_inject_styles__$N,
    __vue_script__$N,
    __vue_scope_id__$N,
    __vue_is_functional_template__$N,
    __vue_module_identifier__$N,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$M = {
  name: 'paragraphFoldtheme5LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      titleTextDataName: 'titleTextData',
      groupData: {},
      isFold: this.isExpand //是否折叠
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    isExpand: {
      //是否展开
      type: Boolean,
      default: false
    }
  },
  created() {
    console.log(this.pGroupData, '组件内部');
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    },
    changepanel() {
      this.isFold = !this.isFold;
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$M = script$M;
/* template */
var __vue_render__$M = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Foldtheme5-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "top-title-style" }, [
              _c(
                "div",
                { staticClass: "title-body-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]),
            _vm._v(" "),
            _c("div", { staticClass: "body-text" }, [
              _c(
                "div",
                { class: !_vm.isFold ? "body-text-fold" : "" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                      "block-data-name": _vm.bodyTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "seemore", on: { click: _vm.changepanel } },
                [
                  _c("span", [
                    _vm._v(_vm._s(!_vm.isFold ? "查看更多" : "收起")),
                  ]),
                ]
              ),
            ]),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$M = [];
__vue_render__$M._withStripped = true;

  /* style */
  const __vue_inject_styles__$M = undefined;
  /* scoped */
  const __vue_scope_id__$M = "data-v-84f54482";
  /* module identifier */
  const __vue_module_identifier__$M = undefined;
  /* functional template */
  const __vue_is_functional_template__$M = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$M = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$M, staticRenderFns: __vue_staticRenderFns__$M },
    __vue_inject_styles__$M,
    __vue_script__$M,
    __vue_scope_id__$M,
    __vue_is_functional_template__$M,
    __vue_module_identifier__$M,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$L = {
  name: 'paragraphTabstheme5LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      titleTextDataName: 'titleTextData',
      titleTextDataName1: 'titleTextData1',
      groupData: {},
      tabslist: [],
      chooseindex: 0,
      timer: ''
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  watch: {
    pGroupData: {
      handler(newValue, oldValue) {
        this.$set(this.groupData, 'titleTextData', newValue.titleTextData);
        this.$set(this.groupData, 'bodyTextData', newValue.bodyTextData);
        this.handleLoad();
      },
      deep: true
    }
  },
  methods: {
    handleLoad() {
      this.timer = new Date().getTime();
    },
    clicktabs(e) {
      this.chooseindex = e;
    },
    addtabs() {
      // this.groupData.titleTextData.push({
      //       html: '<p style="font-size: 16px;font-family: PingFang SC;font-weight: bold;color: #000;">选项一</p>',
      // })
      // this.groupData.bodyTextData.push({
      //     html: '<p style="font-size: 16px;font-family: Microsoft YaHei;font-weight: 400;color: #333333;">夏天的风是蓝色的温柔。我时常仰望夏日天空，蓝得清澈。夏日的风，漫过无边无垠的往事，送来对未来的美好希望。</p>',
      // })
      this.$emit('addtabs', {
        ruleIndex: this.ruleIndex
      });
    },
    deltabs(index) {
      this.$emit('deltabs', {
        ruleIndex: this.ruleIndex,
        dataIndex: index
      });
      if (this.groupData.titleTextData.length == 0) {
        this.chooseindex = 0;
      } else {
        this.chooseindex = this.groupData.titleTextData.length - 1;
      }
    },
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data,
      dataIndex
    }) {
      console.log(ruleIndex, dataName, data);
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data,
        dataIndex
      });
    },
    changepanel() {
      this.isFold = !this.isFold;
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$L = script$L;
var __vue_render__$L = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Tabstheme5-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "top-style" },
            [
              _vm._l(_vm.groupData.titleTextData, function (item, k) {
                return _c(
                  "div",
                  {
                    key: k,
                    on: {
                      click: function ($event) {
                        return _vm.clicktabs(k)
                      },
                    },
                  },
                  [
                    _c("xml-text-render", {
                      key: _vm.timer,
                      class: _vm.chooseindex == k ? "active" : "",
                      attrs: {
                        "p-block-data": item,
                        "block-data-name": _vm.titleTextDataName,
                        "extend-params": _vm.extendParams,
                        "current-rule": _vm.currentRule,
                        "rule-index": _vm.ruleIndex,
                        "data-index": k,
                        "container-class": "text-container",
                        "editor-class": "editor",
                        mode: _vm.mode,
                        "page-type": _vm.pageType,
                        resourceBasisPath: _vm.resourceBasisPath,
                        scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                      },
                      on: {
                        blockclick: _vm.handleBlockClick,
                        groupDataChange: _vm.groupDataChange,
                      },
                      scopedSlots: _vm._u(
                        [
                          _vm._l(_vm.$scopedSlots, function (index, name) {
                            return {
                              key: name,
                              fn: function (deliver) {
                                return [_vm._t(name, null, null, deliver)]
                              },
                            }
                          }),
                        ],
                        null,
                        true
                      ),
                    }),
                    _vm._v(" "),
                    _vm.mode == "editor"
                      ? _c("img", {
                          staticClass: "deltabs",
                          attrs: {
                            src: __$_require_assets_images_closeicon_png__,
                          },
                          on: {
                            click: function ($event) {
                              return _vm.deltabs(k)
                            },
                          },
                        })
                      : _vm._e(),
                  ],
                  1
                )
              }),
              _vm._v(" "),
              _vm.mode == "editor"
                ? _c(
                    "span",
                    { staticClass: "addtabs", on: { click: _vm.addtabs } },
                    [
                      _c("img", {
                        attrs: {
                          src: __$_require_assets_images_addtabicon_png__,
                          alt: "",
                        },
                      }),
                    ]
                  )
                : _vm._e(),
            ],
            2
          ),
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c(
              "div",
              { staticClass: "body-text" },
              _vm._l(_vm.groupData.bodyTextData, function (item, i) {
                return _c(
                  "div",
                  {
                    directives: [
                      {
                        name: "show",
                        rawName: "v-show",
                        value: _vm.chooseindex == i,
                        expression: "chooseindex==i",
                      },
                    ],
                    key: i,
                  },
                  [
                    _c("xml-text-render", {
                      key: _vm.timer,
                      attrs: {
                        "p-block-data": item,
                        "block-data-name": _vm.bodyTextDataName,
                        "extend-params": _vm.extendParams,
                        "current-rule": _vm.currentRule,
                        "rule-index": _vm.ruleIndex,
                        "data-index": i,
                        "container-class": "text-body-container",
                        "editor-class": "editor",
                        mode: _vm.mode,
                        "page-type": _vm.pageType,
                        scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                      },
                      on: {
                        blockclick: _vm.handleBlockClick,
                        groupDataChange: _vm.groupDataChange,
                      },
                      scopedSlots: _vm._u(
                        [
                          _vm._l(_vm.$scopedSlots, function (index, name) {
                            return {
                              key: name,
                              fn: function (deliver) {
                                return [_vm._t(name, null, null, deliver)]
                              },
                            }
                          }),
                        ],
                        null,
                        true
                      ),
                    }),
                  ],
                  1
                )
              }),
              0
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$L = [];
__vue_render__$L._withStripped = true;

  /* style */
  const __vue_inject_styles__$L = undefined;
  /* scoped */
  const __vue_scope_id__$L = "data-v-98181e3e";
  /* module identifier */
  const __vue_module_identifier__$L = undefined;
  /* functional template */
  const __vue_is_functional_template__$L = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$L = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$L, staticRenderFns: __vue_staticRenderFns__$L },
    __vue_inject_styles__$L,
    __vue_script__$L,
    __vue_scope_id__$L,
    __vue_is_functional_template__$L,
    __vue_module_identifier__$L,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$K = {
  name: 'paragraphTabstheme6LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      titleTextDataName: 'titleTextData',
      titleTextDataName1: 'titleTextData1',
      groupData: {},
      tabslist: [],
      chooseindex: 0,
      timer: ''
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  watch: {
    pGroupData: {
      handler(newValue, oldValue) {
        this.$set(this.groupData, 'titleTextData', newValue.titleTextData);
        this.$set(this.groupData, 'bodyTextData', newValue.bodyTextData);
        this.handleLoad();
      },
      deep: true
    }
  },
  methods: {
    handleLoad() {
      this.timer = new Date().getTime();
    },
    clicktabs(e) {
      this.chooseindex = e;
    },
    addtabs() {
      // this.groupData.titleTextData.push({
      //       html: '<p style="font-size: 16px;font-family: PingFang SC;font-weight: bold;color: #000;">选项一</p>',
      // })
      // this.groupData.bodyTextData.push({
      //     html: '<p style="font-size: 16px;font-family: Microsoft YaHei;font-weight: 400;color: #333333;">夏天的风是蓝色的温柔。我时常仰望夏日天空，蓝得清澈。夏日的风，漫过无边无垠的往事，送来对未来的美好希望。</p>',
      // })
      this.$emit('addtabs', {
        ruleIndex: this.ruleIndex
      });
    },
    deltabs(index) {
      this.$emit('deltabs', {
        ruleIndex: this.ruleIndex,
        dataIndex: index
      });
      if (this.groupData.titleTextData.length == 0) {
        this.chooseindex = 0;
      } else {
        this.chooseindex = this.groupData.titleTextData.length - 1;
      }
    },
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data,
      dataIndex
    }) {
      console.log(ruleIndex, dataName, data);
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data,
        dataIndex
      });
    },
    changepanel() {
      this.isFold = !this.isFold;
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$K = script$K;
var __vue_render__$K = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Tabstheme6-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "suptitle" },
            [
              _c("div", { staticClass: "block1" }),
              _vm._v(" "),
              _c("div", { staticClass: "block2" }),
              _vm._v(" "),
              _c("div", { staticClass: "block3" }),
              _vm._v(" "),
              _c("div", { staticClass: "block4" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.titleTextDataName1],
                  "block-data-name": _vm.titleTextDataName1,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  resourceBasisPath: _vm.resourceBasisPath,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
            ],
            1
          ),
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c(
              "div",
              { staticClass: "top-style" },
              [
                _vm._l(_vm.groupData.titleTextData, function (item, k) {
                  return _c(
                    "div",
                    {
                      key: k,
                      class: _vm.chooseindex == k ? "active" : "",
                      on: {
                        click: function ($event) {
                          return _vm.clicktabs(k)
                        },
                      },
                    },
                    [
                      _c("xml-text-render", {
                        key: _vm.timer,
                        attrs: {
                          "p-block-data": item,
                          "block-data-name": _vm.titleTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "data-index": k,
                          "container-class": "text-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      }),
                      _vm._v(" "),
                      _vm.mode == "editor"
                        ? _c("img", {
                            staticClass: "deltabs",
                            attrs: {
                              src: __$_require_assets_images_closeicon_png__,
                            },
                            on: {
                              click: function ($event) {
                                return _vm.deltabs(k)
                              },
                            },
                          })
                        : _vm._e(),
                    ],
                    1
                  )
                }),
                _vm._v(" "),
                _vm.mode == "editor"
                  ? _c(
                      "span",
                      { staticClass: "addtabs", on: { click: _vm.addtabs } },
                      [
                        _c("img", {
                          attrs: {
                            src: __$_require_assets_images_addtabicon_png__,
                            alt: "",
                          },
                        }),
                      ]
                    )
                  : _vm._e(),
              ],
              2
            ),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "body-text" },
              _vm._l(_vm.groupData.bodyTextData, function (item, i) {
                return _c(
                  "div",
                  {
                    directives: [
                      {
                        name: "show",
                        rawName: "v-show",
                        value: _vm.chooseindex == i,
                        expression: "chooseindex==i",
                      },
                    ],
                    key: i,
                  },
                  [
                    _c("xml-text-render", {
                      key: _vm.timer,
                      attrs: {
                        "p-block-data": item,
                        "block-data-name": _vm.bodyTextDataName,
                        "extend-params": _vm.extendParams,
                        "current-rule": _vm.currentRule,
                        "rule-index": _vm.ruleIndex,
                        "data-index": i,
                        "container-class": "text-body-container",
                        "editor-class": "editor",
                        mode: _vm.mode,
                        "page-type": _vm.pageType,
                        scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                      },
                      on: {
                        blockclick: _vm.handleBlockClick,
                        groupDataChange: _vm.groupDataChange,
                      },
                      scopedSlots: _vm._u(
                        [
                          _vm._l(_vm.$scopedSlots, function (index, name) {
                            return {
                              key: name,
                              fn: function (deliver) {
                                return [_vm._t(name, null, null, deliver)]
                              },
                            }
                          }),
                        ],
                        null,
                        true
                      ),
                    }),
                  ],
                  1
                )
              }),
              0
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$K = [];
__vue_render__$K._withStripped = true;

  /* style */
  const __vue_inject_styles__$K = undefined;
  /* scoped */
  const __vue_scope_id__$K = "data-v-28f9a8b5";
  /* module identifier */
  const __vue_module_identifier__$K = undefined;
  /* functional template */
  const __vue_is_functional_template__$K = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$K = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$K, staticRenderFns: __vue_staticRenderFns__$K },
    __vue_inject_styles__$K,
    __vue_script__$K,
    __vue_scope_id__$K,
    __vue_is_functional_template__$K,
    __vue_module_identifier__$K,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$J = {
  name: 'paragraphFortytwoLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$J = script$J;
/* template */
var __vue_render__$J = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Fortytwo-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "top-line" }),
              _vm._v(" "),
              _c("div", { staticClass: "left-line" }),
              _vm._v(" "),
              _c("div", { staticClass: "bottom-line" }),
              _vm._v(" "),
              _c("div", { staticClass: "right-line" }),
              _vm._v(" "),
              _c("div", { staticClass: "right-bottom-triangle" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$J = [];
__vue_render__$J._withStripped = true;

  /* style */
  const __vue_inject_styles__$J = undefined;
  /* scoped */
  const __vue_scope_id__$J = "data-v-0b3011c9";
  /* module identifier */
  const __vue_module_identifier__$J = undefined;
  /* functional template */
  const __vue_is_functional_template__$J = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$J = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$J, staticRenderFns: __vue_staticRenderFns__$J },
    __vue_inject_styles__$J,
    __vue_script__$J,
    __vue_scope_id__$J,
    __vue_is_functional_template__$J,
    __vue_module_identifier__$J,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$I = {
  name: 'paragraphFortythreeLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$I = script$I;
/* template */
var __vue_render__$I = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Fortythree-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("div", { staticClass: "top-round" }),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "top-right-triangle" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$I = [];
__vue_render__$I._withStripped = true;

  /* style */
  const __vue_inject_styles__$I = undefined;
  /* scoped */
  const __vue_scope_id__$I = "data-v-3b6b513f";
  /* module identifier */
  const __vue_module_identifier__$I = undefined;
  /* functional template */
  const __vue_is_functional_template__$I = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$I = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$I, staticRenderFns: __vue_staticRenderFns__$I },
    __vue_inject_styles__$I,
    __vue_script__$I,
    __vue_scope_id__$I,
    __vue_is_functional_template__$I,
    __vue_module_identifier__$I,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$H = {
  name: 'paragraphFortyfourLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      groupData: {}
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  created() {
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$H = script$H;
/* template */
var __vue_render__$H = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Fortyfour-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticClass: "body-text" },
            [
              _c("div", { staticClass: "top-round" }, [
                _c(
                  "svg",
                  {
                    staticClass: "icon",
                    attrs: {
                      t: "1691747531614",
                      viewBox: "0 0 1024 1024",
                      version: "1.1",
                      xmlns: "http://www.w3.org/2000/svg",
                      "p-id": "4801",
                      width: "32",
                      height: "32",
                    },
                  },
                  [
                    _c("path", {
                      attrs: {
                        d: "M470.72 140.032a259.584 259.584 0 0 1 377.216 356.352l-10.112 10.688-408.384 408.384a152 152 0 0 1-223.04-206.144l8.128-8.768 403.968-403.968a50.56 50.56 0 0 1 76.48 65.92l-4.928 5.632-403.968 404.032a50.752 50.752 0 0 0 66.112 76.672l5.632-4.928 408.384-408.32A158.336 158.336 0 0 0 551.04 203.52l-8.704 8.064L214.4 539.52A50.56 50.56 0 0 1 137.92 473.6l4.928-5.696 327.872-327.872z",
                        fill: _vm.groupData.themeColor,
                        "p-id": "4802",
                      },
                    }),
                  ]
                ),
              ]),
              _vm._v(" "),
              _c("xml-text-render", {
                attrs: {
                  "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                  "block-data-name": _vm.bodyTextDataName,
                  "extend-params": _vm.extendParams,
                  "current-rule": _vm.currentRule,
                  "rule-index": _vm.ruleIndex,
                  "container-class": "text-body-container",
                  "editor-class": "editor",
                  mode: _vm.mode,
                  "page-type": _vm.pageType,
                  scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                },
                on: {
                  blockclick: _vm.handleBlockClick,
                  groupDataChange: _vm.groupDataChange,
                },
                scopedSlots: _vm._u(
                  [
                    _vm._l(_vm.$scopedSlots, function (index, name) {
                      return {
                        key: name,
                        fn: function (deliver) {
                          return [_vm._t(name, null, null, deliver)]
                        },
                      }
                    }),
                  ],
                  null,
                  true
                ),
              }),
              _vm._v(" "),
              _c("div", { staticClass: "top-right-triangle" }),
            ],
            1
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$H = [];
__vue_render__$H._withStripped = true;

  /* style */
  const __vue_inject_styles__$H = undefined;
  /* scoped */
  const __vue_scope_id__$H = "data-v-645a740b";
  /* module identifier */
  const __vue_module_identifier__$H = undefined;
  /* functional template */
  const __vue_is_functional_template__$H = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$H = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$H, staticRenderFns: __vue_staticRenderFns__$H },
    __vue_inject_styles__$H,
    __vue_script__$H,
    __vue_scope_id__$H,
    __vue_is_functional_template__$H,
    __vue_module_identifier__$H,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$G = {
  name: 'paragraphFortyfiveLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  data() {
    return {
      typeText: '段落',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      bodyTextDataName: 'bodyTextData',
      titleTextDataName: 'titleTextData',
      groupData: {},
      isFold: this.isExpand //是否折叠
    };
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    isExpand: {
      //是否展开
      type: Boolean,
      default: false
    }
  },
  created() {
    console.log(this.pGroupData, '组件内部');
    this.groupData = this.pGroupData;
  },
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    },
    changepanel() {
      this.isFold = !this.isFold;
    }
  },
  mounted() {}
};

/* script */
const __vue_script__$G = script$G;
/* template */
var __vue_render__$G = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-paragraph-Fortyfive-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c("div", { staticClass: "body-text-bg" }, [
            _c("div", { staticClass: "top-title-style" }, [
              _c(
                "div",
                { staticClass: "title-body-box" },
                [
                  _c("div", { staticClass: "line" }),
                  _vm._v(" "),
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                  _vm._v(" "),
                  _c("div", { staticClass: "line" }),
                ],
                1
              ),
            ]),
            _vm._v(" "),
            _c("div", { staticClass: "body-text" }, [
              _c(
                "div",
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                      "block-data-name": _vm.bodyTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$G = [];
__vue_render__$G._withStripped = true;

  /* style */
  const __vue_inject_styles__$G = undefined;
  /* scoped */
  const __vue_scope_id__$G = "data-v-0d45b178";
  /* module identifier */
  const __vue_module_identifier__$G = undefined;
  /* functional template */
  const __vue_is_functional_template__$G = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$G = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$G, staticRenderFns: __vue_staticRenderFns__$G },
    __vue_inject_styles__$G,
    __vue_script__$G,
    __vue_scope_id__$G,
    __vue_is_functional_template__$G,
    __vue_module_identifier__$G,
    false,
    undefined,
    undefined,
    undefined
  );

const TitleComponents$2 = [__vue_component__$1n, __vue_component__$1m, __vue_component__$1l, __vue_component__$1k, __vue_component__$1j, __vue_component__$1i, __vue_component__$1h, __vue_component__$1g, __vue_component__$1f, __vue_component__$1e, __vue_component__$1d, __vue_component__$1c, __vue_component__$1b, __vue_component__$1a, __vue_component__$19, __vue_component__$18, __vue_component__$17, __vue_component__$16, __vue_component__$15, __vue_component__$14, __vue_component__$13, __vue_component__$12, __vue_component__$11, __vue_component__$10, __vue_component__$$, __vue_component__$_, __vue_component__$Z, __vue_component__$Y, __vue_component__$X, __vue_component__$W, __vue_component__$V, __vue_component__$U, __vue_component__$T, __vue_component__$S, __vue_component__$R, __vue_component__$Q, __vue_component__$P, __vue_component__$O, __vue_component__$N, __vue_component__$M, __vue_component__$L, __vue_component__$K, __vue_component__$J, __vue_component__$I, __vue_component__$H, __vue_component__$G];
var xmlParagraphLibrary = {
  // install,
  ...TitleComponents$2
};

//
/**
 * 单图片组合
 */
var script$F = {
  name: 'imageTextFirstLibraryRender',
  isUnPrefix: true,
  components: {
    XmlImageRender: __vue_component__$4S,
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图文',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$F = script$F;
/* template */
var __vue_render__$F = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-text-image-first-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticStyle: {
                background: "var(--background-color)",
                "border-radius": "6px",
                padding: "9px 11px",
              },
            },
            [
              _c(
                "div",
                { staticStyle: { display: "flex", "flex-wrap": "nowrap" } },
                [
                  _c(
                    "div",
                    [
                      _c("xml-text-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.titleTextDataName],
                          "block-data-name": _vm.titleTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "text-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      }),
                      _vm._v(" "),
                      _c("xml-image-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                          "block-data-name": _vm.imageBlockDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "image-container",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                        },
                        on: { blockclick: _vm.handleBlockClick },
                      }),
                      _vm._v(" "),
                      _c("xml-text-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                          "block-data-name": _vm.bodyTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "text-body-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      }),
                    ],
                    1
                  ),
                ]
              ),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$F = [];
__vue_render__$F._withStripped = true;

  /* style */
  const __vue_inject_styles__$F = undefined;
  /* scoped */
  const __vue_scope_id__$F = "data-v-7e201f60";
  /* module identifier */
  const __vue_module_identifier__$F = undefined;
  /* functional template */
  const __vue_is_functional_template__$F = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$F = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$F, staticRenderFns: __vue_staticRenderFns__$F },
    __vue_inject_styles__$F,
    __vue_script__$F,
    __vue_scope_id__$F,
    __vue_is_functional_template__$F,
    __vue_module_identifier__$F,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$E = {
  name: 'imageTextSecondLibraryRender',
  isUnPrefix: true,
  components: {
    XmlImageRender: __vue_component__$4S,
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图文',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$E = script$E;
/* template */
var __vue_render__$E = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-text-image-second-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticStyle: { display: "flex", "align-items": "center" } },
            [
              _c(
                "div",
                { staticClass: "image-box" },
                [
                  _c("xml-image-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                      "block-data-name": _vm.imageBlockDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "image-container",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "title-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.titleTextDataName],
                      "block-data-name": _vm.titleTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: { blockclick: _vm.handleBlockClick },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]
          ),
          _vm._v(" "),
          _c("div", { staticClass: "body-box" }, [
            _c(
              "div",
              { staticClass: "body-box-inner" },
              [
                _c("xml-text-render", {
                  attrs: {
                    "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                    "block-data-name": _vm.bodyTextDataName,
                    "extend-params": _vm.extendParams,
                    "current-rule": _vm.currentRule,
                    "rule-index": _vm.ruleIndex,
                    "container-class": "text-body-container",
                    "editor-class": "editor",
                    mode: _vm.mode,
                    "page-type": _vm.pageType,
                    resourceBasisPath: _vm.resourceBasisPath,
                    scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                  },
                  on: {
                    blockclick: _vm.handleBlockClick,
                    groupDataChange: _vm.groupDataChange,
                  },
                  scopedSlots: _vm._u(
                    [
                      _vm._l(_vm.$scopedSlots, function (index, name) {
                        return {
                          key: name,
                          fn: function (deliver) {
                            return [_vm._t(name, null, null, deliver)]
                          },
                        }
                      }),
                    ],
                    null,
                    true
                  ),
                }),
              ],
              1
            ),
          ]),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$E = [];
__vue_render__$E._withStripped = true;

  /* style */
  const __vue_inject_styles__$E = undefined;
  /* scoped */
  const __vue_scope_id__$E = "data-v-fc88abde";
  /* module identifier */
  const __vue_module_identifier__$E = undefined;
  /* functional template */
  const __vue_is_functional_template__$E = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$E = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$E, staticRenderFns: __vue_staticRenderFns__$E },
    __vue_inject_styles__$E,
    __vue_script__$E,
    __vue_scope_id__$E,
    __vue_is_functional_template__$E,
    __vue_module_identifier__$E,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$D = {
  name: 'imageTextThirdLibraryRender',
  isUnPrefix: true,
  components: {
    XmlImageRender: __vue_component__$4S,
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图文',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      imageBlockDataName: 'imageData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$D = script$D;
/* template */
var __vue_render__$D = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-text-image-third-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticStyle: {
                "border-radius": "6px",
                padding: "9px 11px",
                "background-color": "var(--background-color)",
              },
            },
            [
              _c(
                "div",
                {
                  staticStyle: {
                    display: "flex",
                    "flex-wrap": "nowrap",
                    "justify-content": "space-between",
                    "align-items": "center",
                  },
                },
                [
                  _c(
                    "div",
                    { staticStyle: { width: "48%" } },
                    [
                      _c("xml-image-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                          "block-data-name": _vm.imageBlockDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "image-container",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                        },
                        on: { blockclick: _vm.handleBlockClick },
                      }),
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c(
                    "div",
                    { staticStyle: { width: "48%" } },
                    [
                      _c("xml-text-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.titleTextDataName],
                          "block-data-name": _vm.titleTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "text-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      }),
                      _vm._v(" "),
                      _c("xml-text-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                          "block-data-name": _vm.bodyTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "text-body-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      }),
                    ],
                    1
                  ),
                ]
              ),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$D = [];
__vue_render__$D._withStripped = true;

  /* style */
  const __vue_inject_styles__$D = undefined;
  /* scoped */
  const __vue_scope_id__$D = "data-v-37319e96";
  /* module identifier */
  const __vue_module_identifier__$D = undefined;
  /* functional template */
  const __vue_is_functional_template__$D = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$D = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$D, staticRenderFns: __vue_staticRenderFns__$D },
    __vue_inject_styles__$D,
    __vue_script__$D,
    __vue_scope_id__$D,
    __vue_is_functional_template__$D,
    __vue_module_identifier__$D,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$C = {
  name: 'imageTextFourthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlImageRender: __vue_component__$4S,
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图文',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      imageBlockDataName: 'imageData',
      numberTextDataName: 'numberTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$C = script$C;
/* template */
var __vue_render__$C = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-text-image-fourth-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticStyle: { "border-radius": "6px", padding: "9px 11px" } },
            [
              _c(
                "div",
                { staticClass: "iamge-bg-box" },
                [
                  _c("xml-image-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                      "block-data-name": _vm.imageBlockDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "image-container",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                    },
                    on: { blockclick: _vm.handleBlockClick },
                  }),
                  _vm._v(" "),
                  _c(
                    "div",
                    { staticClass: "image-text-box" },
                    [
                      _c(
                        "div",
                        { staticClass: "image-top-title" },
                        [
                          _c("xml-text-render", {
                            attrs: {
                              "p-block-data":
                                _vm.groupData[_vm.numberTextDataName],
                              "block-data-name": _vm.numberTextDataName,
                              "extend-params": _vm.extendParams,
                              "current-rule": _vm.currentRule,
                              "rule-index": _vm.ruleIndex,
                              "container-class": "text-container-number",
                              "editor-class": "editor",
                              mode: _vm.mode,
                              "page-type": _vm.pageType,
                              resourceBasisPath: _vm.resourceBasisPath,
                              scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                            },
                            on: {
                              blockclick: _vm.handleBlockClick,
                              groupDataChange: _vm.groupDataChange,
                            },
                            scopedSlots: _vm._u(
                              [
                                _vm._l(
                                  _vm.$scopedSlots,
                                  function (index, name) {
                                    return {
                                      key: name,
                                      fn: function (deliver) {
                                        return [
                                          _vm._t(name, null, null, deliver),
                                        ]
                                      },
                                    }
                                  }
                                ),
                              ],
                              null,
                              true
                            ),
                          }),
                          _vm._v(" "),
                          _c("xml-text-render", {
                            attrs: {
                              "p-block-data":
                                _vm.groupData[_vm.titleTextDataName],
                              "block-data-name": _vm.titleTextDataName,
                              "extend-params": _vm.extendParams,
                              "current-rule": _vm.currentRule,
                              "rule-index": _vm.ruleIndex,
                              "container-class": "text-container",
                              "editor-class": "editor",
                              mode: _vm.mode,
                              "page-type": _vm.pageType,
                              resourceBasisPath: _vm.resourceBasisPath,
                              scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                            },
                            on: {
                              blockclick: _vm.handleBlockClick,
                              groupDataChange: _vm.groupDataChange,
                            },
                            scopedSlots: _vm._u(
                              [
                                _vm._l(
                                  _vm.$scopedSlots,
                                  function (index, name) {
                                    return {
                                      key: name,
                                      fn: function (deliver) {
                                        return [
                                          _vm._t(name, null, null, deliver),
                                        ]
                                      },
                                    }
                                  }
                                ),
                              ],
                              null,
                              true
                            ),
                          }),
                        ],
                        1
                      ),
                      _vm._v(" "),
                      _c("xml-text-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                          "block-data-name": _vm.bodyTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "text-body-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      }),
                    ],
                    1
                  ),
                ],
                1
              ),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$C = [];
__vue_render__$C._withStripped = true;

  /* style */
  const __vue_inject_styles__$C = undefined;
  /* scoped */
  const __vue_scope_id__$C = "data-v-92650376";
  /* module identifier */
  const __vue_module_identifier__$C = undefined;
  /* functional template */
  const __vue_is_functional_template__$C = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$C = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$C, staticRenderFns: __vue_staticRenderFns__$C },
    __vue_inject_styles__$C,
    __vue_script__$C,
    __vue_scope_id__$C,
    __vue_is_functional_template__$C,
    __vue_module_identifier__$C,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$B = {
  name: 'imageTextFifthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlImageRender: __vue_component__$4S,
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图文',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      imageBlockDataName: 'imageData',
      numberTextDataName: 'numberTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$B = script$B;
/* template */
var __vue_render__$B = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-text-image-fifth-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticStyle: { "border-radius": "6px", padding: "9px 11px" } },
            [
              _c(
                "div",
                { staticClass: "iamge-bg-box" },
                [
                  _c(
                    "div",
                    { staticClass: "image-top-title" },
                    [
                      _c("xml-text-render", {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.titleTextDataName],
                          "block-data-name": _vm.titleTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "text-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      }),
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c("xml-image-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                      "block-data-name": _vm.imageBlockDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "image-container",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                    },
                    on: { blockclick: _vm.handleBlockClick },
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "image-text-box" },
                [
                  _c("xml-text-render", {
                    attrs: {
                      "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                      "block-data-name": _vm.bodyTextDataName,
                      "extend-params": _vm.extendParams,
                      "current-rule": _vm.currentRule,
                      "rule-index": _vm.ruleIndex,
                      "container-class": "text-body-container",
                      "editor-class": "editor",
                      mode: _vm.mode,
                      "page-type": _vm.pageType,
                      resourceBasisPath: _vm.resourceBasisPath,
                      scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                    },
                    on: {
                      blockclick: _vm.handleBlockClick,
                      groupDataChange: _vm.groupDataChange,
                    },
                    scopedSlots: _vm._u(
                      [
                        _vm._l(_vm.$scopedSlots, function (index, name) {
                          return {
                            key: name,
                            fn: function (deliver) {
                              return [_vm._t(name, null, null, deliver)]
                            },
                          }
                        }),
                      ],
                      null,
                      true
                    ),
                  }),
                ],
                1
              ),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$B = [];
__vue_render__$B._withStripped = true;

  /* style */
  const __vue_inject_styles__$B = undefined;
  /* scoped */
  const __vue_scope_id__$B = "data-v-6c411f2c";
  /* module identifier */
  const __vue_module_identifier__$B = undefined;
  /* functional template */
  const __vue_is_functional_template__$B = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$B = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$B, staticRenderFns: __vue_staticRenderFns__$B },
    __vue_inject_styles__$B,
    __vue_script__$B,
    __vue_scope_id__$B,
    __vue_is_functional_template__$B,
    __vue_module_identifier__$B,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$A = {
  name: 'imageTextSixthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlImageRender: __vue_component__$4S,
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图文',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      imageBlockDataName: 'imageData',
      numberTextDataName: 'numberTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$A = script$A;
/* template */
var __vue_render__$A = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-text-image-sixth-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticStyle: {
                "border-radius": "6px",
                padding: "9px 11px",
                display: "flex",
              },
            },
            [
              _c("div", { staticStyle: { display: "flex" } }, [
                _c(
                  "div",
                  { staticClass: "iamge-bg-box" },
                  [
                    _c(
                      "div",
                      { staticClass: "image-top-title" },
                      [
                        _c("xml-text-render", {
                          attrs: {
                            "p-block-data":
                              _vm.groupData[_vm.titleTextDataName],
                            "block-data-name": _vm.titleTextDataName,
                            "extend-params": _vm.extendParams,
                            "current-rule": _vm.currentRule,
                            "rule-index": _vm.ruleIndex,
                            "container-class": "text-container",
                            "editor-class": "editor",
                            mode: _vm.mode,
                            "page-type": _vm.pageType,
                            resourceBasisPath: _vm.resourceBasisPath,
                            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                          },
                          on: {
                            blockclick: _vm.handleBlockClick,
                            groupDataChange: _vm.groupDataChange,
                          },
                          scopedSlots: _vm._u(
                            [
                              _vm._l(_vm.$scopedSlots, function (index, name) {
                                return {
                                  key: name,
                                  fn: function (deliver) {
                                    return [_vm._t(name, null, null, deliver)]
                                  },
                                }
                              }),
                            ],
                            null,
                            true
                          ),
                        }),
                      ],
                      1
                    ),
                    _vm._v(" "),
                    _c("xml-image-render", {
                      attrs: {
                        "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                        "block-data-name": _vm.imageBlockDataName,
                        "extend-params": _vm.extendParams,
                        "current-rule": _vm.currentRule,
                        "rule-index": _vm.ruleIndex,
                        "container-class": "image-container",
                        mode: _vm.mode,
                        "page-type": _vm.pageType,
                        resourceBasisPath: _vm.resourceBasisPath,
                      },
                      on: { blockclick: _vm.handleBlockClick },
                    }),
                  ],
                  1
                ),
                _vm._v(" "),
                _c(
                  "div",
                  { staticClass: "image-text-box" },
                  [
                    _c("xml-text-render", {
                      attrs: {
                        "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                        "block-data-name": _vm.bodyTextDataName,
                        "extend-params": _vm.extendParams,
                        "current-rule": _vm.currentRule,
                        "rule-index": _vm.ruleIndex,
                        "container-class": "text-body-container",
                        "editor-class": "editor",
                        mode: _vm.mode,
                        "page-type": _vm.pageType,
                        resourceBasisPath: _vm.resourceBasisPath,
                        scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                      },
                      on: {
                        blockclick: _vm.handleBlockClick,
                        groupDataChange: _vm.groupDataChange,
                      },
                      scopedSlots: _vm._u(
                        [
                          _vm._l(_vm.$scopedSlots, function (index, name) {
                            return {
                              key: name,
                              fn: function (deliver) {
                                return [_vm._t(name, null, null, deliver)]
                              },
                            }
                          }),
                        ],
                        null,
                        true
                      ),
                    }),
                  ],
                  1
                ),
                _vm._v(" "),
                _c("div", { staticClass: "image-text-decorate" }),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$A = [];
__vue_render__$A._withStripped = true;

  /* style */
  const __vue_inject_styles__$A = undefined;
  /* scoped */
  const __vue_scope_id__$A = "data-v-1a727db5";
  /* module identifier */
  const __vue_module_identifier__$A = undefined;
  /* functional template */
  const __vue_is_functional_template__$A = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$A = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$A, staticRenderFns: __vue_staticRenderFns__$A },
    __vue_inject_styles__$A,
    __vue_script__$A,
    __vue_scope_id__$A,
    __vue_is_functional_template__$A,
    __vue_module_identifier__$A,
    false,
    undefined,
    undefined,
    undefined
  );

//
/**
 * 单图片组合
 */
var script$z = {
  name: 'imageTextSeventhLibraryRender',
  isUnPrefix: true,
  components: {
    XmlImageRender: __vue_component__$4S,
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '图文',
      //定义此变量，是为了解决页面中有多个块儿的情况。
      titleTextDataName: 'titleTextData',
      bodyTextDataName: 'bodyTextData',
      imageBlockDataName: 'imageData',
      numberTextDataName: 'numberTextData',
      groupData: {}
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName,
        propertyComponentsName,
        currentRule: this.currentRule,
        blockId,
        ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$z = script$z;
/* template */
var __vue_render__$z = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-text-image-seventh-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            "rule-index": _vm.ruleIndex,
          },
          scopedSlots: _vm._u(
            [
              {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t("default")]
                },
                proxy: true,
              },
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            { staticStyle: { "border-radius": "6px", padding: "9px 11px" } },
            [
              _c("div", {}, [
                _c("div", { staticClass: "image-text-decorate2" }),
                _vm._v(" "),
                _c(
                  "div",
                  { staticClass: "iamge-bg-box" },
                  [
                    _c("xml-image-render", {
                      attrs: {
                        "p-block-data": _vm.groupData[_vm.imageBlockDataName],
                        "block-data-name": _vm.imageBlockDataName,
                        "extend-params": _vm.extendParams,
                        "current-rule": _vm.currentRule,
                        "rule-index": _vm.ruleIndex,
                        "container-class": "image-container",
                        mode: _vm.mode,
                        "page-type": _vm.pageType,
                        resourceBasisPath: _vm.resourceBasisPath,
                      },
                      on: { blockclick: _vm.handleBlockClick },
                    }),
                  ],
                  1
                ),
                _vm._v(" "),
                _c(
                  "div",
                  { staticClass: "image-text-box" },
                  [
                    _c(
                      "xml-text-render",
                      {
                        attrs: {
                          "p-block-data": _vm.groupData[_vm.bodyTextDataName],
                          "block-data-name": _vm.bodyTextDataName,
                          "extend-params": _vm.extendParams,
                          "current-rule": _vm.currentRule,
                          "rule-index": _vm.ruleIndex,
                          "container-class": "text-body-container",
                          "editor-class": "editor",
                          mode: _vm.mode,
                          "page-type": _vm.pageType,
                          resourceBasisPath: _vm.resourceBasisPath,
                          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
                        },
                        on: {
                          blockclick: _vm.handleBlockClick,
                          groupDataChange: _vm.groupDataChange,
                        },
                        scopedSlots: _vm._u(
                          [
                            _vm._l(_vm.$scopedSlots, function (index, name) {
                              return {
                                key: name,
                                fn: function (deliver) {
                                  return [_vm._t(name, null, null, deliver)]
                                },
                              }
                            }),
                          ],
                          null,
                          true
                        ),
                      },
                      [_vm._v("s\n          ")]
                    ),
                  ],
                  1
                ),
                _vm._v(" "),
                _c("div", { staticClass: "image-text-decorate" }),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$z = [];
__vue_render__$z._withStripped = true;

  /* style */
  const __vue_inject_styles__$z = undefined;
  /* scoped */
  const __vue_scope_id__$z = "data-v-30f0aa52";
  /* module identifier */
  const __vue_module_identifier__$z = undefined;
  /* functional template */
  const __vue_is_functional_template__$z = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$z = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$z, staticRenderFns: __vue_staticRenderFns__$z },
    __vue_inject_styles__$z,
    __vue_script__$z,
    __vue_scope_id__$z,
    __vue_is_functional_template__$z,
    __vue_module_identifier__$z,
    false,
    undefined,
    undefined,
    undefined
  );

const TitleComponents$1 = [__vue_component__$F, __vue_component__$E, __vue_component__$D, __vue_component__$C, __vue_component__$B, __vue_component__$A, __vue_component__$z];
var xmlImageTextLibrary = {
  // install,
  ...TitleComponents$1
};

//
var script$y = {
  name: 'splitlineFirstLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'SplitlineData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex: this.ruleIndex,
        dataName: this.titleTextDataName,
        data: this.pGroupData
      });
    }
  }
};

/* script */
const __vue_script__$y = script$y;
/* template */
var __vue_render__$y = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-first-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c("xml-group-render", {
        ref: "xmlGroup",
        attrs: {
          "page-type": _vm.pageType,
          mode: _vm.mode,
          "type-text": _vm.typeText,
          showLine: false,
          "rule-index": _vm.ruleIndex,
          scopedSlots: { $scopedSlots: _vm.$scopedSlots },
        },
        scopedSlots: _vm._u(
          [
            _vm._l(_vm.$scopedSlots, function (index, name) {
              return {
                key: "action-buttons",
                fn: function () {
                  return [_vm._t(name)]
                },
                proxy: true,
              }
            }),
          ],
          null,
          true
        ),
      }),
      _vm._v(" "),
      _c(
        "div",
        {
          staticClass: "title-container",
          attrs: { id: _vm.blockId },
          on: { click: _vm.handleBlockClick },
        },
        [
          _c("div", { staticClass: "line" }),
          _vm._v(" "),
          _c("div", { staticClass: "centerimg" }),
          _vm._v(" "),
          _c("div", { staticClass: "line" }),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$y = [];
__vue_render__$y._withStripped = true;

  /* style */
  const __vue_inject_styles__$y = undefined;
  /* scoped */
  const __vue_scope_id__$y = "data-v-27ecf513";
  /* module identifier */
  const __vue_module_identifier__$y = undefined;
  /* functional template */
  const __vue_is_functional_template__$y = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$y = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$y, staticRenderFns: __vue_staticRenderFns__$y },
    __vue_inject_styles__$y,
    __vue_script__$y,
    __vue_scope_id__$y,
    __vue_is_functional_template__$y,
    __vue_module_identifier__$y,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$x = {
  name: 'splitlineSecondLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$x = script$x;
/* template */
var __vue_render__$x = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-second-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "line1" }, [_c("div")]),
              _vm._v(" "),
              _c("div", { staticClass: "line2" }, [_c("div")]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$x = [];
__vue_render__$x._withStripped = true;

  /* style */
  const __vue_inject_styles__$x = undefined;
  /* scoped */
  const __vue_scope_id__$x = "data-v-41a2336c";
  /* module identifier */
  const __vue_module_identifier__$x = undefined;
  /* functional template */
  const __vue_is_functional_template__$x = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$x = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$x, staticRenderFns: __vue_staticRenderFns__$x },
    __vue_inject_styles__$x,
    __vue_script__$x,
    __vue_scope_id__$x,
    __vue_is_functional_template__$x,
    __vue_module_identifier__$x,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$w = {
  name: 'splitlineFourthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$w = script$w;
/* template */
var __vue_render__$w = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-fourth-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "line" }),
              _vm._v(" "),
              _c("div", { staticClass: "centerimg" }, [
                _c("div", { staticClass: "foldline1" }),
                _vm._v(" "),
                _c("div", { staticClass: "foldline2" }),
                _vm._v(" "),
                _c("div", { staticClass: "foldline3" }),
                _vm._v(" "),
                _c("div", { staticClass: "foldline4" }),
                _vm._v(" "),
                _c("div", { staticClass: "foldline5" }),
                _vm._v(" "),
                _c("div", { staticClass: "foldline6" }),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "line" }),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$w = [];
__vue_render__$w._withStripped = true;

  /* style */
  const __vue_inject_styles__$w = undefined;
  /* scoped */
  const __vue_scope_id__$w = "data-v-c8a73bfc";
  /* module identifier */
  const __vue_module_identifier__$w = undefined;
  /* functional template */
  const __vue_is_functional_template__$w = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$w = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$w, staticRenderFns: __vue_staticRenderFns__$w },
    __vue_inject_styles__$w,
    __vue_script__$w,
    __vue_scope_id__$w,
    __vue_is_functional_template__$w,
    __vue_module_identifier__$w,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$v = {
  name: 'splitlineFifthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$v = script$v;
/* template */
var __vue_render__$v = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-fifth-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "line" }),
              _vm._v(" "),
              _c("div", { staticClass: "centerimg" }, [_c("div")]),
              _vm._v(" "),
              _c("div", { staticClass: "line" }),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$v = [];
__vue_render__$v._withStripped = true;

  /* style */
  const __vue_inject_styles__$v = undefined;
  /* scoped */
  const __vue_scope_id__$v = "data-v-27fc0e32";
  /* module identifier */
  const __vue_module_identifier__$v = undefined;
  /* functional template */
  const __vue_is_functional_template__$v = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$v = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$v, staticRenderFns: __vue_staticRenderFns__$v },
    __vue_inject_styles__$v,
    __vue_script__$v,
    __vue_scope_id__$v,
    __vue_is_functional_template__$v,
    __vue_module_identifier__$v,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$u = {
  name: 'splitlineSixthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$u = script$u;
/* template */
var __vue_render__$u = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-sixth-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "line1" }),
              _vm._v(" "),
              _c("div", { staticClass: "centerimg" }, [
                _c("div", { staticClass: "block1" }),
                _vm._v(" "),
                _c("div", { staticClass: "block2" }),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "line2" }),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$u = [];
__vue_render__$u._withStripped = true;

  /* style */
  const __vue_inject_styles__$u = undefined;
  /* scoped */
  const __vue_scope_id__$u = "data-v-0e6f6682";
  /* module identifier */
  const __vue_module_identifier__$u = undefined;
  /* functional template */
  const __vue_is_functional_template__$u = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$u = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$u, staticRenderFns: __vue_staticRenderFns__$u },
    __vue_inject_styles__$u,
    __vue_script__$u,
    __vue_scope_id__$u,
    __vue_is_functional_template__$u,
    __vue_module_identifier__$u,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$t = {
  name: 'splitlineSeventhLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$t = script$t;
/* template */
var __vue_render__$t = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-seventh-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "dotted" }, [
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "centerimg" }),
              _vm._v(" "),
              _c("div", { staticClass: "dotted" }, [
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$t = [];
__vue_render__$t._withStripped = true;

  /* style */
  const __vue_inject_styles__$t = undefined;
  /* scoped */
  const __vue_scope_id__$t = "data-v-3dfa9ba6";
  /* module identifier */
  const __vue_module_identifier__$t = undefined;
  /* functional template */
  const __vue_is_functional_template__$t = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$t = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$t, staticRenderFns: __vue_staticRenderFns__$t },
    __vue_inject_styles__$t,
    __vue_script__$t,
    __vue_scope_id__$t,
    __vue_is_functional_template__$t,
    __vue_module_identifier__$t,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$s = {
  name: 'splitlineEighthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$s = script$s;
/* template */
var __vue_render__$s = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-eighth-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "centerimg" }, [
                _c("div", { staticClass: "line1" }),
                _vm._v(" "),
                _c("div", { staticClass: "line2" }),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$s = [];
__vue_render__$s._withStripped = true;

  /* style */
  const __vue_inject_styles__$s = undefined;
  /* scoped */
  const __vue_scope_id__$s = "data-v-0bcb78a1";
  /* module identifier */
  const __vue_module_identifier__$s = undefined;
  /* functional template */
  const __vue_is_functional_template__$s = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$s = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$s, staticRenderFns: __vue_staticRenderFns__$s },
    __vue_inject_styles__$s,
    __vue_script__$s,
    __vue_scope_id__$s,
    __vue_is_functional_template__$s,
    __vue_module_identifier__$s,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$r = {
  name: 'splitlineTenthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$r = script$r;
/* template */
var __vue_render__$r = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-tenth-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", [
                _c("div", { staticClass: "centerimg" }),
                _vm._v(" "),
                _c("div", { staticClass: "line" }),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$r = [];
__vue_render__$r._withStripped = true;

  /* style */
  const __vue_inject_styles__$r = undefined;
  /* scoped */
  const __vue_scope_id__$r = "data-v-704b82b6";
  /* module identifier */
  const __vue_module_identifier__$r = undefined;
  /* functional template */
  const __vue_is_functional_template__$r = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$r = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$r, staticRenderFns: __vue_staticRenderFns__$r },
    __vue_inject_styles__$r,
    __vue_script__$r,
    __vue_scope_id__$r,
    __vue_is_functional_template__$r,
    __vue_module_identifier__$r,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$q = {
  name: 'splitlineEleventhLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$q = script$q;
/* template */
var __vue_render__$q = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-eleventh-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", [
                _c("div", { staticClass: "line1" }),
                _vm._v(" "),
                _c("div", { staticClass: "line2" }),
                _vm._v(" "),
                _c("div", { staticClass: "centerimg" }),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$q = [];
__vue_render__$q._withStripped = true;

  /* style */
  const __vue_inject_styles__$q = undefined;
  /* scoped */
  const __vue_scope_id__$q = "data-v-490c5ad7";
  /* module identifier */
  const __vue_module_identifier__$q = undefined;
  /* functional template */
  const __vue_is_functional_template__$q = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$q = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$q, staticRenderFns: __vue_staticRenderFns__$q },
    __vue_inject_styles__$q,
    __vue_script__$q,
    __vue_scope_id__$q,
    __vue_is_functional_template__$q,
    __vue_module_identifier__$q,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$p = {
  name: 'splitlineNinthLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$p = script$p;
/* template */
var __vue_render__$p = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-ninth-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "centerimg" }, [
                _c("div", { staticClass: "skeybox" }),
                _vm._v(" "),
                _c("div", { staticClass: "line" }),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$p = [];
__vue_render__$p._withStripped = true;

  /* style */
  const __vue_inject_styles__$p = undefined;
  /* scoped */
  const __vue_scope_id__$p = "data-v-5d030f61";
  /* module identifier */
  const __vue_module_identifier__$p = undefined;
  /* functional template */
  const __vue_is_functional_template__$p = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$p = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$p, staticRenderFns: __vue_staticRenderFns__$p },
    __vue_inject_styles__$p,
    __vue_script__$p,
    __vue_scope_id__$p,
    __vue_is_functional_template__$p,
    __vue_module_identifier__$p,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$o = {
  name: 'splitlineRedtheme1LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$o = script$o;
/* template */
var __vue_render__$o = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Redtheme1-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "left-line" }, [
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      staticStyle: { transform: "rotate(90deg)" },
                      attrs: {
                        t: "1684829468544",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "28595",
                        width: "20",
                        height: "20",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M533.504 268.288q33.792-41.984 71.68-75.776 32.768-27.648 74.24-50.176t86.528-19.456q63.488 5.12 105.984 30.208t67.584 63.488 34.304 87.04 6.144 99.84-17.92 97.792-36.864 87.04-48.64 74.752-53.248 61.952q-40.96 41.984-85.504 78.336t-84.992 62.464-73.728 41.472-51.712 15.36q-20.48 1.024-52.224-14.336t-69.632-41.472-79.872-61.952-82.944-75.776q-26.624-25.6-57.344-59.392t-57.856-74.24-46.592-87.552-21.504-100.352 11.264-99.84 39.936-83.456 65.536-61.952 88.064-35.328q24.576-5.12 49.152-1.536t48.128 12.288 45.056 22.016 40.96 27.648q45.056 33.792 86.016 80.896z",
                          "p-id": "28596",
                          fill: _vm.groupData.themeColor,
                        },
                      }),
                    ]
                  ),
                  _vm._v(" "),
                  _c("div", { staticClass: "line" }, [
                    _c("div", { staticClass: "circle" }),
                  ]),
                ]),
                _vm._v(" "),
                _c(
                  "div",
                  {
                    staticClass: "left-line",
                    staticStyle: { transform: "rotate(180deg)" },
                  },
                  [
                    _c(
                      "svg",
                      {
                        staticClass: "icon",
                        staticStyle: { transform: "rotate(90deg)" },
                        attrs: {
                          t: "1684829468544",
                          viewBox: "0 0 1024 1024",
                          version: "1.1",
                          xmlns: "http://www.w3.org/2000/svg",
                          "p-id": "28595",
                          width: "20",
                          height: "20",
                        },
                      },
                      [
                        _c("path", {
                          attrs: {
                            d: "M533.504 268.288q33.792-41.984 71.68-75.776 32.768-27.648 74.24-50.176t86.528-19.456q63.488 5.12 105.984 30.208t67.584 63.488 34.304 87.04 6.144 99.84-17.92 97.792-36.864 87.04-48.64 74.752-53.248 61.952q-40.96 41.984-85.504 78.336t-84.992 62.464-73.728 41.472-51.712 15.36q-20.48 1.024-52.224-14.336t-69.632-41.472-79.872-61.952-82.944-75.776q-26.624-25.6-57.344-59.392t-57.856-74.24-46.592-87.552-21.504-100.352 11.264-99.84 39.936-83.456 65.536-61.952 88.064-35.328q24.576-5.12 49.152-1.536t48.128 12.288 45.056 22.016 40.96 27.648q45.056 33.792 86.016 80.896z",
                            "p-id": "28596",
                            fill: _vm.groupData.themeColor,
                          },
                        }),
                      ]
                    ),
                    _vm._v(" "),
                    _c("div", { staticClass: "line" }, [
                      _c("div", { staticClass: "circle" }),
                    ]),
                  ]
                ),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$o = [];
__vue_render__$o._withStripped = true;

  /* style */
  const __vue_inject_styles__$o = undefined;
  /* scoped */
  const __vue_scope_id__$o = "data-v-75fc3288";
  /* module identifier */
  const __vue_module_identifier__$o = undefined;
  /* functional template */
  const __vue_is_functional_template__$o = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$o = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$o, staticRenderFns: __vue_staticRenderFns__$o },
    __vue_inject_styles__$o,
    __vue_script__$o,
    __vue_scope_id__$o,
    __vue_is_functional_template__$o,
    __vue_module_identifier__$o,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$n = {
  name: 'splitlineGreytheme2LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$n = script$n;
/* template */
var __vue_render__$n = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Greytheme2-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "left-icon" }, [
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      attrs: {
                        t: "1684833198250",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "31621",
                        width: "25",
                        height: "31",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M288.105 122.229C174.047 122.21 64.691 231.687 64.691 388.095c0 176.07 156.747 241.891 261.855 312.283 101.962 68.266 174.057 161.602 185.453 201.393 9.743-38.936 91.03-135.019 185.448-203.373 103.196-74.727 261.861-136.19 261.861-312.262 0-152.117-109.34-260.294-222.908-260.294-86.792 0-167.781 15.754-224.419 128.441-65.593-111.977-138.495-132.042-223.876-132.054",
                          fill: _vm.groupData.themeColor,
                          "p-id": "31622",
                        },
                      }),
                    ]
                  ),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "right-icon" }, [
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$n = [];
__vue_render__$n._withStripped = true;

  /* style */
  const __vue_inject_styles__$n = undefined;
  /* scoped */
  const __vue_scope_id__$n = "data-v-e552590e";
  /* module identifier */
  const __vue_module_identifier__$n = undefined;
  /* functional template */
  const __vue_is_functional_template__$n = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$n = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$n, staticRenderFns: __vue_staticRenderFns__$n },
    __vue_inject_styles__$n,
    __vue_script__$n,
    __vue_scope_id__$n,
    __vue_is_functional_template__$n,
    __vue_module_identifier__$n,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$m = {
  name: 'splitlineGreytheme3LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$m = script$m;
/* template */
var __vue_render__$m = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Greytheme3-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "left-icon" }, [
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      attrs: {
                        t: "1684833525217",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "32635",
                        width: "25",
                        height: "31",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M957.111079 403.480424c-3.927449-11.669784-14.447037-19.86442-26.723641-20.816095L647.68068 360.749204 540.183388 84.126003c-4.586458-11.803837-15.951297-19.579941-28.614711-19.579941s-24.02723 7.776104-28.614711 19.579941L375.458719 360.749204l-282.708803 21.915126c-12.276604 0.951675-22.796192 9.146311-26.723641 20.816095-3.927449 11.669784-0.50142 24.557302 8.701173 32.737612l217.547735 193.358823-67.980277 291.298436c-2.848884 12.20702 2.009773 24.919553 12.273535 32.114418 10.264784 7.195889 23.87271 7.42818 34.375925 0.586354l240.624313-156.709111 240.625336 156.709111c5.099135 3.320629 10.92891 4.974291 16.752546 4.974291 6.173606 0 12.342096-1.858324 17.623379-5.561669 10.263761-7.194866 15.122419-19.907399 12.273535-32.114418l-67.980277-291.299459L948.409906 436.218036C957.613522 428.037726 961.037505 415.150208 957.111079 403.480424z",
                          fill: _vm.groupData.themeColor,
                          "p-id": "32636",
                        },
                      }),
                    ]
                  ),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "right-icon" }, [
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$m = [];
__vue_render__$m._withStripped = true;

  /* style */
  const __vue_inject_styles__$m = undefined;
  /* scoped */
  const __vue_scope_id__$m = "data-v-cf8f6ca4";
  /* module identifier */
  const __vue_module_identifier__$m = undefined;
  /* functional template */
  const __vue_is_functional_template__$m = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$m = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$m, staticRenderFns: __vue_staticRenderFns__$m },
    __vue_inject_styles__$m,
    __vue_script__$m,
    __vue_scope_id__$m,
    __vue_is_functional_template__$m,
    __vue_module_identifier__$m,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$l = {
  name: 'splitlineGreytheme5LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$l = script$l;
/* template */
var __vue_render__$l = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Greytheme5-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "left-icon" }, [
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      attrs: {
                        t: "1684834224886",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "42504",
                        width: "25",
                        height: "31",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M992 475.648h-73.088l36.32-62.848a32 32 0 0 0-55.392-32.032l-54.752 94.88H631.52l90.496-52.256a32 32 0 0 0 11.68-43.744 31.904 31.904 0 0 0-43.68-11.68l-90.592 52.288 106.848-185.04h109.536a31.84 31.84 0 0 0 31.904-31.968 31.824 31.824 0 0 0-31.872-32l-72.624 0.032 36.528-63.312a31.952 31.952 0 0 0-11.712-43.696 31.872 31.872 0 0 0-43.68 11.728l-36.56 63.344-36.256-62.944a31.984 31.984 0 0 0-43.776-11.696 31.84 31.84 0 0 0-11.68 43.632l54.816 94.928L544 388.304v-104.656a32 32 0 1 0-64 0v104.56l-106.816-184.992 54.752-94.88a31.904 31.904 0 0 0-11.712-43.632 31.856 31.856 0 0 0-43.664 11.632l-36.32 62.912-36.528-63.28A31.968 31.968 0 0 0 256 64.272a31.92 31.92 0 0 0-11.68 43.696l36.56 63.312-72.624-0.064c-17.712 0-32 14.32-32 32.064a31.84 31.84 0 0 0 31.936 31.936h109.6l106.848 185.056-90.624-52.304a31.888 31.888 0 0 0-43.68 11.712 32 32 0 0 0 11.648 43.728l90.496 52.256H178.944l-54.784-94.88a31.968 31.968 0 0 0-43.648-11.664 31.904 31.904 0 0 0-11.744 43.664l36.32 62.88H32a32 32 0 1 0 0 64h73.088l-36.336 62.848a32 32 0 0 0 55.392 32.032l54.784-94.88h213.68l-90.624 52.32a31.904 31.904 0 0 0-11.68 43.68 31.984 31.984 0 0 0 43.68 11.744l90.624-52.32-106.816 184.992H208.16c-17.632 0-31.936 14.32-31.936 32s14.288 32 31.936 32h72.656l-36.528 63.28a31.968 31.968 0 1 0 55.392 31.968l36.528-63.28 36.256 62.88a32 32 0 0 0 43.744 11.712 31.936 31.936 0 0 0 11.68-43.68l-54.752-94.88L480 627.056v104.592c0 17.696 14.32 32 32 32s32-14.304 32-32v-104.592l106.848 185.024-54.816 94.88a31.952 31.952 0 0 0 11.712 43.68c15.312 8.816 34.88 3.632 43.68-11.68l36.352-62.912 36.528 63.28a31.952 31.952 0 0 0 43.68 11.744 32.016 32.016 0 0 0 11.712-43.744l-36.528-63.28 72.56 0.032a32 32 0 0 0 0.032-64h-109.536l-106.752-184.944 90.464 52.256a32 32 0 0 0 43.728-11.744 31.872 31.872 0 0 0-11.728-43.68l-90.592-52.32h213.68l54.752 94.88a31.936 31.936 0 0 0 43.68 11.68 31.952 31.952 0 0 0 11.712-43.68l-36.288-62.88H992c17.68 0 32-14.304 32-32 0-17.696-14.32-32-32-32z m-480 96a64 64 0 1 1 0-128 64 64 0 0 1 0 128z",
                          fill: _vm.groupData.themeColor,
                          "p-id": "42505",
                        },
                      }),
                    ]
                  ),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "right-icon" }, [
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$l = [];
__vue_render__$l._withStripped = true;

  /* style */
  const __vue_inject_styles__$l = undefined;
  /* scoped */
  const __vue_scope_id__$l = "data-v-5fe27026";
  /* module identifier */
  const __vue_module_identifier__$l = undefined;
  /* functional template */
  const __vue_is_functional_template__$l = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$l = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$l, staticRenderFns: __vue_staticRenderFns__$l },
    __vue_inject_styles__$l,
    __vue_script__$l,
    __vue_scope_id__$l,
    __vue_is_functional_template__$l,
    __vue_module_identifier__$l,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$k = {
  name: 'splitlineYellowtheme3LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$k = script$k;
/* template */
var __vue_render__$k = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Yellowtheme3-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "left-block-box" }, [
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "line-con" }),
                _vm._v(" "),
                _c("div", { staticClass: "right-block-box" }, [
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$k = [];
__vue_render__$k._withStripped = true;

  /* style */
  const __vue_inject_styles__$k = undefined;
  /* scoped */
  const __vue_scope_id__$k = "data-v-089985c2";
  /* module identifier */
  const __vue_module_identifier__$k = undefined;
  /* functional template */
  const __vue_is_functional_template__$k = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$k = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$k, staticRenderFns: __vue_staticRenderFns__$k },
    __vue_inject_styles__$k,
    __vue_script__$k,
    __vue_scope_id__$k,
    __vue_is_functional_template__$k,
    __vue_module_identifier__$k,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$j = {
  name: 'splitlineBluetheme1LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$j = script$j;
/* template */
var __vue_render__$j = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Bluetheme1-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "iconbox" }, [
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      staticStyle: { transform: "rotate(90deg)" },
                      attrs: {
                        t: "1684838451897",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "51769",
                        width: "10",
                        height: "10",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M525.873548 897.156129l-383.174193-761.723871 763.045161-1.981935-379.870968 763.705806z",
                          "p-id": "51770",
                          fill: _vm.groupData.themeColor,
                        },
                      }),
                    ]
                  ),
                  _vm._v(" "),
                  _c("div", { staticClass: "circle" }),
                  _vm._v(" "),
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      staticStyle: { transform: "rotate(-90deg)" },
                      attrs: {
                        t: "1684838451897",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "51769",
                        width: "10",
                        height: "10",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M525.873548 897.156129l-383.174193-761.723871 763.045161-1.981935-379.870968 763.705806z",
                          "p-id": "51770",
                          fill: _vm.groupData.themeColor,
                        },
                      }),
                    ]
                  ),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "iconbox" }, [
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      staticStyle: { transform: "rotate(90deg)" },
                      attrs: {
                        t: "1684838451897",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "51769",
                        width: "10",
                        height: "10",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M525.873548 897.156129l-383.174193-761.723871 763.045161-1.981935-379.870968 763.705806z",
                          "p-id": "51770",
                          fill: _vm.groupData.themeColor,
                        },
                      }),
                    ]
                  ),
                  _vm._v(" "),
                  _c("div", { staticClass: "circle" }),
                  _vm._v(" "),
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      staticStyle: { transform: "rotate(-90deg)" },
                      attrs: {
                        t: "1684838451897",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "51769",
                        width: "10",
                        height: "10",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M525.873548 897.156129l-383.174193-761.723871 763.045161-1.981935-379.870968 763.705806z",
                          "p-id": "51770",
                          fill: _vm.groupData.themeColor,
                        },
                      }),
                    ]
                  ),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "iconbox" }, [
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      staticStyle: { transform: "rotate(90deg)" },
                      attrs: {
                        t: "1684838451897",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "51769",
                        width: "10",
                        height: "10",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M525.873548 897.156129l-383.174193-761.723871 763.045161-1.981935-379.870968 763.705806z",
                          "p-id": "51770",
                          fill: _vm.groupData.themeColor,
                        },
                      }),
                    ]
                  ),
                  _vm._v(" "),
                  _c("div", { staticClass: "circle" }),
                  _vm._v(" "),
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      staticStyle: { transform: "rotate(-90deg)" },
                      attrs: {
                        t: "1684838451897",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "51769",
                        width: "10",
                        height: "10",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M525.873548 897.156129l-383.174193-761.723871 763.045161-1.981935-379.870968 763.705806z",
                          "p-id": "51770",
                          fill: _vm.groupData.themeColor,
                        },
                      }),
                    ]
                  ),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "iconbox" }, [
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      staticStyle: { transform: "rotate(90deg)" },
                      attrs: {
                        t: "1684838451897",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "51769",
                        width: "10",
                        height: "10",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M525.873548 897.156129l-383.174193-761.723871 763.045161-1.981935-379.870968 763.705806z",
                          "p-id": "51770",
                          fill: _vm.groupData.themeColor,
                        },
                      }),
                    ]
                  ),
                  _vm._v(" "),
                  _c("div", { staticClass: "circle" }),
                  _vm._v(" "),
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      staticStyle: { transform: "rotate(-90deg)" },
                      attrs: {
                        t: "1684838451897",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "51769",
                        width: "10",
                        height: "10",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M525.873548 897.156129l-383.174193-761.723871 763.045161-1.981935-379.870968 763.705806z",
                          "p-id": "51770",
                          fill: _vm.groupData.themeColor,
                        },
                      }),
                    ]
                  ),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$j = [];
__vue_render__$j._withStripped = true;

  /* style */
  const __vue_inject_styles__$j = undefined;
  /* scoped */
  const __vue_scope_id__$j = "data-v-fbfbaeaa";
  /* module identifier */
  const __vue_module_identifier__$j = undefined;
  /* functional template */
  const __vue_is_functional_template__$j = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$j = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$j, staticRenderFns: __vue_staticRenderFns__$j },
    __vue_inject_styles__$j,
    __vue_script__$j,
    __vue_scope_id__$j,
    __vue_is_functional_template__$j,
    __vue_module_identifier__$j,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$i = {
  name: 'splitlineBluetheme2LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$i = script$i;
/* template */
var __vue_render__$i = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Bluetheme2-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
                _vm._v(" "),
                _c("div"),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$i = [];
__vue_render__$i._withStripped = true;

  /* style */
  const __vue_inject_styles__$i = undefined;
  /* scoped */
  const __vue_scope_id__$i = "data-v-22a59cff";
  /* module identifier */
  const __vue_module_identifier__$i = undefined;
  /* functional template */
  const __vue_is_functional_template__$i = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$i = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$i, staticRenderFns: __vue_staticRenderFns__$i },
    __vue_inject_styles__$i,
    __vue_script__$i,
    __vue_scope_id__$i,
    __vue_is_functional_template__$i,
    __vue_module_identifier__$i,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$h = {
  name: 'splitlineYellowtheme2LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$h = script$h;
/* template */
var __vue_render__$h = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Yellowtheme2-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "linebox-circle" }),
                _vm._v(" "),
                _c("div", { staticClass: "iconbox" }, [
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      staticStyle: { "margin-left": "-5px" },
                      attrs: {
                        t: "1684841153840",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "52311",
                        width: "35",
                        height: "35",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M960 512L512 769.9 64 512l448-257.9z",
                          fill: _vm.groupData.themeColor,
                          "p-id": "52312",
                        },
                      }),
                    ]
                  ),
                  _vm._v(" "),
                  _c("div", { staticClass: "circle" }),
                  _vm._v(" "),
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      attrs: {
                        t: "1684841153840",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "52311",
                        width: "20",
                        height: "20",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M960 512L512 769.9 64 512l448-257.9z",
                          fill: _vm.groupData.themeColor,
                          "p-id": "52312",
                        },
                      }),
                    ]
                  ),
                  _vm._v(" "),
                  _c("div", { staticClass: "circle" }),
                  _vm._v(" "),
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      staticStyle: { "margin-right": "-5px" },
                      attrs: {
                        t: "1684841153840",
                        viewBox: "0 0 1024 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "52311",
                        width: "35",
                        height: "35",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M960 512L512 769.9 64 512l448-257.9z",
                          fill: _vm.groupData.themeColor,
                          "p-id": "52312",
                        },
                      }),
                    ]
                  ),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "linebox-circle" }),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$h = [];
__vue_render__$h._withStripped = true;

  /* style */
  const __vue_inject_styles__$h = undefined;
  /* scoped */
  const __vue_scope_id__$h = "data-v-30477e81";
  /* module identifier */
  const __vue_module_identifier__$h = undefined;
  /* functional template */
  const __vue_is_functional_template__$h = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$h = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$h, staticRenderFns: __vue_staticRenderFns__$h },
    __vue_inject_styles__$h,
    __vue_script__$h,
    __vue_scope_id__$h,
    __vue_is_functional_template__$h,
    __vue_module_identifier__$h,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$g = {
  name: 'splitlineRedtheme4LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$g = script$g;
/* template */
var __vue_render__$g = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Redtheme4-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "top-linecon" }),
                _vm._v(" "),
                _c("div", { staticClass: "bottom-linecon" }, [
                  _c("div", { staticClass: "left-trianglebox" }, [
                    _c("div"),
                    _vm._v(" "),
                    _c("div"),
                    _vm._v(" "),
                    _c("div"),
                    _vm._v(" "),
                    _c("div"),
                    _vm._v(" "),
                    _c("div"),
                    _vm._v(" "),
                    _c("div"),
                    _vm._v(" "),
                    _c("div"),
                    _vm._v(" "),
                    _c("div"),
                  ]),
                  _vm._v(" "),
                  _c("div", { staticClass: "line" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "right-trianglebox" }, [
                    _c("div"),
                    _vm._v(" "),
                    _c("div"),
                    _vm._v(" "),
                    _c("div"),
                    _vm._v(" "),
                    _c("div"),
                    _vm._v(" "),
                    _c("div"),
                    _vm._v(" "),
                    _c("div"),
                    _vm._v(" "),
                    _c("div"),
                    _vm._v(" "),
                    _c("div"),
                  ]),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$g = [];
__vue_render__$g._withStripped = true;

  /* style */
  const __vue_inject_styles__$g = undefined;
  /* scoped */
  const __vue_scope_id__$g = "data-v-689b28b2";
  /* module identifier */
  const __vue_module_identifier__$g = undefined;
  /* functional template */
  const __vue_is_functional_template__$g = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$g = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$g, staticRenderFns: __vue_staticRenderFns__$g },
    __vue_inject_styles__$g,
    __vue_script__$g,
    __vue_scope_id__$g,
    __vue_is_functional_template__$g,
    __vue_module_identifier__$g,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$f = {
  name: 'splitlineYellowtheme1LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$f = script$f;
/* template */
var __vue_render__$f = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Yellowtheme1-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "left-block" }),
                _vm._v(" "),
                _c("div", { staticClass: "linecon" }),
                _vm._v(" "),
                _c("div", { staticClass: "right-icon" }, [
                  _c(
                    "svg",
                    {
                      staticClass: "icon",
                      staticStyle: { transform: "rotate(180deg)" },
                      attrs: {
                        t: "1684893686787",
                        viewBox: "0 0 1096 1024",
                        version: "1.1",
                        xmlns: "http://www.w3.org/2000/svg",
                        "p-id": "4676",
                        width: "32",
                        height: "32",
                      },
                    },
                    [
                      _c("path", {
                        attrs: {
                          d: "M29.125818 609.321374c0 63.550061 50.313051 113.859232 113.864404 113.859232 63.544889 0 113.857939-50.307879 113.85794-113.859232s-50.313051-113.863111-113.85794-113.863111c-63.551354 0-113.864404 50.313051-113.864404 113.863111z m0 0",
                          fill: _vm.groupData.themeColor,
                          "p-id": "4677",
                        },
                      }),
                      _vm._v(" "),
                      _c("path", {
                        attrs: {
                          d: "M516.342949 296.868202c0 45.014626 34.424242 79.433697 79.440162 79.433697 42.364121 0 79.43499-37.070869 79.43499-79.433697 0-45.015919-34.419071-79.440162-79.43499-79.440162s-79.440162 37.070869-79.440162 79.440162z m0 0",
                          fill: _vm.groupData.themeColor,
                          "p-id": "4678",
                        },
                      }),
                      _vm._v(" "),
                      _c("path", {
                        attrs: {
                          d: "M852.631273 675.519354c0 50.313051 39.717495 90.030545 90.030545 90.030545 50.307879 0 90.025374-39.717495 90.025374-90.030545 0-50.307879-39.717495-90.030545-90.025374-90.030546-50.313051-2.646626-90.030545 39.722667-90.030545 90.030546z m0 0",
                          fill: _vm.groupData.themeColor,
                          "p-id": "4679",
                        },
                      }),
                      _vm._v(" "),
                      _c("path", {
                        attrs: {
                          d: "M0 815.857778c0 26.479192 21.182061 47.661253 47.661253 47.661252 26.480485 0 47.662545-21.182061 47.662545-47.661252s-21.182061-47.65996-47.662545-47.65996c-26.479192-0.001293-47.661253 21.179475-47.661253 47.65996z m1048.576-373.35402a23.731717 23.731717 0 0 0 23.833859 23.828686 23.730424 23.730424 0 0 0 23.828686-23.828686 23.730424 23.730424 0 0 0-23.828686-23.832566 23.731717 23.731717 0 0 0-23.833859 23.832566z m0 0",
                          fill: _vm.groupData.themeColor,
                          "p-id": "4680",
                        },
                      }),
                      _vm._v(" "),
                      _c("path", {
                        attrs: {
                          d: "M887.050343 408.079515c0 15.888808 13.242182 26.480485 26.479192 26.480485 15.888808 0 26.479192-13.243475 26.479192-26.480485 0-15.888808-13.23701-26.479192-26.479192-26.479192-15.883636-2.646626-26.479192 10.590384-26.479192 26.479192z m0 0",
                          fill: _vm.groupData.themeColor,
                          "p-id": "4681",
                        },
                      }),
                      _vm._v(" "),
                      _c("path", {
                        attrs: {
                          d: "M296.565657 196.24598c0 18.535434 15.888808 34.424242 34.424242 34.424242s34.424242-15.888808 34.424242-34.424242-15.888808-34.424242-34.424242-34.424243c-18.535434-2.646626-34.424242 13.243475-34.424242 34.424243z m0 0",
                          fill: _vm.groupData.themeColor,
                          "p-id": "4682",
                        },
                      }),
                      _vm._v(" "),
                      _c("path", {
                        attrs: {
                          d: "M675.216808 511.347071c0 18.535434 13.242182 31.777616 31.777616 31.777616s31.772444-15.888808 31.772445-31.777616c0-18.535434-13.23701-31.772444-31.772445-31.772445s-31.777616 13.23701-31.777616 31.772445z m0 0",
                          fill: _vm.groupData.themeColor,
                          "p-id": "4683",
                        },
                      }),
                      _vm._v(" "),
                      _c("path", {
                        attrs: {
                          d: "M378.651152 508.700444c0 18.535434 13.242182 31.773737 31.777616 31.773738s31.773737-13.23701 31.773737-31.773738c0-18.535434-13.238303-31.777616-31.773737-31.777616s-31.777616 13.242182-31.777616 31.777616z m0 0",
                          fill: _vm.groupData.themeColor,
                          "p-id": "4684",
                        },
                      }),
                      _vm._v(" "),
                      _c("path", {
                        attrs: {
                          d: "M264.793212 352.473212c0 13.238303 10.590384 26.480485 23.827394 26.480485 13.243475 0 23.833859-10.591677 23.833859-26.480485 0-13.242182-10.590384-26.479192-23.833859-26.479192-13.23701 0-23.827394 13.23701-23.827394 26.479192z m0 0",
                          fill: _vm.groupData.themeColor,
                          "p-id": "4685",
                        },
                      }),
                      _vm._v(" "),
                      _c("path", {
                        attrs: {
                          d: "M526.934626 654.337293a23.731717 23.731717 0 0 0 23.833859 23.828687 23.730424 23.730424 0 0 0 23.828687-23.828687 23.731717 23.731717 0 0 0-23.828687-23.833859 23.73301 23.73301 0 0 0-23.833859 23.833859z m0 0",
                          fill: _vm.groupData.themeColor,
                          "p-id": "4686",
                        },
                      }),
                    ]
                  ),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$f = [];
__vue_render__$f._withStripped = true;

  /* style */
  const __vue_inject_styles__$f = undefined;
  /* scoped */
  const __vue_scope_id__$f = "data-v-58b29b6c";
  /* module identifier */
  const __vue_module_identifier__$f = undefined;
  /* functional template */
  const __vue_is_functional_template__$f = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$f = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$f, staticRenderFns: __vue_staticRenderFns__$f },
    __vue_inject_styles__$f,
    __vue_script__$f,
    __vue_scope_id__$f,
    __vue_is_functional_template__$f,
    __vue_module_identifier__$f,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$e = {
  name: 'splitlineGreytheme1LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$e = script$e;
/* template */
var __vue_render__$e = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Greytheme1-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "left-icon" }, [
                  _c("div", { staticClass: "block" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "triangle" }),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "right-icon" }, [
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$e = [];
__vue_render__$e._withStripped = true;

  /* style */
  const __vue_inject_styles__$e = undefined;
  /* scoped */
  const __vue_scope_id__$e = "data-v-3d72a2c9";
  /* module identifier */
  const __vue_module_identifier__$e = undefined;
  /* functional template */
  const __vue_is_functional_template__$e = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$e = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$e, staticRenderFns: __vue_staticRenderFns__$e },
    __vue_inject_styles__$e,
    __vue_script__$e,
    __vue_scope_id__$e,
    __vue_is_functional_template__$e,
    __vue_module_identifier__$e,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$d = {
  name: 'splitlineBluetheme4LibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$d = script$d;
/* template */
var __vue_render__$d = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Bluetheme4-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "linebox" }, [
                _c("div", { staticClass: "top-lineconbox" }),
                _vm._v(" "),
                _c("div", { staticClass: "bottom-lineconbox" }, [
                  _c("div", { staticClass: "linecon1" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "bottom-block1" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "bottom-block2" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "linecon2" }),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$d = [];
__vue_render__$d._withStripped = true;

  /* style */
  const __vue_inject_styles__$d = undefined;
  /* scoped */
  const __vue_scope_id__$d = "data-v-5408f11c";
  /* module identifier */
  const __vue_module_identifier__$d = undefined;
  /* functional template */
  const __vue_is_functional_template__$d = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$d = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$d, staticRenderFns: __vue_staticRenderFns__$d },
    __vue_inject_styles__$d,
    __vue_script__$d,
    __vue_scope_id__$d,
    __vue_is_functional_template__$d,
    __vue_module_identifier__$d,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$c = {
  name: 'splitlineTwentytwoLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$c = script$c;
/* template */
var __vue_render__$c = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Twentytwo-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "centerimg" }, [_c("div")])]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$c = [];
__vue_render__$c._withStripped = true;

  /* style */
  const __vue_inject_styles__$c = undefined;
  /* scoped */
  const __vue_scope_id__$c = "data-v-9d98bdb8";
  /* module identifier */
  const __vue_module_identifier__$c = undefined;
  /* functional template */
  const __vue_is_functional_template__$c = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$c = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$c, staticRenderFns: __vue_staticRenderFns__$c },
    __vue_inject_styles__$c,
    __vue_script__$c,
    __vue_scope_id__$c,
    __vue_is_functional_template__$c,
    __vue_module_identifier__$c,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$b = {
  name: 'splitlineTwentythreeLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$b = script$b;
/* template */
var __vue_render__$b = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Twentythree-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", { staticClass: "centerimg" }, [_c("div")])]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$b = [];
__vue_render__$b._withStripped = true;

  /* style */
  const __vue_inject_styles__$b = undefined;
  /* scoped */
  const __vue_scope_id__$b = "data-v-7aa4eca4";
  /* module identifier */
  const __vue_module_identifier__$b = undefined;
  /* functional template */
  const __vue_is_functional_template__$b = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$b = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$b, staticRenderFns: __vue_staticRenderFns__$b },
    __vue_inject_styles__$b,
    __vue_script__$b,
    __vue_scope_id__$b,
    __vue_is_functional_template__$b,
    __vue_module_identifier__$b,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$a = {
  name: 'splitlineTwentyfourLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$a = script$a;
/* template */
var __vue_render__$a = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Twentyfour-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [_c("div", [_c("div", { staticClass: "centerimg" }, [_c("div")])])]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$a = [];
__vue_render__$a._withStripped = true;

  /* style */
  const __vue_inject_styles__$a = undefined;
  /* scoped */
  const __vue_scope_id__$a = "data-v-7c66ac84";
  /* module identifier */
  const __vue_module_identifier__$a = undefined;
  /* functional template */
  const __vue_is_functional_template__$a = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$a = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$a, staticRenderFns: __vue_staticRenderFns__$a },
    __vue_inject_styles__$a,
    __vue_script__$a,
    __vue_scope_id__$a,
    __vue_is_functional_template__$a,
    __vue_module_identifier__$a,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$9 = {
  name: 'splitlineTwentyfiveLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$9 = script$9;
/* template */
var __vue_render__$9 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Twentyfive-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", [
                _c("div", { staticClass: "left-top-line" }),
                _vm._v(" "),
                _c("div", { staticClass: "left-bottom-line" }),
                _vm._v(" "),
                _c("div", { staticClass: "left-block-box" }, [
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "right-top-line" }),
                _vm._v(" "),
                _c("div", { staticClass: "right-bottom-line" }),
                _vm._v(" "),
                _c("div", { staticClass: "right-block-box" }, [
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                ]),
                _vm._v(" "),
                _c("div", { staticClass: "centerimg" }, [
                  _c("div"),
                  _vm._v(" "),
                  _c("div"),
                  _vm._v(" "),
                  _c("div", { staticClass: "left-line-box" }),
                  _vm._v(" "),
                  _c("div", { staticClass: "right-line-box" }),
                ]),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$9 = [];
__vue_render__$9._withStripped = true;

  /* style */
  const __vue_inject_styles__$9 = undefined;
  /* scoped */
  const __vue_scope_id__$9 = "data-v-2cf1fce4";
  /* module identifier */
  const __vue_module_identifier__$9 = undefined;
  /* functional template */
  const __vue_is_functional_template__$9 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$9 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$9, staticRenderFns: __vue_staticRenderFns__$9 },
    __vue_inject_styles__$9,
    __vue_script__$9,
    __vue_scope_id__$9,
    __vue_is_functional_template__$9,
    __vue_module_identifier__$9,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$8 = {
  name: 'splitlineTwentysixLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$8 = script$8;
/* template */
var __vue_render__$8 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Twentysix-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "left-triangle" }),
              _vm._v(" "),
              _c("div", { staticClass: "centerimg" }, [_c("div")]),
              _vm._v(" "),
              _c("div", { staticClass: "right-triangle" }),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$8 = [];
__vue_render__$8._withStripped = true;

  /* style */
  const __vue_inject_styles__$8 = undefined;
  /* scoped */
  const __vue_scope_id__$8 = "data-v-512ce6ab";
  /* module identifier */
  const __vue_module_identifier__$8 = undefined;
  /* functional template */
  const __vue_is_functional_template__$8 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$8 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 },
    __vue_inject_styles__$8,
    __vue_script__$8,
    __vue_scope_id__$8,
    __vue_is_functional_template__$8,
    __vue_module_identifier__$8,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$7 = {
  name: 'splitlineTwentysevenLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$7 = script$7;
/* template */
var __vue_render__$7 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Twentyseven-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
              _vm._v(" "),
              _c("div"),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$7 = [];
__vue_render__$7._withStripped = true;

  /* style */
  const __vue_inject_styles__$7 = undefined;
  /* scoped */
  const __vue_scope_id__$7 = "data-v-3d6343d2";
  /* module identifier */
  const __vue_module_identifier__$7 = undefined;
  /* functional template */
  const __vue_is_functional_template__$7 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$7 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 },
    __vue_inject_styles__$7,
    __vue_script__$7,
    __vue_scope_id__$7,
    __vue_is_functional_template__$7,
    __vue_module_identifier__$7,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$6 = {
  name: 'splitlineTwentyeightLibraryRender',
  isUnPrefix: true,
  components: {
    XmlTextRender: __vue_component__$4M
  },
  mixins: [singleGroupMixin],
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: function () {
        return 'editor';
      }
    },
    //必须有此属性，接收初始化值
    pGroupData: {
      type: Object,
      default: function () {
        return {};
      }
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    //必须有此属性，页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      typeText: '分割线',
      titleTextDataName: 'titleTextData',
      groupData: {},
      blockId: `blockId${Math.random()}`,
      propertyComponentsName: 'XmlSplitlineProperty'
    };
  },
  created() {
    this.groupData = this.pGroupData;
  },
  mounted() {},
  methods: {
    //
    /***
     * 固定方法。接收固定参数
     * 此方法接收块儿点击事件，事件传递块相关参数
     * @param blockData 块中的data属性数据
     * @param dataName 块data数据在组中时，属性key
     * @param propertyComponentsName 块儿对应的属性组件名
     */
    handleBlockClick({
      blockData,
      dataName,
      propertyComponentsName,
      blockId,
      ruleIndex
    }) {
      this.$emit('blockclick', {
        groupData: this.groupData,
        blockData,
        dataName: this.titleTextDataName,
        propertyComponentsName: this.propertyComponentsName,
        currentRule: this.currentRule,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    groupDataChange({
      ruleIndex,
      dataName,
      data
    }) {
      this.$emit('groupDataChange', {
        ruleIndex,
        dataName,
        data
      });
    }
  }
};

/* script */
const __vue_script__$6 = script$6;
/* template */
var __vue_render__$6 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "parent-group parent-group-mark",
      class: [
        "xml-splitline-Twentyeight-library-" + _vm.pageType,
        "xml-single-ebook-group-" + _vm.pageType,
        _vm.groupIsActive ? "active" : "",
      ],
      style: { "--background-color": _vm.groupData.themeColor },
      on: { click: _vm.emitClick },
    },
    [
      _c(
        "xml-group-render",
        {
          ref: "xmlGroup",
          attrs: {
            "page-type": _vm.pageType,
            mode: _vm.mode,
            "type-text": _vm.typeText,
            showLine: false,
            "rule-index": _vm.ruleIndex,
            scopedSlots: { $scopedSlots: _vm.$scopedSlots },
          },
          scopedSlots: _vm._u(
            [
              _vm._l(_vm.$scopedSlots, function (index, name) {
                return {
                  key: "action-buttons",
                  fn: function () {
                    return [_vm._t(name)]
                  },
                  proxy: true,
                }
              }),
            ],
            null,
            true
          ),
        },
        [
          _vm._v(" "),
          _c(
            "div",
            {
              staticClass: "title-container",
              attrs: { id: _vm.blockId },
              on: { click: _vm.handleBlockClick },
            },
            [
              _c("div", { staticClass: "side-block-box" }, [
                _c("div", { staticClass: "round" }),
                _vm._v(" "),
                _c("div", { staticClass: "icon" }),
              ]),
              _vm._v(" "),
              _c("div", { staticClass: "left-line-box" }),
              _vm._v(" "),
              _c("div", { staticClass: "centerimg" }, [_c("div")]),
              _vm._v(" "),
              _c("div", { staticClass: "right-line-box" }),
              _vm._v(" "),
              _c("div", { staticClass: "side-block-box" }, [
                _c("div", { staticClass: "icon" }),
                _vm._v(" "),
                _c("div", { staticClass: "round" }),
              ]),
            ]
          ),
        ]
      ),
    ],
    1
  )
};
var __vue_staticRenderFns__$6 = [];
__vue_render__$6._withStripped = true;

  /* style */
  const __vue_inject_styles__$6 = undefined;
  /* scoped */
  const __vue_scope_id__$6 = "data-v-be7fe2d4";
  /* module identifier */
  const __vue_module_identifier__$6 = undefined;
  /* functional template */
  const __vue_is_functional_template__$6 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$6 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 },
    __vue_inject_styles__$6,
    __vue_script__$6,
    __vue_scope_id__$6,
    __vue_is_functional_template__$6,
    __vue_module_identifier__$6,
    false,
    undefined,
    undefined,
    undefined
  );

const TitleComponents = [__vue_component__$y, __vue_component__$x, __vue_component__$w, __vue_component__$v, __vue_component__$u, __vue_component__$t, __vue_component__$s, __vue_component__$r, __vue_component__$q, __vue_component__$p, __vue_component__$o, __vue_component__$n, __vue_component__$m, __vue_component__$l, __vue_component__$k, __vue_component__$j, __vue_component__$i, __vue_component__$h, __vue_component__$g, __vue_component__$f, __vue_component__$e, __vue_component__$d, __vue_component__$c, __vue_component__$b, __vue_component__$a, __vue_component__$9, __vue_component__$8, __vue_component__$7, __vue_component__$6];
var xmlSplitlineLibrary = {
  // install,
  ...TitleComponents
};

//
//
//
//
//
//
//
//
//
//
//

var script$5 = {
  name: 'xmlPopup',
  props: {
    position: {
      //弹窗方向top、bottom、left、right、center
      type: String,
      default: 'bottom'
    }
  },
  watch: {
    show(val) {
      if (val) {
        this.showPopup = true;
      } else {
        setTimeout(() => {
          this.showPopup = false;
        }, 300);
      }
    }
  },
  data() {
    return {
      showPopup: false,
      show: false
    };
  },
  computed: {
    styleData() {
      let data = {};
      if (this.position == 'top') {
        data = {
          'align-items': 'center'
        };
      } else if (this.position == 'bottom') {
        data = {
          'justify-content': 'flex-end',
          'align-items': 'cneter'
        };
      } else if (this.position == 'left') {
        data = {
          'justify-content': 'center'
        };
      } else if (this.position == 'right') {
        data = {
          'justify-content': 'center',
          'align-items': 'flex-end'
        };
      } else if (this.position == 'center') {
        data = {
          'justify-content': 'center',
          'align-items': 'center'
        };
      }
      return data;
    }
  },
  methods: {
    close() {
      this.$emit('close');
    }
  },
  created() {},
  mounted() {}
};

/* script */
const __vue_script__$5 = script$5;
/* template */
var __vue_render__$5 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "van-popup",
    {
      attrs: { round: "", position: _vm.position },
      on: { close: _vm.close },
      model: {
        value: _vm.show,
        callback: function ($$v) {
          _vm.show = $$v;
        },
        expression: "show",
      },
    },
    [
      _c("div", { staticClass: "xml-popup-content" }, [
        _c("div", { staticClass: "content" }, [_vm._t("default")], 2),
      ]),
    ]
  )
};
var __vue_staticRenderFns__$5 = [];
__vue_render__$5._withStripped = true;

  /* style */
  const __vue_inject_styles__$5 = undefined;
  /* scoped */
  const __vue_scope_id__$5 = "data-v-566a9534";
  /* module identifier */
  const __vue_module_identifier__$5 = undefined;
  /* functional template */
  const __vue_is_functional_template__$5 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$5 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 },
    __vue_inject_styles__$5,
    __vue_script__$5,
    __vue_scope_id__$5,
    __vue_is_functional_template__$5,
    __vue_module_identifier__$5,
    false,
    undefined,
    undefined,
    undefined
  );

//
//
//
//
//
//
//
//
//
//
//
//
//
//

var script$4 = {
  name: 'xmlCollapse',
  props: {
    title: {
      type: String,
      default: ''
    },
    name: {
      type: Number,
      default: 0
    },
    current: {
      type: Number,
      default: 0
    },
    className: {
      type: String,
      default: ''
    }
  },
  data() {
    return {};
  },
  methods: {},
  created() {},
  mounted() {}
};

/* script */
const __vue_script__$4 = script$4;
/* template */
var __vue_render__$4 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticClass: "xml-collapse-content" }, [
    _c("div", { staticClass: "xml-collapse-item" }, [
      _c(
        "div",
        {
          staticClass: "collapse-top",
          on: {
            click: function ($event) {
              $event.stopPropagation();
              return _vm.$emit(
                "collapseClick",
                _vm.name != _vm.current ? _vm.name : -1
              )
            },
          },
        },
        [
          _c("div", { staticClass: "collapse-title" }, [
            _vm._v(_vm._s(_vm.title)),
          ]),
          _vm._v(" "),
          _c("i", {
            staticClass: "el-icon-arrow-down",
            class: _vm.name == _vm.current ? "collapse" : "",
          }),
        ]
      ),
      _vm._v(" "),
      _vm.name == _vm.current
        ? _c(
            "div",
            { staticClass: "collapse-content", class: _vm.className },
            [_vm._t("default")],
            2
          )
        : _vm._e(),
    ]),
  ])
};
var __vue_staticRenderFns__$4 = [];
__vue_render__$4._withStripped = true;

  /* style */
  const __vue_inject_styles__$4 = undefined;
  /* scoped */
  const __vue_scope_id__$4 = "data-v-c1adc6d8";
  /* module identifier */
  const __vue_module_identifier__$4 = undefined;
  /* functional template */
  const __vue_is_functional_template__$4 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$4 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 },
    __vue_inject_styles__$4,
    __vue_script__$4,
    __vue_scope_id__$4,
    __vue_is_functional_template__$4,
    __vue_module_identifier__$4,
    false,
    undefined,
    undefined,
    undefined
  );

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

// 拖拽状态 true：下拉  false：上拉
let SCROLLSTATUS;
var script$3 = {
  name: 'xmlWrapperPage',
  props: {
    // 能够拖拽的最大距离
    maxDistance: {
      type: Number,
      default: 120
    },
    // 定义触发加载刷新事件的拉伸长度
    triggerDistance: {
      type: Number,
      default: 100
    },
    isFirstOne: {
      // 是否是第一章
      type: Boolean,
      default: false
    },
    isLastOne: {
      // 是否是最后一章
      type: Boolean,
      default: false
    },
    showToast: {
      type: Function,
      default: null
    }
  },
  data() {
    return {
      startLocation: '',
      // 记录触摸开始的位置
      moveDistance: 0,
      // 记录移动的位置
      isTransition: false,
      // 是否启动transition
      isRotate: false,
      // 是否选择箭头
      isShrinked: false,
      // 是否收缩完成
      isTop: false,
      isBottom: false,
      isFlippingPages: false,
      //是否可以翻页
      startTime: 0 //触摸开始时间
    };
  },
  mounted() {},
  methods: {
    // 获取手指触屏时的屏幕Y轴位置
    handlerTouchStart(e) {
      this.startTime = new Date().getTime();
      let xmlPreviewDom = document.getElementById('xmlPreviewDom');
      this.isTop = false;
      this.isBottom = false;
      this.isFlippingPages = true;
      if (xmlPreviewDom.scrollTop == 0) {
        this.isTop = true;
      }
      if (xmlPreviewDom.scrollHeight < xmlPreviewDom.scrollTop + xmlPreviewDom.offsetHeight + 2) {
        this.isBottom = true;
      }
      this.isTransition = false;
      this.startLocation = e.touches[0].pageY;
      // 重置箭头反转
      this.isRotate = false;
      // 重置箭头
      this.isShrinked = false;
      //   触摸500毫秒后，代表长按 禁用拖拽
      setTimeout(() => {
        this.isFlippingPages = false;
      }, 500);
    },
    // 获取手指移动的距离
    handlerTouchMove(e) {
      if (!this.isFlippingPages) return;
      if (this.moveDistance > this.maxDistance + 1 || -this.moveDistance > this.maxDistance + 1) {
        this.isRotate = true;
        return;
      }
      this.moveDistance = Math.floor((e.touches[0].pageY - this.startLocation) / 2);
      // console.log(this.moveDistance)
      if (this.moveDistance > 0 && this.isTop || this.moveDistance < 0 && this.isBottom) {
        this.$refs.scrollContainer.style.transform = `translateY(${this.moveDistance}px)`;
      } else {
        this.moveDistance = 0;
      }
    },
    // 获取手指松开的Y轴位置
    handlerTouchEnd(e) {
      // 记录拖拽状态是为上拉还是下拉
      SCROLLSTATUS = this.moveDistance > 0;
      this.isTransition = true; // 开启transition

      this.isFlippingPages = true;
      let endTime = new Date().getTime() - this.startTime;
      if (Math.abs(this.moveDistance) < this.triggerDistance || !this.isTop && !this.isBottom || endTime < 300 || this.isFirstOne && SCROLLSTATUS || this.isLastOne && !SCROLLSTATUS) {
        this.$refs.scrollContainer.style.transform = 'translateY(0px)';
        this.moveDistance = 0;
      } else {
        // 拖拽距离是否大于指定的触发长度
        // 容器位置恢复后触发
        setTimeout(() => {
          setTimeout(() => {
            this.moveDistance = 0;
            this.$refs.scrollContainer.style.transform = 'translateY(0px)';
          }, 200);
          this.shrinked();
        }, 700);
      }
    },
    // 容器恢复后的操作
    shrinked() {
      //   this.showToast(SCROLLSTATUS)
      if (SCROLLSTATUS) {
        // 下拉刷新业务逻辑
        // 已经恢复完，箭头转为加载
        this.isShrinked = true;
        this.$emit('previousChapter');
      } else {
        // 上拉加载业务逻辑
        this.$emit('nextChapter');
      }
    }
  }
};

/* script */
const __vue_script__$3 = script$3;
/* template */
var __vue_render__$3 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticClass: "xml-drag-and-drop-loading" }, [
    _c(
      "div",
      {
        ref: "scrollContainer",
        class: { transition: _vm.isTransition },
        attrs: { id: "xml-scroll-container" },
        on: {
          touchstart: function ($event) {
            $event.stopPropagation();
            return _vm.handlerTouchStart.apply(null, arguments)
          },
          touchmove: function ($event) {
            $event.stopPropagation();
            return _vm.handlerTouchMove.apply(null, arguments)
          },
          touchend: function ($event) {
            $event.stopPropagation();
            return _vm.handlerTouchEnd.apply(null, arguments)
          },
        },
      },
      [
        _c(
          "div",
          { staticClass: "xml-loading-text", attrs: { id: "up-loading-text" } },
          [
            _c(
              "span",
              {
                directives: [
                  {
                    name: "show",
                    rawName: "v-show",
                    value: !_vm.isTransition,
                    expression: "!isTransition",
                  },
                ],
              },
              [
                _vm._v(
                  _vm._s(
                    _vm.isFirstOne
                      ? "已经是第一章啦"
                      : _vm.triggerDistance < _vm.moveDistance
                      ? "释放即可加载上一章"
                      : "继续上拉加载上一章"
                  )
                ),
              ]
            ),
            _vm._v(" "),
            _c(
              "span",
              {
                directives: [
                  {
                    name: "show",
                    rawName: "v-show",
                    value: _vm.isTransition,
                    expression: "isTransition",
                  },
                ],
              },
              [_vm._v("加载中"), _c("i", { staticClass: "el-icon-loading" })]
            ),
          ]
        ),
        _vm._v(" "),
        _vm._t("default"),
        _vm._v(" "),
        _c(
          "div",
          {
            staticClass: "xml-loading-text",
            attrs: { id: "down-loading-text" },
          },
          [
            _c(
              "span",
              {
                directives: [
                  {
                    name: "show",
                    rawName: "v-show",
                    value: !_vm.isTransition,
                    expression: "!isTransition",
                  },
                ],
              },
              [
                _vm._v(
                  _vm._s(
                    _vm.isLastOne
                      ? "已经是最后一章啦"
                      : _vm.triggerDistance < -_vm.moveDistance
                      ? "释放即可加载下一章"
                      : "继续上拉加载下一章"
                  )
                ),
              ]
            ),
            _vm._v(" "),
            _c(
              "span",
              {
                directives: [
                  {
                    name: "show",
                    rawName: "v-show",
                    value: _vm.isTransition,
                    expression: "isTransition",
                  },
                ],
              },
              [_vm._v("加载中"), _c("i", { staticClass: "el-icon-loading" })]
            ),
          ]
        ),
      ],
      2
    ),
  ])
};
var __vue_staticRenderFns__$3 = [];
__vue_render__$3._withStripped = true;

  /* style */
  const __vue_inject_styles__$3 = undefined;
  /* scoped */
  const __vue_scope_id__$3 = undefined;
  /* module identifier */
  const __vue_module_identifier__$3 = undefined;
  /* functional template */
  const __vue_is_functional_template__$3 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },
    __vue_inject_styles__$3,
    __vue_script__$3,
    __vue_scope_id__$3,
    __vue_is_functional_template__$3,
    __vue_module_identifier__$3,
    false,
    undefined,
    undefined,
    undefined
  );

//
//
//
//
//
//
//
//

var script$2 = {
  name: 'xmlTextOverflow',
  props: {
    info: {
      type: String,
      default: ''
    },
    lineClamp: {
      type: Number,
      default: 3
    },
    hiddenBtn: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
      showall: false
    };
  },
  computed: {
    textStyleObject() {
      return {
        'max-height': this.showall ? 'none' : `${1.5 * this.lineClamp}em`
      };
    },
    textClass() {
      let cls = this.showall ? 'showall' : '';
      cls = cls + (this.hiddenBtn ? ' hidden-btn' : '');
      return cls;
    }
  },
  watch: {
    info() {
      this.showall = false;
    }
  }
};

/* script */
const __vue_script__$2 = script$2;
/* template */
var __vue_render__$2 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticClass: "dp-text-ellipsis-wrapper" }, [
    _c(
      "div",
      { staticClass: "text", class: _vm.textClass, style: _vm.textStyleObject },
      [
        _c("label", {
          class: _vm.info.length >= 48 ? "btn" : "",
          on: {
            click: function ($event) {
              $event.stopPropagation();
              _vm.showall = !_vm.showall;
            },
          },
        }),
        _vm._v("\n    " + _vm._s(_vm.info) + "\n  "),
      ]
    ),
  ])
};
var __vue_staticRenderFns__$2 = [];
__vue_render__$2._withStripped = true;

  /* style */
  const __vue_inject_styles__$2 = undefined;
  /* scoped */
  const __vue_scope_id__$2 = undefined;
  /* module identifier */
  const __vue_module_identifier__$2 = undefined;
  /* functional template */
  const __vue_is_functional_template__$2 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
    __vue_inject_styles__$2,
    __vue_script__$2,
    __vue_scope_id__$2,
    __vue_is_functional_template__$2,
    __vue_module_identifier__$2,
    false,
    undefined,
    undefined,
    undefined
  );

//
//
//
//
//
//

var script$1 = {
  name: 'xmlWatermarkBg',
  data() {
    return {
      div: null,
      base64: 'url("data:image/png;base64, ")'
    };
  },
  mounted() {
    this.resetWatermark();
    const ob = new MutationObserver(entries => {
      for (const entry of entries) {
        for (const node of entry.removedNodes) {
          if (node === this.div) {
            // 处理删除
            this.resetWatermark();
          }
        }
        if (entry.target === this.div) {
          // 处理修改
          this.resetWatermark();
        }
      }
    });
    ob.observe(this.$refs.xmlWatermarkBg, {
      childList: true,
      subtree: true,
      attributes: true
    });
  },
  methods: {
    resetWatermark() {
      if (!this.$refs.xmlWatermarkBg) {
        return;
      }
      if (this.div) {
        this.div.remove();
      }
      this.div = document.createElement('div');
      this.div.style.position = 'absolute';
      this.div.style.zIndex = 999;
      this.div.style.backgroundImage = this.base64;
      this.div.style.backgroundSize = '50%';
      this.div.style.backgroundRepeat = 'repeat';
      //   this.div.style.backgroundPositionY = 'calc(80vh - 100px)'
      this.div.style.pointerEvents = 'none';
      this.div.style.inset = 0;
      this.$refs.xmlWatermarkBg.appendChild(this.div);
    }
  }
};

/* script */
const __vue_script__$1 = script$1;

/* template */
var __vue_render__$1 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { ref: "xmlWatermarkBg" }, [_vm._t("default")], 2)
};
var __vue_staticRenderFns__$1 = [];
__vue_render__$1._withStripped = true;

  /* style */
  const __vue_inject_styles__$1 = undefined;
  /* scoped */
  const __vue_scope_id__$1 = undefined;
  /* module identifier */
  const __vue_module_identifier__$1 = undefined;
  /* functional template */
  const __vue_is_functional_template__$1 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
    __vue_inject_styles__$1,
    __vue_script__$1,
    __vue_scope_id__$1,
    __vue_is_functional_template__$1,
    __vue_module_identifier__$1,
    false,
    undefined,
    undefined,
    undefined
  );

const xmlView = [__vue_component__$5, __vue_component__$4, __vue_component__$24, __vue_component__$3, __vue_component__$2, __vue_component__$1];
var xmlView$1 = {
  // install,
  ...xmlView
};

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

var script = {
  name: 'xml-hevue-img-preview',
  data() {
    return {
      // imgWidth: 0,
      // imgHeight: 0,
      visible: false,
      // 插件显示，默认为false
      imgScale: 1,
      imgTop: 0,
      imgLeft: 0,
      imgRotate: 0,
      isFull: false,
      maxWH: 'max-width:100%;max-height:100%;',
      clientX: 0,
      clientY: 0,
      imgIndex: 0,
      canRun: true,
      imgurl: '',
      imgState: 1,
      start: [{}, {}],
      mobileScale: 0,
      // 手指离开时图片的缩放比例
      // 以下内容为用户传入配置
      // show: true, // 插件显示，默认为false
      url: '',
      // 预览图片的地址
      nowImgIndex: 0,
      multiple: false,
      imgList: [],
      imgKey: 'url',
      titleKey: 'title',
      imgTitle: '',
      // 以下为可全局配置
      controlBar: true,
      closeBtn: true,
      arrowBtn: true,
      keyboard: false,
      clickMaskCLose: false,
      // 是否点击遮罩关闭，默认false
      closeFn: null,
      // 关闭回调函数
      changeFn: null // 切换图片回调函数
    };
  },
  mounted() {
    this.initImg();
  },
  watch: {
    url() {
      this.initImg();
    },
    visible: {
      handler(newV) {
        if (newV) {
          this.$nextTick(() => {
            let _dom = document.getElementById('hevue-imgpreview-wrap');
            _dom.onmousewheel = this.scrollFunc;
            // 火狐浏览器没有onmousewheel事件，用DOMMouseScroll代替(滚轮事件)
            document.body.addEventListener('DOMMouseScroll', this.scrollFunc);
            // 禁止火狐浏览器下拖拽图片的默认事件
            document.ondragstart = function () {
              return false;
            };
            // 判断是否多图
            if (this.multiple) {
              if (Array.isArray(this.imgList) && this.imgList.length > 0) {
                this.imgIndex = Number(this.nowImgIndex) || 0;
                // this.url = this.imgList[this.imgIndex]
                this.imgTitle = this.imgList[this.imgIndex][this.titleKey];
                this.changeUrl(this.imgList[this.imgIndex][this.imgKey], this.imgIndex);
              }
            } else {
              this.changeUrl(this.url);
            }
            // 判断是否开启键盘事件
            if (this.keyboard) {
              document.addEventListener('keydown', this.keyHandleDebounce);
            }
          });
        }
      },
      immediate: true
    }
  },
  methods: {
    show() {
      this.visible = true;
    },
    close(data) {
      this.initImg();
      // this.maxWH = "max-width:100%;max-height:100%;";
      // this.isFull = false;
      // 移除火狐浏览器下的鼠标滚动事件
      document.body.removeEventListener('DOMMouseScroll', this.scrollFunc);
      //恢复火狐及Safari浏览器下的图片拖拽
      document.ondragstart = null;
      // 移除键盘事件
      if (this.keyboard) {
        document.removeEventListener('keydown', this.keyHandleDebounce);
      }
      this.visible = false;
      this.closeFn && this.closeFn(data);
    },
    initImg() {
      this.mobileScale = 1;
      this.imgScale = 1;
      this.imgRotate = 0;
      this.imgTop = 0;
      this.imgLeft = 0;
    },
    /**
     * 切换图片
     * true 下一张
     * false 上一张
     */
    toogleImg(bool, way) {
      let fromIndex = this.imgIndex;
      if (bool) {
        this.imgIndex++;
        if (this.imgIndex > this.imgList.length - 1) {
          this.imgIndex = 0;
        }
      } else {
        this.imgIndex--;
        if (this.imgIndex < 0) {
          this.imgIndex = this.imgList.length - 1;
        }
      }
      this.changeFn && this.changeFn({
        type: bool ? 'next' : 'prev',
        fromImgIndex: fromIndex,
        fromImgUrl: this.imgList[fromIndex],
        toImgIndex: this.imgIndex,
        toImgUrl: this.imgList[this.imgIndex],
        way
      });
      // this.url = this.imgList[this.imgIndex]
      this.imgTitle = this.imgList[this.imgIndex][this.titleKey];
      this.changeUrl(this.imgList[this.imgIndex][this.imgKey], this.imgIndex);
    },
    // 改变图片地址
    /**
     * @description:
     * @param {String} url 要显示的图片的url
     * @param {Number} index 当前显示当图片下标，防止用户点击切换图片过快
     * @return {*}
     */
    changeUrl(url, index) {
      this.imgState = 1;
      let img = new Image();
      img.src = url;
      img.onload = () => {
        // 如果加载出来图片当下标不是当前显示图片当下标，则不予显示（用户点击过快当时候，会出现用户点到第三张了，此时第一张图片才加载完当情况）
        if (index != undefined && index == this.imgIndex) {
          this.imgState = 2;
          this.imgurl = url;
        } else if (index == undefined) {
          this.imgState = 2;
          this.imgurl = url;
        }
      };
      img.onerror = () => {
        if (index != undefined && index == this.imgIndex) {
          this.imgState = 3;
        } else if (index == undefined) {
          this.imgState = 3;
        }
      };
    },
    // 旋转图片
    rotateFunc(deg) {
      this.imgRotate += deg;
    },
    // 图片缩放
    scaleFunc(num, bool) {
      if (this.imgScale <= 0.2 && num < 0) return;
      if (bool) {
        this.imgScale = num;
      } else {
        this.imgScale += num;
      }
    },
    // 图片原尺寸切换
    imgToggle() {
      this.initImg();
      if (this.isFull) {
        this.maxWH = 'max-width:100%;max-height:100%;';
      } else {
        this.maxWH = '';
      }
      this.isFull = !this.isFull;
    },
    // 鼠标滚轮缩放
    scrollFunc(e) {
      e = e || window.event;
      // e.returnValue = false // ie
      // 火狐下没有wheelDelta，用detail代替，由于detail值的正负和wheelDelta相反，所以取反
      e.delta = e.wheelDelta || -e.detail;
      e.preventDefault();
      if (e.delta > 0) {
        //当滑轮向上滚动时
        this.scaleFunc(0.05);
      }
      if (e.delta < 0) {
        //当滑轮向下滚动时
        this.scaleFunc(-0.05);
      }
    },
    // 鼠标按下
    addMove(e) {
      e = e || window.event;
      this.clientX = e.clientX;
      this.clientY = e.clientY;
      this.$refs.heImg.onmousemove = this.moveFunc;
    },
    // 手指按下事件
    addMoveMobile(e) {
      e.preventDefault();
      e = e || window.event;
      if (e.touches.length > 1) {
        this.start = e.touches;
      } else {
        this.clientX = e.touches[0].pageX;
        this.clientY = e.touches[0].pageY;
      }
      // 添加手指拖动事件
      this.$refs.heImg.ontouchmove = this.moveFuncMobile;
    },
    // 鼠标拖动
    moveFunc(e) {
      e = e || window.event;
      e.preventDefault();
      let movementX = e.clientX - this.clientX;
      let movementY = e.clientY - this.clientY;
      // event.clientY;
      this.imgLeft += movementX * 2;
      this.imgTop += movementY * 2;
      this.clientX = e.clientX;
      this.clientY = e.clientY;
    },
    // 手指拖动
    moveFuncMobile(e) {
      e = e || window.event;
      if (e.touches.length > 1) {
        var now = e.touches;
        var scale = this.getDistance(now[0], now[1]) / this.getDistance(this.start[0], this.start[1]);
        // 判断是否手指缩放过，如果缩放过，要在上次缩放的比例基础上进行缩放
        if (this.mobileScale) {
          if (scale > 1) {
            // 放大
            this.scaleFunc(scale + this.mobileScale - 1, true);
          } else {
            // 缩小
            this.scaleFunc(scale * this.mobileScale, true);
          }
        } else {
          this.scaleFunc(scale, true);
        }
      } else {
        let touch = e.touches[0];
        e.preventDefault();
        let movementX = touch.pageX - this.clientX;
        let movementY = touch.pageY - this.clientY;
        // event.clientY;
        this.imgLeft += movementX * 2;
        this.imgTop += movementY * 2;
        this.clientX = touch.pageX;
        this.clientY = touch.pageY;
      }
    },
    // 移除拖动事件
    removeMove(type) {
      if (type === 'pc') {
        this.$refs.heImg.onmousemove = null;
      } else {
        this.mobileScale = this.imgScale;
        this.$refs.heImg.ontouchmove = null;
      }
    },
    keyHandleDebounce(e) {
      if (this.canRun) {
        // 如果this.canRun为true证明当前可以执行函数
        this.keyHandle(e);
        this.canRun = false; // 执行函数后一段时间内不可再次执行
        setTimeout(() => {
          this.canRun = true; // 等到了我们设定的时间之后，把this.canRun改为true，可以再次执行函数
        }, 300);
      }
    },
    // 键盘事件
    keyHandle(e) {
      e = window.event || e;
      var key = e.keyCode || e.which || e.charCode;
      switch (key) {
        case 27:
          // esc
          this.close({
            way: 'esc'
          });
          break;
        case 65:
          // a键-上一张
          if (this.multiple) {
            this.toogleImg(false, 'key-a');
          }
          break;
        case 68:
          // d键-下一张
          if (this.multiple) {
            this.toogleImg(true, 'key-d');
          }
          break;
        case 87:
          // w键-放大
          this.scaleFunc(0.15);
          break;
        case 83:
          // s键-缩小
          this.scaleFunc(-0.15);
          break;
        case 81:
          // q键-逆时针旋转
          this.rotateFunc(-90);
          break;
        case 69:
          // e键-顺时针旋转
          this.rotateFunc(90);
          break;
        case 82:
          // r键-复位键
          this.initImg();
          break;
      }
    },
    // 点击遮罩层
    clickMask() {
      if (this.clickMaskCLose) {
        this.close({
          way: 'mask'
        });
      }
    },
    //缩放 勾股定理方法-求两点之间的距离
    getDistance(p1, p2) {
      var x = p2.pageX - p1.pageX,
        y = p2.pageY - p1.pageY;
      return Math.sqrt(x * x + y * y);
    },
    /**
     * @description:
     * @param {String} imgsrc
     * @param {*} name
     * @return {*}
     */
    downloadIamge() {
      //下载图片地址和图片名
      let image = new Image();
      // 解决跨域 Canvas 污染问题
      image.setAttribute('crossOrigin', 'anonymous');
      image.onload = function () {
        let canvas = document.createElement('canvas');
        canvas.width = image.width;
        canvas.height = image.height;
        let context = canvas.getContext('2d');
        context.drawImage(image, 0, 0, image.width, image.height);
        let url = canvas.toDataURL('image/png'); //得到图片的base64编码数据
        let a = document.createElement('a'); // 生成一个a元素
        let event = new MouseEvent('click'); // 创建一个单击事件
        a.download = 'photo' + +new Date(); // 设置图片名称
        a.href = url; // 将生成的URL设置为a.href属性
        a.dispatchEvent(event); // 触发a的单击事件
      };
      image.onerror = function (err) {
        console.log('图片信息不正确或图片服务器禁止访问');
        console.log(err);
      };
      if (this.multiple) {
        image.src = this.imgList[this.imgIndex];
      } else {
        image.src = this.url;
      }
    }
  }
};

/* script */
const __vue_script__ = script;

/* template */
var __vue_render__ = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("transition", { attrs: { name: "fade" } }, [
    _vm.visible
      ? _c(
          "div",
          {
            ref: "heImg",
            staticClass: "xml-hevue-imgpreview-wrap",
            attrs: { id: "hevue-imgpreview-wrap" },
            on: {
              mouseup: function ($event) {
                return _vm.removeMove("pc")
              },
              touchend: function ($event) {
                return _vm.removeMove("mobile")
              },
              click: function ($event) {
                $event.stopPropagation();
                return _vm.clickMask.apply(null, arguments)
              },
            },
          },
          [
            _c("div", { staticClass: "he-img-wrap" }, [
              _c("div", { staticClass: "he-control-title" }, [
                _vm._v(_vm._s(_vm.imgTitle)),
              ]),
              _vm._v(" "),
              _c(
                "div",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: _vm.imgState === 1,
                      expression: "imgState === 1",
                    },
                  ],
                  staticClass:
                    "heimgfont hevue-img-status-icon rotate-animation",
                },
                [_vm._v("")]
              ),
              _vm._v(" "),
              _c("img", {
                directives: [
                  {
                    name: "show",
                    rawName: "v-show",
                    value: _vm.imgState === 2,
                    expression: "imgState === 2",
                  },
                ],
                ref: "heImView",
                staticClass: "he-img-view",
                style:
                  "transform: scale(" +
                  _vm.imgScale +
                  ") rotate(" +
                  _vm.imgRotate +
                  "deg);margin-top:" +
                  _vm.imgTop +
                  "px;margin-left:" +
                  _vm.imgLeft +
                  "px;" +
                  _vm.maxWH,
                attrs: { src: _vm.imgurl },
                on: {
                  click: function ($event) {
                    $event.stopPropagation();
                  },
                  mousedown: _vm.addMove,
                  touchstart: _vm.addMoveMobile,
                },
              }),
              _vm._v(" "),
              _c(
                "div",
                {
                  directives: [
                    {
                      name: "show",
                      rawName: "v-show",
                      value: _vm.imgState === 3,
                      expression: "imgState === 3",
                    },
                  ],
                  staticClass: "heimgfont hevue-img-status-icon",
                },
                [_vm._v("")]
              ),
              _vm._v(" "),
              _vm.closeBtn
                ? _c(
                    "div",
                    {
                      staticClass: "heimgfont he-close-icon",
                      on: {
                        click: function ($event) {
                          $event.stopPropagation();
                          return _vm.close({ way: "closeBtn" })
                        },
                      },
                    },
                    [_vm._v("")]
                  )
                : _vm._e(),
              _vm._v(" "),
              _vm.arrowBtn && _vm.multiple && _vm.imgList.length > 1
                ? _c(
                    "div",
                    {
                      staticClass: "arrow arrow-left heimgfont",
                      on: {
                        click: function ($event) {
                          $event.stopPropagation();
                          return _vm.toogleImg(false, "btn")
                        },
                      },
                    },
                    [_vm._v("\n        \n      ")]
                  )
                : _vm._e(),
              _vm._v(" "),
              _vm.arrowBtn && _vm.multiple && _vm.imgList.length > 1
                ? _c(
                    "div",
                    {
                      staticClass: "arrow arrow-right heimgfont",
                      on: {
                        click: function ($event) {
                          $event.stopPropagation();
                          return _vm.toogleImg(true, "btn")
                        },
                      },
                    },
                    [_vm._v("\n        \n      ")]
                  )
                : _vm._e(),
              _vm._v(" "),
              _vm.controlBar
                ? _c("div", { staticClass: "he-control-bar-wrap" }, [
                    _c(
                      "div",
                      {
                        staticClass: "he-control-bar",
                        on: {
                          click: function ($event) {
                            $event.stopPropagation();
                          },
                        },
                      },
                      [
                        _c(
                          "div",
                          {
                            staticClass: "he-control-btn heimgfont",
                            on: {
                              click: function ($event) {
                                $event.stopPropagation();
                                return _vm.scaleFunc(-0.15)
                              },
                            },
                          },
                          [_vm._v("")]
                        ),
                        _vm._v(" "),
                        _c(
                          "div",
                          {
                            staticClass: "he-control-btn heimgfont",
                            on: {
                              click: function ($event) {
                                $event.stopPropagation();
                                return _vm.scaleFunc(0.15)
                              },
                            },
                          },
                          [_vm._v("")]
                        ),
                        _vm._v(" "),
                        _c(
                          "div",
                          {
                            directives: [
                              {
                                name: "show",
                                rawName: "v-show",
                                value: _vm.isFull,
                                expression: "isFull",
                              },
                            ],
                            staticClass: "he-control-btn heimgfont",
                            on: {
                              click: function ($event) {
                                $event.stopPropagation();
                                return _vm.imgToggle.apply(null, arguments)
                              },
                            },
                          },
                          [_vm._v("")]
                        ),
                        _vm._v(" "),
                        _c(
                          "div",
                          {
                            directives: [
                              {
                                name: "show",
                                rawName: "v-show",
                                value: !_vm.isFull,
                                expression: "!isFull",
                              },
                            ],
                            staticClass: "he-control-btn heimgfont",
                            on: {
                              click: function ($event) {
                                $event.stopPropagation();
                                return _vm.imgToggle.apply(null, arguments)
                              },
                            },
                          },
                          [_vm._v("")]
                        ),
                        _vm._v(" "),
                        _c(
                          "div",
                          {
                            staticClass: "he-control-btn heimgfont",
                            on: {
                              click: function ($event) {
                                $event.stopPropagation();
                                return _vm.rotateFunc(-90)
                              },
                            },
                          },
                          [_vm._v("")]
                        ),
                        _vm._v(" "),
                        _c(
                          "div",
                          {
                            staticClass: "he-control-btn heimgfont",
                            on: {
                              click: function ($event) {
                                $event.stopPropagation();
                                return _vm.rotateFunc(90)
                              },
                            },
                          },
                          [_vm._v("")]
                        ),
                      ]
                    ),
                  ])
                : _vm._e(),
            ]),
          ]
        )
      : _vm._e(),
  ])
};
var __vue_staticRenderFns__ = [];
__vue_render__._withStripped = true;

  /* style */
  const __vue_inject_styles__ = undefined;
  /* scoped */
  const __vue_scope_id__ = undefined;
  /* module identifier */
  const __vue_module_identifier__ = undefined;
  /* functional template */
  const __vue_is_functional_template__ = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__ = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
    __vue_inject_styles__,
    __vue_script__,
    __vue_scope_id__,
    __vue_is_functional_template__,
    __vue_module_identifier__,
    false,
    undefined,
    undefined,
    undefined
  );

/*
 * @Author: 贺永胜
 * @Date: 2020-04-22 15:40:42
 * @公众号: 百里青山
 * @LastEditors: 贺永胜
 * @LastEditTime: 2022-07-21 16:21:47
 * @Descripttion: 
 */
const install$1 = async (app, opts = {}) => {
  app.version.split(".")[0];
  // if (vueVersion > 2) {
  //   let {createApp} = await import("vue");
  //   imgApp = createApp(VueToast)
  //   app.config.globalProperties.$hevueImgPreview = ImgPreview;
  // } else {
  // let _vue = await (await import("vue")).default;
  // imgApp = _vue.extend(VueToast)
  // _vue.prototype.$hevueImgPreview = ImgPreview;
  // }    
};
if (typeof window !== "undefined" && window.Vue) {
  install$1(window.Vue);
}

vhCheck();
const publicLibComponents = [Popup];
const components = [__vue_component__$4V, __vue_component__$4S, __vue_component__$4R, __vue_component__$4Q, __vue_component__$4L, __vue_component__$4A, __vue_component__$4z, __vue_component__$4r, __vue_component__$4x,
// XmlVideo,
__vue_component__$4q,
// XmlHotzone,
// XmlLayout,
__vue_component__$2y, __vue_component__$2x, __vue_component__$2w, __vue_component__$2v, __vue_component__$2u, __vue_component__$2t, __vue_component__$2s, __vue_component__$2r, __vue_component__$2q, __vue_component__$2p, __vue_component__$2o, __vue_component__$2n, __vue_component__$2m, __vue_component__$2l, __vue_component__$2k, __vue_component__$4T, __vue_component__$4o, __vue_component__];
const styledComponents = [];
// 多个导出的组件使用AddComponent方法将全部导出添加到components
AddComponent(XmlMusic);
AddComponent(XmlTitle, true);
AddComponent(ImageText, true);
AddComponent(paragraph, true);
AddComponent(splitline, true);
AddComponent(XmlReader);
AddComponent(XmlTitleLibrary, true);
AddComponent(xmlParagraphLibrary, true);
AddComponent(xmlImageTextLibrary, true);
AddComponent(xmlSplitlineLibrary, true);
AddComponent(XmlText, true);
AddComponent(XmlHotzone);
AddComponent(XmlLayout);
AddComponent(XmlVideo, true);
AddComponent(xmlView$1);
const EventBus = new Vue();
let imgApp;
let instance;
let hevueImgPreviewConfig;
const install = async (Vue, options = {}) => {
  // 判断是否安装
  if (install.installed) return;
  install.installed = true;
  components.forEach(component => {
    Vue.component(createNamespace$1(component.name, {
      prefix: options.prefix
    }), component);
    // console.log('xml普通组件注册', component, options, createNamespace(component.name, { prefix: options.prefix }))
  });
  styledComponents.forEach(component => {
    Vue.component(createNamespace$1(component.name, {
      prefix: options.prefix,
      isUnPrefix: true
    }), component);
    // console.log(
    //   'xml样式库组件注册',
    //   component,
    //   options,
    //   createNamespace(component.name, { prefix: options.prefix, isUnPrefix: true })
    // )
  });
  publicLibComponents.forEach(component => {
    Vue.use(component);
  });

  // console.log({ instance: Vue })

  Vue.prototype.$EventBus = EventBus;
  Vue.prototype.$iconfont = options.iconfont || 'iconfont';
  Vue.prototype.$useNamespace = useNamespace;
  hevueImgPreviewConfig = options;
  let _vue = await (await import('vue')).default;
  imgApp = _vue.extend(__vue_component__);
  _vue.prototype.$xmlImgPreview = ImgPreview;
};

// 判断调用vue加载器，实现全局加载
if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue);
}

// 将组件添加到components进行注册
function AddComponent(data, isStyled) {
  Object.keys(data).forEach(key => {
    isStyled ? styledComponents.push(data[key]) : components.push(data[key]);
  });
}
const ImgPreview = (options = {}) => {
  if (typeof options === 'string') {
    options = {
      url: options
    };
  }

  // 优先采取局部配置，其次采取全局配置
  Object.keys(hevueImgPreviewConfig).map(name => {
    if (options[name] == undefined) {
      options[name] = hevueImgPreviewConfig[name];
    }
  });
  instance = new imgApp({
    data: options
  });
  instance.$mount();
  let dom = instance.$el;
  document.body.appendChild(dom);
  instance.show();
  return instance;
};
// Vue.use 和按需加载都可以
var index = {
  install,
  updateElementTheme,
  updateUITheme,
  ...components
};

export { index as default };
