vue-pdf3
Version:
基于Vue3 + vite + PDF.js版的PDF预览插件
2 lines (1 loc) • 2.31 kB
JavaScript
function d(t,n){const e=Object.create(null),o=t.split(",");for(let s=0;s<o.length;s++)e[o[s]]=!0;return n?s=>!!e[s.toLowerCase()]:s=>!!e[s]}const h="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",E=d(h);function P(t){return!!t||t===""}function m(t){if(y(t)){const n={};for(let e=0;e<t.length;e++){const o=t[e],s=r(o)?g(o):m(o);if(s)for(const l in s)n[l]=s[l]}return n}else{if(r(t))return t;if(a(t))return t}}const u=/;(?![^(]*\))/g,b=/:(.+)/;function g(t){const n={};return t.split(u).forEach(e=>{if(e){const o=e.split(b);o.length>1&&(n[o[0].trim()]=o[1].trim())}}),n}function O(t){let n="";if(r(t))n=t;else if(y(t))for(let e=0;e<t.length;e++){const o=O(t[e]);o&&(n+=o+" ")}else if(a(t))for(const e in t)t[e]&&(n+=e+" ");return n.trim()}const R={},T=[],M=()=>{},N=()=>!1,j=/^on[^a-z]/,C=t=>j.test(t),U=t=>t.startsWith("onUpdate:"),V=Object.assign,_=(t,n)=>{const e=t.indexOf(n);e>-1&&t.splice(e,1)},w=Object.prototype.hasOwnProperty,F=(t,n)=>w.call(t,n),y=Array.isArray,x=t=>c(t)==="[object Map]",D=t=>c(t)==="[object Set]",f=t=>typeof t=="function",r=t=>typeof t=="string",L=t=>typeof t=="symbol",a=t=>t!==null&&typeof t=="object",k=t=>a(t)&&f(t.then)&&f(t.catch),S=Object.prototype.toString,c=t=>S.call(t),G=t=>c(t).slice(8,-1),H=t=>c(t)==="[object Object]",I=t=>r(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,K=d(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),i=t=>{const n=Object.create(null);return e=>n[e]||(n[e]=t(e))},A=/-(\w)/g,Y=i(t=>t.replace(A,(n,e)=>e?e.toUpperCase():"")),z=/\B([A-Z])/g,$=i(t=>t.replace(z,"-$1").toLowerCase()),B=i(t=>t.charAt(0).toUpperCase()+t.slice(1)),q=i(t=>t?`on${B(t)}`:""),J=(t,n)=>!Object.is(t,n),W=(t,n)=>{for(let e=0;e<t.length;e++)t[e](n)},Z=(t,n,e)=>{Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value:e})},Q=t=>{const n=parseFloat(t);return isNaN(n)?t:n};let p;const X=()=>p||(p=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});export{N as A,U as B,_ as C,D,T as E,H as F,E as G,P as H,M as N,x as a,I as b,a as c,Z as d,f as e,V as f,L as g,F as h,y as i,J as j,r as k,m as l,d as m,O as n,C as o,X as p,K as q,R as r,W as s,G as t,k as u,Q as v,q as w,Y as x,$ as y,B as z};