nhanh-pure-function 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,7 +63,7 @@ export declare class _Browser_KeyedWindowManager {
63
63
  * paperHeightPx: number; // 纸张总高度(px)
64
64
  * }
65
65
  */
66
- export declare function _Browser_GetPrintableArea(type: PaperType, padding: number): {
66
+ export declare function _Browser_CalculatePrintableArea(type: PaperType, padding: number): {
67
67
  /** 内容宽度(像素) */
68
68
  contentWidth: number;
69
69
  /** 内容高度(像素) */
@@ -89,7 +89,7 @@ export declare const WINDOW_TARGET: readonly ["_self", "_blank", "_parent", "_to
89
89
  /** 浏览器窗口目标类型 */
90
90
  export type WindowTarget = (typeof WINDOW_TARGET)[number];
91
91
  /** 纸张尺寸 */
92
- export declare const PAPER_SIZES: {
92
+ export declare const PAPER_SIZE_DEFINITIONS: {
93
93
  readonly Letter: {
94
94
  readonly width: 215.9;
95
95
  readonly height: 279.4;
@@ -248,9 +248,9 @@ export declare const PAPER_SIZES: {
248
248
  };
249
249
  };
250
250
  /** 纸张尺寸 */
251
- export type PaperType = keyof typeof PAPER_SIZES;
251
+ export type PaperType = keyof typeof PAPER_SIZE_DEFINITIONS;
252
252
  /** 纸张尺寸列表 */
253
- export declare const PAPER_TYPES: {
253
+ export declare const PAPER_SIZE_OPTIONS: {
254
254
  value: string;
255
255
  label: string;
256
256
  }[];
package/dist/index.cjs.js CHANGED
@@ -1,3 +1,3 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".no-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}")),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
2
- "use strict";var ft=Object.defineProperty;var rt=n=>{throw TypeError(n)};var pt=(n,e,t)=>e in n?ft(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var C=(n,e,t)=>pt(n,typeof e!="symbol"?e+"":e,t),ot=(n,e,t)=>e.has(n)||rt("Cannot "+t);var u=(n,e,t)=>(ot(n,e,"read from private field"),t?t.call(n):e.get(n)),f=(n,e,t)=>e.has(n)?rt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),m=(n,e,t,i)=>(ot(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function gt(n,e=500){let t,i=!0;function o(r){if(!i)return;t||(t=r);let a=Math.min((r-t)/e,1);n(a),r-t<e&&requestAnimationFrame(o)}return requestAnimationFrame(o),()=>i=!1}function _t(n,e,t,i,o=2){let r=n,a=!1,s=1,c=n,l=e,h=t;const d=()=>{const x=(l-c)/h;return Number(x.toFixed(o))};let p=d();const y=x=>Math.min(Math.max(x,c),l),_=x=>Number(x.toFixed(o)),P=(x,H,V)=>{const U=[];return x>=H&&U.push("最小值必须小于最大值"),V<=0?U.push("分段数必须为正数"):d()==0&&U.push("数值精度过低,致使动画步长为 0"),U},O=(x,H,V)=>{const U=P(x,H,V);return U.length>0?(console.error(`参数更新失败: ${U.join("; ")}`),!1):(c=x,l=H,h=V,p=d(),r=y(r),!0)},X=()=>{a&&(s=r>=l?-1:r<=c?1:s,r=y(r+p*s),i(_(r)),requestAnimationFrame(X))};return{play(x=r){if(r=y(x),P(c,l,h).length)return console.error("配置参数错误",this.getParams());a||(a=!0,X())},pause(){a=!1},getCurrent:()=>_(r),isPlaying:()=>a,updateParams:O,getParams:()=>({min:c,max:l,steps:h,precision:o,stepSize:p})}}function wt(n,e,t,i,o=2){if(t<=0)return console.error("动画步数 必须为正数");const r=d=>Number(d.toFixed(o)),a=e-n,s=r(Math.abs(a)/t);if(s===0)return console.error("数值精度过低,致使动画步长为 0");const c=Math.sign(a);let l=n;const h=()=>{l=r(l+s*c),(c>0?l<e:l>e)?(i(l),requestAnimationFrame(h)):i(e)};h()}function yt(n,e="image/png"){try{let t,i=e;if(n instanceof File)return URL.createObjectURL(n);if(typeof n=="string"){let r=n;const a=r.match(/^data:([^;]*)(;base64)?,(.*)$/i);if(a){if(!a[2])return console.error("无效的数据 URL:缺少 base64 编码声明");if(i=a[1]||i,r=a[3],!r)return console.error("数据 URL 包含空有效负载")}r=r.replace(/[^A-Za-z0-9+/=]/g,"");const s=atob(r);t=new Uint8Array(s.length);for(let c=0;c<s.length;c++)t[c]=s.charCodeAt(c)}else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof Uint8Array)t=n;else return console.error("不支持的数据类型。应为 Base64 字符串、ArrayBuffer 或 Uint8Array");const o=new Blob([t],{type:i});return URL.createObjectURL(o)}catch(t){return console.error("数据到 ImageURL 的转换失败:",t.message,t.stack||"没有可用的堆栈跟踪"),null}}const xt={".mp3":"audio/mpeg",".mp4":"video/mp4",".m4a":"audio/mp4",".aac":"audio/aac",".ogg":"audio/ogg",".wav":"audio/wav",".flac":"audio/flac",".opus":"audio/opus",".webm":"video/webm",".avi":"video/x-msvideo",".mov":"video/quicktime",".wmv":"video/x-ms-wmv",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".bmp":"image/bmp",".tiff":"image/tiff",".ico":"image/vnd.microsoft.icon",".svg":"image/svg+xml",".webp":"image/webp",".heif":"image/heif",".heic":"image/heic",".json":"application/json",".xml":"application/xml",".html":"text/html",".htm":"text/html",".css":"text/css",".js":"application/javascript",".ts":"application/typescript",".csv":"text/csv",".tsv":"text/tab-separated-values",".txt":"text/plain",".md":"text/markdown",".rtf":"application/rtf",".pdf":"application/pdf",".zip":"application/zip",".rar":"application/x-rar-compressed",".tar":"application/x-tar",".gz":"application/gzip",".7z":"application/x-7z-compressed",".exe":"application/x-msdownload",".apk":"application/vnd.android.package-archive",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".odt":"application/vnd.oasis.opendocument.text",".ods":"application/vnd.oasis.opendocument.spreadsheet",".odp":"application/vnd.oasis.opendocument.presentation",".jsonld":"application/ld+json",".yaml":"application/x-yaml",".yml":"application/x-yaml",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject",".map":"application/json"},tt={image:[".jpg",".jpeg",".png",".gif",".bmp",".webp",".tiff",".svg",".heif",".heic",".ico",".raw",".jfif",".avif",".png8",".indd",".eps",".ai"],ppt:[".ppt",".pptx",".odp"],word:[".doc",".docx",".odt",".rtf"],excel:[".xls",".xlsx",".ods",".csv",".tsv"],pdf:[".pdf"],text:[".txt",".csv",".md",".json",".yaml",".yml",".log",".ini",".rtf"],audio:[".mp3",".wav",".ogg",".flac",".aac",".wma",".m4a",".alac",".ape",".opus",".amr",".ra",".mid",".midi",".aiff",".pcm",".au",".wavpack",".spx"],video:[".mp4",".avi",".mkv",".mov",".wmv",".flv",".webm",".mpg",".mpeg",".3gp",".vob",".ogv",".m4v",".ts",".rm",".rmvb",".m2ts",".divx",".xvid",".swf",".f4v"],archive:[".zip",".rar",".tar",".gz",".bz2",".xz",".7z",".tar.gz",".tar.bz2",".tar.xz",".tar.lz",".tar.lzma",".cab",".iso",".dmg",".tgz",".apk",".gz2",".tar.zst"],code:[".js",".ts",".py",".java",".cpp",".c",".html",".css",".scss",".less",".sass",".php",".rb",".go",".swift",".rs",".kt",".scala",".lua",".pl",".m",".h",".xml",".json",".yaml",".yml",".toml",".vue",".ejs",".handlebars",".jinja",".dart"],font:[".woff",".woff2",".ttf",".otf",".eot",".svg",".ttc",".fnt",".fon",".otc"],database:[".sql",".sqlite",".db",".mdb",".accdb",".jsonld",".xml",".csv"],markup:[".html",".htm",".xhtml",".xml",".json",".yaml",".yml"],configuration:[".ini",".conf",".cfg",".env",".properties",".json",".toml"],logs:[".log",".err",".trace",".out"],script:[".bash",".sh",".zsh",".bat",".ps1",".vbs",".cmd",".sed",".awk",".php"]},st=["","万","亿","兆","京","垓","秭","穰","沟","涧","正","载","极"],at={Letter:{width:215.9,height:279.4},Legal:{width:215.9,height:355.6},Tabloid:{width:279.4,height:431.8},Ledger:{width:431.8,height:279.4},Executive:{width:184.2,height:266.7},Folio:{width:215.9,height:330.2},Quarto:{width:215,height:275},"Government-Letter":{width:203.2,height:266.7},A0:{width:841,height:1189},A1:{width:594,height:841},A2:{width:420,height:594},A3:{width:297,height:420},A4:{width:210,height:297},A5:{width:148,height:210},A6:{width:105,height:148},A7:{width:74,height:105},A8:{width:52,height:74},A9:{width:37,height:52},A10:{width:26,height:37},B0:{width:1e3,height:1414},B1:{width:707,height:1e3},B2:{width:500,height:707},B3:{width:353,height:500},B4:{width:250,height:353},B5:{width:176,height:250},B6:{width:125,height:176},B7:{width:88,height:125},B8:{width:62,height:88},B9:{width:44,height:62},B10:{width:31,height:44},C0:{width:917,height:1297},C1:{width:648,height:917},C2:{width:458,height:648},C3:{width:324,height:458},C4:{width:229,height:324},C5:{width:162,height:229},C6:{width:114,height:162},C7:{width:81,height:114},C8:{width:57,height:81}};Object.keys(at).map(n=>({value:n,label:n}));function bt(n,e=10){let t=0,i=e;function o(){if(i>0)i--,requestAnimationFrame(o);else{const a=(+new Date-t)/e,s=1e3/a;n(Number(s.toFixed(2)),Number(a.toFixed(2)))}}requestAnimationFrame(()=>{t=+new Date,o()})}function vt(n){const e=()=>Promise.resolve(),t=s=>(console.error(s),Promise.reject(s));function i(){return navigator.clipboard.writeText(n).then(e).catch(t)}function o(){const s=document.createElement("div");s.innerText=n,document.body.appendChild(s);const c=document.createRange();c.selectNodeContents(s);const l=window.getSelection();let h=!1;return l&&(l.removeAllRanges(),l.addRange(c),h=document.execCommand("copy")),document.body.removeChild(s),h?Promise.resolve():Promise.reject()}function r(){const s=document.createElement("textarea");s.value=n,document.body.appendChild(s),s.select(),s.setSelectionRange(0,n.length);let c=!1;return document.activeElement===s&&(c=document.execCommand("Copy",!0)),document.body.removeChild(s),c?Promise.resolve():Promise.reject()}function a(){return o().then(e).catch(()=>{r().then(e).catch(()=>t("复制方式尽皆失效"))})}return navigator.clipboard?i().catch(a):a()}class ct{constructor(){}static add(e,t){this.keys.set(e,t)}static open(e,t,i,o){const r=this.keys.get(e);if(r&&!r.closed)return r.focus(),r;{const a=window.open(t,i,o);if(a)return this.keys.set(e,a),a;console.error("window.open failed: 可能是浏览器阻止了弹出窗口"),this.keys.delete(e)}}static isOpen(e){const t=this.keys.get(e);return t!=null&&t.closed&&this.keys.delete(e),this.keys.has(e)}static getWindow(e){if(this.isOpen(e))return this.keys.get(e)}static close(e){const t=this.keys.get(e);t&&(t.close(),this.keys.delete(e))}static closeAll(){this.keys.forEach((e,t)=>e.close()),this.keys.clear()}}C(ct,"keys",new Map);function Et(n,e){const t=at[n];if(!t)throw new Error(`未知纸张类型: ${n}`);const{width:i,height:o}=t,r=_=>_/25.4,s=typeof window<"u"?window.devicePixelRatio*96:300,c=_=>Math.round(r(_)*s),l=c(i),h=c(o),d=c(e),p=Math.max(0,l-2*d),y=Math.max(0,h-2*d);return{contentWidth:p,contentHeight:y,paddingPx:d,paperWidthPx:l,paperHeightPx:h}}function Mt(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Ct(n,e,t=2){return!Number.isFinite(n)||!Number.isFinite(e)||!Number.isFinite(t)?(console.error("所有参数必须是有限的数字"),""):e===0?(console.error("分母不能为零"),""):t<0?(console.error("小数位数不能为负数"),""):(n/e*100).toFixed(t)+"%"}function Ft(n){const t=n.toString().split("."),i=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",");return t.length>1?i+"."+t[1]:i}function Lt(n,e){const t={join:!0,suffix:"",decimalPlaces:2},{join:i,suffix:o,decimalPlaces:r}={...t,...e||{}},a=Number(n);if(isNaN(a))return i?`0${o}`:[0,o];const s=Math.abs(a),c=a>=0,l=Math.max(0,Math.floor(Math.log10(s)/4)),h=Math.pow(1e4,l),d=s/h,p=(c?1:-1)*parseFloat(d.toFixed(Math.max(0,r)));return i?`${p}${st[l]}${o}`:[p,st[l]+o]}function Pt(n){const e=["B","KB","MB","GB","TB","PB"];let t=0;for(;n>1024;)n/=1024,t++;return`${Math.round(n*100)/100} ${e[t]}`}function Tt(n,e="YYYY-MM-DD hh:mm:ss",t=!0){const i=new Date(n);if(isNaN(i.getTime()))return console.error("Invalid date"),"";const o={YYYY:r=>r.getFullYear(),MM:r=>r.getMonth()+1,DD:r=>r.getDate(),hh:r=>r.getHours(),mm:r=>r.getMinutes(),ss:r=>r.getSeconds(),ms:r=>r.getMilliseconds()};return e.replace(/YYYY|MM|DD|hh|mm|ss|ms/g,r=>{const a=o[r](i);return t?String(a).padStart(2,"0"):String(a)})}function G(n,e="file"){if(!n||(n=String(n).trim(),n===""))return e;const t=n.split("/");return t[t.length-1].split("?")[0]}function It(n,e){return n=n.replace(/([^a-zA-Z][a-z])/g,t=>t.toUpperCase()),e?n.replace(/[^a-zA-Z]+/g,""):n}function Ut(n,e,t=","){const i=new RegExp(`(^|${t})${e}(${t}|$)`,"g");return n.replace(i,function(o,r,a){return r===a?t:""})}function At(n){return!(n===null||typeof n!="object"||Array.isArray(n))}function lt(n,e=2){if(Array.isArray(n)&&n.length>=e){for(let i=0;i<n.length;i++)if(typeof n[i]!="number"||!Number.isFinite(n[i]))return!1}else return!1;return!0}function St(n,e=1,t=2){if(Array.isArray(n)&&n.length>=e){for(let o=0;o<n.length;o++)if(!lt(n[o],t))return!1}else return!1;return!0}function Dt(n,e,t){return Math.abs(n-e)<=t}function Rt(n,e){let t=!1;const{x:i,y:o}=n,r=e.length;for(let a=0,s=r-1;a<r;s=a++){const c=e[a].x,l=e[a].y,h=e[s].x,d=e[s].y;l>o!=d>o&&i<(h-c)*(o-l)/(d-l)+c&&(t=!t)}return t}function jt(n,e,t,i){const o=Math.min(n[0],e[0]),r=Math.max(n[0],e[0]),a=Math.min(n[1],e[1]),s=Math.max(n[1],e[1]),c=[[o,a],[r,a],[r,s],[o,s]],l=i[1]-t[1],h=t[0]-i[0],d=i[0]*t[1]-t[0]*i[1];if(l===0&&h===0){const[P,O]=t;return P>=o&&P<=r&&O>=a&&O<=s}const p=1e-10;let y=!1,_=!1;for(const[P,O]of c){const X=l*P+h*O+d;if(Math.abs(X)<p||(X>p?y=!0:_=!0,y&&_))return!0}return y&&_}function Z(n){return Object.prototype.toString.call(n).slice(8,-1).toLowerCase()}function Ot(n){return["https:","wss:","ftps:","sftp:","smpts:","smtp+tls:","imap+tls:","pop3+tls:","rdp:","vpn:"].some(t=>n.startsWith(t))}function kt(n){return new Promise((e,t)=>{if(typeof n!="string"||n.trim()===""||!n.includes("://")){t(new Error("Invalid URL: Must be a non-empty string"));return}try{new XMLHttpRequest().open("HEAD",n,!0)}catch(r){t(new Error(`Invalid URL format: ${r.message}`));return}const i=new XMLHttpRequest;i.open("HEAD",n,!0);const o=r=>{t(new Error(`Request failed: ${r.type}`))};i.onreadystatechange=function(){i.readyState===XMLHttpRequest.DONE&&(i.status===0?t(new Error("Network error or CORS blocked")):i.status>=200&&i.status<300?e(!0):t(new Error(`HTTP Error: ${i.status}`)))},i.onerror=o,i.onabort=o,i.ontimeout=o;try{i.send()}catch(r){t(new Error(`Request send failed: ${r.message}`))}})}const T=class T{constructor(){if(new.target===T)throw new Error("请直接使用静态方法,而不是实例化此类")}static check(e,t){if(!e||typeof e!="string")return console.error("Invalid URL provided"),t?!1:"unknown";const i=G(e).toLowerCase();if(t){if(!tt.hasOwnProperty(t))return console.error(`Unknown file type: ${t}`),"unknown";const o=tt[t];return T._checkExtension(i,o)}return T._detectFileType(i)}static parseAddresses(e){return!e||typeof e!="string"?(console.error("Invalid URL provided"),[]):e.split(",").map(t=>{const i=G(t),o=this.check(t);return{url:t,name:i,type:o}})}static matchesMimeType(e,t){if(!t)return!0;if(typeof e!="string"||typeof t!="string")return!1;const i=T._normalizeType(e),o=t.split(",").map(s=>T._normalizeType(s.trim())),[r,a="*"]=i.split("/");return o.some(s=>{const[c,l="*"]=s.split("/");return(c==="*"||r==="*"||c===r)&&(l==="*"||a==="*"||l===a)})}static _normalizeType(e){return e.startsWith(".")&&!e.includes("/")?xt[e.toLowerCase()]||e:e.includes("/")?e:`${e}/*`}static _checkExtension(e,t){return t.some(i=>e.endsWith(i))}static _detectFileType(e){for(const[t,i]of T.cachedEntries)if(i.some(o=>e.endsWith(o)))return t;return"unknown"}};C(T,"cachedEntries",Object.entries(tt));let et=T;function zt(n){if(typeof n!="function")return console.error("非函数:",n);const e=function(t){t.didTimeout||t.timeRemaining()<=0?requestIdleCallback(e):n()};requestIdleCallback(e)}function Bt(n,e){const t=+new Date;return new Promise((i,o)=>{const r=()=>{if(+new Date-t>=e)return o("超时");if(n())return i("完成");requestIdleCallback(r)};r()})}function nt(n,e,t=[],i=+new Date){if(i<+new Date-50){console.error("_MergeObjects 合并异常:疑似死循环");return}const o=Z(n),r=Z(e);if(o!=r)return e;if(o=="object"||o=="array"){if(t.some(([a,s])=>a==n&&s==e))return n;if(t.push([n,e]),o=="object"){for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const s=e[a],c=n[a],l=nt(c,s,t,i);n[a]=l}return n}else if(o=="array")return e.forEach((a,s)=>{const c=a,l=n[s],h=nt(l,c,t,i);n[s]=h}),n}else return e}function Nt(n=""){return n+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function ut(n,e){let t;return function(...i){clearTimeout(t),t=setTimeout(()=>{n(...i),t=void 0},e)}}function qt(n,e){let t=-1/0;return function(...i){const o=performance.now();if(o-t>e){t=o;try{n(...i)}catch(r){console.error("Throttled function execution failed:",r)}}}}function $t(n,e,t){if(!n||!e)return n;const i=e.split(".");return i.reduce((o,r,a)=>o.hasOwnProperty(r)?o[r]:a===i.length-1?o[r]=t:o[r]={},n)}function Yt(n,e){if(!n||!e)return n;const t=e.split(".");return t.reduce((i,o,r)=>i.hasOwnProperty(o)?i[o]:r==t.length-1?void 0:{},n)}function Wt(n,e,t){if(!n||!e)return n;const i=e.split(".");return i.reduce((o,r,a)=>(a===i.length-1&&(o[r]=t),o.hasOwnProperty(r)?o[r]:o[r]={}),n)}function Xt(n){return n.map((e,t)=>n.slice(t).concat(n.slice(0,t)))}function Ht(n){const e=window.structuredClone,t=(i,o=new WeakMap)=>{const r=i;if(r===null||typeof r!="object")return r;if(o.has(r))return o.get(r);switch(Z(r)){case"array":{const s=[];o.set(r,s);for(const c of r)s.push(t(c,o));return s}case"object":{if(r===null)return r;const s={};o.set(r,s);for(const c in r)Object.prototype.hasOwnProperty.call(r,c)&&(s[c]=t(r[c],o));return s}case"date":{const s=new Date(r.getTime());return o.set(r,s),s}case"regexp":{const s=r,c=new RegExp(s.source,s.flags);return c.lastIndex=s.lastIndex,o.set(r,c),c}case"map":{const s=new Map;return o.set(r,s),r.forEach((c,l)=>{s.set(t(l,o),t(c,o))}),s}case"set":{const s=new Set;return o.set(r,s),r.forEach(c=>{s.add(t(c,o))}),s}case"arraybuffer":case"dataview":case"int8array":case"uint8array":case"uint8clampedarray":case"int16array":case"uint16array":case"int32array":case"uint32array":case"float32array":case"float64array":case"bigint64array":case"biguint64array":{const s=r,c=s.constructor,l=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),h=new c(l,s.byteOffset,s.byteLength/s.BYTES_PER_ELEMENT);return o.set(r,h),h}case"error":{const s=r,c=new s.constructor(s.message);return c.stack=s.stack,c.name=s.name,o.set(r,c),c}case"function":case"promise":case"weakmap":case"weakset":default:return r}};try{return e?e(n):t(n)}catch(i){return console.error("structuredClone error:",i),e&&t(n)}}function Vt(n,e,t=30){if(typeof n!="function")return console.error("第一个参数必须是一个函数。");if(!Array.isArray(e))return console.error("第二个参数必须是一个数组。");let i=[],o=0;const r=(a,s)=>{for(const[c,l]of s)if(a>=c)return l;return"black"};return function(...a){const s=performance.now(),c=n(...a),l=performance.now()-s;i.push(l),i.length>t&&i.shift(),o=i.reduce((p,y)=>p+y,0)/i.length||0;const h=r(l,e),d=r(o,e);return console.log(`%c单次耗时:${l.toFixed(2)}ms
3
- %c平均耗时(${i.length}次):${o.toFixed(2)}ms`,`color: ${h}; padding: 2px 0;`,`color: ${d}; padding: 2px 0;`),c}}function Gt(n){const e=Date.now();let t=performance.now();for(;Date.now()-e<n;){t=Math.sin(t)*1e6,(t>1e6||t<-1e6)&&(t=0);try{const i=t.toString().substring(0,8);history.replaceState(null,"",`#${i}`)}catch{}}return Date.now()-e}function Zt(n){const e=ut(n,100);let t=0,i=0;return function(o){const r=o.target;if(!r||!(r instanceof Element))return;const{scrollTop:a,scrollHeight:s,clientHeight:c,scrollLeft:l,scrollWidth:h,clientWidth:d}=r;function p(){if(t==a)return;const _=t>a;if(t=a,_)return;s-a-c<=1&&e("vertical")}function y(){if(i==l)return;const _=i>l;if(i=l,_)return;h-l-d<=1&&e("horizontal")}p(),y()}}function Kt(n,e,t){const{isClickAllowed:i,uiLibrary:o=["naiveUI","ElementPlus","Element"]}=t||{},r=function(c){const l=[];for(const h in c)Object.hasOwnProperty.call(c,h)&&o.includes(h)&&l.push(...c[h]);return l}({naiveUI:[".v-binder-follower-container",".n-image-preview-container",".n-modal-container"],ElementPlus:[".el-popper"],Element:[".el-popper"]});function a(){e(),document.removeEventListener("mousedown",s)}function s(c){if(i){const d=i(c);if(d)return;if(d===!1)return a()}const l=c.target;if(!(l instanceof Element)||!l.isConnected)return;n.concat(r).some(d=>!!(l!=null&&l.closest(d)))||a()}requestAnimationFrame(()=>document.addEventListener("mousedown",s))}var b,A,S,z,B,F,L,I,N;class Qt{constructor(){f(this,b);f(this,A,!1);f(this,S,{});f(this,z,0);f(this,B,0);f(this,F,0);f(this,L,0);f(this,I);f(this,N)}init(e,t){m(this,b,e),m(this,I,t==null?void 0:t.limit),m(this,N,t==null?void 0:t.dragDom),m(this,S,{mousedown:this.mousedown.bind(this),mousemove:this.mousemove.bind(this),mouseup:this.mouseup.bind(this)}),this.bindOrUnbindEvent("bind")}finish(){this.bindOrUnbindEvent("unbind")}bindOrUnbindEvent(e){const t=e==="bind"?"addEventListener":"removeEventListener";if(!u(this,b))return console.error("No DOM");u(this,b)[t]("mousedown",u(this,S).mousedown),document[t]("mousemove",u(this,S).mousemove),document[t]("mouseup",u(this,S).mouseup)}alterLocation(){if(!u(this,b))return console.error("No DOM");u(this,I)&&(m(this,F,Math.min(u(this,F),u(this,I).max.top)),m(this,F,Math.max(u(this,F),u(this,I).min.top)),m(this,L,Math.min(u(this,L),u(this,I).max.left)),m(this,L,Math.max(u(this,L),u(this,I).min.left))),u(this,b).style.setProperty("--top",u(this,F)+"px"),u(this,b).style.setProperty("--left",u(this,L)+"px")}mousedown(e){if(!u(this,b))return console.error("No DOM");if(u(this,N)&&e.target!=u(this,N))return;document.body.classList.add("no-select"),m(this,A,!0);const t=u(this,b).getBoundingClientRect(),{pageX:i,pageY:o}=e;m(this,z,i),m(this,B,o),m(this,F,t.y),m(this,L,t.x)}mousemove(e){const{pageX:t,pageY:i}=e;u(this,A)&&(m(this,F,u(this,F)+(i-u(this,B))),m(this,L,u(this,L)+(t-u(this,z))),m(this,z,t),m(this,B,i),this.alterLocation())}mouseup(){u(this,A)&&(m(this,A,!1),document.body.classList.remove("no-select"))}}b=new WeakMap,A=new WeakMap,S=new WeakMap,z=new WeakMap,B=new WeakMap,F=new WeakMap,L=new WeakMap,I=new WeakMap,N=new WeakMap;var v,D,R,q,$,E,M,w,Y,W;class Jt{constructor(){f(this,v);f(this,D,!1);f(this,R,{});f(this,q,0);f(this,$,0);f(this,E,0);f(this,M,0);f(this,w);f(this,Y);f(this,W)}init(e,t={}){m(this,v,e),m(this,w,t.limit),m(this,Y,t.update_move),m(this,W,t.update_up),m(this,R,{mousedown:this.mousedown.bind(this),mousemove:this.mousemove.bind(this),mouseup:this.mouseup.bind(this)}),this.bindOrUnbindEvent("bind")}finish(){this.bindOrUnbindEvent("unbind")}bindOrUnbindEvent(e){const t=e==="bind"?"addEventListener":"removeEventListener";if(!u(this,v))return console.error("No DOM");u(this,v)[t]("mousedown",u(this,R).mousedown),document[t]("mousemove",u(this,R).mousemove),document[t]("mouseup",u(this,R).mouseup)}updateValue(){const e={top:u(this,E),left:u(this,M),percentage:{top:0,left:0}};if(u(this,w)){const t=i=>u(this,w)?(e[i]-u(this,w).min[i])/(u(this,w).max[i]-u(this,w).min[i]):0;e.percentage={top:t("top")||0,left:t("left")||0}}return e}alterLocation(){if(!u(this,v))return console.error("No DOM");u(this,w)&&(m(this,E,Math.min(u(this,E),u(this,w).max.top)),m(this,E,Math.max(u(this,E),u(this,w).min.top)),m(this,M,Math.min(u(this,M),u(this,w).max.left)),m(this,M,Math.max(u(this,M),u(this,w).min.left))),u(this,Y)&&u(this,Y).call(this,this.updateValue()),u(this,v).style.setProperty("--top",u(this,E)+"px"),u(this,v).style.setProperty("--left",u(this,M)+"px")}mousedown(e){if(!u(this,v))return console.error("No DOM");document.body.classList.add("no-select"),m(this,D,!0);const t=u(this,v).getBoundingClientRect();m(this,$,t.y),m(this,q,t.x);const{pageX:i,pageY:o}=e;m(this,E,o-u(this,$)),m(this,M,i-u(this,q)),this.alterLocation()}mousemove(e){const{pageX:t,pageY:i}=e;u(this,D)&&(m(this,E,i-u(this,$)),m(this,M,t-u(this,q)),this.alterLocation())}mouseup(){u(this,D)&&(m(this,D,!1),document.body.classList.remove("no-select"),u(this,W)&&u(this,W).call(this,this.updateValue()))}}v=new WeakMap,D=new WeakMap,R=new WeakMap,q=new WeakMap,$=new WeakMap,E=new WeakMap,M=new WeakMap,w=new WeakMap,Y=new WeakMap,W=new WeakMap;function J(n){if(typeof n=="string"){const e=document.querySelector(n);if(!e)throw new Error(`Element "${n}" not found`);return e}else return n||document.documentElement}function ht(n){const e=J(n);return e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():Promise.reject("No Fullscreen API")}function mt(){const n=document;return document.exitFullscreen?document.exitFullscreen():n.mozCancelFullScreen?n.mozCancelFullScreen():n.webkitExitFullscreen?n.webkitExitFullscreen():n.msExitFullscreen?n.msExitFullscreen():Promise.reject("No ExitFullscreen API")}function it(n){const e=J(n),t=document,i=document.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement;return e==i||!n&&window.innerWidth==screen.width&&window.innerHeight==screen.height}function te(n){return n=J(n),function(){it(n)?mt():ht(n)}}function ee(n,e){const t=J(e),i=()=>{n(it(t))};return document.addEventListener("fullscreenchange",i),document.addEventListener("webkitfullscreenchange",i),document.addEventListener("mozfullscreenchange",i),document.addEventListener("MSFullscreenChange",i),i(),()=>{document.removeEventListener("fullscreenchange",i),document.removeEventListener("webkitfullscreenchange",i),document.removeEventListener("mozfullscreenchange",i),document.removeEventListener("MSFullscreenChange",i)}}function ne(n,e){if(typeof n=="number")return n;if(/px/.test(n))return Number(n.replace(/px/,""))||0;const t=document.createElement("div");t.style.width=n,e=e||document.body,e.appendChild(t);const i=t.getBoundingClientRect().width;return e.removeChild(t),i}function ie(n,e){if(!n)return;let t,i;if(typeof e=="string"){const r=document.querySelector(e);if(!r)return;const a=r.getBoundingClientRect();t=a.width,i=a.height}else if(Array.isArray(e))t=e[0],i=e[1];else{const r=e.getBoundingClientRect();t=r.width,i=r.height}const o=t/i;return o>n?[n*i,i]:o<n?[t,t/n]:[t,i]}function re(n,e=5e3){return new Promise((t,i)=>{const o=new Image;o.src=n;const r=setTimeout(()=>{i(new Error("图片加载超时")),o.onload=null,o.onerror=null},e);o.onload=()=>{clearTimeout(r);const a=o.naturalWidth,s=o.naturalHeight,c=a/s;t([o,c])},o.onerror=()=>{clearTimeout(r),i(new Error("图片加载失败"))},o.crossOrigin="Anonymous"})}function oe(n){return new Promise((e,t)=>{fetch(n).then(i=>e(i.text())).catch(i=>{console.error("Error fetching :",i),t(i)})})}function dt(n,e){return new Promise((t,i)=>{try{e=e||G(n,"downloaded_file"),fetch(n).then(o=>(o.ok||i(`文件下载失败,状态码: ${o.status}`),o.blob())).then(o=>{const r=URL.createObjectURL(o),a=document.createElement("a");a.href=r,a.download=decodeURIComponent(e),document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r),t(o)}).catch(i)}catch(o){i(o)}})}function se(n,e,t){if(!t){let r=e.replace(/^[^.]+./,"");r=r==e?"text/plain":"application/"+r,t={type:r}}const i=new Blob(n,t),o=URL.createObjectURL(i);dt(o,e)}const ae=Math.PI/2,K=Math.PI/180,Q=6378137,ce=85.05112878;function le(n,e){const t=Math.max(Math.min(n,180),-180),i=Math.max(Math.min(e,ce),-85.05112878),o=t*K*Q,r=i*K,a=Math.log(Math.tan(Math.PI/4+r/2))*Q;return[o,a]}function ue(n,e){const t=n/Q/K,i=(2*Math.atan(Math.exp(e/Q))-ae)/K;return[t,i]}function he(n,e,t){const[i,o]=n,[r,a]=e,[s,c]=t,l=(s-r)**2+(c-a)**2;if(l===0)return Math.sqrt((i-r)**2+(o-a)**2);let h=((i-r)*(s-r)+(o-a)*(c-a))/l;return h=Math.max(0,Math.min(1,h)),Math.sqrt((i-(r+h*(s-r)))**2+(o-(a+h*(c-a)))**2)}function me(n,e,t,i,o,r=1,a=1){const s=n+t*Math.cos(i)*r,c=e+t*Math.sin(i)*a,l=n+t*Math.cos(o)*r,h=e+t*Math.sin(o)*a;return[[s,c],[l,h]]}function de(n,e,t,i){return Math.hypot(Math.abs(t-n),Math.abs(i-e))}function fe(n,e,t,i){const o=(n+t)/2,r=(e+i)/2;return{x:o,y:r}}function pe(n,e,t,i){const[o,r]=n,[a,s]=e;let c=1/0;if(a!==0){const l=a>0?(t-o)/a:-o/a;l>0&&(c=Math.min(c,l))}if(s!==0){const l=s>0?(i-r)/s:-r/s;l>0&&(c=Math.min(c,l))}return c===1/0?n:[o+a*c,r+s*c]}class k{constructor(e,t){C(this,"resolve");C(this,"reject");this.resolve=e,this.reject=t}run(e){var t,i;return e instanceof Promise?e.then(o=>{var r;return(r=this.resolve)==null||r.call(this),o}).catch(o=>{var r;return(r=this.reject)==null||r.call(this),Promise.reject(o)}):e?(t=this.resolve)==null||t.call(this):(i=this.reject)==null||i.call(this),e}}class ge extends k{constructor(e){super(),this.resolve=e}warning(...e){const t=()=>{var i,o;return(o=(i=j.tips).warning)==null?void 0:o.call(i,...e)};return new k(this.resolve,t)}error(...e){const t=()=>{var i,o;return(o=(i=j.tips).error)==null?void 0:o.call(i,...e)};return new k(this.resolve,t)}}class _e extends k{constructor(e){super(),this.reject=e}info(...e){const t=()=>{var i,o;return(o=(i=j.tips).info)==null?void 0:o.call(i,...e)};return new k(t,this.reject)}success(...e){const t=()=>{var i,o;return(o=(i=j.tips).success)==null?void 0:o.call(i,...e)};return new k(t,this.reject)}}const g=class g{constructor(){if(new.target===g)throw new Error("请直接使用静态方法,而不是实例化此类")}static register(e,t){if(typeof t!="function")return console.error("TipHandler must be a function");g.tips[e]=t}static resolveTip(e){return function(...t){const i=()=>{var o,r;return(r=(o=g.tips)[e])==null?void 0:r.call(o,...t)};return new ge(i)}}static rejectTip(e){return function(...t){const i=()=>{var o,r;return(r=(o=g.tips)[e])==null?void 0:r.call(o,...t)};return new _e(i)}}};C(g,"tips",{info:void 0,success:void 0,warning:void 0,error:void 0}),C(g,"info",g.resolveTip("info")),C(g,"success",g.resolveTip("success")),C(g,"warning",g.rejectTip("warning")),C(g,"error",g.rejectTip("error"));let j=g;exports._Animate_CreateOscillator=_t;exports._Animate_NumericTransition=wt;exports._Animate_Schedule=gt;exports._Blob_ConvertDataToImageUrl=yt;exports._Browser_CopyToClipboard=vt;exports._Browser_GetFrameRate=bt;exports._Browser_GetPrintableArea=Et;exports._Browser_KeyedWindowManager=ct;exports._Element_CalculateCanvasSize=ie;exports._Element_CloseOnOutsideClick=Kt;exports._Element_Drag=Qt;exports._Element_EnterFullscreen=ht;exports._Element_ExitFullscreen=mt;exports._Element_Fullscreen=te;exports._Element_FullscreenObserver=ee;exports._Element_GetOtherSizeInPixels=ne;exports._Element_IsFullscreen=it;exports._Element_LoadImage=re;exports._Element_LocalDrag=Jt;exports._Element_ScrollEndListener=Zt;exports._File_CreateAndDownload=se;exports._File_Download=dt;exports._File_Read=oe;exports._Format_CamelCase=It;exports._Format_CapitalizeFirstLetter=Mt;exports._Format_ExcludeSubstring=Ut;exports._Format_FileSize=Pt;exports._Format_HrefName=G;exports._Format_NumberWithCommas=Ft;exports._Format_NumberWithUnit=Lt;exports._Format_Percentage=Ct;exports._Format_Timestamp=Tt;exports._Math_CalculateDistance2D=de;exports._Math_GetArcPoints=me;exports._Math_GetBoundaryIntersection=pe;exports._Math_GetMidpoint=fe;exports._Math_LngLatToPlane=le;exports._Math_PlaneToLngLat=ue;exports._Math_PointToLineDistance=he;exports._Tip=j;exports._Utility_Clone=Ht;exports._Utility_Debounce=ut;exports._Utility_ExecuteWhenIdle=zt;exports._Utility_GenerateUUID=Nt;exports._Utility_GetTargetByPath=Yt;exports._Utility_InitTargetByPath=$t;exports._Utility_MergeObjects=nt;exports._Utility_RotateList=Xt;exports._Utility_SetTargetByPath=Wt;exports._Utility_Sleep=Gt;exports._Utility_Throttle=qt;exports._Utility_TimeConsumption=Vt;exports._Utility_WaitForCondition=Bt;exports._Valid_CheckConnectionWithXHR=kt;exports._Valid_DataType=Z;exports._Valid_DoesInfiniteLineIntersectRectangle=jt;exports._Valid_FileTypeChecker=et;exports._Valid_Is2DNumberArray=St;exports._Valid_IsInMargin=Dt;exports._Valid_IsNumberArray=lt;exports._Valid_IsObject=At;exports._Valid_IsPointInPolygon=Rt;exports._Valid_IsSecureContext=Ot;
2
+ "use strict";var ft=Object.defineProperty;var rt=n=>{throw TypeError(n)};var pt=(n,e,t)=>e in n?ft(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var C=(n,e,t)=>pt(n,typeof e!="symbol"?e+"":e,t),ot=(n,e,t)=>e.has(n)||rt("Cannot "+t);var u=(n,e,t)=>(ot(n,e,"read from private field"),t?t.call(n):e.get(n)),f=(n,e,t)=>e.has(n)?rt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),m=(n,e,t,i)=>(ot(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function gt(n,e=500){let t,i=!0;function o(r){if(!i)return;t||(t=r);let a=Math.min((r-t)/e,1);n(a),r-t<e&&requestAnimationFrame(o)}return requestAnimationFrame(o),()=>i=!1}function _t(n,e,t,i,o=2){let r=n,a=!1,s=1,c=n,l=e,h=t;const d=()=>{const x=(l-c)/h;return Number(x.toFixed(o))};let p=d();const y=x=>Math.min(Math.max(x,c),l),_=x=>Number(x.toFixed(o)),T=(x,H,V)=>{const U=[];return x>=H&&U.push("最小值必须小于最大值"),V<=0?U.push("分段数必须为正数"):d()==0&&U.push("数值精度过低,致使动画步长为 0"),U},O=(x,H,V)=>{const U=T(x,H,V);return U.length>0?(console.error(`参数更新失败: ${U.join("; ")}`),!1):(c=x,l=H,h=V,p=d(),r=y(r),!0)},X=()=>{a&&(s=r>=l?-1:r<=c?1:s,r=y(r+p*s),i(_(r)),requestAnimationFrame(X))};return{play(x=r){if(r=y(x),T(c,l,h).length)return console.error("配置参数错误",this.getParams());a||(a=!0,X())},pause(){a=!1},getCurrent:()=>_(r),isPlaying:()=>a,updateParams:O,getParams:()=>({min:c,max:l,steps:h,precision:o,stepSize:p})}}function wt(n,e,t,i,o=2){if(t<=0)return console.error("动画步数 必须为正数");const r=d=>Number(d.toFixed(o)),a=e-n,s=r(Math.abs(a)/t);if(s===0)return console.error("数值精度过低,致使动画步长为 0");const c=Math.sign(a);let l=n;const h=()=>{l=r(l+s*c),(c>0?l<e:l>e)?(i(l),requestAnimationFrame(h)):i(e)};h()}function yt(n,e="image/png"){try{let t,i=e;if(n instanceof File)return URL.createObjectURL(n);if(typeof n=="string"){let r=n;const a=r.match(/^data:([^;]*)(;base64)?,(.*)$/i);if(a){if(!a[2])return console.error("无效的数据 URL:缺少 base64 编码声明");if(i=a[1]||i,r=a[3],!r)return console.error("数据 URL 包含空有效负载")}r=r.replace(/[^A-Za-z0-9+/=]/g,"");const s=atob(r);t=new Uint8Array(s.length);for(let c=0;c<s.length;c++)t[c]=s.charCodeAt(c)}else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof Uint8Array)t=n;else return console.error("不支持的数据类型。应为 Base64 字符串、ArrayBuffer 或 Uint8Array");const o=new Blob([t],{type:i});return URL.createObjectURL(o)}catch(t){return console.error("数据到 ImageURL 的转换失败:",t.message,t.stack||"没有可用的堆栈跟踪"),null}}const xt={".mp3":"audio/mpeg",".mp4":"video/mp4",".m4a":"audio/mp4",".aac":"audio/aac",".ogg":"audio/ogg",".wav":"audio/wav",".flac":"audio/flac",".opus":"audio/opus",".webm":"video/webm",".avi":"video/x-msvideo",".mov":"video/quicktime",".wmv":"video/x-ms-wmv",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".bmp":"image/bmp",".tiff":"image/tiff",".ico":"image/vnd.microsoft.icon",".svg":"image/svg+xml",".webp":"image/webp",".heif":"image/heif",".heic":"image/heic",".json":"application/json",".xml":"application/xml",".html":"text/html",".htm":"text/html",".css":"text/css",".js":"application/javascript",".ts":"application/typescript",".csv":"text/csv",".tsv":"text/tab-separated-values",".txt":"text/plain",".md":"text/markdown",".rtf":"application/rtf",".pdf":"application/pdf",".zip":"application/zip",".rar":"application/x-rar-compressed",".tar":"application/x-tar",".gz":"application/gzip",".7z":"application/x-7z-compressed",".exe":"application/x-msdownload",".apk":"application/vnd.android.package-archive",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".odt":"application/vnd.oasis.opendocument.text",".ods":"application/vnd.oasis.opendocument.spreadsheet",".odp":"application/vnd.oasis.opendocument.presentation",".jsonld":"application/ld+json",".yaml":"application/x-yaml",".yml":"application/x-yaml",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject",".map":"application/json"},tt={image:[".jpg",".jpeg",".png",".gif",".bmp",".webp",".tiff",".svg",".heif",".heic",".ico",".raw",".jfif",".avif",".png8",".indd",".eps",".ai"],ppt:[".ppt",".pptx",".odp"],word:[".doc",".docx",".odt",".rtf"],excel:[".xls",".xlsx",".ods",".csv",".tsv"],pdf:[".pdf"],text:[".txt",".csv",".md",".json",".yaml",".yml",".log",".ini",".rtf"],audio:[".mp3",".wav",".ogg",".flac",".aac",".wma",".m4a",".alac",".ape",".opus",".amr",".ra",".mid",".midi",".aiff",".pcm",".au",".wavpack",".spx"],video:[".mp4",".avi",".mkv",".mov",".wmv",".flv",".webm",".mpg",".mpeg",".3gp",".vob",".ogv",".m4v",".ts",".rm",".rmvb",".m2ts",".divx",".xvid",".swf",".f4v"],archive:[".zip",".rar",".tar",".gz",".bz2",".xz",".7z",".tar.gz",".tar.bz2",".tar.xz",".tar.lz",".tar.lzma",".cab",".iso",".dmg",".tgz",".apk",".gz2",".tar.zst"],code:[".js",".ts",".py",".java",".cpp",".c",".html",".css",".scss",".less",".sass",".php",".rb",".go",".swift",".rs",".kt",".scala",".lua",".pl",".m",".h",".xml",".json",".yaml",".yml",".toml",".vue",".ejs",".handlebars",".jinja",".dart"],font:[".woff",".woff2",".ttf",".otf",".eot",".svg",".ttc",".fnt",".fon",".otc"],database:[".sql",".sqlite",".db",".mdb",".accdb",".jsonld",".xml",".csv"],markup:[".html",".htm",".xhtml",".xml",".json",".yaml",".yml"],configuration:[".ini",".conf",".cfg",".env",".properties",".json",".toml"],logs:[".log",".err",".trace",".out"],script:[".bash",".sh",".zsh",".bat",".ps1",".vbs",".cmd",".sed",".awk",".php"]},st=["","万","亿","兆","京","垓","秭","穰","沟","涧","正","载","极"],at={Letter:{width:215.9,height:279.4},Legal:{width:215.9,height:355.6},Tabloid:{width:279.4,height:431.8},Ledger:{width:431.8,height:279.4},Executive:{width:184.2,height:266.7},Folio:{width:215.9,height:330.2},Quarto:{width:215,height:275},"Government-Letter":{width:203.2,height:266.7},A0:{width:841,height:1189},A1:{width:594,height:841},A2:{width:420,height:594},A3:{width:297,height:420},A4:{width:210,height:297},A5:{width:148,height:210},A6:{width:105,height:148},A7:{width:74,height:105},A8:{width:52,height:74},A9:{width:37,height:52},A10:{width:26,height:37},B0:{width:1e3,height:1414},B1:{width:707,height:1e3},B2:{width:500,height:707},B3:{width:353,height:500},B4:{width:250,height:353},B5:{width:176,height:250},B6:{width:125,height:176},B7:{width:88,height:125},B8:{width:62,height:88},B9:{width:44,height:62},B10:{width:31,height:44},C0:{width:917,height:1297},C1:{width:648,height:917},C2:{width:458,height:648},C3:{width:324,height:458},C4:{width:229,height:324},C5:{width:162,height:229},C6:{width:114,height:162},C7:{width:81,height:114},C8:{width:57,height:81}};Object.keys(at).map(n=>({value:n,label:n}));function bt(n,e=10){let t=0,i=e;function o(){if(i>0)i--,requestAnimationFrame(o);else{const a=(+new Date-t)/e,s=1e3/a;n(Number(s.toFixed(2)),Number(a.toFixed(2)))}}requestAnimationFrame(()=>{t=+new Date,o()})}function vt(n){const e=()=>Promise.resolve(),t=s=>(console.error(s),Promise.reject(s));function i(){return navigator.clipboard.writeText(n).then(e).catch(t)}function o(){const s=document.createElement("div");s.innerText=n,document.body.appendChild(s);const c=document.createRange();c.selectNodeContents(s);const l=window.getSelection();let h=!1;return l&&(l.removeAllRanges(),l.addRange(c),h=document.execCommand("copy")),document.body.removeChild(s),h?Promise.resolve():Promise.reject()}function r(){const s=document.createElement("textarea");s.value=n,document.body.appendChild(s),s.select(),s.setSelectionRange(0,n.length);let c=!1;return document.activeElement===s&&(c=document.execCommand("Copy",!0)),document.body.removeChild(s),c?Promise.resolve():Promise.reject()}function a(){return o().then(e).catch(()=>{r().then(e).catch(()=>t("复制方式尽皆失效"))})}return navigator.clipboard?i().catch(a):a()}class ct{constructor(){}static add(e,t){this.keys.set(e,t)}static open(e,t,i,o){const r=this.keys.get(e);if(r&&!r.closed)return r.focus(),r;{const a=window.open(t,i,o);if(a)return this.keys.set(e,a),a;console.error("window.open failed: 可能是浏览器阻止了弹出窗口"),this.keys.delete(e)}}static isOpen(e){const t=this.keys.get(e);return t!=null&&t.closed&&this.keys.delete(e),this.keys.has(e)}static getWindow(e){if(this.isOpen(e))return this.keys.get(e)}static close(e){const t=this.keys.get(e);t&&(t.close(),this.keys.delete(e))}static closeAll(){this.keys.forEach((e,t)=>e.close()),this.keys.clear()}}C(ct,"keys",new Map);function Et(n,e){const t=at[n];if(!t)throw new Error(`未知纸张类型: ${n}`);const{width:i,height:o}=t,r=_=>_/25.4,s=typeof window<"u"?window.devicePixelRatio*96:300,c=_=>Math.round(r(_)*s),l=c(i),h=c(o),d=c(e),p=Math.max(0,l-2*d),y=Math.max(0,h-2*d);return{contentWidth:p,contentHeight:y,paddingPx:d,paperWidthPx:l,paperHeightPx:h}}function Mt(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Ct(n,e,t=2){return!Number.isFinite(n)||!Number.isFinite(e)||!Number.isFinite(t)?(console.error("所有参数必须是有限的数字"),""):e===0?(console.error("分母不能为零"),""):t<0?(console.error("小数位数不能为负数"),""):(n/e*100).toFixed(t)+"%"}function Ft(n){const t=n.toString().split("."),i=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",");return t.length>1?i+"."+t[1]:i}function Lt(n,e){const t={join:!0,suffix:"",decimalPlaces:2},{join:i,suffix:o,decimalPlaces:r}={...t,...e||{}},a=Number(n);if(isNaN(a))return i?`0${o}`:[0,o];const s=Math.abs(a),c=a>=0,l=Math.max(0,Math.floor(Math.log10(s)/4)),h=Math.pow(1e4,l),d=s/h,p=(c?1:-1)*parseFloat(d.toFixed(Math.max(0,r)));return i?`${p}${st[l]}${o}`:[p,st[l]+o]}function Tt(n){const e=["B","KB","MB","GB","TB","PB"];let t=0;for(;n>1024;)n/=1024,t++;return`${Math.round(n*100)/100} ${e[t]}`}function Pt(n,e="YYYY-MM-DD hh:mm:ss",t=!0){const i=new Date(n);if(isNaN(i.getTime()))return console.error("Invalid date"),"";const o={YYYY:r=>r.getFullYear(),MM:r=>r.getMonth()+1,DD:r=>r.getDate(),hh:r=>r.getHours(),mm:r=>r.getMinutes(),ss:r=>r.getSeconds(),ms:r=>r.getMilliseconds()};return e.replace(/YYYY|MM|DD|hh|mm|ss|ms/g,r=>{const a=o[r](i);return t?String(a).padStart(2,"0"):String(a)})}function G(n,e="file"){if(!n||(n=String(n).trim(),n===""))return e;const t=n.split("/");return t[t.length-1].split("?")[0]}function It(n,e){return n=n.replace(/([^a-zA-Z][a-z])/g,t=>t.toUpperCase()),e?n.replace(/[^a-zA-Z]+/g,""):n}function Ut(n,e,t=","){const i=new RegExp(`(^|${t})${e}(${t}|$)`,"g");return n.replace(i,function(o,r,a){return r===a?t:""})}function At(n){return!(n===null||typeof n!="object"||Array.isArray(n))}function lt(n,e=2){if(Array.isArray(n)&&n.length>=e){for(let i=0;i<n.length;i++)if(typeof n[i]!="number"||!Number.isFinite(n[i]))return!1}else return!1;return!0}function St(n,e=1,t=2){if(Array.isArray(n)&&n.length>=e){for(let o=0;o<n.length;o++)if(!lt(n[o],t))return!1}else return!1;return!0}function Dt(n,e,t){return Math.abs(n-e)<=t}function Rt(n,e){let t=!1;const{x:i,y:o}=n,r=e.length;for(let a=0,s=r-1;a<r;s=a++){const c=e[a].x,l=e[a].y,h=e[s].x,d=e[s].y;l>o!=d>o&&i<(h-c)*(o-l)/(d-l)+c&&(t=!t)}return t}function jt(n,e,t,i){const o=Math.min(n[0],e[0]),r=Math.max(n[0],e[0]),a=Math.min(n[1],e[1]),s=Math.max(n[1],e[1]),c=[[o,a],[r,a],[r,s],[o,s]],l=i[1]-t[1],h=t[0]-i[0],d=i[0]*t[1]-t[0]*i[1];if(l===0&&h===0){const[T,O]=t;return T>=o&&T<=r&&O>=a&&O<=s}const p=1e-10;let y=!1,_=!1;for(const[T,O]of c){const X=l*T+h*O+d;if(Math.abs(X)<p||(X>p?y=!0:_=!0,y&&_))return!0}return y&&_}function Z(n){return Object.prototype.toString.call(n).slice(8,-1).toLowerCase()}function Ot(n){return["https:","wss:","ftps:","sftp:","smpts:","smtp+tls:","imap+tls:","pop3+tls:","rdp:","vpn:"].some(t=>n.startsWith(t))}function kt(n){return new Promise((e,t)=>{if(typeof n!="string"||n.trim()===""||!n.includes("://")){t(new Error("Invalid URL: Must be a non-empty string"));return}try{new XMLHttpRequest().open("HEAD",n,!0)}catch(r){t(new Error(`Invalid URL format: ${r.message}`));return}const i=new XMLHttpRequest;i.open("HEAD",n,!0);const o=r=>{t(new Error(`Request failed: ${r.type}`))};i.onreadystatechange=function(){i.readyState===XMLHttpRequest.DONE&&(i.status===0?t(new Error("Network error or CORS blocked")):i.status>=200&&i.status<300?e(!0):t(new Error(`HTTP Error: ${i.status}`)))},i.onerror=o,i.onabort=o,i.ontimeout=o;try{i.send()}catch(r){t(new Error(`Request send failed: ${r.message}`))}})}const P=class P{constructor(){if(new.target===P)throw new Error("请直接使用静态方法,而不是实例化此类")}static check(e,t){if(!e||typeof e!="string")return console.error("Invalid URL provided"),t?!1:"unknown";const i=G(e).toLowerCase();if(t){if(!tt.hasOwnProperty(t))return console.error(`Unknown file type: ${t}`),"unknown";const o=tt[t];return P._checkExtension(i,o)}return P._detectFileType(i)}static parseAddresses(e){return!e||typeof e!="string"?(console.error("Invalid URL provided"),[]):e.split(",").map(t=>{const i=G(t),o=this.check(t);return{url:t,name:i,type:o}})}static matchesMimeType(e,t){if(!t)return!0;if(typeof e!="string"||typeof t!="string")return!1;const i=P._normalizeType(e),o=t.split(",").map(s=>P._normalizeType(s.trim())),[r,a="*"]=i.split("/");return o.some(s=>{const[c,l="*"]=s.split("/");return(c==="*"||r==="*"||c===r)&&(l==="*"||a==="*"||l===a)})}static _normalizeType(e){return e.startsWith(".")&&!e.includes("/")?xt[e.toLowerCase()]||e:e.includes("/")?e:`${e}/*`}static _checkExtension(e,t){return t.some(i=>e.endsWith(i))}static _detectFileType(e){for(const[t,i]of P.cachedEntries)if(i.some(o=>e.endsWith(o)))return t;return"unknown"}};C(P,"cachedEntries",Object.entries(tt));let et=P;function zt(n){if(typeof n!="function")return console.error("非函数:",n);const e=function(t){t.didTimeout||t.timeRemaining()<=0?requestIdleCallback(e):n()};requestIdleCallback(e)}function Nt(n,e){const t=+new Date;return new Promise((i,o)=>{const r=()=>{if(+new Date-t>=e)return o("超时");if(n())return i("完成");requestIdleCallback(r)};r()})}function nt(n,e,t=[],i=+new Date){if(i<+new Date-50){console.error("_MergeObjects 合并异常:疑似死循环");return}const o=Z(n),r=Z(e);if(o!=r)return e;if(o=="object"||o=="array"){if(t.some(([a,s])=>a==n&&s==e))return n;if(t.push([n,e]),o=="object"){for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const s=e[a],c=n[a],l=nt(c,s,t,i);n[a]=l}return n}else if(o=="array")return e.forEach((a,s)=>{const c=a,l=n[s],h=nt(l,c,t,i);n[s]=h}),n}else return e}function Bt(n=""){return n+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function ut(n,e){let t;return function(...i){clearTimeout(t),t=setTimeout(()=>{n(...i),t=void 0},e)}}function qt(n,e){let t=-1/0;return function(...i){const o=performance.now();if(o-t>e){t=o;try{n(...i)}catch(r){console.error("Throttled function execution failed:",r)}}}}function $t(n,e,t){if(!n||!e)return n;const i=e.split(".");return i.reduce((o,r,a)=>o.hasOwnProperty(r)?o[r]:a===i.length-1?o[r]=t:o[r]={},n)}function Yt(n,e){if(!n||!e)return n;const t=e.split(".");return t.reduce((i,o,r)=>i.hasOwnProperty(o)?i[o]:r==t.length-1?void 0:{},n)}function Wt(n,e,t){if(!n||!e)return n;const i=e.split(".");return i.reduce((o,r,a)=>(a===i.length-1&&(o[r]=t),o.hasOwnProperty(r)?o[r]:o[r]={}),n)}function Xt(n){return n.map((e,t)=>n.slice(t).concat(n.slice(0,t)))}function Ht(n){const e=window.structuredClone,t=(i,o=new WeakMap)=>{const r=i;if(r===null||typeof r!="object")return r;if(o.has(r))return o.get(r);switch(Z(r)){case"array":{const s=[];o.set(r,s);for(const c of r)s.push(t(c,o));return s}case"object":{if(r===null)return r;const s={};o.set(r,s);for(const c in r)Object.prototype.hasOwnProperty.call(r,c)&&(s[c]=t(r[c],o));return s}case"date":{const s=new Date(r.getTime());return o.set(r,s),s}case"regexp":{const s=r,c=new RegExp(s.source,s.flags);return c.lastIndex=s.lastIndex,o.set(r,c),c}case"map":{const s=new Map;return o.set(r,s),r.forEach((c,l)=>{s.set(t(l,o),t(c,o))}),s}case"set":{const s=new Set;return o.set(r,s),r.forEach(c=>{s.add(t(c,o))}),s}case"arraybuffer":case"dataview":case"int8array":case"uint8array":case"uint8clampedarray":case"int16array":case"uint16array":case"int32array":case"uint32array":case"float32array":case"float64array":case"bigint64array":case"biguint64array":{const s=r,c=s.constructor,l=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),h=new c(l,s.byteOffset,s.byteLength/s.BYTES_PER_ELEMENT);return o.set(r,h),h}case"error":{const s=r,c=new s.constructor(s.message);return c.stack=s.stack,c.name=s.name,o.set(r,c),c}case"function":case"promise":case"weakmap":case"weakset":default:return r}};try{return e?e(n):t(n)}catch(i){return console.error("structuredClone error:",i),e&&t(n)}}function Vt(n,e,t=30){if(typeof n!="function")return console.error("第一个参数必须是一个函数。");if(!Array.isArray(e))return console.error("第二个参数必须是一个数组。");let i=[],o=0;const r=(a,s)=>{for(const[c,l]of s)if(a>=c)return l;return"black"};return function(...a){const s=performance.now(),c=n(...a),l=performance.now()-s;i.push(l),i.length>t&&i.shift(),o=i.reduce((p,y)=>p+y,0)/i.length||0;const h=r(l,e),d=r(o,e);return console.log(`%c单次耗时:${l.toFixed(2)}ms
3
+ %c平均耗时(${i.length}次):${o.toFixed(2)}ms`,`color: ${h}; padding: 2px 0;`,`color: ${d}; padding: 2px 0;`),c}}function Gt(n){const e=Date.now();let t=performance.now();for(;Date.now()-e<n;){t=Math.sin(t)*1e6,(t>1e6||t<-1e6)&&(t=0);try{const i=t.toString().substring(0,8);history.replaceState(null,"",`#${i}`)}catch{}}return Date.now()-e}function Zt(n){const e=ut(n,100);let t=0,i=0;return function(o){const r=o.target;if(!r||!(r instanceof Element))return;const{scrollTop:a,scrollHeight:s,clientHeight:c,scrollLeft:l,scrollWidth:h,clientWidth:d}=r;function p(){if(t==a)return;const _=t>a;if(t=a,_)return;s-a-c<=1&&e("vertical")}function y(){if(i==l)return;const _=i>l;if(i=l,_)return;h-l-d<=1&&e("horizontal")}p(),y()}}function Kt(n,e,t){const{isClickAllowed:i,uiLibrary:o=["naiveUI","ElementPlus","Element"]}=t||{},r=function(c){const l=[];for(const h in c)Object.hasOwnProperty.call(c,h)&&o.includes(h)&&l.push(...c[h]);return l}({naiveUI:[".v-binder-follower-container",".n-image-preview-container",".n-modal-container"],ElementPlus:[".el-popper"],Element:[".el-popper"]});function a(){e(),document.removeEventListener("mousedown",s)}function s(c){if(i){const d=i(c);if(d)return;if(d===!1)return a()}const l=c.target;if(!(l instanceof Element)||!l.isConnected)return;n.concat(r).some(d=>!!(l!=null&&l.closest(d)))||a()}requestAnimationFrame(()=>document.addEventListener("mousedown",s))}var b,A,S,z,N,F,L,I,B;class Qt{constructor(){f(this,b);f(this,A,!1);f(this,S,{});f(this,z,0);f(this,N,0);f(this,F,0);f(this,L,0);f(this,I);f(this,B)}init(e,t){m(this,b,e),m(this,I,t==null?void 0:t.limit),m(this,B,t==null?void 0:t.dragDom),m(this,S,{mousedown:this.mousedown.bind(this),mousemove:this.mousemove.bind(this),mouseup:this.mouseup.bind(this)}),this.bindOrUnbindEvent("bind")}finish(){this.bindOrUnbindEvent("unbind")}bindOrUnbindEvent(e){const t=e==="bind"?"addEventListener":"removeEventListener";if(!u(this,b))return console.error("No DOM");u(this,b)[t]("mousedown",u(this,S).mousedown),document[t]("mousemove",u(this,S).mousemove),document[t]("mouseup",u(this,S).mouseup)}alterLocation(){if(!u(this,b))return console.error("No DOM");u(this,I)&&(m(this,F,Math.min(u(this,F),u(this,I).max.top)),m(this,F,Math.max(u(this,F),u(this,I).min.top)),m(this,L,Math.min(u(this,L),u(this,I).max.left)),m(this,L,Math.max(u(this,L),u(this,I).min.left))),u(this,b).style.setProperty("--top",u(this,F)+"px"),u(this,b).style.setProperty("--left",u(this,L)+"px")}mousedown(e){if(!u(this,b))return console.error("No DOM");if(u(this,B)&&e.target!=u(this,B))return;document.body.classList.add("no-select"),m(this,A,!0);const t=u(this,b).getBoundingClientRect(),{pageX:i,pageY:o}=e;m(this,z,i),m(this,N,o),m(this,F,t.y),m(this,L,t.x)}mousemove(e){const{pageX:t,pageY:i}=e;u(this,A)&&(m(this,F,u(this,F)+(i-u(this,N))),m(this,L,u(this,L)+(t-u(this,z))),m(this,z,t),m(this,N,i),this.alterLocation())}mouseup(){u(this,A)&&(m(this,A,!1),document.body.classList.remove("no-select"))}}b=new WeakMap,A=new WeakMap,S=new WeakMap,z=new WeakMap,N=new WeakMap,F=new WeakMap,L=new WeakMap,I=new WeakMap,B=new WeakMap;var v,D,R,q,$,E,M,w,Y,W;class Jt{constructor(){f(this,v);f(this,D,!1);f(this,R,{});f(this,q,0);f(this,$,0);f(this,E,0);f(this,M,0);f(this,w);f(this,Y);f(this,W)}init(e,t={}){m(this,v,e),m(this,w,t.limit),m(this,Y,t.update_move),m(this,W,t.update_up),m(this,R,{mousedown:this.mousedown.bind(this),mousemove:this.mousemove.bind(this),mouseup:this.mouseup.bind(this)}),this.bindOrUnbindEvent("bind")}finish(){this.bindOrUnbindEvent("unbind")}bindOrUnbindEvent(e){const t=e==="bind"?"addEventListener":"removeEventListener";if(!u(this,v))return console.error("No DOM");u(this,v)[t]("mousedown",u(this,R).mousedown),document[t]("mousemove",u(this,R).mousemove),document[t]("mouseup",u(this,R).mouseup)}updateValue(){const e={top:u(this,E),left:u(this,M),percentage:{top:0,left:0}};if(u(this,w)){const t=i=>u(this,w)?(e[i]-u(this,w).min[i])/(u(this,w).max[i]-u(this,w).min[i]):0;e.percentage={top:t("top")||0,left:t("left")||0}}return e}alterLocation(){if(!u(this,v))return console.error("No DOM");u(this,w)&&(m(this,E,Math.min(u(this,E),u(this,w).max.top)),m(this,E,Math.max(u(this,E),u(this,w).min.top)),m(this,M,Math.min(u(this,M),u(this,w).max.left)),m(this,M,Math.max(u(this,M),u(this,w).min.left))),u(this,Y)&&u(this,Y).call(this,this.updateValue()),u(this,v).style.setProperty("--top",u(this,E)+"px"),u(this,v).style.setProperty("--left",u(this,M)+"px")}mousedown(e){if(!u(this,v))return console.error("No DOM");document.body.classList.add("no-select"),m(this,D,!0);const t=u(this,v).getBoundingClientRect();m(this,$,t.y),m(this,q,t.x);const{pageX:i,pageY:o}=e;m(this,E,o-u(this,$)),m(this,M,i-u(this,q)),this.alterLocation()}mousemove(e){const{pageX:t,pageY:i}=e;u(this,D)&&(m(this,E,i-u(this,$)),m(this,M,t-u(this,q)),this.alterLocation())}mouseup(){u(this,D)&&(m(this,D,!1),document.body.classList.remove("no-select"),u(this,W)&&u(this,W).call(this,this.updateValue()))}}v=new WeakMap,D=new WeakMap,R=new WeakMap,q=new WeakMap,$=new WeakMap,E=new WeakMap,M=new WeakMap,w=new WeakMap,Y=new WeakMap,W=new WeakMap;function J(n){if(typeof n=="string"){const e=document.querySelector(n);if(!e)throw new Error(`Element "${n}" not found`);return e}else return n||document.documentElement}function ht(n){const e=J(n);return e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():Promise.reject("No Fullscreen API")}function mt(){const n=document;return document.exitFullscreen?document.exitFullscreen():n.mozCancelFullScreen?n.mozCancelFullScreen():n.webkitExitFullscreen?n.webkitExitFullscreen():n.msExitFullscreen?n.msExitFullscreen():Promise.reject("No ExitFullscreen API")}function it(n){const e=J(n),t=document,i=document.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement;return e==i||!n&&window.innerWidth==screen.width&&window.innerHeight==screen.height}function te(n){return n=J(n),function(){it(n)?mt():ht(n)}}function ee(n,e){const t=J(e),i=()=>{n(it(t))};return document.addEventListener("fullscreenchange",i),document.addEventListener("webkitfullscreenchange",i),document.addEventListener("mozfullscreenchange",i),document.addEventListener("MSFullscreenChange",i),i(),()=>{document.removeEventListener("fullscreenchange",i),document.removeEventListener("webkitfullscreenchange",i),document.removeEventListener("mozfullscreenchange",i),document.removeEventListener("MSFullscreenChange",i)}}function ne(n,e){if(typeof n=="number")return n;if(/px/.test(n))return Number(n.replace(/px/,""))||0;const t=document.createElement("div");t.style.width=n,e=e||document.body,e.appendChild(t);const i=t.getBoundingClientRect().width;return e.removeChild(t),i}function ie(n,e){if(!n)return;let t,i;if(typeof e=="string"){const r=document.querySelector(e);if(!r)return;const a=r.getBoundingClientRect();t=a.width,i=a.height}else if(Array.isArray(e))t=e[0],i=e[1];else{const r=e.getBoundingClientRect();t=r.width,i=r.height}const o=t/i;return o>n?[n*i,i]:o<n?[t,t/n]:[t,i]}function re(n,e=5e3){return new Promise((t,i)=>{const o=new Image;o.src=n;const r=setTimeout(()=>{i(new Error("图片加载超时")),o.onload=null,o.onerror=null},e);o.onload=()=>{clearTimeout(r);const a=o.naturalWidth,s=o.naturalHeight,c=a/s;t([o,c])},o.onerror=()=>{clearTimeout(r),i(new Error("图片加载失败"))},o.crossOrigin="Anonymous"})}function oe(n){return new Promise((e,t)=>{fetch(n).then(i=>e(i.text())).catch(i=>{console.error("Error fetching :",i),t(i)})})}function dt(n,e){return new Promise((t,i)=>{try{e=e||G(n,"downloaded_file"),fetch(n).then(o=>(o.ok||i(`文件下载失败,状态码: ${o.status}`),o.blob())).then(o=>{const r=URL.createObjectURL(o),a=document.createElement("a");a.href=r,a.download=decodeURIComponent(e),document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r),t(o)}).catch(i)}catch(o){i(o)}})}function se(n,e,t){if(!t){let r=e.replace(/^[^.]+./,"");r=r==e?"text/plain":"application/"+r,t={type:r}}const i=new Blob(n,t),o=URL.createObjectURL(i);dt(o,e)}const ae=Math.PI/2,K=Math.PI/180,Q=6378137,ce=85.05112878;function le(n,e){const t=Math.max(Math.min(n,180),-180),i=Math.max(Math.min(e,ce),-85.05112878),o=t*K*Q,r=i*K,a=Math.log(Math.tan(Math.PI/4+r/2))*Q;return[o,a]}function ue(n,e){const t=n/Q/K,i=(2*Math.atan(Math.exp(e/Q))-ae)/K;return[t,i]}function he(n,e,t){const[i,o]=n,[r,a]=e,[s,c]=t,l=(s-r)**2+(c-a)**2;if(l===0)return Math.sqrt((i-r)**2+(o-a)**2);let h=((i-r)*(s-r)+(o-a)*(c-a))/l;return h=Math.max(0,Math.min(1,h)),Math.sqrt((i-(r+h*(s-r)))**2+(o-(a+h*(c-a)))**2)}function me(n,e,t,i,o,r=1,a=1){const s=n+t*Math.cos(i)*r,c=e+t*Math.sin(i)*a,l=n+t*Math.cos(o)*r,h=e+t*Math.sin(o)*a;return[[s,c],[l,h]]}function de(n,e,t,i){return Math.hypot(Math.abs(t-n),Math.abs(i-e))}function fe(n,e,t,i){const o=(n+t)/2,r=(e+i)/2;return{x:o,y:r}}function pe(n,e,t,i){const[o,r]=n,[a,s]=e;let c=1/0;if(a!==0){const l=a>0?(t-o)/a:-o/a;l>0&&(c=Math.min(c,l))}if(s!==0){const l=s>0?(i-r)/s:-r/s;l>0&&(c=Math.min(c,l))}return c===1/0?n:[o+a*c,r+s*c]}class k{constructor(e,t){C(this,"resolve");C(this,"reject");this.resolve=e,this.reject=t}run(e){var t,i;return e instanceof Promise?e.then(o=>{var r;return(r=this.resolve)==null||r.call(this),o}).catch(o=>{var r;return(r=this.reject)==null||r.call(this),Promise.reject(o)}):e?(t=this.resolve)==null||t.call(this):(i=this.reject)==null||i.call(this),e}}class ge extends k{constructor(e){super(),this.resolve=e}warning(...e){const t=()=>{var i,o;return(o=(i=j.tips).warning)==null?void 0:o.call(i,...e)};return new k(this.resolve,t)}error(...e){const t=()=>{var i,o;return(o=(i=j.tips).error)==null?void 0:o.call(i,...e)};return new k(this.resolve,t)}}class _e extends k{constructor(e){super(),this.reject=e}info(...e){const t=()=>{var i,o;return(o=(i=j.tips).info)==null?void 0:o.call(i,...e)};return new k(t,this.reject)}success(...e){const t=()=>{var i,o;return(o=(i=j.tips).success)==null?void 0:o.call(i,...e)};return new k(t,this.reject)}}const g=class g{constructor(){if(new.target===g)throw new Error("请直接使用静态方法,而不是实例化此类")}static register(e,t){if(typeof t!="function")return console.error("TipHandler must be a function");g.tips[e]=t}static resolveTip(e){return function(...t){const i=()=>{var o,r;return(r=(o=g.tips)[e])==null?void 0:r.call(o,...t)};return new ge(i)}}static rejectTip(e){return function(...t){const i=()=>{var o,r;return(r=(o=g.tips)[e])==null?void 0:r.call(o,...t)};return new _e(i)}}};C(g,"tips",{info:void 0,success:void 0,warning:void 0,error:void 0}),C(g,"info",g.resolveTip("info")),C(g,"success",g.resolveTip("success")),C(g,"warning",g.rejectTip("warning")),C(g,"error",g.rejectTip("error"));let j=g;exports._Animate_CreateOscillator=_t;exports._Animate_NumericTransition=wt;exports._Animate_Schedule=gt;exports._Blob_ConvertDataToImageUrl=yt;exports._Browser_CalculatePrintableArea=Et;exports._Browser_CopyToClipboard=vt;exports._Browser_GetFrameRate=bt;exports._Browser_KeyedWindowManager=ct;exports._Element_CalculateCanvasSize=ie;exports._Element_CloseOnOutsideClick=Kt;exports._Element_Drag=Qt;exports._Element_EnterFullscreen=ht;exports._Element_ExitFullscreen=mt;exports._Element_Fullscreen=te;exports._Element_FullscreenObserver=ee;exports._Element_GetOtherSizeInPixels=ne;exports._Element_IsFullscreen=it;exports._Element_LoadImage=re;exports._Element_LocalDrag=Jt;exports._Element_ScrollEndListener=Zt;exports._File_CreateAndDownload=se;exports._File_Download=dt;exports._File_Read=oe;exports._Format_CamelCase=It;exports._Format_CapitalizeFirstLetter=Mt;exports._Format_ExcludeSubstring=Ut;exports._Format_FileSize=Tt;exports._Format_HrefName=G;exports._Format_NumberWithCommas=Ft;exports._Format_NumberWithUnit=Lt;exports._Format_Percentage=Ct;exports._Format_Timestamp=Pt;exports._Math_CalculateDistance2D=de;exports._Math_GetArcPoints=me;exports._Math_GetBoundaryIntersection=pe;exports._Math_GetMidpoint=fe;exports._Math_LngLatToPlane=le;exports._Math_PlaneToLngLat=ue;exports._Math_PointToLineDistance=he;exports._Tip=j;exports._Utility_Clone=Ht;exports._Utility_Debounce=ut;exports._Utility_ExecuteWhenIdle=zt;exports._Utility_GenerateUUID=Bt;exports._Utility_GetTargetByPath=Yt;exports._Utility_InitTargetByPath=$t;exports._Utility_MergeObjects=nt;exports._Utility_RotateList=Xt;exports._Utility_SetTargetByPath=Wt;exports._Utility_Sleep=Gt;exports._Utility_Throttle=qt;exports._Utility_TimeConsumption=Vt;exports._Utility_WaitForCondition=Nt;exports._Valid_CheckConnectionWithXHR=kt;exports._Valid_DataType=Z;exports._Valid_DoesInfiniteLineIntersectRectangle=jt;exports._Valid_FileTypeChecker=et;exports._Valid_Is2DNumberArray=St;exports._Valid_IsInMargin=Dt;exports._Valid_IsNumberArray=lt;exports._Valid_IsObject=At;exports._Valid_IsPointInPolygon=Rt;exports._Valid_IsSecureContext=Ot;
package/dist/index.es.js CHANGED
@@ -23,12 +23,12 @@ function Et(n, e, t, i, o = 2) {
23
23
  return Number(v.toFixed(o));
24
24
  };
25
25
  let p = d();
26
- const y = (v) => Math.min(Math.max(v, a), l), w = (v) => Number(v.toFixed(o)), P = (v, W, G) => {
26
+ const y = (v) => Math.min(Math.max(v, a), l), w = (v) => Number(v.toFixed(o)), P = (v, W, V) => {
27
27
  const I = [];
28
- return v >= W && I.push("最小值必须小于最大值"), G <= 0 ? I.push("分段数必须为正数") : d() == 0 && I.push("数值精度过低,致使动画步长为 0"), I;
29
- }, k = (v, W, G) => {
30
- const I = P(v, W, G);
31
- return I.length > 0 ? (console.error(`参数更新失败: ${I.join("; ")}`), !1) : (a = v, l = W, h = G, p = d(), r = y(r), !0);
28
+ return v >= W && I.push("最小值必须小于最大值"), V <= 0 ? I.push("分段数必须为正数") : d() == 0 && I.push("数值精度过低,致使动画步长为 0"), I;
29
+ }, k = (v, W, V) => {
30
+ const I = P(v, W, V);
31
+ return I.length > 0 ? (console.error(`参数更新失败: ${I.join("; ")}`), !1) : (a = v, l = W, h = V, p = d(), r = y(r), !0);
32
32
  }, H = () => {
33
33
  c && (s = r >= l ? -1 : r <= a ? 1 : s, r = y(r + p * s), i(w(r)), requestAnimationFrame(H));
34
34
  };
@@ -411,10 +411,12 @@ const ut = {
411
411
  C7: { width: 81, height: 114 },
412
412
  C8: { width: 57, height: 81 }
413
413
  };
414
- Object.keys(st).map((n) => ({
415
- value: n,
416
- label: n
417
- }));
414
+ Object.keys(st).map(
415
+ (n) => ({
416
+ value: n,
417
+ label: n
418
+ })
419
+ );
418
420
  function Ft(n, e = 10) {
419
421
  let t = 0, i = e;
420
422
  function o() {
@@ -868,12 +870,12 @@ function Wt(n, e) {
868
870
  }
869
871
  };
870
872
  }
871
- function Gt(n, e, t) {
873
+ function Vt(n, e, t) {
872
874
  if (!n || !e) return n;
873
875
  const i = e.split(".");
874
876
  return i.reduce((o, r, c) => o.hasOwnProperty(r) ? o[r] : c === i.length - 1 ? o[r] = t : o[r] = {}, n);
875
877
  }
876
- function Vt(n, e) {
878
+ function Gt(n, e) {
877
879
  if (!n || !e) return n;
878
880
  const t = e.split(".");
879
881
  return t.reduce((i, o, r) => i.hasOwnProperty(o) ? i[o] : r == t.length - 1 ? void 0 : {}, n);
@@ -1288,13 +1290,13 @@ function he(n, e, t) {
1288
1290
  const i = new Blob(n, t), o = URL.createObjectURL(i);
1289
1291
  gt(o, e);
1290
1292
  }
1291
- const wt = Math.PI / 2, V = Math.PI / 180, Z = 6378137, xt = 85.05112878;
1293
+ const wt = Math.PI / 2, G = Math.PI / 180, Z = 6378137, xt = 85.05112878;
1292
1294
  function me(n, e) {
1293
- const t = Math.max(Math.min(n, 180), -180), i = Math.max(Math.min(e, xt), -85.05112878), o = t * V * Z, r = i * V, c = Math.log(Math.tan(Math.PI / 4 + r / 2)) * Z;
1295
+ const t = Math.max(Math.min(n, 180), -180), i = Math.max(Math.min(e, xt), -85.05112878), o = t * G * Z, r = i * G, c = Math.log(Math.tan(Math.PI / 4 + r / 2)) * Z;
1294
1296
  return [o, c];
1295
1297
  }
1296
1298
  function de(n, e) {
1297
- const t = n / Z / V, i = (2 * Math.atan(Math.exp(e / Z)) - wt) / V;
1299
+ const t = n / Z / G, i = (2 * Math.atan(Math.exp(e / Z)) - wt) / G;
1298
1300
  return [t, i];
1299
1301
  }
1300
1302
  function fe(n, e, t) {
@@ -1432,9 +1434,9 @@ export {
1432
1434
  Mt as _Animate_NumericTransition,
1433
1435
  _t as _Animate_Schedule,
1434
1436
  Ct as _Blob_ConvertDataToImageUrl,
1437
+ Pt as _Browser_CalculatePrintableArea,
1435
1438
  Lt as _Browser_CopyToClipboard,
1436
1439
  Ft as _Browser_GetFrameRate,
1437
- Pt as _Browser_GetPrintableArea,
1438
1440
  ht as _Browser_KeyedWindowManager,
1439
1441
  ae as _Element_CalculateCanvasSize,
1440
1442
  ne as _Element_CloseOnOutsideClick,
@@ -1472,8 +1474,8 @@ export {
1472
1474
  dt as _Utility_Debounce,
1473
1475
  Yt as _Utility_ExecuteWhenIdle,
1474
1476
  Ht as _Utility_GenerateUUID,
1475
- Vt as _Utility_GetTargetByPath,
1476
- Gt as _Utility_InitTargetByPath,
1477
+ Gt as _Utility_GetTargetByPath,
1478
+ Vt as _Utility_InitTargetByPath,
1477
1479
  ot as _Utility_MergeObjects,
1478
1480
  Kt as _Utility_RotateList,
1479
1481
  Zt as _Utility_SetTargetByPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhanh-pure-function",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "纯函数工具",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",