/*
* XmlDigitalTeaching v0.0.1
* Copyright ©Tue Jul 23 2024 08:52:25 GMT+0800 (中国标准时间) smile
* Released under the ISC License.
*/
import Vue from 'vue';
import crypto from 'crypto';
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var script$I = {
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(/
]*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 `
-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==";
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__$I = script$I;
var __vue_render__$J = 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__$I = [
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__$J._withStripped = true;
/* style */
const __vue_inject_styles__$I = undefined;
/* scoped */
const __vue_scope_id__$I = "data-v-73d8b7a0";
/* 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__$J, 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
);
const reHtml = str => {
return str ? str.replace(/&((g|l|quo|ldquo|rdquo)t|amp|#39|nbsp);/g, function (m) {
return {
'<': '<',
'&': '&',
'"': '"',
'“': '“',
'”': '”',
'>': '>',
''': "'",
' ': ' '
}[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;
font-size:16px;
font-weight: normal;
font-style: normal;
text-align: left;
text-indent: initial;
// color: #6883FA;
color: #00F;
transition: all 240ms ease-in-out;
cursor: pointer;
}
.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 = `
`;
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
});
}
}
/* istanbul ignore next */
Vue.prototype.$isServer;
/* istanbul ignore next */
const trim$1 = function (string) {
return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
};
/* istanbul ignore next */
function hasClass(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(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(el, clsName)) {
curClass += ' ' + clsName;
}
}
if (!el.classList) {
el.setAttribute('class', curClass);
}
}
/* istanbul ignore next */
function removeClass(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(el, clsName)) {
curClass = curClass.replace(' ' + clsName + ' ', ' ');
}
}
if (!el.classList) {
el.setAttribute('class', trim$1(curClass));
}
}
if (typeof /./ !== 'function' && typeof Int8Array !== 'object' && (Vue.prototype.$isServer || typeof document.childNodes !== 'function')) ;
const isFirefox = function () {
return !Vue.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
};
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(modalDom, 'v-modal');
if (this.modalFade && !hasModal) {
addClass(modalDom, 'v-modal-enter');
}
if (modalClass) {
let classArr = modalClass.trim().split(/\s+/);
classArr.forEach(item => addClass(modalDom, item));
}
setTimeout(() => {
removeClass(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(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(modalDom, 'v-modal-leave');
}
setTimeout(() => {
if (modalStack.length === 0) {
if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
modalDom.style.display = 'none';
PopupManager.modalDom = undefined;
}
removeClass(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();
}
}
});
}
//
isFirefox() ? 'DOMMouseScroll' : 'mousewheel';
/* script */
/* template */
var __vue_render__$I = 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
),
]
),
])
};
__vue_render__$I._withStripped = true;
const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
let poolPtr = rnds8Pool.length;
function rng() {
if (poolPtr > rnds8Pool.length - 16) {
crypto.randomFillSync(rnds8Pool);
poolPtr = 0;
}
return rnds8Pool.slice(poolPtr, poolPtr += 16);
}
var REGEX = /^(?:[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.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(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(rnds);
}
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
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