(function(n,s){if(typeof module=="object"&&module.exports){module.exports=s(n);return}n.UploadPages=s(n),n.document&&n.document.addEventListener("DOMContentLoaded",function(){n.UploadPages.init()})})(typeof globalThis!="undefined"?globalThis:window,function(n){"use strict";var s=n.document,T=4*1024*1024,h={};function m(e){var t=e||{},r=t.ossId;return{ossId:r==null?"":String(r),fileName:t.fileName||t.originalName||"",url:t.url||""}}function U(e,t){return(e||"文件")+(t?" 上传完成":" 上传失败")}function N(){return"resumable"}function R(){return n.GenealogyApi&&n.GenealogyApi.defaultClient}function k(e,t){var r=t&&(t.status||t.code);return!e||!e.getToken||!e.getToken()||Number(r)===401}function I(e,t){return k(e,t)?(e&&e.clearToken&&e.clearToken(),n.NavigationUtil.open("login.html"),!0):!1}function g(e){return Number(e&&(e.status||e.code))===403}function w(e,t){return(t||s).querySelector(e)}function E(e,t){return Array.prototype.slice.call((t||s).querySelectorAll(e))}function v(e,t,r){if(e){if(e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),t&&n.ProfileUI&&n.ProfileUI.setApiState){n.ProfileUI.setApiState(e,t,r);return}e.textContent=r||""}}function x(e){if(n.layui&&n.layui.layer){n.layui.layer.msg(e);return}n.alert&&n.alert(e)}function B(){return n.crypto&&typeof n.crypto.randomUUID=="function"?"pc-"+n.crypto.randomUUID():"pc-"+Date.now()+"-"+Math.random().toString(16).slice(2)}function F(e){var t=new Uint8Array(e),r=[],a;for(a=0;a=t)throw a;r+=1}}async function D(e,t,r){var a=r||{},u=a.chunkSize||T,c=Math.ceil(t.size/u),l=a.hashBlob||A,o=await l(t),i={uploadId:a.uploadId||B(),fileName:t.name,fileMd5:o,totalSize:t.size,totalChunks:c,chunkSize:u,contentType:t.type||"application/octet-stream"},d=await e.initResumableUpload(i),y=Array.isArray(d&&d.uploadedChunks)?d.uploadedChunks.slice():[],z={},b,f;if(d&&d.instant)return m(d);for(b=d&&d.uploadId||i.uploadId,y.forEach(function(p){z[Number(p)]=!0}),a.onProgress&&a.onProgress({uploadedChunks:y.length,totalChunks:c}),f=0;f