bmw-form-render 0.0.314-beta.6 → 0.0.314
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.
- package/dist/{AntiCheating-wNVGoMGD.cjs → AntiCheating-BG3DPuXi.cjs} +1 -1
- package/dist/{AppointConfig-n7t3E9dR.cjs → AppointConfig-CKcO1IVh.cjs} +1 -1
- package/dist/{BasicInputSetting-DD0zudTG.cjs → BasicInputSetting-BRAjmsUA.cjs} +1 -1
- package/dist/{BasicSelectSetting-4uy5R7O8.cjs → BasicSelectSetting-CoW-dsal.cjs} +1 -1
- package/dist/{Button-D39rrHwD.cjs → Button-BXatkcP-.cjs} +1 -1
- package/dist/{ButtonConfig-BaId74qK.cjs → ButtonConfig-wRXMLPL9.cjs} +1 -1
- package/dist/{CacheIcon-DeJMcHBI.cjs → CacheIcon-CulV9_p4.cjs} +1 -1
- package/dist/{Carousel-mzzLuW-c.cjs → Carousel-ClxI06AJ.cjs} +1 -1
- package/dist/{CarouselSetting-DkT0qK7a.cjs → CarouselSetting-Cem0Ny1T.cjs} +1 -1
- package/dist/{CheckEntrySetting-J_Fk--OU.cjs → CheckEntrySetting-GB-59aSP.cjs} +1 -1
- package/dist/{CheckboxRange.vue_vue_type_script_setup_true_lang-CHURRx5e.cjs → CheckboxRange.vue_vue_type_script_setup_true_lang-DHRGTR9W.cjs} +1 -1
- package/dist/{CheckboxSetting-D4a2lHP-.cjs → CheckboxSetting-Dv4WpFP6.cjs} +1 -1
- package/dist/{Choice-GTtmdJUE.cjs → Choice-qy-hijdN.cjs} +1 -1
- package/dist/{ChooseInput-C4JSV2KO.cjs → ChooseInput-BborBkGw.cjs} +1 -1
- package/dist/{Column.vue_vue_type_script_setup_true_lang-BsrAbl3I.cjs → Column.vue_vue_type_script_setup_true_lang-DWSPshNX.cjs} +1 -1
- package/dist/{ColumnNumOption.vue_vue_type_script_setup_true_lang-e36eZhh2.cjs → ColumnNumOption.vue_vue_type_script_setup_true_lang-DgteJy0w.cjs} +1 -1
- package/dist/{CommonRadioSetting-oMHVfrdK.cjs → CommonRadioSetting-BLYrXSfl.cjs} +1 -1
- package/dist/{ConfirmCode-CFvMRgJq.cjs → ConfirmCode-BSFlxBxU.cjs} +1 -1
- package/dist/{ContactUs-B558R1vE.cjs → ContactUs-B3NnHlzg.cjs} +1 -1
- package/dist/{ContactUs-DF1Mnn8-.cjs → ContactUs-CPT64Dp2.cjs} +1 -1
- package/dist/{ContactUsSetting-CjxDCxmo.cjs → ContactUsSetting-B9RYXVC5.cjs} +1 -1
- package/dist/{CrowdManagement-DAIgtCL3.cjs → CrowdManagement-woRi_nfn.cjs} +1 -1
- package/dist/{DataCollectPanel-BVkfrV3O.cjs → DataCollectPanel-Cf6f8sRi.cjs} +1 -1
- package/dist/{DataSubmitPanel-8OYN7JSO.cjs → DataSubmitPanel-Bdr6U5sW.cjs} +1 -1
- package/dist/{DateSetting-Dlvs9VpC.cjs → DateSetting-Cu0IrTIB.cjs} +1 -1
- package/dist/{DynamicTableSetting-D6Q6y04b.cjs → DynamicTableSetting-DkOCPwWJ.cjs} +1 -1
- package/dist/{EduCheckboxSetting-CWoUGPtv.cjs → EduCheckboxSetting-tpFK-1WZ.cjs} +1 -1
- package/dist/{EmailInputSetting-CPDcaT7p.cjs → EmailInputSetting-D7WKKgAF.cjs} +1 -1
- package/dist/{ExamBar-C14LCPXG.cjs → ExamBar-KYCi9o4B.cjs} +1 -1
- package/dist/{FileSetting-DvfVDWR0.cjs → FileSetting-BaWh6BUP.cjs} +1 -1
- package/dist/{FillBlank-DNOKI-3w.cjs → FillBlank-BhJ3Hn4L.cjs} +1 -1
- package/dist/{FormProgress-BmFarFRH.cjs → FormProgress-B7LTCaIV.cjs} +1 -1
- package/dist/{GainConfig-AiHGhwVe.cjs → GainConfig-CWNaVT7B.cjs} +1 -1
- package/dist/{Geolocation-hBpeJPDG.cjs → Geolocation-Cvp-gUlJ.cjs} +1 -1
- package/dist/{IdCardInputSetting-B1SMxpQy.cjs → IdCardInputSetting-CrKZz3W2.cjs} +1 -1
- package/dist/{ImgCard-CFwCFRm8.cjs → ImgCard-UYYypqrq.cjs} +1 -1
- package/dist/{ImgCheckboxSetting-D-huG0Tr.cjs → ImgCheckboxSetting-Ceeu8BKW.cjs} +1 -1
- package/dist/{ImgRadioSetting--LM31_Qr.cjs → ImgRadioSetting-ULCTtWu6.cjs} +1 -1
- package/dist/{ImportantOption.vue_vue_type_script_setup_true_lang-Rk0Gizvb.cjs → ImportantOption.vue_vue_type_script_setup_true_lang-B3W_qkQT.cjs} +1 -1
- package/dist/{Input-BFT3F0KU.cjs → Input-eVq8sK-T.cjs} +1 -1
- package/dist/{InputTimer-DXVWRPHp.cjs → InputTimer-DxIYmKfP.cjs} +1 -1
- package/dist/{LengthRangeOption.vue_vue_type_script_setup_true_lang-BBa9SgzT.cjs → LengthRangeOption.vue_vue_type_script_setup_true_lang-BzMis-T8.cjs} +1 -1
- package/dist/{LocationSetting-Qp70TuWU.cjs → LocationSetting-BZWA-bMt.cjs} +1 -1
- package/dist/{MapNavSetting-CUZEvCEc.cjs → MapNavSetting-BLY1rUQA.cjs} +1 -1
- package/dist/{MapNavigation-DyuZxctr.cjs → MapNavigation-CuNBFeii.cjs} +1 -1
- package/dist/{MessagePush-CDRApvrT.cjs → MessagePush-CFLUolP-.cjs} +1 -1
- package/dist/{MultiSelectSetting-Pk2r8RyI.cjs → MultiSelectSetting-Clz_yswU.cjs} +1 -1
- package/dist/{NumRange-VNADDplA.cjs → NumRange-BxMmnSH2.cjs} +1 -1
- package/dist/{NumberFillBlank-CTrB--UZ.cjs → NumberFillBlank-CH1MhBym.cjs} +1 -1
- package/dist/{NumberInputSetting-zBfrbt77.cjs → NumberInputSetting-DbmHngqr.cjs} +1 -1
- package/dist/{OcrSetting-C1f4zrlU.cjs → OcrSetting-BY_DOe-Z.cjs} +1 -1
- package/dist/{OcrWidget-DwvGrJxf.cjs → OcrWidget-CLs8LU6u.cjs} +1 -1
- package/dist/{OptionRandom.vue_vue_type_script_setup_true_lang-CJFCsW70.cjs → OptionRandom.vue_vue_type_script_setup_true_lang-C5PcEMr_.cjs} +1 -1
- package/dist/{PageHeader-D1IGb0GM.cjs → PageHeader-D7VBZZxL.cjs} +1 -1
- package/dist/{PageHeaderSetting-CgkVbQr-.cjs → PageHeaderSetting-_JfMhCf6.cjs} +1 -1
- package/dist/{Pagination-DxWQ016Y.cjs → Pagination-Dz3Zsq6F.cjs} +1 -1
- package/dist/{PayConfig-CtvsZU29.cjs → PayConfig-DlHXPLoi.cjs} +1 -1
- package/dist/{PayMethod-ByJdmevy.cjs → PayMethod-CbgDRkHw.cjs} +1 -1
- package/dist/{PhoneInputSetting-DL0pVBW_.cjs → PhoneInputSetting-D-glIKHT.cjs} +1 -1
- package/dist/{PlaceholderOption.vue_vue_type_script_setup_true_lang-58T2WbPT.cjs → PlaceholderOption.vue_vue_type_script_setup_true_lang-CozWuR2z.cjs} +1 -1
- package/dist/{PreparePlaceholderOption.vue_vue_type_script_setup_true_lang-1uyXrM9n.cjs → PreparePlaceholderOption.vue_vue_type_script_setup_true_lang-DKQXGYeE.cjs} +1 -1
- package/dist/{PreparerNameSetting-BdhNftQp.cjs → PreparerNameSetting-C73wSLz0.cjs} +1 -1
- package/dist/{PreparerPhoneInputSetting-By1_ZY2x.cjs → PreparerPhoneInputSetting-Cbr5kvLZ.cjs} +1 -1
- package/dist/{PreparerSetting-DUA-0kXS.cjs → PreparerSetting-CGm42u80.cjs} +1 -1
- package/dist/RadioSetting-CZiI4jcL.cjs +1 -0
- package/dist/{RatingSetting-BI7JTcQg.cjs → RatingSetting-6d-wIj9i.cjs} +1 -1
- package/dist/{SearchAndShare-DsQM5piM.cjs → SearchAndShare-DQWRJzgK.cjs} +1 -1
- package/dist/{SetpayModal-CiOXwj3q.cjs → SetpayModal-DAgNUS-3.cjs} +1 -1
- package/dist/{ShareQRCode-DN4Gucnq.cjs → ShareQRCode-CX1gOZI2.cjs} +1 -1
- package/dist/{TableSetting-CypnzOAm.cjs → TableSetting-BkcDzi56.cjs} +1 -1
- package/dist/{TestSettingPanel-CyBYm4s2.cjs → TestSettingPanel-BDa2WUGK.cjs} +1 -1
- package/dist/{ViewVoteRate-TsgDYIIl.cjs → ViewVoteRate-Dj-OcZ_M.cjs} +1 -1
- package/dist/{WatermarkSetting-Cmw-NlPB.cjs → WatermarkSetting-B0aSo5Ty.cjs} +1 -1
- package/dist/bmw-form-render.cjs +1 -1
- package/dist/{index-CSs84aiy.cjs → index-CRPPGSlX.cjs} +1 -1
- package/dist/{index-CSh6zCPQ.cjs → index-CT99e2GX.cjs} +1 -1
- package/dist/index-CftE72_b.cjs +1 -0
- package/dist/{index-C9O3ITRR.cjs → index-DFH3S9RG.cjs} +1 -1
- package/dist/{index-BXmkm6Hy.cjs → index-DI8gv4f0.cjs} +1 -1
- package/dist/{index-6CTmbW7K.cjs → index-DTLmySAQ.cjs} +1 -1
- package/dist/{index-Dh7Ovkkz.cjs → index-Do19pptM.cjs} +1 -1
- package/dist/{index-XuD3jT4W.cjs → index-r7Ww1Z_Z.cjs} +1 -1
- package/dist/{main-CJkDCVt9.cjs → main-DX3b4SJ1.cjs} +3 -3
- package/dist/{style-BT4ULoHQ.cjs → style-Bdir8YVP.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useVipDialog-BFjtiCWO.cjs → useVipDialog-C4TlkxFm.cjs} +1 -1
- package/dist/{vue-quill.esm-bundler-CSIJCiqE.cjs → vue-quill.esm-bundler-BQgFSpLK.cjs} +1 -1
- package/package.json +1 -1
- package/dist/RadioSetting-C-FtFmbD.cjs +0 -1
- package/dist/index-CEOZfRoz.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),n=require("./index-CftE72_b.cjs"),r=require("./PlaceholderOption.vue_vue_type_script_setup_true_lang-CozWuR2z.cjs"),_=require("./ImportantOption.vue_vue_type_script_setup_true_lang-B3W_qkQT.cjs"),o=e.defineComponent({__name:"IdCardInputSetting",setup(u){return(a,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(n.TitleRow),null,{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString((t=e.unref(e.activeWidgetInfo))==null?void 0:t.name)+"设置",1)]}),_:1}),e.createVNode(r._sfc_main),e.createVNode(_._sfc_main)],64))}});exports.default=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),i={class:"option-list"},u={key:0,class:"standard-text"},m=["src"],k={class:"info"},f={class:"label"},p=e.defineComponent({__name:"ImgCard",setup(v){const c=e.inject("answerItem"),s=e.inject("widget"),l=r=>{var n;switch(s.type){case"eduImgRadio":return c.answer===r.value;case"eduImgCheckbox":return console.log("answerItem.answer: ",c.answer),(n=c.answer)==null?void 0:n.some(t=>t===r.value)}return!1},o=r=>{var n,t;if(!e.isShowAnalysis.value)return"";if(s.attrs.scoreType==="single"&&s.attrs.standard.find(a=>a.id===r.value))return"(正确答案)";if(s.attrs.scoreType==="multiple"&&typeof((n=s.attrs.standard.find(a=>a.id===r.value))==null?void 0:n.mark)=="number")return`(${(t=s.attrs.standard.find(a=>a.id===r.value))==null?void 0:t.mark}分)`;if(s.attrs.scoreType==="cumulative"){const a=s.attrs.standard.find(d=>d.id===r.value);if(typeof(a==null?void 0:a.mark)=="number")return`(${a==null?void 0:a.mark}分) (正确答案)`}};return(r,n)=>(e.openBlock(),e.createElementBlock("div",i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s).attrs.list,t=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["option-item",{checked:l(t)}]),key:t.value},[o(t)?(e.openBlock(),e.createElementBlock("div",u,e.toDisplayString(o(t)),1)):e.createCommentVNode("",!0),e.createBaseVNode("img",{src:t.url,alt:"图片选项"},null,8,m),e.createBaseVNode("div",k,[e.unref(s).type==="eduImgRadio"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["radio-icon",{checked:l(t)}])},null,2)):(e.openBlock(),e.createBlock(e.unref(e.ElCheckbox),{key:1,class:"square-icon","model-value":l(t)},null,8,["model-value"])),e.createBaseVNode("span",f,e.toDisplayString(t.label),1)])],2))),128))]))}}),_=e._export_sfc(p,[["__scopeId","data-v-502a3f4e"]]);exports.default=_;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),_=require("./index-CftE72_b.cjs"),n=require("./ColumnNumOption.vue_vue_type_script_setup_true_lang-DgteJy0w.cjs"),r=require("./CheckboxRange.vue_vue_type_script_setup_true_lang-DHRGTR9W.cjs"),o=require("./OptionRandom.vue_vue_type_script_setup_true_lang-C5PcEMr_.cjs"),c=require("./ImportantOption.vue_vue_type_script_setup_true_lang-B3W_qkQT.cjs"),t=require("./ViewVoteRate-Dj-OcZ_M.cjs"),u=e.defineComponent({__name:"ImgCheckboxSetting",setup(i){return(a,s)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(_.TitleRow),null,{default:e.withCtx(()=>[e.createTextVNode("选项设置")]),_:1}),e.createVNode(n._sfc_main),e.createVNode(r._sfc_main),e.createVNode(o._sfc_main),e.createVNode(t.OptionTips),e.createVNode(t._sfc_main),e.createVNode(c._sfc_main)]))}});exports.default=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),n=require("./index-CftE72_b.cjs"),t=require("./ViewVoteRate-Dj-OcZ_M.cjs"),o=e.defineComponent({__name:"ImgRadioSetting",setup(r){return(i,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(n.TitleRow),null,{default:e.withCtx(()=>[e.createTextVNode("选项设置")]),_:1}),e.createVNode(t.OptionTips),e.createVNode(t._sfc_main)]))}});exports.default=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("./main-
|
|
1
|
+
"use strict";const n=require("./main-DX3b4SJ1.cjs"),t=n.defineComponent({__name:"ImportantOption",setup(e){return(_,r)=>null}});exports._sfc_main=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./main-
|
|
1
|
+
"use strict";const e=require("./main-DX3b4SJ1.cjs"),p=require("./index-CftE72_b.cjs"),u={key:0,class:"description"},m=e.defineComponent({__name:"Input",props:e.mergeModels({placeholder:{},maxLength:{},type:{},desc:{},label:{},tips:{},wrap:{type:Boolean},custom:{type:Boolean},is_title:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["blur"],["update:modelValue"]),setup(l,{emit:r}){const n=e.useModel(l,"modelValue"),t=l,s=r;function d(){try{s("blur")}catch{}}return(o,a)=>(e.openBlock(),e.createBlock(p.Row,e.normalizeProps(e.guardReactiveProps(t)),{default:e.withCtx(()=>[t.desc?(e.openBlock(),e.createElementBlock("div",u,e.toDisplayString(t.desc),1)):e.createCommentVNode("",!0),e.createVNode(e.unref(e.ElInput),{type:o.type,modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=c=>n.value=c),maxlength:o.maxLength,placeholder:o.placeholder,onBlur:d},null,8,["type","modelValue","maxlength","placeholder"])]),_:1},16))}}),i=e._export_sfc(m,[["__scopeId","data-v-c3abe453"]]);exports.InputRow=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),w=r=>(e.pushScopeId("data-v-3dc25b3e"),r=r(),e.popScopeId(),r),h=w(()=>e.createBaseVNode("i",{class:"iconfont icon-form-clock"},null,-1)),S={class:"txt"},l=5,T=e.defineComponent({__name:"InputTimer",setup(r){const t=e.ref(performance.now()),c=e.FormSetting.value.test_setting.limit_minutes*60*1e3+t.value,i=()=>{t.value=performance.now(),a=window.setTimeout(i,200)};let a=window.setTimeout(i,200);e.onUnmounted(()=>{window.clearTimeout(a)});const m=e.computed(()=>{const o=c-t.value>0?c-t.value:0,n=Math.floor(o/1e3/60/60).toString().padStart(2,"0"),v=Math.floor(o/1e3/60%60).toString().padStart(2,"0"),_=Math.floor(o/1e3%60).toString().padStart(2,"0");return`${n}:${v}:${_}`}),s=e.computed(()=>t.value>=c),u=e.computed(()=>{if(s.value){const o=t.value-c,n=l*1e3-o;return n>0?Math.floor(n/1e3):0}return l}),d=e.watchEffect(()=>{u.value===0&&(d(),window.clearTimeout(a),document.dispatchEvent(new Event("form-render:autosubmit")))}),p=e.computed(()=>`自动交卷(${u.value})`),f=e.ref(null);return(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createBaseVNode("div",{class:"input-timer",ref_key:"inputTimerRef",ref:f},[h,e.createBaseVNode("span",S,"距结束 "+e.toDisplayString(m.value),1)],512),e.createVNode(e.ConfirmDialog,{"model-value":s.value,title:"限时交卷",content:"考试时间到,系统即将为你自动交卷!","confirm-text":p.value,"confirm-disabled":!0,"show-cancel":!1,width:400,transform:"translate(0px)"},null,8,["model-value","confirm-text"])],64))}}),g=e._export_sfc(T,[["__scopeId","data-v-3dc25b3e"]]);exports.default=g;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("./main-
|
|
1
|
+
"use strict";const t=require("./main-DX3b4SJ1.cjs");require("./index-CftE72_b.cjs");const i=require("./NumRange-BxMmnSH2.cjs"),m=t.defineComponent({__name:"LengthRangeOption",setup(l){const s=t.computed({get:()=>{var e;return((e=t.activeWidgetAttrs.value)==null?void 0:e.minLength)??null},set:e=>{typeof e=="number"?t.setMinLength(Math.abs(e)):t.setMinLength(null)}}),u=t.computed({get:()=>{var e;return((e=t.activeWidgetAttrs.value)==null?void 0:e.maxLength)??null},set:e=>{typeof e=="number"?t.setMaxLength(Math.abs(e)):t.setMaxLength(null)}});return(e,n)=>(t.openBlock(),t.createBlock(t.unref(i.NumRangeRow),{label:"字数限制",min:s.value,"onUpdate:min":n[0]||(n[0]=a=>s.value=a),max:u.value,"onUpdate:max":n[1]||(n[1]=a=>u.value=a)},null,8,["min","max"]))}});exports._sfc_main=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),t={};function c(o,r){return e.openBlock(),e.createElementBlock("div")}const n=e._export_sfc(t,[["render",c]]);exports.default=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),c=require("./index-CftE72_b.cjs"),i=e.defineComponent({__name:"MapNavSetting",setup(d){const o=e.computed({get:()=>e.activeWidgetAttrs.value,set:n=>{e.setMapNavAttrs(e.cloneDeep(n))}}),r=e.ref(!1),u=e.ref([]),s=async n=>{if(!(!n||r.value)){r.value=!0;try{const a=await e.useJSONP(`https://apis.map.qq.com/ws/place/v1/suggestion?key=${e.globalInject.qqMapKey}&keyword=${n}&page_index=1&page_size=8`),{data:t}=a;t!=null&&t.length?u.value=t.map(l=>({lng:l.location.lng,lat:l.location.lat,name:l.title,address:l.address})):u.value=[]}catch(a){console.error(a)}finally{r.value=!1}}};return(n,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(c.TitleRow),null,{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString((t=e.unref(e.activeWidgetInfo))==null?void 0:t.name)+"设置 ",1)]}),_:1}),e.createVNode(e.unref(c.Row),{label:"设置导航地址",wrap:""},{default:e.withCtx(()=>[e.createVNode(e.unref(e.ElSelect),{modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=t=>o.value=t),"value-key":"lng",placeholder:o.value.name,filterable:"",remote:"","remote-method":s,loading:r.value,placement:"bottom-end","fit-input-width":!0},{default:e.withCtx(()=>{var t;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((t=u.value)!=null&&t.length?u.value:[o.value],l=>(e.openBlock(),e.createBlock(e.unref(e.ElOption),{key:`${l.lng}-${l.lat}`,label:l.name+" - "+l.address,value:l},null,8,["label","value"]))),128))]}),_:1},8,["modelValue","placeholder","loading"])]),_:1})],64))}});exports.default=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),l=a=>(e.pushScopeId("data-v-30a53c84"),a=a(),e.popScopeId(),a),d={class:"map-navigation"},p={class:"tit"},m=l(()=>e.createBaseVNode("i",{class:"iconfont icon-form-location"},null,-1)),_=["src"],u=e.defineComponent({__name:"MapNavigation",props:{attrs:{}},setup(a){const o=a,c=e.inject("editable"),n=e.inject("formMode"),i=(t,s)=>`https://apis.map.qq.com/ws/staticmap/v2/?key=${e.globalInject.qqMapKey}¢er=${s},${t}&zoom=16&size=480*180&scale=2`,r=()=>{if(c)return;const t=document.createElement("a");t.href=`https://uri.amap.com/marker?position=${o.attrs.lng},${o.attrs.lat}&name=${o.attrs.name}&src=mypage&coordinate=gaode&callnative=0`,t.target="_blank",t.click()};return(t,s)=>(e.openBlock(),e.createElementBlock("div",d,[e.createVNode(e._sfc_main),e.createVNode(e.ChoosenView,null,{default:e.withCtx(()=>[e.createVNode(e._sfc_main$1),e.createBaseVNode("div",{class:e.normalizeClass(["map-box",{disabled:e.unref(n)==="answer-preview"}]),onClick:r},[e.createBaseVNode("div",p,[m,e.createBaseVNode("span",null,e.toDisplayString(t.attrs.name),1)]),e.createBaseVNode("img",{src:i(t.attrs.lng,t.attrs.lat),alt:""},null,8,_)],2),e.createVNode(e._sfc_main$2)]),_:1})]))}}),f=e._export_sfc(u,[["__scopeId","data-v-30a53c84"]]);exports.default=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),d=l=>(e.pushScopeId("data-v-3c0afbdb"),l=l(),e.popScopeId(),l),r={class:"panel-box"},v=d(()=>e.createBaseVNode("div",{class:"box-title"},"新数据微信自动提醒",-1)),_={class:"box-row"},p={class:"form"},m={class:"box-row"},b=d(()=>e.createBaseVNode("span",{class:"label"}," 提醒模式 ",-1)),f={class:"form"},V={class:"box-row"},B=d(()=>e.createBaseVNode("span",{class:"label"}," 夜间免打扰(晚11点~早7点不提醒) ",-1)),g={class:"form"},h={class:"box-row"},N=e.defineComponent({__name:"MessagePush",setup(l){const n=e.ref(e.FormSetting.value.details.notice_mode),c=e.ref(e.FormSetting.value.details.no_disturb),s=e.computed({get:()=>e.FormSetting.value.details.auto_notice,set:a=>{e.FormSetting.value.details.auto_notice=a,e.updateSetting()}}),u=async()=>{e.FormSetting.value.details.notice_mode=n.value,e.FormSetting.value.details.no_disturb=c.value,await e.updateSetting()&&e.message.success("保存设置成功")},i=a=>{a&&e.globalInject.postCollection("editor_form_set_pushmessage_wechatreminder")};return(a,o)=>(e.openBlock(),e.createElementBlock("section",null,[e.createBaseVNode("div",r,[v,e.createBaseVNode("div",_,[e.createBaseVNode("div",p,[e.createVNode(e.unref(e.ElSwitch),{modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=t=>s.value=t),"active-text":s.value===1?"已开启":"已关闭","active-value":1,"inactive-value":0,onChange:i},null,8,["modelValue","active-text"])])]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("div",m,[b,e.createBaseVNode("div",f,[e.createVNode(e.unref(e.ElSelect),{class:"action-btn-select",modelValue:n.value,"onUpdate:modelValue":o[1]||(o[1]=t=>n.value=t)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(e.noticeModeOptions),t=>(e.openBlock(),e.createBlock(e.unref(e.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])]),e.createBaseVNode("div",V,[B,e.createBaseVNode("div",g,[e.createVNode(e.unref(e.ElSelect),{class:"action-btn-select",modelValue:c.value,"onUpdate:modelValue":o[2]||(o[2]=t=>c.value=t)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(e.noDisturbOptions),t=>(e.openBlock(),e.createBlock(e.unref(e.ElOption),{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])]),e.createBaseVNode("div",h,[e.createVNode(e.unref(e.ElButton),{class:"button",type:"primary",onClick:u},{default:e.withCtx(()=>[e.createTextVNode(" 保存设置 ")]),_:1})])],512),[[e.vShow,s.value===1]])])]))}}),S=e._export_sfc(N,[["__scopeId","data-v-3c0afbdb"]]);exports.default=S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),t=require("./index-CftE72_b.cjs"),n=require("./OptionRandom.vue_vue_type_script_setup_true_lang-C5PcEMr_.cjs"),r=require("./ImportantOption.vue_vue_type_script_setup_true_lang-B3W_qkQT.cjs"),_=e.defineComponent({__name:"MultiSelectSetting",setup(o){return(u,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(t.TitleRow),null,{default:e.withCtx(()=>[e.createTextVNode("选项设置")]),_:1}),e.createVNode(n._sfc_main),e.createVNode(r._sfc_main)],64))}});exports.default=_;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./main-
|
|
1
|
+
"use strict";const e=require("./main-DX3b4SJ1.cjs"),d=require("./index-CftE72_b.cjs"),c={class:"range"},p={class:"text"},v={class:"text"},f=e.defineComponent({__name:"NumRange",props:e.mergeModels({labels:{default:()=>["最少","最多"]},min:{},max:{},label:{},tips:{},wrap:{type:Boolean},custom:{type:Boolean},is_title:{type:Boolean}},{min:{},minModifiers:{},max:{},maxModifiers:{}}),emits:["update:min","update:max"],setup(o){const s=o,a=e.useModel(o,"min"),l=e.useModel(o,"max"),i=e.computed(()=>Math.max(a.value??0,0)),m=()=>{typeof a.value=="number"&&typeof l.value=="number"&&a.value>l.value&&(l.value=a.value)},r=()=>{typeof l.value=="number"&&typeof a.value=="number"&&l.value<a.value&&(a.value=l.value)};return(u,t)=>(e.openBlock(),e.createBlock(d.Row,e.normalizeProps(e.guardReactiveProps(s)),{default:e.withCtx(()=>[e.createBaseVNode("div",c,[e.createBaseVNode("span",p,e.toDisplayString(u.labels[0]),1),e.createVNode(e.unref(e.ElInput),{type:"number",class:"input",min:0,max:l.value,modelValue:a.value,"onUpdate:modelValue":t[0]||(t[0]=n=>a.value=n),modelModifiers:{number:!0},onBlur:m},null,8,["max","modelValue"]),e.createBaseVNode("span",v,e.toDisplayString(u.labels[1]),1),e.createVNode(e.unref(e.ElInput),{type:"number",class:"input",min:i.value,modelValue:l.value,"onUpdate:modelValue":t[1]||(t[1]=n=>l.value=n),modelModifiers:{number:!0},onBlur:r},null,8,["min","modelValue"])])]),_:1},16))}}),x=e._export_sfc(f,[["__scopeId","data-v-aa5668ca"]]);exports.NumRangeRow=x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),n=t=>(e.pushScopeId("data-v-e70842ef"),t=t(),e.popScopeId(),t),a={class:"number-fill-blank"},c=n(()=>e.createBaseVNode("i",{class:"iconfont icon-form-number"},null,-1)),r=n(()=>e.createBaseVNode("div",{style:{height:"20px"}},null,-1)),i={class:"standard"},l=e.defineComponent({__name:"NumberFillBlank",setup(t){const o=e.inject("widget"),s=e.inject("answerItem");return(_,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createBaseVNode("div",a,[c,e.createTextVNode(" "+e.toDisplayString(e.unref(s).answer||" "),1)]),e.unref(e.isShowAnalysis)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[r,e.createBaseVNode("div",i,"正确答案:"+e.toDisplayString(e.unref(o).attrs.standard),1)],64)):e.createCommentVNode("",!0)],64))}}),d=e._export_sfc(l,[["__scopeId","data-v-e70842ef"]]);exports.default=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),i=require("./index-CftE72_b.cjs"),l=require("./PlaceholderOption.vue_vue_type_script_setup_true_lang-CozWuR2z.cjs"),m=require("./NumRange-BxMmnSH2.cjs"),s=require("./ImportantOption.vue_vue_type_script_setup_true_lang-B3W_qkQT.cjs"),c=e.defineComponent({__name:"NumRangeOption",setup(a){const u=e.computed({get:()=>{var t;return((t=e.activeWidgetAttrs.value)==null?void 0:t.min)??null},set:t=>{typeof t=="number"?e.setMinNum(t):e.setMinNum(null)}}),r=e.computed({get:()=>{var t;return((t=e.activeWidgetAttrs.value)==null?void 0:t.max)??null},set:t=>{typeof t=="number"?e.setMaxNum(t):e.setMaxNum(null)}});return(t,n)=>(e.openBlock(),e.createBlock(e.unref(m.NumRangeRow),{label:"输入值",labels:["最小","最大"],min:u.value,"onUpdate:min":n[0]||(n[0]=o=>u.value=o),max:r.value,"onUpdate:max":n[1]||(n[1]=o=>r.value=o)},null,8,["min","max"]))}}),_=e.defineComponent({__name:"NumberInputSetting",setup(a){return(u,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(i.TitleRow),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(e.activeWidgetInfo).name)+"设置",1)]),_:1}),e.createVNode(l._sfc_main),e.createVNode(c),e.createVNode(s._sfc_main)],64))}});exports.default=_;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),p=f=>(e.pushScopeId("data-v-2912e6a5"),f=f(),e.popScopeId(),f),S={class:"ocr-setting"},I={class:"section"},A=p(()=>e.createBaseVNode("div",{class:"section-header"},[e.createBaseVNode("span",{class:"section-title"},"AI识别字段"),e.createBaseVNode("span",{class:"ai-badge"},"AI")],-1)),$={class:"section-body"},U=["onClick"],M={key:1,class:"drag-handle"},T=p(()=>e.createBaseVNode("span",{class:"icon iconfont icon-form-handle-v"},null,-1)),L=[T],W=p(()=>e.createBaseVNode("span",{class:"add-icon"},"+",-1)),D={key:0,class:"subsection-name"},O={class:"section"},R=p(()=>e.createBaseVNode("div",{class:"section-header"},[e.createBaseVNode("span",{class:"section-title"},"图片上传方式")],-1)),z={class:"section-body"},G=e.defineComponent({__name:"OcrSetting",setup(f){const B=/[^a-zA-Z0-9\u4e00-\u9fff\u3400-\u4dbf]/g,m=e.computed(()=>e.activeWidgetAttrs.value),r=e.computed(()=>e.activeWidgetType.value==="customTableOcr"),u=e.computed(()=>{var t;return((t=m.value)==null?void 0:t.sections)||[]}),o=e.reactive({}),c=e.ref([]),v=e.ref();let k=1,h=!1;function g(){return`custom_field_${k++}_${Date.now().toString(36)}`}function y(){if(!r.value)return;const t=u.value[0];if(t&&t.fields.length>0){let l=0;t.fields.forEach(a=>{const s=a.key.match(/^custom_field_(\d+)_/);if(s){const n=parseInt(s[1],10);n>l&&(l=n)}}),k=l+1,c.value=e.lodashExports.cloneDeep(t.fields)}else{k=1;const l={key:g(),label:"",value:"",visible:!0};c.value=[l],o[l.key]=!0,h=!0,d()}}function b(){var t;if(!r.value){const l=(t=m.value)==null?void 0:t.sections;if(!l)return;l.forEach(a=>{a.fields.forEach(s=>{o[s.key]=s.visible!==!1})});return}c.value.forEach(l=>{o[l.key]=l.visible!==!1})}e.watch(()=>e.activeWidgetType.value,()=>{r.value&&y(),b()},{immediate:!0}),e.watch(()=>{var t;return(t=m.value)==null?void 0:t.sections},t=>{r.value&&(h?h=!1:y()),b()},{immediate:!0,deep:!0});const i=e.reactive({camera:!0,gallery:!0});e.watch(()=>{var t;return(t=m.value)==null?void 0:t.allowCamera},t=>{i.camera=t!==!1},{immediate:!0}),e.watch(()=>{var t;return(t=m.value)==null?void 0:t.allowGallery},t=>{i.gallery=t!==!1},{immediate:!0});function d(){const t=e.lodashExports.cloneDeep(u.value),l=c.value.map(a=>({...a,visible:o[a.key]??!0}));t.length>0?t[0].fields=l:t.push({name:"",fields:l}),e.setWidgetAttrs({attr:"sections",value:t})}function C(){if(r.value){d();return}const t=e.lodashExports.cloneDeep(u.value);t.forEach(l=>{l.fields.forEach(a=>{a.visible=o[a.key]??!0})}),e.setWidgetAttrs({attr:"sections",value:t})}function V(t){if(Object.values(o).filter(Boolean).length===0){e.ElMessage.warning("至少保留1个识别字段,否则组件无法使用"),o[t]=!0;return}C()}function E(t){const l=t.label.replace(B,"");l!==t.label&&(t.label=l,e.ElMessage.warning("禁止使用特殊字符,请输入中文/英文/数字")),t.label&&!o[t.key]&&(o[t.key]=!0),N()}function w(t){const l=t.label.trim();if(!l)return;u.value.flatMap(s=>s.fields.filter(n=>n!==t&&n.label.trim()===l)).length>1&&e.ElMessage.warning(`字段名称"${l}"已存在,请更换名称`)}function N(){d()}function F(){const t={key:g(),label:"",value:"",visible:!1};c.value.push(t),o[t.key]=!1,d(),e.nextTick(()=>{var a;const l=(a=v.value)==null?void 0:a.querySelectorAll(".el-input__inner");l!=null&&l.length&&l[l.length-1].focus()})}function x(t){const l=c.value[t];c.value.splice(t,1),delete o[l.key],c.value.length===0&&(o._placeholder=!1),d()}e.watch(r,t=>{t&&e.nextTick(()=>{v.value&&e.Vt(v,c,{handle:".drag-handle",direction:"vertical",animation:150,onEnd(){d()}})})},{immediate:!0});function _(t){const{camera:l,gallery:a}=i;if(!l&&!a){e.ElMessage.warning("至少开启一种上传方式"),t==="allowCamera"?i.camera=!0:i.gallery=!0;return}e.setWidgetAttrs({attr:t,value:t==="allowCamera"?i.camera:i.gallery})}return(t,l)=>(e.openBlock(),e.createElementBlock("div",S,[e.createBaseVNode("div",I,[A,e.createBaseVNode("div",$,[r.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createBaseVNode("div",{ref_key:"fieldListRef",ref:v,class:"custom-fields-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,s)=>(e.openBlock(),e.createElementBlock("div",{key:a.key,class:"custom-field-row"},[e.createVNode(e.unref(e.ElCheckbox),{modelValue:o[a.key],"onUpdate:modelValue":n=>o[a.key]=n,onChange:n=>V(a.key)},null,8,["modelValue","onUpdate:modelValue","onChange"]),e.createVNode(e.unref(e.ElInput),{modelValue:a.label,"onUpdate:modelValue":n=>a.label=n,size:"small",maxlength:"50",placeholder:"请输入需要识别的字段",onInput:n=>E(a),onBlur:n=>w(a)},null,8,["modelValue","onUpdate:modelValue","onInput","onBlur"]),c.value.length>=2?(e.openBlock(),e.createElementBlock("i",{key:0,onClick:n=>x(s),class:"iconfont icon-form-guanbi close-btn"},null,8,U)):e.createCommentVNode("",!0),c.value.length>=2?(e.openBlock(),e.createElementBlock("span",M,L)):e.createCommentVNode("",!0)]))),128))],512),c.value.length<=30?(e.openBlock(),e.createElementBlock("div",{key:0,class:"add-field-btn",onClick:F},[W,e.createTextVNode(" 添加字段 ")])):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(u.value,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.name},[a.name&&u.value.length>1?(e.openBlock(),e.createElementBlock("div",D,e.toDisplayString(a.name),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.fields,s=>(e.openBlock(),e.createBlock(e.unref(e.ElCheckbox),{key:s.key,modelValue:o[s.key],"onUpdate:modelValue":n=>o[s.key]=n,label:s.label,class:"field-checkbox",onChange:n=>V(s.key)},null,8,["modelValue","onUpdate:modelValue","label","onChange"]))),128))],64))),128))])]),e.createBaseVNode("div",O,[R,e.createBaseVNode("div",z,[e.createVNode(e.unref(e.ElCheckbox),{modelValue:i.camera,"onUpdate:modelValue":l[0]||(l[0]=a=>i.camera=a),label:"拍照上传",class:"field-checkbox",onChange:l[1]||(l[1]=a=>_("allowCamera"))},null,8,["modelValue"]),e.createVNode(e.unref(e.ElCheckbox),{modelValue:i.gallery,"onUpdate:modelValue":l[2]||(l[2]=a=>i.gallery=a),label:"从相册选择",class:"field-checkbox",onChange:l[3]||(l[3]=a=>_("allowGallery"))},null,8,["modelValue"])])])]))}}),j=e._export_sfc(G,[["__scopeId","data-v-2912e6a5"]]);exports.default=j;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./main-CJkDCVt9.cjs"),ve=r=>(f.pushScopeId("data-v-908bdd1c"),r=r(),f.popScopeId(),r),Le={class:"ocr-uploader"},Te={class:"upload-buttons"},Re=ve(()=>f.createBaseVNode("div",{class:"btn-content"},[f.createBaseVNode("span",{class:"icon iconfont icon-form-camera btn-icon"}),f.createBaseVNode("span",{class:"btn-text"},"拍照上传")],-1)),Pe=[Re],De=ve(()=>f.createBaseVNode("div",{class:"btn-content"},[f.createBaseVNode("span",{class:"icon iconfont icon-form-photo-album btn-icon"}),f.createBaseVNode("span",{class:"btn-text"},"从相册选择")],-1)),je=[De],Me=f.defineComponent({__name:"OcrUploader",props:{allowCamera:{type:Boolean},allowGallery:{type:Boolean}},emits:["upload"],setup(r,{emit:n}){const e=r,o=n,i=f.inject("editable"),t=f.ref(),l=f.ref(),p=f.computed(()=>e.allowCamera&&e.allowGallery);f.onMounted(async()=>{if(navigator.userAgent.toLowerCase().includes("micromessenger"))try{const{data:k}=await f.globalInject.$axios.get(`/v1/wxAccount/getWxSign?q=${window.btoa(JSON.stringify({url:window.location.href}))}`);wx.config({debug:!1,appId:k.result.appId,timestamp:k.result.timestamp,nonceStr:k.result.nonceStr,signature:k.result.signature,jsApiList:["chooseImage","getLocalImgData"]}),wx.ready(()=>{console.log("[OcrUploader] wx.ready")}),wx.error(S=>{console.warn("[OcrUploader] wx.config 失败:",S)})}catch{}});function v(C){try{const k=C.split(",");if(k.length<2)return null;const S=k[0].match(/:(.*?);/),A=(S==null?void 0:S[1])||"image/jpeg",x=atob(k[1]),g=x.length,y=new Uint8Array(g);for(let u=0;u<g;u++)y[u]=x.charCodeAt(u);return new File([y],`ocr_${Date.now()}.jpg`,{type:A})}catch{return null}}function a(C){wx.chooseImage({count:1,sizeType:["compressed"],sourceType:C==="camera"?["camera"]:["album"],success(k){const S=k.localIds[0];wx.getLocalImgData({localId:S,success(A){let x=A.localData;x.indexOf("jgp")>-1&&x.indexOf("jpeg")===-1&&(x=x.replace(/\bjgp\b/g,"jpeg")),x.indexOf("data:image")!==0&&(x="data:image/jpeg;base64,"+x);const g=v(x);if(!g){f.ElMessage.error("图片处理失败,请重试");return}if(g.size>10*1024*1024){f.ElMessage.error("图片大小不能超过10MB");return}o("upload",g)},fail(){f.ElMessage.error("获取图片数据失败,请重试")}})},fail(){}})}async function h(C){var S,A;if(i)return;if(await f.isWxMiniProgram()){a(C);return}C==="camera"?(S=l.value)==null||S.click():(A=t.value)==null||A.click()}function m(C){var x;const k=C.target,S=(x=k.files)==null?void 0:x[0];if(!S)return;if(!["image/jpeg","image/png"].includes(S.type)){f.ElMessage.error("请上传JPG/PNG格式的图片"),k.value="";return}if(S.size>10*1024*1024){f.ElMessage.error("图片大小不能超过10MB"),k.value="";return}o("upload",S),k.value=""}return(C,k)=>(f.openBlock(),f.createElementBlock("div",Le,[f.createBaseVNode("div",Te,[C.allowCamera!==!1?(f.openBlock(),f.createElementBlock("div",{key:0,class:f.normalizeClass(["upload-btn",{"single-button":!p.value}]),onClick:k[0]||(k[0]=S=>h("camera"))},Pe,2)):f.createCommentVNode("",!0),C.allowGallery!==!1?(f.openBlock(),f.createElementBlock("div",{key:1,class:f.normalizeClass(["upload-btn",{"single-button":!p.value}]),onClick:k[1]||(k[1]=S=>h("gallery"))},je,2)):f.createCommentVNode("",!0)]),f.createBaseVNode("input",{ref_key:"galleryInput",ref:t,type:"file",accept:".jpg,.jpeg,.png",style:{display:"none"},onChange:k[2]||(k[2]=S=>m(S))},null,544),f.createBaseVNode("input",{ref_key:"cameraInput",ref:l,type:"file",accept:".jpg,.jpeg,.png",capture:"environment",style:{display:"none"},onChange:k[3]||(k[3]=S=>m(S))},null,544)]))}}),Ve=f._export_sfc(Me,[["__scopeId","data-v-908bdd1c"]]),$e={key:0,class:"section-header"},He={class:"section-body"},qe={class:"field-cell-pair"},Ne={class:"field-label"},Ge={class:"field-value"},Ke=["onBlur"],Xe={key:1,class:"value-text"},We={key:0,class:"section-header"},Je={class:"section-body"},Ze={class:"field-label field-label-editor"},Ye={class:"field-value"},Qe=["onBlur"],et={key:1,class:"value-text"},tt=f.defineComponent({__name:"OcrResultTable",props:{sections:{},ocrData:{},canEdit:{type:Boolean},ocrType:{},isLanding:{type:Boolean}},emits:["update:field"],setup(r,{emit:n}){const e=n;function o(i,t){const l=t.target;e("update:field",i,l.innerText||"")}return(i,t)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["ocr-result-table",{"landing-layout":i.isLanding}])},[i.isLanding?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(i.sections,(l,p)=>(f.openBlock(),f.createElementBlock("div",{key:p,class:"section-table"},[i.sections.length>1&&l.name?(f.openBlock(),f.createElementBlock("div",$e,f.toDisplayString(l.name),1)):f.createCommentVNode("",!0),f.createBaseVNode("div",He,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(l.fields,v=>(f.openBlock(),f.createElementBlock("div",{key:v.key,class:"field-row-pair"},[f.createBaseVNode("div",qe,[f.createBaseVNode("div",Ne,f.toDisplayString(v.label),1),f.createBaseVNode("div",Ge,[i.canEdit?(f.openBlock(),f.createElementBlock("div",{key:0,class:"value-input",contenteditable:"",onBlur:a=>o(v.key,a),onKeydown:t[0]||(t[0]=f.withKeys(f.withModifiers(a=>a.target.blur(),["prevent"]),["enter"]))},f.toDisplayString(i.ocrData[v.key]||""),41,Ke)):(f.openBlock(),f.createElementBlock("span",Xe,f.toDisplayString(i.ocrData[v.key]||""),1))])])]))),128))])]))),128)):(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:1},f.renderList(i.sections,(l,p)=>(f.openBlock(),f.createElementBlock("div",{key:p,class:"section-table"},[i.sections.length>1&&l.name?(f.openBlock(),f.createElementBlock("div",We,f.toDisplayString(l.name),1)):f.createCommentVNode("",!0),f.createBaseVNode("div",Je,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(l.fields,v=>(f.openBlock(),f.createElementBlock("div",{class:"field-row",key:v.key},[f.createBaseVNode("div",Ze,f.toDisplayString(v.label),1),f.createBaseVNode("div",Ye,[i.canEdit?(f.openBlock(),f.createElementBlock("div",{key:0,class:"value-input",contenteditable:"",onBlur:a=>o(v.key,a),onKeydown:t[1]||(t[1]=f.withKeys(f.withModifiers(a=>a.target.blur(),["prevent"]),["enter"]))},f.toDisplayString(i.ocrData[v.key]||""),41,Qe)):(f.openBlock(),f.createElementBlock("span",et,f.toDisplayString(i.ocrData[v.key]||""),1))])]))),128))])]))),128))],2))}}),nt=f._export_sfc(tt,[["__scopeId","data-v-ff268045"]]);async function rt(r){const{url:n,keys:e,eacb:o}=r,t=(await f.globalInject.$axios.post("/v2/form/ocrRecognize",{eacb:o,url:n,keys:e})).data;if(t.status!==1)throw new Error(t.msg||"OCR 识别失败");const l=t.result;if(!Array.isArray(l)||l.length===0)throw new Error("OCR 识别返回空数据");const p={};for(const{key:v,value:a}of l)v&&(p[v]=a??"");return{fields:p}}var me=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),B;(function(r){r.InvalidFile="InvalidFile",r.InvalidToken="InvalidToken",r.InvalidMetadata="InvalidMetadata",r.InvalidChunkSize="InvalidChunkSize",r.InvalidCustomVars="InvalidCustomVars",r.NotAvailableUploadHost="NotAvailableUploadHost",r.ReadCacheFailed="ReadCacheFailed",r.InvalidCacheData="InvalidCacheData",r.WriteCacheFailed="WriteCacheFailed",r.RemoveCacheFailed="RemoveCacheFailed",r.GetCanvasContextFailed="GetCanvasContextFailed",r.UnsupportedFileType="UnsupportedFileType",r.FileReaderReadFailed="FileReaderReadFailed",r.NotAvailableXMLHttpRequest="NotAvailableXMLHttpRequest",r.InvalidProgressEventTarget="InvalidProgressEventTarget",r.RequestError="RequestError"})(B||(B={}));var E=function(){function r(n,e){this.name=n,this.message=e,this.stack=new Error().stack}return r}(),G=function(r){me(n,r);function n(e,o,i,t){var l=r.call(this,B.RequestError,i)||this;return l.code=e,l.reqId=o,l.isRequestError=!0,l.data=t,l}return n}(E),it=function(r){me(n,r);function n(e,o){return o===void 0&&(o=""),r.call(this,0,o,e)||this}return n}(G),ot=function(){function r(n,e){this.runTask=n,this.limit=e,this.aborted=!1,this.queue=[],this.processing=[]}return r.prototype.enqueue=function(n){var e=this;return new Promise(function(o,i){e.queue.push({task:n,resolve:o,reject:i}),e.check()})},r.prototype.run=function(n){var e=this;this.queue=this.queue.filter(function(o){return o!==n}),this.processing.push(n),this.runTask(n.task).then(function(){e.processing=e.processing.filter(function(o){return o!==n}),n.resolve(),e.check()},function(o){return n.reject(o)})},r.prototype.check=function(){var n=this;if(!this.aborted){var e=this.processing.length,o=this.limit-e;this.queue.slice(0,o).forEach(function(i){n.run(i)})}},r.prototype.abort=function(){this.queue=[],this.aborted=!0},r}(),at=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),q=function(){return q=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},q.apply(this,arguments)},st=function(){function r(){this.closed=!1}return r.prototype.unsubscribe=function(){this.closed||(this.closed=!0,this._unsubscribe&&this._unsubscribe())},r.prototype.add=function(n){this._unsubscribe=n},r}(),ut=function(r){at(n,r);function n(e,o,i){var t=r.call(this)||this;return t.isStopped=!1,e&&typeof e=="object"?t.destination=e:t.destination=q(q(q({},e&&{next:e}),o&&{error:o}),i&&{complete:i}),t}return n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this))},n.prototype.next=function(e){!this.isStopped&&this.destination.next&&this.destination.next(e)},n.prototype.error=function(e){!this.isStopped&&this.destination.error&&(this.isStopped=!0,this.destination.error(e))},n.prototype.complete=function(e){!this.isStopped&&this.destination.complete&&(this.isStopped=!0,this.destination.complete(e))},n}(st),lt=function(){function r(n){this._subscribe=n}return r.prototype.subscribe=function(n,e,o){var i=new ut(n,e,o);return i.add(this._subscribe(i)),i},r}();function ct(r){if(r===null||typeof r>"u")return"";var n=r+"",e="",o,i,t=0;o=i=0,t=n.length;for(var l=0;l<t;l++){var p=n.charCodeAt(l),v=null;if(p<128)i++;else if(p>127&&p<2048)v=String.fromCharCode(p>>6|192,p&63|128);else if((p&63488^55296)>0)v=String.fromCharCode(p>>12|224,p>>6&63|128,p&63|128);else{if((p&64512^55296)>0)throw new RangeError("Unmatched trail surrogate at "+l);var a=n.charCodeAt(++l);if((a&64512^56320)>0)throw new RangeError("Unmatched lead surrogate at "+(l-1));p=((p&1023)<<10)+(a&1023)+65536,v=String.fromCharCode(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}v!==null&&(i>o&&(e+=n.slice(o,i)),e+=v,o=i=l+1)}return i>o&&(e+=n.slice(o,t)),e}function ft(r){var n=[],e=0,o=0,i=0;for(r+="";e<r.length;){o=r.charCodeAt(e)&255,i=0,o<=191?(o=o&127,i=1):o<=223?(o=o&31,i=2):o<=239?(o=o&15,i=3):(o=o&7,i=4);for(var t=1;t<i;++t)o=o<<6|r.charCodeAt(t+e)&63;i===4?(o-=65536,n.push(String.fromCharCode(55296|o>>10&1023)),n.push(String.fromCharCode(56320|o&1023))):n.push(String.fromCharCode(o)),e+=i}return n.join("")}function dt(r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e,o,i,t,l,p,v,a,h=0,m=0,C="",k=[];if(!r)return r;r=ct(r+"");do e=r.charCodeAt(h++),o=r.charCodeAt(h++),i=r.charCodeAt(h++),a=e<<16|o<<8|i,t=a>>18&63,l=a>>12&63,p=a>>6&63,v=a&63,k[m++]=n.charAt(t)+n.charAt(l)+n.charAt(p)+n.charAt(v);while(h<r.length);switch(C=k.join(""),r.length%3){case 1:C=C.slice(0,-2)+"==";break;case 2:C=C.slice(0,-1)+"=";break}return C}function ht(r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e,o,i,t,l,p,v,a,h=0,m=0,C="",k=[];if(!r)return r;r+="";do t=n.indexOf(r.charAt(h++)),l=n.indexOf(r.charAt(h++)),p=n.indexOf(r.charAt(h++)),v=n.indexOf(r.charAt(h++)),a=t<<18|l<<12|p<<6|v,e=a>>16&255,o=a>>8&255,i=a&255,p===64?k[m++]=String.fromCharCode(e):v===64?k[m++]=String.fromCharCode(e,o):k[m++]=String.fromCharCode(e,o,i);while(h<r.length);return C=k.join(""),ft(C)}function be(r){return r=dt(r),r.replace(/\//g,"_").replace(/\+/g,"-")}function pt(r){return r=r.replace(/_/g,"/").replace(/-/g,"+"),ht(r)}var we={exports:{}};(function(r,n){(function(e){r.exports=e()})(function(e){var o=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(g,y){var u=g[0],s=g[1],d=g[2],c=g[3];u+=(s&d|~s&c)+y[0]-680876936|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[1]-389564586|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[2]+606105819|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[3]-1044525330|0,s=(s<<22|s>>>10)+d|0,u+=(s&d|~s&c)+y[4]-176418897|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[5]+1200080426|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[6]-1473231341|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[7]-45705983|0,s=(s<<22|s>>>10)+d|0,u+=(s&d|~s&c)+y[8]+1770035416|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[9]-1958414417|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[10]-42063|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[11]-1990404162|0,s=(s<<22|s>>>10)+d|0,u+=(s&d|~s&c)+y[12]+1804603682|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[13]-40341101|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[14]-1502002290|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[15]+1236535329|0,s=(s<<22|s>>>10)+d|0,u+=(s&c|d&~c)+y[1]-165796510|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[6]-1069501632|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[11]+643717713|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[0]-373897302|0,s=(s<<20|s>>>12)+d|0,u+=(s&c|d&~c)+y[5]-701558691|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[10]+38016083|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[15]-660478335|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[4]-405537848|0,s=(s<<20|s>>>12)+d|0,u+=(s&c|d&~c)+y[9]+568446438|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[14]-1019803690|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[3]-187363961|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[8]+1163531501|0,s=(s<<20|s>>>12)+d|0,u+=(s&c|d&~c)+y[13]-1444681467|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[2]-51403784|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[7]+1735328473|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[12]-1926607734|0,s=(s<<20|s>>>12)+d|0,u+=(s^d^c)+y[5]-378558|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[8]-2022574463|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[11]+1839030562|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[14]-35309556|0,s=(s<<23|s>>>9)+d|0,u+=(s^d^c)+y[1]-1530992060|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[4]+1272893353|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[7]-155497632|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[10]-1094730640|0,s=(s<<23|s>>>9)+d|0,u+=(s^d^c)+y[13]+681279174|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[0]-358537222|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[3]-722521979|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[6]+76029189|0,s=(s<<23|s>>>9)+d|0,u+=(s^d^c)+y[9]-640364487|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[12]-421815835|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[15]+530742520|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[2]-995338651|0,s=(s<<23|s>>>9)+d|0,u+=(d^(s|~c))+y[0]-198630844|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[7]+1126891415|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[14]-1416354905|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[5]-57434055|0,s=(s<<21|s>>>11)+d|0,u+=(d^(s|~c))+y[12]+1700485571|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[3]-1894986606|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[10]-1051523|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[1]-2054922799|0,s=(s<<21|s>>>11)+d|0,u+=(d^(s|~c))+y[8]+1873313359|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[15]-30611744|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[6]-1560198380|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[13]+1309151649|0,s=(s<<21|s>>>11)+d|0,u+=(d^(s|~c))+y[4]-145523070|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[11]-1120210379|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[2]+718787259|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[9]-343485551|0,s=(s<<21|s>>>11)+d|0,g[0]=u+g[0]|0,g[1]=s+g[1]|0,g[2]=d+g[2]|0,g[3]=c+g[3]|0}function t(g){var y=[],u;for(u=0;u<64;u+=4)y[u>>2]=g.charCodeAt(u)+(g.charCodeAt(u+1)<<8)+(g.charCodeAt(u+2)<<16)+(g.charCodeAt(u+3)<<24);return y}function l(g){var y=[],u;for(u=0;u<64;u+=4)y[u>>2]=g[u]+(g[u+1]<<8)+(g[u+2]<<16)+(g[u+3]<<24);return y}function p(g){var y=g.length,u=[1732584193,-271733879,-1732584194,271733878],s,d,c,I,F,O;for(s=64;s<=y;s+=64)i(u,t(g.substring(s-64,s)));for(g=g.substring(s-64),d=g.length,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=0;s<d;s+=1)c[s>>2]|=g.charCodeAt(s)<<(s%4<<3);if(c[s>>2]|=128<<(s%4<<3),s>55)for(i(u,c),s=0;s<16;s+=1)c[s]=0;return I=y*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),F=parseInt(I[2],16),O=parseInt(I[1],16)||0,c[14]=F,c[15]=O,i(u,c),u}function v(g){var y=g.length,u=[1732584193,-271733879,-1732584194,271733878],s,d,c,I,F,O;for(s=64;s<=y;s+=64)i(u,l(g.subarray(s-64,s)));for(g=s-64<y?g.subarray(s-64):new Uint8Array(0),d=g.length,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=0;s<d;s+=1)c[s>>2]|=g[s]<<(s%4<<3);if(c[s>>2]|=128<<(s%4<<3),s>55)for(i(u,c),s=0;s<16;s+=1)c[s]=0;return I=y*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),F=parseInt(I[2],16),O=parseInt(I[1],16)||0,c[14]=F,c[15]=O,i(u,c),u}function a(g){var y="",u;for(u=0;u<4;u+=1)y+=o[g>>u*8+4&15]+o[g>>u*8&15];return y}function h(g){var y;for(y=0;y<g.length;y+=1)g[y]=a(g[y]);return g.join("")}h(p("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function g(y,u){return y=y|0||0,y<0?Math.max(y+u,0):Math.min(y,u)}ArrayBuffer.prototype.slice=function(y,u){var s=this.byteLength,d=g(y,s),c=s,I,F,O,X;return u!==e&&(c=g(u,s)),d>c?new ArrayBuffer(0):(I=c-d,F=new ArrayBuffer(I),O=new Uint8Array(F),X=new Uint8Array(this,d,I),O.set(X),F)}}();function m(g){return/[\u0080-\uFFFF]/.test(g)&&(g=unescape(encodeURIComponent(g))),g}function C(g,y){var u=g.length,s=new ArrayBuffer(u),d=new Uint8Array(s),c;for(c=0;c<u;c+=1)d[c]=g.charCodeAt(c);return y?d:s}function k(g){return String.fromCharCode.apply(null,new Uint8Array(g))}function S(g,y,u){var s=new Uint8Array(g.byteLength+y.byteLength);return s.set(new Uint8Array(g)),s.set(new Uint8Array(y),g.byteLength),s}function A(g){var y=[],u=g.length,s;for(s=0;s<u-1;s+=2)y.push(parseInt(g.substr(s,2),16));return String.fromCharCode.apply(String,y)}function x(){this.reset()}return x.prototype.append=function(g){return this.appendBinary(m(g)),this},x.prototype.appendBinary=function(g){this._buff+=g,this._length+=g.length;var y=this._buff.length,u;for(u=64;u<=y;u+=64)i(this._hash,t(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},x.prototype.end=function(g){var y=this._buff,u=y.length,s,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c;for(s=0;s<u;s+=1)d[s>>2]|=y.charCodeAt(s)<<(s%4<<3);return this._finish(d,u),c=h(this._hash),g&&(c=A(c)),this.reset(),c},x.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},x.prototype.setState=function(g){return this._buff=g.buff,this._length=g.length,this._hash=g.hash,this},x.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},x.prototype._finish=function(g,y){var u=y,s,d,c;if(g[u>>2]|=128<<(u%4<<3),u>55)for(i(this._hash,g),u=0;u<16;u+=1)g[u]=0;s=this._length*8,s=s.toString(16).match(/(.*?)(.{0,8})$/),d=parseInt(s[2],16),c=parseInt(s[1],16)||0,g[14]=d,g[15]=c,i(this._hash,g)},x.hash=function(g,y){return x.hashBinary(m(g),y)},x.hashBinary=function(g,y){var u=p(g),s=h(u);return y?A(s):s},x.ArrayBuffer=function(){this.reset()},x.ArrayBuffer.prototype.append=function(g){var y=S(this._buff.buffer,g),u=y.length,s;for(this._length+=g.byteLength,s=64;s<=u;s+=64)i(this._hash,l(y.subarray(s-64,s)));return this._buff=s-64<u?new Uint8Array(y.buffer.slice(s-64)):new Uint8Array(0),this},x.ArrayBuffer.prototype.end=function(g){var y=this._buff,u=y.length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d,c;for(d=0;d<u;d+=1)s[d>>2]|=y[d]<<(d%4<<3);return this._finish(s,u),c=h(this._hash),g&&(c=A(c)),this.reset(),c},x.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.ArrayBuffer.prototype.getState=function(){var g=x.prototype.getState.call(this);return g.buff=k(g.buff),g},x.ArrayBuffer.prototype.setState=function(g){return g.buff=C(g.buff,!0),x.prototype.setState.call(this,g)},x.ArrayBuffer.prototype.destroy=x.prototype.destroy,x.ArrayBuffer.prototype._finish=x.prototype._finish,x.ArrayBuffer.hash=function(g,y){var u=v(new Uint8Array(g)),s=h(u);return y?A(s):s},x})})(we);var yt=we.exports;const gt=f.getDefaultExportFromCjs(yt);var J=function(){return J=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},J.apply(this,arguments)},vt=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},mt=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},D=Math.pow(1024,2);function bt(r,n){var e=n*D;if(e>r.size)e=r.size;else for(;r.size>e*1e4;)e*=2;for(var o=[],i=Math.ceil(r.size/e),t=0;t<i;t++){var l=r.slice(e*t,t===i-1?r.size:e*(t+1));o.push(l)}return o}function wt(r){return Object.keys(r).every(function(n){return n.indexOf("x-qn-meta-")===0})}function _t(r){return Object.keys(r).every(function(n){return n.indexOf("x:")===0})}function kt(r){return r.reduce(function(n,e){return n+e},0)}function xt(r,n,e){try{localStorage.setItem(r,JSON.stringify(n))}catch{e.warn(new E(B.WriteCacheFailed,"setLocalFileInfo failed: "+r))}}function Ct(r,n,e){var o=n==null?"_":"_key_"+n+"_";return"qiniu_js_sdk_upload_file_name_"+r+o+"size_"+e}function re(r,n){try{localStorage.removeItem(r)}catch{n.warn(new E(B.RemoveCacheFailed,"removeLocalFileInfo failed. key: "+r))}}function St(r,n){var e=null;try{e=localStorage.getItem(r)}catch{n.warn(new E(B.ReadCacheFailed,"getLocalFileInfo failed. key: "+r))}if(e==null)return null;var o=null;try{o=JSON.parse(e)}catch{re(r,n),n.warn(new E(B.InvalidCacheData,"getLocalFileInfo failed to parse. key: "+r))}return o}function Y(r){var n="UpToken "+r;return{Authorization:n}}function Bt(r){var n=Y(r);return J({"content-type":"application/octet-stream"},n)}function Et(r){var n=Y(r);return J({"content-type":"application/json"},n)}function _e(){if(window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)return new window.ActiveXObject("Microsoft.XMLHTTP");throw new E(B.NotAvailableXMLHttpRequest,"the current environment does not support.")}function It(r){return vt(this,void 0,void 0,function(){var n,e;return mt(this,function(o){switch(o.label){case 0:return[4,At(r)];case 1:return n=o.sent(),e=new gt.ArrayBuffer,e.append(n),[2,e.end()]}})})}function At(r){return new Promise(function(n,e){var o=new FileReader;o.onload=function(i){if(i.target){var t=i.target.result;n(t)}else e(new E(B.InvalidProgressEventTarget,"progress event target is undefined"))},o.onerror=function(){e(new E(B.FileReaderReadFailed,"fileReader read failed"))},o.readAsArrayBuffer(r)})}function K(r,n){return new Promise(function(e,o){var i=_e();if(i.open(n.method,r),n.onCreate&&n.onCreate(i),n.headers){var t=n.headers;Object.keys(t).forEach(function(l){i.setRequestHeader(l,t[l])})}i.upload.addEventListener("progress",function(l){l.lengthComputable&&n.onProgress&&n.onProgress({loaded:l.loaded,total:l.total})}),i.onreadystatechange=function(){var l=i.responseText;if(i.readyState===4){var p=i.getResponseHeader("x-reqId")||"";if(i.status===0){o(new it("network error.",p));return}if(i.status!==200){var v="xhr request failed, code: "+i.status;l&&(v+=" response: "+l);var a=void 0;try{a=JSON.parse(l)}catch{}o(new G(i.status,p,v,a));return}try{e({data:JSON.parse(l),reqId:p})}catch(h){o(h)}}},i.send(n.body)})}function Ut(r){if(r&&r.match){var n=r.match(/(^https?)/);if(!n)return"";var e=n[1];return n=r.match(/^https?:\/\/([^:^/]*):(\d*)/),n?n[2]:e==="http"?"80":"443"}return""}function Ft(r){if(r&&r.match){var n=r.match(/^https?:\/\/([^:^/]*)/);return n?n[1]:""}return""}function ie(r){if(!r)throw new E(B.InvalidToken,"invalid token.");var n=r.split(":");if(n.length===1)throw new E(B.InvalidToken,"invalid token segments.");var e=n.length>3?n[1]:n[0];if(!e)throw new E(B.InvalidToken,"missing assess key field.");var o=null;try{o=JSON.parse(pt(n[n.length-1]))}catch{throw new E(B.InvalidToken,"token parse failed.")}if(o==null)throw new E(B.InvalidToken,"putPolicy is null.");if(o.scope==null)throw new E(B.InvalidToken,"scope field is null.");var i=o.scope.split(":")[0];if(!i)throw new E(B.InvalidToken,"resolve bucketName failed.");return{assessKey:e,bucketName:i,scope:o.scope}}var z,P={z0:"z0",z1:"z1",z2:"z2",na0:"na0",as0:"as0",cnEast2:"cn-east-2"},Ot=(z={},z[P.z0]={srcUphost:["up.qiniup.com"],cdnUphost:["upload.qiniup.com"]},z[P.z1]={srcUphost:["up-z1.qiniup.com"],cdnUphost:["upload-z1.qiniup.com"]},z[P.z2]={srcUphost:["up-z2.qiniup.com"],cdnUphost:["upload-z2.qiniup.com"]},z[P.na0]={srcUphost:["up-na0.qiniup.com"],cdnUphost:["upload-na0.qiniup.com"]},z[P.as0]={srcUphost:["up-as0.qiniup.com"],cdnUphost:["upload-as0.qiniup.com"]},z[P.cnEast2]={srcUphost:["up-cn-east-2.qiniup.com"],cdnUphost:["upload-cn-east-2.qiniup.com"]},z),V=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}},zt=function(r,n,e,o){return n=n||"&",e=e||"=",r===null&&(r=void 0),typeof r=="object"?Object.keys(r).map(function(i){var t=encodeURIComponent(V(i))+e;return Array.isArray(r[i])?r[i].map(function(l){return t+encodeURIComponent(V(l))}).join(n):t+encodeURIComponent(V(r[i]))}).filter(Boolean).join(n):o?encodeURIComponent(V(o))+e+encodeURIComponent(V(r)):""},ke;ke=zt;var R=function(){return R=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},R.apply(this,arguments)},Lt=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},Tt=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};function Rt(r,n,e){return Lt(this,void 0,void 0,function(){var o,i;return Tt(this,function(t){return o=ke({ak:r,bucket:n}),i=e+"://api.qiniu.com/v2/query?"+o,[2,K(i,{method:"GET"})]})})}function xe(r,n,e){var o=e.url,i=e.id;return o+"/buckets/"+r+"/objects/"+(n!=null?be(n):"~")+"/uploads/"+i}function Pt(r,n,e,o){var i=o+"/buckets/"+n+"/objects/"+(e!=null?be(e):"~")+"/uploads";return K(i,{method:"POST",headers:Y(r)})}function Dt(r,n,e,o,i){var t=ie(r).bucketName,l=xe(t,n,o)+("/"+e),p=Bt(r);return i.md5&&(p["Content-MD5"]=i.md5),K(l,R(R({},i),{method:"PUT",headers:p}))}function jt(r,n,e,o){var i=ie(r).bucketName,t=xe(i,n,e);return K(t,R(R({},o),{method:"POST",headers:Et(r)}))}function Mt(r,n,e){return K(r,R({method:"POST",body:n},e))}var Z=function(){return Z=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},Z.apply(this,arguments)},ue=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},le=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Vt=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},$t=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Vt(arguments[n]));return r},Ht=4,Ce=[0,502,503,504,599],qt=$t(Ce,[406]),Nt=Math.pow(1024,3),Se=function(){function r(n,e,o,i){this.hostPool=o,this.logger=i,this.aborted=!1,this.retryCount=0,this.xhrList=[],this.config=n.config,i.info("config inited.",this.config),this.putExtra=Z({fname:""},n.putExtra),i.info("putExtra inited.",this.putExtra),this.key=n.key,this.file=n.file,this.token=n.token,this.onData=e.onData,this.onError=e.onError,this.onComplete=e.onComplete;try{var t=ie(this.token);this.bucketName=t.bucketName,this.assessKey=t.assessKey}catch(l){i.error("get putPolicy from token failed.",l),this.onError(l)}}return r.prototype.checkAndUpdateUploadHost=function(){return ue(this,void 0,void 0,function(){var n;return le(this,function(e){switch(e.label){case 0:return this.logger.info("get available upload host."),[4,this.hostPool.getUp(this.assessKey,this.bucketName,this.config.upprotocol)];case 1:if(n=e.sent(),n==null)throw new E(B.NotAvailableUploadHost,"no available upload host.");return this.uploadHost!=null&&this.uploadHost.host!==n.host?this.logger.warn("host switches from "+this.uploadHost.host+" to "+n.host+"."):this.logger.info("use host "+n.host+"."),this.uploadHost=n,[2]}})})},r.prototype.checkAndUnfreezeHost=function(){this.logger.info("check unfreeze host."),this.uploadHost!=null&&this.uploadHost.isFrozen()&&(this.logger.warn(this.uploadHost.host+" will be unfrozen."),this.uploadHost.unfreeze())},r.prototype.checkAndFreezeHost=function(n){this.logger.info("check freeze host."),n instanceof G&&this.uploadHost!=null&&Ce.includes(n.code)&&(this.logger.warn(this.uploadHost.host+" will be temporarily frozen."),this.uploadHost.freeze())},r.prototype.handleError=function(n){this.logger.error(n.message),this.onError(n)},r.prototype.putFile=function(){return ue(this,void 0,void 0,function(){var n,e,o,i;return le(this,function(t){switch(t.label){case 0:if(this.aborted=!1,this.putExtra.fname||(this.logger.info("use file.name as fname."),this.putExtra.fname=this.file.name),this.file.size>1e4*Nt)return this.handleError(new E(B.InvalidFile,"file size exceed maximum value 10000G")),[2];if(this.putExtra.customVars&&!_t(this.putExtra.customVars))return this.handleError(new E(B.InvalidCustomVars,"customVars key should start width x:")),[2];if(this.putExtra.metadata&&!wt(this.putExtra.metadata))return this.handleError(new E(B.InvalidMetadata,"metadata key should start with x-qn-meta-")),[2];t.label=1;case 1:return t.trys.push([1,4,,5]),this.uploadAt=new Date().getTime(),[4,this.checkAndUpdateUploadHost()];case 2:return t.sent(),[4,this.run()];case 3:return n=t.sent(),this.onComplete(n.data),this.checkAndUnfreezeHost(),this.sendLog(n.reqId,200),[2];case 4:return e=t.sent(),this.aborted?(this.logger.warn("upload is aborted."),this.sendLog("",-2),[2]):(this.clear(),this.logger.error(e),e instanceof G&&(this.sendLog(e.reqId,e.code),this.checkAndFreezeHost(e),o=++this.retryCount<=this.config.retryCount,i=qt.includes(e.code),i&&o)?(this.logger.warn("error auto retry: "+this.retryCount+"/"+this.config.retryCount+"."),this.putFile(),[2]):(this.onError(e),[3,5]));case 5:return[2]}})})},r.prototype.clear=function(){this.xhrList.forEach(function(n){n.onreadystatechange=null,n.abort()}),this.xhrList=[],this.logger.info("cleanup uploading xhr.")},r.prototype.stop=function(){this.logger.info("aborted."),this.clear(),this.aborted=!0},r.prototype.addXhr=function(n){this.xhrList.push(n)},r.prototype.sendLog=function(n,e){var o,i;this.logger.report({code:e,reqId:n,remoteIp:"",upType:"jssdk-h5",size:this.file.size,time:Math.floor(this.uploadAt/1e3),port:Ut((o=this.uploadHost)===null||o===void 0?void 0:o.getUrl()),host:Ft((i=this.uploadHost)===null||i===void 0?void 0:i.getUrl()),bytesSent:this.progress?this.progress.total.loaded:0,duration:Math.floor((new Date().getTime()-this.uploadAt)/1e3)})},r.prototype.getProgressInfoItem=function(n,e,o){return Z({size:e,loaded:n,percent:n/e*100},o==null?{}:{fromCache:o})},r}(),Gt=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),N=function(){return N=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},N.apply(this,arguments)},$=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},H=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};function Kt(r){var n=/^[1-9]\d*$/;return n.test(String(r))}var Xt=function(r){Gt(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}return n.prototype.run=function(){return $(this,void 0,void 0,function(){var e,o,i,t,l,p=this;return H(this,function(v){switch(v.label){case 0:if(this.logger.info("start run Resume."),!this.config.chunkSize||!Kt(this.config.chunkSize))throw new E(B.InvalidChunkSize,"chunkSize must be a positive integer");if(this.config.chunkSize>1024)throw new E(B.InvalidChunkSize,"chunkSize maximum value is 1024");return[4,this.initBeforeUploadChunks()];case 1:v.sent(),e=new ot(function(a){return $(p,void 0,void 0,function(){return H(this,function(h){switch(h.label){case 0:if(this.aborted)throw e.abort(),new Error("pool is aborted");return[4,this.uploadChunk(a)];case 1:return h.sent(),[2]}})})},this.config.concurrentRequestLimit),o=null,i=this.getLocalKey(),t=this.chunks.map(function(a,h){return e.enqueue({chunk:a,index:h})}),v.label=2;case 2:return v.trys.push([2,5,,6]),[4,Promise.all(t)];case 3:return v.sent(),[4,this.mkFileReq()];case 4:return o=v.sent(),[3,6];case 5:throw l=v.sent(),l instanceof G&&(l.code===612||l.code===400)&&re(i,this.logger),l;case 6:return re(i,this.logger),[2,o]}})})},n.prototype.uploadChunk=function(e){return $(this,void 0,void 0,function(){var o,i,t,l,p,v,a,h,m,C=this;return H(this,function(k){switch(k.label){case 0:return o=e.index,i=e.chunk,t=this.cachedUploadedList[o],this.logger.info("upload part "+o+", cache:",t),l=this.config.checkByMD5,p=function(){C.usedCacheList[o]=!0,C.updateChunkProgress(i.size,o),C.uploadedList[o]=t,C.updateLocalCache()},t&&!l?(p(),[2]):[4,It(i)];case 1:return v=k.sent(),this.logger.info("computed part md5.",v),t&&v===t.md5?(p(),[2]):(this.usedCacheList[o]=!1,a=function(S){C.updateChunkProgress(S.loaded,o)},h={body:i,md5:this.config.checkByServer?v:void 0,onProgress:a,onCreate:function(S){return C.addXhr(S)}},this.logger.info("part "+o+" start uploading."),[4,Dt(this.token,this.key,e.index+1,this.getUploadInfo(),h)]);case 2:return m=k.sent(),this.logger.info("part "+o+" upload completed."),a({loaded:i.size,total:i.size}),this.uploadedList[o]={etag:m.data.etag,md5:m.data.md5,size:i.size},this.updateLocalCache(),[2]}})})},n.prototype.mkFileReq=function(){return $(this,void 0,void 0,function(){var e,o,i=this;return H(this,function(t){switch(t.label){case 0:return e=N(N(N({parts:this.uploadedList.map(function(l,p){return{etag:l.etag,partNumber:p+1}}),fname:this.putExtra.fname},this.putExtra.mimeType&&{mimeType:this.putExtra.mimeType}),this.putExtra.customVars&&{customVars:this.putExtra.customVars}),this.putExtra.metadata&&{metadata:this.putExtra.metadata}),this.logger.info("parts upload completed, make file.",e),[4,jt(this.token,this.key,this.getUploadInfo(),{onCreate:function(l){return i.addXhr(l)},body:JSON.stringify(e)})];case 1:return o=t.sent(),this.logger.info("finish Resume Progress."),this.updateMkFileProgress(1),[2,o]}})})},n.prototype.initBeforeUploadChunks=function(){return $(this,void 0,void 0,function(){var e,o,i;return H(this,function(t){switch(t.label){case 0:return this.uploadedList=[],this.usedCacheList=[],e=St(this.getLocalKey(),this.logger),e?[3,2]:(this.logger.info("init upload parts from api."),[4,Pt(this.token,this.bucketName,this.key,this.uploadHost.getUrl())]);case 1:return o=t.sent(),this.logger.info("initd upload parts of id: "+o.data.uploadId+"."),this.uploadId=o.data.uploadId,this.cachedUploadedList=[],[3,3];case 2:i=["resume upload parts from local cache,","total "+e.data.length+" part,","id is "+e.id+"."],this.logger.info(i.join(" ")),this.cachedUploadedList=e.data,this.uploadId=e.id,t.label=3;case 3:return this.chunks=bt(this.file,this.config.chunkSize),this.loaded={mkFileProgress:0,chunks:this.chunks.map(function(l){return 0})},this.notifyResumeProgress(),[2]}})})},n.prototype.getUploadInfo=function(){return{id:this.uploadId,url:this.uploadHost.getUrl()}},n.prototype.getLocalKey=function(){return Ct(this.file.name,this.key,this.file.size)},n.prototype.updateLocalCache=function(){xt(this.getLocalKey(),{id:this.uploadId,data:this.uploadedList},this.logger)},n.prototype.updateChunkProgress=function(e,o){this.loaded.chunks[o]=e,this.notifyResumeProgress()},n.prototype.updateMkFileProgress=function(e){this.loaded.mkFileProgress=e,this.notifyResumeProgress()},n.prototype.notifyResumeProgress=function(){var e=this;this.progress={total:this.getProgressInfoItem(kt(this.loaded.chunks)+this.loaded.mkFileProgress,this.file.size+1),chunks:this.chunks.map(function(o,i){var t=e.usedCacheList[i];return e.getProgressInfoItem(e.loaded.chunks[i],o.size,t)}),uploadInfo:{id:this.uploadId,url:this.uploadHost.getUrl()}},this.onData(this.progress)},n}(Se),ce=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},fe=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Wt=function(){function r(){this.crc=-1,this.table=this.makeTable()}return r.prototype.makeTable=function(){for(var n=new Array,e=0;e<256;e++){for(var o=e,i=0;i<8;i++)o&1?o=o>>>1^3988292384:o>>>=1;n[e]=o}return n},r.prototype.append=function(n){for(var e=this.crc,o=0;o<n.byteLength;o++)e=e>>>8^this.table[(e^n[o])&255];this.crc=e},r.prototype.compute=function(){return(this.crc^-1)>>>0},r.prototype.readAsUint8Array=function(n){return ce(this,void 0,void 0,function(){var e;return fe(this,function(o){switch(o.label){case 0:return typeof n.arrayBuffer!="function"?[3,2]:(e=Uint8Array.bind,[4,n.arrayBuffer()]);case 1:return[2,new(e.apply(Uint8Array,[void 0,o.sent()]))];case 2:return[2,new Promise(function(i,t){var l=new FileReader;l.onload=function(){if(l.result==null){t();return}if(typeof l.result=="string"){t();return}i(new Uint8Array(l.result))},l.readAsArrayBuffer(n)})]}})})},r.prototype.file=function(n){return ce(this,void 0,void 0,function(){var e,o,i,t,l,p;return fe(this,function(v){switch(v.label){case 0:return n.size<=D?(e=this.append,[4,this.readAsUint8Array(n)]):[3,2];case 1:return e.apply(this,[v.sent()]),[2,this.compute()];case 2:o=Math.ceil(n.size/D),i=0,v.label=3;case 3:return i<o?(t=i*D,l=i===o-1?n.size:t+D,[4,this.readAsUint8Array(n.slice(t,l))]):[3,6];case 4:p=v.sent(),this.append(new Uint8Array(p)),v.label=5;case 5:return i++,[3,3];case 6:return[2,this.compute()]}})})},r.file=function(n){var e=new r;return e.file(n)},r}(),Jt=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),Zt=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},Yt=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},de=function(r){Jt(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}return n.prototype.run=function(){return Zt(this,void 0,void 0,function(){var e,o,i,t,l,p,v=this;return Yt(this,function(a){switch(a.label){case 0:return this.logger.info("start run Direct."),e=new FormData,this.putExtra.mimeType?(o=this.file.slice(0,this.file.size,this.putExtra.mimeType),e.append("file",o,this.putExtra.fname||this.file.name)):e.append("file",this.file,this.putExtra.fname||this.file.name),e.append("token",this.token),this.key!=null&&e.append("key",this.key),e.append("fname",this.putExtra.fname),this.config.checkByServer?[4,Wt.file(this.file)]:[3,2];case 1:i=a.sent(),e.append("crc32",i.toString()),a.label=2;case 2:return this.putExtra.customVars&&(this.logger.info("init customVars."),t=this.putExtra.customVars,Object.keys(t).forEach(function(h){return e.append(h,t[h].toString())}),this.logger.info("customVars inited.")),this.putExtra.metadata&&(this.logger.info("init metadata."),l=this.putExtra.metadata,Object.keys(l).forEach(function(h){return e.append(h,l[h].toString())})),this.logger.info("formData inited."),[4,Mt(this.uploadHost.getUrl(),e,{onProgress:function(h){v.updateDirectProgress(h.loaded,h.total)},onCreate:function(h){return v.addXhr(h)}})];case 3:return p=a.sent(),this.logger.info("Direct progress finish."),this.finishDirectProgress(),[2,p]}})})},n.prototype.updateDirectProgress=function(e,o){this.progress={total:this.getProgressInfoItem(e,o+1)},this.onData(this.progress)},n.prototype.finishDirectProgress=function(){if(!this.progress){this.logger.warn("progress is null."),this.progress={total:this.getProgressInfoItem(this.file.size,this.file.size)},this.onData(this.progress);return}var e=this.progress.total;this.progress={total:this.getProgressInfoItem(e.loaded+1,e.size)},this.onData(this.progress)},n}(Se);function Be(r,n,e){e===void 0&&(e=3);var o=_e();o.open("POST","https://uplog.qbox.me/log/3"),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.setRequestHeader("Authorization",Y(r).Authorization),o.onreadystatechange=function(){o.readyState===4&&o.status!==200&&e>0&&Be(r,n,e-1)};var i=[n.code||"",n.reqId||"",n.host||"",n.remoteIp||"",n.port||"",n.duration||"",n.time||"",n.bytesSent||"",n.upType||"",n.size||""].join(",");o.send(i)}var Qt=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},ee=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Qt(arguments[n]));return r},en=function(){function r(n,e,o,i){e===void 0&&(e=!0),o===void 0&&(o="OFF"),i===void 0&&(i="UPLOAD"),this.token=n,this.disableReport=e,this.level=o,this.prefix=i,this.id=++r.id}return r.prototype.getPrintPrefix=function(n){return"Qiniu-JS-SDK ["+n+"]["+this.prefix+"#"+this.id+"]:"},r.prototype.report=function(n,e){if(!this.disableReport)try{Be(this.token,n,e)}catch(o){this.warn(o)}},r.prototype.info=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var o=["INFO"];o.includes(this.level)&&console.log.apply(console,ee([this.getPrintPrefix("INFO")],n))},r.prototype.warn=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var o=["INFO","WARN"];o.includes(this.level)&&console.warn.apply(console,ee([this.getPrintPrefix("WARN")],n))},r.prototype.error=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var o=["INFO","WARN","ERROR"];o.includes(this.level)&&console.error.apply(console,ee([this.getPrintPrefix("ERROR")],n))},r.id=0,r}(),he=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},pe=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},tn=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},nn=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(tn(arguments[n]));return r},W=new Map,rn=function(){function r(n,e){this.host=n,this.protocol=e}return r.prototype.isFrozen=function(){var n=new Date().getTime(),e=W.get(this.host);return e!=null&&e>=n},r.prototype.freeze=function(n){n===void 0&&(n=20);var e=new Date().getTime()+n*1e3;W.set(this.host,e)},r.prototype.unfreeze=function(){W.delete(this.host)},r.prototype.getUrl=function(){return this.protocol+"://"+this.host},r.prototype.getUnfreezeTime=function(){return W.get(this.host)},r}(),on=function(){function r(n){n===void 0&&(n=[]),this.initHosts=n,this.cachedHostsMap=new Map}return r.prototype.register=function(n,e,o,i){this.cachedHostsMap.set(n+"@"+e,o.map(function(t){return new rn(t,i)}))},r.prototype.refresh=function(n,e,o){var i,t,l,p;return he(this,void 0,void 0,function(){var v,a,h;return pe(this,function(m){switch(m.label){case 0:return v=this.cachedHostsMap.get(n+"@"+e)||[],v.length>0?[2]:this.initHosts.length>0?(this.register(n,e,this.initHosts,o),[2]):[4,Rt(n,e,o)];case 1:return a=m.sent(),(a==null?void 0:a.data)!=null&&(h=nn(((t=(i=a.data.up)===null||i===void 0?void 0:i.acc)===null||t===void 0?void 0:t.main)||[],((p=(l=a.data.up)===null||l===void 0?void 0:l.acc)===null||p===void 0?void 0:p.backup)||[]),this.register(n,e,h,o)),[2]}})})},r.prototype.getUp=function(n,e,o){return he(this,void 0,void 0,function(){var i,t,l;return pe(this,function(p){switch(p.label){case 0:return[4,this.refresh(n,e,o)];case 1:return p.sent(),i=this.cachedHostsMap.get(n+"@"+e)||[],i.length===0?[2,null]:(t=i.filter(function(v){return!v.isFrozen()}),t.length>0?[2,t[0]]:(l=i.slice().sort(function(v,a){return(v.getUnfreezeTime()||0)-(a.getUnfreezeTime()||0)}),[2,l[0]]))}})})},r}();function an(r,n,e,o){return r.config&&r.config.forceDirect?(o.info("ues forceDirect mode."),new de(r,n,e,o)):r.file.size>4*D?(o.info("file size over 4M, use Resume."),new Xt(r,n,e,o)):(o.info("file size less or equal than 4M, use Direct."),new de(r,n,e,o))}function sn(r,n,e,o,i){var t=new en(e,void 0,void 0,r.name),l={file:r,key:n,token:e,putExtra:o,config:cn(i)},p=new on(l.config.uphost);return new lt(function(v){var a=an(l,{onData:function(h){return v.next(h)},onError:function(h){return v.error(h)},onComplete:function(h){return v.complete(h)}},p,t);return a.putFile(),a.stop.bind(a)})}var j=function(){return j=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},j.apply(this,arguments)},un=function(r,n){var e={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.indexOf(o)<0&&(e[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,o=Object.getOwnPropertySymbols(r);i<o.length;i++)n.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(r,o[i])&&(e[o[i]]=r[o[i]]);return e},ln=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},te=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(ln(arguments[n]));return r};function cn(r,n){var e=j({},r),o=e.upprotocol,i=e.uphost,t=un(e,["upprotocol","uphost"]),l=j({uphost:[],retryCount:3,checkByMD5:!1,forceDirect:!1,useCdnDomain:!0,checkByServer:!0,concurrentRequestLimit:3,chunkSize:Ht,upprotocol:"https",debugLogLevel:"OFF",disableStatisticsReport:!1},t);o&&(l.upprotocol=o.replace(/:$/,""));var p=[];if(i)Array.isArray(i)?p.push.apply(p,te(i)):p.push(i);else if(l!=null&&l.region){var v=Ot[l==null?void 0:l.region];l.useCdnDomain?p.push.apply(p,te(v.cdnUphost)):p.push.apply(p,te(v.srcUphost))}return j(j({},l),{uphost:p.filter(Boolean)})}var ye={PNG:"image/png",JPEG:"image/jpeg",WEBP:"image/webp",BMP:"image/bmp"};Object.keys(ye).map(function(r){return ye[r]});let ne=null;async function fn(r,n,e={}){if(!n){console.error("UID is required to upload file to other user's cloud storage");return}return ne||await i(),await t();async function i(){let{data:p}=await f.globalInject.$axios.get("/v2/form/uploadToken");if(p.status===1)ne=p.result;else throw new Error(p.msg)}async function t(){let p=e.path||"att_file/";const v=ge(e.name||r.name),a=parseInt(Date.now()/1e3).toString(),h=p+n+"/"+a+"_"+l()+"_."+ge(v);return sn(r,h,ne)}function l(){let p="";for(let v=0;v<6;v++){const a=parseInt(Math.random()*10);p+=a}return p}}const ge=r=>r.split(".").pop(),Ee=r=>(f.pushScopeId("data-v-45101ef0"),r=r(),f.popScopeId(),r),dn={class:"ocr-widget-box widget-box"},hn={class:"ocr-header"},pn={key:1,class:"ocr-image-preview"},yn=["src"],gn={key:0,class:"loading-overlay"},vn=Ee(()=>f.createBaseVNode("span",{class:"loading-spinner-icon"},null,-1)),mn=[vn],bn=Ee(()=>f.createBaseVNode("span",{class:"reupload-text"},"重新上传",-1)),wn=[bn],_n={key:0,class:"ocr-error-bar"},kn={class:"error-text"},xn=f.defineComponent({__name:"OcrWidget",props:{id:{},type:{},attrs:{},value:{}},emits:["update:value"],setup(r,{emit:n}){const e=r,o=n,i=f.inject("editable"),t=f.inject("formMode"),l=f.computed(()=>t.value==="answer-preview"),p=f.computed(()=>t.value==="input"||t.value==="preview"),v=f.ref(!1),a=f.ref(""),h=f.ref(!1),m=f.ref(!1),C=f.ref(""),k=["购买方","销售方","货物或应税劳务、服务"],S=f.ref(""),A=f.ref(""),x=f.ref(!1),g=f.computed(()=>{const b={};return e.attrs.sections.forEach(w=>{w.fields.filter(_=>_.visible!==!1&&_.label).forEach(_=>{k.includes(w.name)?b[_.key]=w.name+_.label:b[_.key]=_.label})}),b}),y=f.computed(()=>{const b={};for(const[w,_]of Object.entries(g.value))b[_]=w;return b}),u=f.computed(()=>{const b=e.value;if(!b)return{};if(typeof b=="object"&&"fields"in b)return b.fields||{};const w=b,_={};for(const[U,L]of Object.entries(w)){const T=y.value[U]||U;_[T]=L}return _}),s=f.computed(()=>({imageUrl:S.value,imageKey:A.value,recognized:x.value,fields:u.value}));function d(b){const w={};for(const[_,U]of Object.entries(b)){const L=g.value[_]||_;w[L]=U}return w}const c=f.ref(""),I=f.ref("");async function F(b){const w=await f.getCreateUid(),_=await fn(b,w);return new Promise((U,L)=>{_.subscribe({error:T=>L(T),complete:T=>U(T)})})}const O=f.computed(()=>{const b=[];return e.attrs.sections.forEach(w=>{w.fields.filter(_=>_.visible!==!1).forEach(_=>{if(_.label){let U=_.label;k.includes(w.name)&&(U=w.name+U),b.push(U)}})}),b}),X=f.computed(()=>{const b={};return e.attrs.sections.forEach(w=>{w.fields.filter(_=>_.visible!==!1&&_.label).forEach(_=>{b[_.label]=_.key,k.includes(w.name)&&(b[w.name+_.label]=_.key)})}),b}),oe=f.computed(()=>!!C.value||!!s.value.imageUrl),Ie=f.computed(()=>i||l.value?!1:!!(s.value.recognized||h.value)),Ae=f.computed(()=>{const b={};return e.attrs.sections.forEach(w=>{w.fields.forEach(_=>{b[_.key]=""})}),b}),Ue=f.computed(()=>e.attrs.sections.map(b=>({...b,fields:b.fields.filter(w=>w.visible!==!1).map(w=>{var _;return{...w,value:((_=s.value.fields)==null?void 0:_[w.key])??""}})})).filter(b=>b.fields.length>0));function M(b){b.imageUrl!==void 0&&(S.value=b.imageUrl),b.imageKey!==void 0&&(A.value=b.imageKey),b.recognized!==void 0&&(x.value=b.recognized);const w="fields"in b?b.fields:u.value;o("update:value",d(w))}async function Fe(b){if(!b)return m.value=!0,null;try{const w=await rt({url:b,keys:O.value}),_={};for(const[U,L]of Object.entries(w.fields)){const T=X.value[U]||U;_[T]=L}return _}catch(w){const _=w instanceof Error?w.message:"识别失败";return _.includes("超时")||_.includes("timeout"),m.value=!0,null}}async function Oe(b){C.value=URL.createObjectURL(b),v.value=!0,a.value="",m.value=!1,h.value=!1,M({fields:{},recognized:!1});try{const{key:w}=await F(b);if(!w){f.ElMessage.error("上传失败");return}I.value=w,c.value="https://fatt.bmwax.cn/"+w,M({imageUrl:c.value,imageKey:w});const _=await Fe(c.value);if(v.value=!1,se(),_){const U={...Ae.value,..._};M({fields:U,recognized:!0}),m.value=!1}else a.value="识别失败,请确保图片清晰、无遮挡并重新上传",m.value=!0}catch(w){v.value=!1,se(),a.value=w.message||"识别失败",Q()}}function ze(b,w){M({fields:{...s.value.fields,[b]:w}})}function ae(){M({imageUrl:"",imageKey:"",recognized:!1,fields:{}}),c.value="",I.value="",a.value="",v.value=!1,m.value=!1,h.value=!1,Q()}function Q(){C.value&&(URL.revokeObjectURL(C.value),C.value="")}f.onUnmounted(()=>{Q()});function se(){h.value=!0,a.value=""}return(b,w)=>(f.openBlock(),f.createElementBlock("div",dn,[f.createVNode(f._sfc_main),f.createVNode(f.ChoosenView,null,{default:f.withCtx(()=>[f.createVNode(f._sfc_main$1),f.createBaseVNode("div",{class:f.normalizeClass(["ocr-container",{disabled:f.unref(i)||l.value,"landing-layout":p.value}])},[f.createBaseVNode("div",hn,[oe.value?f.createCommentVNode("",!0):(f.openBlock(),f.createBlock(Ve,{key:0,editable:f.unref(i),"allow-camera":b.attrs.allowCamera,"allow-gallery":b.attrs.allowGallery,"is-landing":p.value,onUpload:Oe},null,8,["editable","allow-camera","allow-gallery","is-landing"])),oe.value?(f.openBlock(),f.createElementBlock("div",pn,[f.createBaseVNode("img",{src:C.value||s.value.imageUrl,alt:"上传图片"},null,8,yn),v.value?(f.openBlock(),f.createElementBlock("div",gn,mn)):a.value?(f.openBlock(),f.createElementBlock("div",{key:1,class:"error-overlay",onClick:ae},wn)):f.createCommentVNode("",!0),a.value?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("span",{key:2,class:"close-icon iconfont icon-form-close",onClick:ae}))])):f.createCommentVNode("",!0)]),a.value?(f.openBlock(),f.createElementBlock("div",_n,[f.createBaseVNode("span",kn,f.toDisplayString(a.value),1)])):f.createCommentVNode("",!0),f.createVNode(nt,{sections:Ue.value,"ocr-data":s.value.fields,"can-edit":Ie.value,"ocr-type":b.attrs.ocrType,"is-landing":p.value,"onUpdate:field":ze},null,8,["sections","ocr-data","can-edit","ocr-type","is-landing"])],2),f.createVNode(f.VerifyTip),f.createVNode(f._sfc_main$2)]),_:1})]))}}),Cn=f._export_sfc(xn,[["__scopeId","data-v-45101ef0"]]);exports.default=Cn;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./main-DX3b4SJ1.cjs"),ve=r=>(f.pushScopeId("data-v-908bdd1c"),r=r(),f.popScopeId(),r),Le={class:"ocr-uploader"},Te={class:"upload-buttons"},Re=ve(()=>f.createBaseVNode("div",{class:"btn-content"},[f.createBaseVNode("span",{class:"icon iconfont icon-form-camera btn-icon"}),f.createBaseVNode("span",{class:"btn-text"},"拍照上传")],-1)),Pe=[Re],De=ve(()=>f.createBaseVNode("div",{class:"btn-content"},[f.createBaseVNode("span",{class:"icon iconfont icon-form-photo-album btn-icon"}),f.createBaseVNode("span",{class:"btn-text"},"从相册选择")],-1)),je=[De],Me=f.defineComponent({__name:"OcrUploader",props:{allowCamera:{type:Boolean},allowGallery:{type:Boolean}},emits:["upload"],setup(r,{emit:n}){const e=r,o=n,i=f.inject("editable"),t=f.ref(),l=f.ref(),p=f.computed(()=>e.allowCamera&&e.allowGallery);f.onMounted(async()=>{if(navigator.userAgent.toLowerCase().includes("micromessenger"))try{const{data:k}=await f.globalInject.$axios.get(`/v1/wxAccount/getWxSign?q=${window.btoa(JSON.stringify({url:window.location.href}))}`);wx.config({debug:!1,appId:k.result.appId,timestamp:k.result.timestamp,nonceStr:k.result.nonceStr,signature:k.result.signature,jsApiList:["chooseImage","getLocalImgData"]}),wx.ready(()=>{console.log("[OcrUploader] wx.ready")}),wx.error(S=>{console.warn("[OcrUploader] wx.config 失败:",S)})}catch{}});function v(C){try{const k=C.split(",");if(k.length<2)return null;const S=k[0].match(/:(.*?);/),A=(S==null?void 0:S[1])||"image/jpeg",x=atob(k[1]),g=x.length,y=new Uint8Array(g);for(let u=0;u<g;u++)y[u]=x.charCodeAt(u);return new File([y],`ocr_${Date.now()}.jpg`,{type:A})}catch{return null}}function a(C){wx.chooseImage({count:1,sizeType:["compressed"],sourceType:C==="camera"?["camera"]:["album"],success(k){const S=k.localIds[0];wx.getLocalImgData({localId:S,success(A){let x=A.localData;x.indexOf("jgp")>-1&&x.indexOf("jpeg")===-1&&(x=x.replace(/\bjgp\b/g,"jpeg")),x.indexOf("data:image")!==0&&(x="data:image/jpeg;base64,"+x);const g=v(x);if(!g){f.ElMessage.error("图片处理失败,请重试");return}if(g.size>10*1024*1024){f.ElMessage.error("图片大小不能超过10MB");return}o("upload",g)},fail(){f.ElMessage.error("获取图片数据失败,请重试")}})},fail(){}})}async function h(C){var S,A;if(i)return;if(await f.isWxMiniProgram()){a(C);return}C==="camera"?(S=l.value)==null||S.click():(A=t.value)==null||A.click()}function m(C){var x;const k=C.target,S=(x=k.files)==null?void 0:x[0];if(!S)return;if(!["image/jpeg","image/png"].includes(S.type)){f.ElMessage.error("请上传JPG/PNG格式的图片"),k.value="";return}if(S.size>10*1024*1024){f.ElMessage.error("图片大小不能超过10MB"),k.value="";return}o("upload",S),k.value=""}return(C,k)=>(f.openBlock(),f.createElementBlock("div",Le,[f.createBaseVNode("div",Te,[C.allowCamera!==!1?(f.openBlock(),f.createElementBlock("div",{key:0,class:f.normalizeClass(["upload-btn",{"single-button":!p.value}]),onClick:k[0]||(k[0]=S=>h("camera"))},Pe,2)):f.createCommentVNode("",!0),C.allowGallery!==!1?(f.openBlock(),f.createElementBlock("div",{key:1,class:f.normalizeClass(["upload-btn",{"single-button":!p.value}]),onClick:k[1]||(k[1]=S=>h("gallery"))},je,2)):f.createCommentVNode("",!0)]),f.createBaseVNode("input",{ref_key:"galleryInput",ref:t,type:"file",accept:".jpg,.jpeg,.png",style:{display:"none"},onChange:k[2]||(k[2]=S=>m(S))},null,544),f.createBaseVNode("input",{ref_key:"cameraInput",ref:l,type:"file",accept:".jpg,.jpeg,.png",capture:"environment",style:{display:"none"},onChange:k[3]||(k[3]=S=>m(S))},null,544)]))}}),Ve=f._export_sfc(Me,[["__scopeId","data-v-908bdd1c"]]),$e={key:0,class:"section-header"},He={class:"section-body"},qe={class:"field-cell-pair"},Ne={class:"field-label"},Ge={class:"field-value"},Ke=["onBlur"],Xe={key:1,class:"value-text"},We={key:0,class:"section-header"},Je={class:"section-body"},Ze={class:"field-label field-label-editor"},Ye={class:"field-value"},Qe=["onBlur"],et={key:1,class:"value-text"},tt=f.defineComponent({__name:"OcrResultTable",props:{sections:{},ocrData:{},canEdit:{type:Boolean},ocrType:{},isLanding:{type:Boolean}},emits:["update:field"],setup(r,{emit:n}){const e=n;function o(i,t){const l=t.target;e("update:field",i,l.innerText||"")}return(i,t)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["ocr-result-table",{"landing-layout":i.isLanding}])},[i.isLanding?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(i.sections,(l,p)=>(f.openBlock(),f.createElementBlock("div",{key:p,class:"section-table"},[i.sections.length>1&&l.name?(f.openBlock(),f.createElementBlock("div",$e,f.toDisplayString(l.name),1)):f.createCommentVNode("",!0),f.createBaseVNode("div",He,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(l.fields,v=>(f.openBlock(),f.createElementBlock("div",{key:v.key,class:"field-row-pair"},[f.createBaseVNode("div",qe,[f.createBaseVNode("div",Ne,f.toDisplayString(v.label),1),f.createBaseVNode("div",Ge,[i.canEdit?(f.openBlock(),f.createElementBlock("div",{key:0,class:"value-input",contenteditable:"",onBlur:a=>o(v.key,a),onKeydown:t[0]||(t[0]=f.withKeys(f.withModifiers(a=>a.target.blur(),["prevent"]),["enter"]))},f.toDisplayString(i.ocrData[v.key]||""),41,Ke)):(f.openBlock(),f.createElementBlock("span",Xe,f.toDisplayString(i.ocrData[v.key]||""),1))])])]))),128))])]))),128)):(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:1},f.renderList(i.sections,(l,p)=>(f.openBlock(),f.createElementBlock("div",{key:p,class:"section-table"},[i.sections.length>1&&l.name?(f.openBlock(),f.createElementBlock("div",We,f.toDisplayString(l.name),1)):f.createCommentVNode("",!0),f.createBaseVNode("div",Je,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(l.fields,v=>(f.openBlock(),f.createElementBlock("div",{class:"field-row",key:v.key},[f.createBaseVNode("div",Ze,f.toDisplayString(v.label),1),f.createBaseVNode("div",Ye,[i.canEdit?(f.openBlock(),f.createElementBlock("div",{key:0,class:"value-input",contenteditable:"",onBlur:a=>o(v.key,a),onKeydown:t[1]||(t[1]=f.withKeys(f.withModifiers(a=>a.target.blur(),["prevent"]),["enter"]))},f.toDisplayString(i.ocrData[v.key]||""),41,Qe)):(f.openBlock(),f.createElementBlock("span",et,f.toDisplayString(i.ocrData[v.key]||""),1))])]))),128))])]))),128))],2))}}),nt=f._export_sfc(tt,[["__scopeId","data-v-61a3a77c"]]);async function rt(r){const{url:n,keys:e,eacb:o}=r,t=(await f.globalInject.$axios.post("/v2/form/ocrRecognize",{eacb:o,url:n,keys:e})).data;if(t.status!==1)throw new Error(t.msg||"OCR 识别失败");const l=t.result;if(!Array.isArray(l)||l.length===0)throw new Error("OCR 识别返回空数据");const p={};for(const{key:v,value:a}of l)v&&(p[v]=a??"");return{fields:p}}var me=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),B;(function(r){r.InvalidFile="InvalidFile",r.InvalidToken="InvalidToken",r.InvalidMetadata="InvalidMetadata",r.InvalidChunkSize="InvalidChunkSize",r.InvalidCustomVars="InvalidCustomVars",r.NotAvailableUploadHost="NotAvailableUploadHost",r.ReadCacheFailed="ReadCacheFailed",r.InvalidCacheData="InvalidCacheData",r.WriteCacheFailed="WriteCacheFailed",r.RemoveCacheFailed="RemoveCacheFailed",r.GetCanvasContextFailed="GetCanvasContextFailed",r.UnsupportedFileType="UnsupportedFileType",r.FileReaderReadFailed="FileReaderReadFailed",r.NotAvailableXMLHttpRequest="NotAvailableXMLHttpRequest",r.InvalidProgressEventTarget="InvalidProgressEventTarget",r.RequestError="RequestError"})(B||(B={}));var E=function(){function r(n,e){this.name=n,this.message=e,this.stack=new Error().stack}return r}(),G=function(r){me(n,r);function n(e,o,i,t){var l=r.call(this,B.RequestError,i)||this;return l.code=e,l.reqId=o,l.isRequestError=!0,l.data=t,l}return n}(E),it=function(r){me(n,r);function n(e,o){return o===void 0&&(o=""),r.call(this,0,o,e)||this}return n}(G),ot=function(){function r(n,e){this.runTask=n,this.limit=e,this.aborted=!1,this.queue=[],this.processing=[]}return r.prototype.enqueue=function(n){var e=this;return new Promise(function(o,i){e.queue.push({task:n,resolve:o,reject:i}),e.check()})},r.prototype.run=function(n){var e=this;this.queue=this.queue.filter(function(o){return o!==n}),this.processing.push(n),this.runTask(n.task).then(function(){e.processing=e.processing.filter(function(o){return o!==n}),n.resolve(),e.check()},function(o){return n.reject(o)})},r.prototype.check=function(){var n=this;if(!this.aborted){var e=this.processing.length,o=this.limit-e;this.queue.slice(0,o).forEach(function(i){n.run(i)})}},r.prototype.abort=function(){this.queue=[],this.aborted=!0},r}(),at=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),q=function(){return q=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},q.apply(this,arguments)},st=function(){function r(){this.closed=!1}return r.prototype.unsubscribe=function(){this.closed||(this.closed=!0,this._unsubscribe&&this._unsubscribe())},r.prototype.add=function(n){this._unsubscribe=n},r}(),ut=function(r){at(n,r);function n(e,o,i){var t=r.call(this)||this;return t.isStopped=!1,e&&typeof e=="object"?t.destination=e:t.destination=q(q(q({},e&&{next:e}),o&&{error:o}),i&&{complete:i}),t}return n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this))},n.prototype.next=function(e){!this.isStopped&&this.destination.next&&this.destination.next(e)},n.prototype.error=function(e){!this.isStopped&&this.destination.error&&(this.isStopped=!0,this.destination.error(e))},n.prototype.complete=function(e){!this.isStopped&&this.destination.complete&&(this.isStopped=!0,this.destination.complete(e))},n}(st),lt=function(){function r(n){this._subscribe=n}return r.prototype.subscribe=function(n,e,o){var i=new ut(n,e,o);return i.add(this._subscribe(i)),i},r}();function ct(r){if(r===null||typeof r>"u")return"";var n=r+"",e="",o,i,t=0;o=i=0,t=n.length;for(var l=0;l<t;l++){var p=n.charCodeAt(l),v=null;if(p<128)i++;else if(p>127&&p<2048)v=String.fromCharCode(p>>6|192,p&63|128);else if((p&63488^55296)>0)v=String.fromCharCode(p>>12|224,p>>6&63|128,p&63|128);else{if((p&64512^55296)>0)throw new RangeError("Unmatched trail surrogate at "+l);var a=n.charCodeAt(++l);if((a&64512^56320)>0)throw new RangeError("Unmatched lead surrogate at "+(l-1));p=((p&1023)<<10)+(a&1023)+65536,v=String.fromCharCode(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}v!==null&&(i>o&&(e+=n.slice(o,i)),e+=v,o=i=l+1)}return i>o&&(e+=n.slice(o,t)),e}function ft(r){var n=[],e=0,o=0,i=0;for(r+="";e<r.length;){o=r.charCodeAt(e)&255,i=0,o<=191?(o=o&127,i=1):o<=223?(o=o&31,i=2):o<=239?(o=o&15,i=3):(o=o&7,i=4);for(var t=1;t<i;++t)o=o<<6|r.charCodeAt(t+e)&63;i===4?(o-=65536,n.push(String.fromCharCode(55296|o>>10&1023)),n.push(String.fromCharCode(56320|o&1023))):n.push(String.fromCharCode(o)),e+=i}return n.join("")}function dt(r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e,o,i,t,l,p,v,a,h=0,m=0,C="",k=[];if(!r)return r;r=ct(r+"");do e=r.charCodeAt(h++),o=r.charCodeAt(h++),i=r.charCodeAt(h++),a=e<<16|o<<8|i,t=a>>18&63,l=a>>12&63,p=a>>6&63,v=a&63,k[m++]=n.charAt(t)+n.charAt(l)+n.charAt(p)+n.charAt(v);while(h<r.length);switch(C=k.join(""),r.length%3){case 1:C=C.slice(0,-2)+"==";break;case 2:C=C.slice(0,-1)+"=";break}return C}function ht(r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e,o,i,t,l,p,v,a,h=0,m=0,C="",k=[];if(!r)return r;r+="";do t=n.indexOf(r.charAt(h++)),l=n.indexOf(r.charAt(h++)),p=n.indexOf(r.charAt(h++)),v=n.indexOf(r.charAt(h++)),a=t<<18|l<<12|p<<6|v,e=a>>16&255,o=a>>8&255,i=a&255,p===64?k[m++]=String.fromCharCode(e):v===64?k[m++]=String.fromCharCode(e,o):k[m++]=String.fromCharCode(e,o,i);while(h<r.length);return C=k.join(""),ft(C)}function be(r){return r=dt(r),r.replace(/\//g,"_").replace(/\+/g,"-")}function pt(r){return r=r.replace(/_/g,"/").replace(/-/g,"+"),ht(r)}var we={exports:{}};(function(r,n){(function(e){r.exports=e()})(function(e){var o=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(g,y){var u=g[0],s=g[1],d=g[2],c=g[3];u+=(s&d|~s&c)+y[0]-680876936|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[1]-389564586|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[2]+606105819|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[3]-1044525330|0,s=(s<<22|s>>>10)+d|0,u+=(s&d|~s&c)+y[4]-176418897|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[5]+1200080426|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[6]-1473231341|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[7]-45705983|0,s=(s<<22|s>>>10)+d|0,u+=(s&d|~s&c)+y[8]+1770035416|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[9]-1958414417|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[10]-42063|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[11]-1990404162|0,s=(s<<22|s>>>10)+d|0,u+=(s&d|~s&c)+y[12]+1804603682|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[13]-40341101|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[14]-1502002290|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[15]+1236535329|0,s=(s<<22|s>>>10)+d|0,u+=(s&c|d&~c)+y[1]-165796510|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[6]-1069501632|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[11]+643717713|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[0]-373897302|0,s=(s<<20|s>>>12)+d|0,u+=(s&c|d&~c)+y[5]-701558691|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[10]+38016083|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[15]-660478335|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[4]-405537848|0,s=(s<<20|s>>>12)+d|0,u+=(s&c|d&~c)+y[9]+568446438|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[14]-1019803690|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[3]-187363961|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[8]+1163531501|0,s=(s<<20|s>>>12)+d|0,u+=(s&c|d&~c)+y[13]-1444681467|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[2]-51403784|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[7]+1735328473|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[12]-1926607734|0,s=(s<<20|s>>>12)+d|0,u+=(s^d^c)+y[5]-378558|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[8]-2022574463|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[11]+1839030562|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[14]-35309556|0,s=(s<<23|s>>>9)+d|0,u+=(s^d^c)+y[1]-1530992060|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[4]+1272893353|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[7]-155497632|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[10]-1094730640|0,s=(s<<23|s>>>9)+d|0,u+=(s^d^c)+y[13]+681279174|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[0]-358537222|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[3]-722521979|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[6]+76029189|0,s=(s<<23|s>>>9)+d|0,u+=(s^d^c)+y[9]-640364487|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[12]-421815835|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[15]+530742520|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[2]-995338651|0,s=(s<<23|s>>>9)+d|0,u+=(d^(s|~c))+y[0]-198630844|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[7]+1126891415|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[14]-1416354905|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[5]-57434055|0,s=(s<<21|s>>>11)+d|0,u+=(d^(s|~c))+y[12]+1700485571|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[3]-1894986606|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[10]-1051523|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[1]-2054922799|0,s=(s<<21|s>>>11)+d|0,u+=(d^(s|~c))+y[8]+1873313359|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[15]-30611744|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[6]-1560198380|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[13]+1309151649|0,s=(s<<21|s>>>11)+d|0,u+=(d^(s|~c))+y[4]-145523070|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[11]-1120210379|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[2]+718787259|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[9]-343485551|0,s=(s<<21|s>>>11)+d|0,g[0]=u+g[0]|0,g[1]=s+g[1]|0,g[2]=d+g[2]|0,g[3]=c+g[3]|0}function t(g){var y=[],u;for(u=0;u<64;u+=4)y[u>>2]=g.charCodeAt(u)+(g.charCodeAt(u+1)<<8)+(g.charCodeAt(u+2)<<16)+(g.charCodeAt(u+3)<<24);return y}function l(g){var y=[],u;for(u=0;u<64;u+=4)y[u>>2]=g[u]+(g[u+1]<<8)+(g[u+2]<<16)+(g[u+3]<<24);return y}function p(g){var y=g.length,u=[1732584193,-271733879,-1732584194,271733878],s,d,c,I,F,O;for(s=64;s<=y;s+=64)i(u,t(g.substring(s-64,s)));for(g=g.substring(s-64),d=g.length,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=0;s<d;s+=1)c[s>>2]|=g.charCodeAt(s)<<(s%4<<3);if(c[s>>2]|=128<<(s%4<<3),s>55)for(i(u,c),s=0;s<16;s+=1)c[s]=0;return I=y*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),F=parseInt(I[2],16),O=parseInt(I[1],16)||0,c[14]=F,c[15]=O,i(u,c),u}function v(g){var y=g.length,u=[1732584193,-271733879,-1732584194,271733878],s,d,c,I,F,O;for(s=64;s<=y;s+=64)i(u,l(g.subarray(s-64,s)));for(g=s-64<y?g.subarray(s-64):new Uint8Array(0),d=g.length,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=0;s<d;s+=1)c[s>>2]|=g[s]<<(s%4<<3);if(c[s>>2]|=128<<(s%4<<3),s>55)for(i(u,c),s=0;s<16;s+=1)c[s]=0;return I=y*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),F=parseInt(I[2],16),O=parseInt(I[1],16)||0,c[14]=F,c[15]=O,i(u,c),u}function a(g){var y="",u;for(u=0;u<4;u+=1)y+=o[g>>u*8+4&15]+o[g>>u*8&15];return y}function h(g){var y;for(y=0;y<g.length;y+=1)g[y]=a(g[y]);return g.join("")}h(p("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function g(y,u){return y=y|0||0,y<0?Math.max(y+u,0):Math.min(y,u)}ArrayBuffer.prototype.slice=function(y,u){var s=this.byteLength,d=g(y,s),c=s,I,F,O,X;return u!==e&&(c=g(u,s)),d>c?new ArrayBuffer(0):(I=c-d,F=new ArrayBuffer(I),O=new Uint8Array(F),X=new Uint8Array(this,d,I),O.set(X),F)}}();function m(g){return/[\u0080-\uFFFF]/.test(g)&&(g=unescape(encodeURIComponent(g))),g}function C(g,y){var u=g.length,s=new ArrayBuffer(u),d=new Uint8Array(s),c;for(c=0;c<u;c+=1)d[c]=g.charCodeAt(c);return y?d:s}function k(g){return String.fromCharCode.apply(null,new Uint8Array(g))}function S(g,y,u){var s=new Uint8Array(g.byteLength+y.byteLength);return s.set(new Uint8Array(g)),s.set(new Uint8Array(y),g.byteLength),s}function A(g){var y=[],u=g.length,s;for(s=0;s<u-1;s+=2)y.push(parseInt(g.substr(s,2),16));return String.fromCharCode.apply(String,y)}function x(){this.reset()}return x.prototype.append=function(g){return this.appendBinary(m(g)),this},x.prototype.appendBinary=function(g){this._buff+=g,this._length+=g.length;var y=this._buff.length,u;for(u=64;u<=y;u+=64)i(this._hash,t(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},x.prototype.end=function(g){var y=this._buff,u=y.length,s,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c;for(s=0;s<u;s+=1)d[s>>2]|=y.charCodeAt(s)<<(s%4<<3);return this._finish(d,u),c=h(this._hash),g&&(c=A(c)),this.reset(),c},x.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},x.prototype.setState=function(g){return this._buff=g.buff,this._length=g.length,this._hash=g.hash,this},x.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},x.prototype._finish=function(g,y){var u=y,s,d,c;if(g[u>>2]|=128<<(u%4<<3),u>55)for(i(this._hash,g),u=0;u<16;u+=1)g[u]=0;s=this._length*8,s=s.toString(16).match(/(.*?)(.{0,8})$/),d=parseInt(s[2],16),c=parseInt(s[1],16)||0,g[14]=d,g[15]=c,i(this._hash,g)},x.hash=function(g,y){return x.hashBinary(m(g),y)},x.hashBinary=function(g,y){var u=p(g),s=h(u);return y?A(s):s},x.ArrayBuffer=function(){this.reset()},x.ArrayBuffer.prototype.append=function(g){var y=S(this._buff.buffer,g),u=y.length,s;for(this._length+=g.byteLength,s=64;s<=u;s+=64)i(this._hash,l(y.subarray(s-64,s)));return this._buff=s-64<u?new Uint8Array(y.buffer.slice(s-64)):new Uint8Array(0),this},x.ArrayBuffer.prototype.end=function(g){var y=this._buff,u=y.length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d,c;for(d=0;d<u;d+=1)s[d>>2]|=y[d]<<(d%4<<3);return this._finish(s,u),c=h(this._hash),g&&(c=A(c)),this.reset(),c},x.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.ArrayBuffer.prototype.getState=function(){var g=x.prototype.getState.call(this);return g.buff=k(g.buff),g},x.ArrayBuffer.prototype.setState=function(g){return g.buff=C(g.buff,!0),x.prototype.setState.call(this,g)},x.ArrayBuffer.prototype.destroy=x.prototype.destroy,x.ArrayBuffer.prototype._finish=x.prototype._finish,x.ArrayBuffer.hash=function(g,y){var u=v(new Uint8Array(g)),s=h(u);return y?A(s):s},x})})(we);var yt=we.exports;const gt=f.getDefaultExportFromCjs(yt);var J=function(){return J=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},J.apply(this,arguments)},vt=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},mt=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},D=Math.pow(1024,2);function bt(r,n){var e=n*D;if(e>r.size)e=r.size;else for(;r.size>e*1e4;)e*=2;for(var o=[],i=Math.ceil(r.size/e),t=0;t<i;t++){var l=r.slice(e*t,t===i-1?r.size:e*(t+1));o.push(l)}return o}function wt(r){return Object.keys(r).every(function(n){return n.indexOf("x-qn-meta-")===0})}function _t(r){return Object.keys(r).every(function(n){return n.indexOf("x:")===0})}function kt(r){return r.reduce(function(n,e){return n+e},0)}function xt(r,n,e){try{localStorage.setItem(r,JSON.stringify(n))}catch{e.warn(new E(B.WriteCacheFailed,"setLocalFileInfo failed: "+r))}}function Ct(r,n,e){var o=n==null?"_":"_key_"+n+"_";return"qiniu_js_sdk_upload_file_name_"+r+o+"size_"+e}function re(r,n){try{localStorage.removeItem(r)}catch{n.warn(new E(B.RemoveCacheFailed,"removeLocalFileInfo failed. key: "+r))}}function St(r,n){var e=null;try{e=localStorage.getItem(r)}catch{n.warn(new E(B.ReadCacheFailed,"getLocalFileInfo failed. key: "+r))}if(e==null)return null;var o=null;try{o=JSON.parse(e)}catch{re(r,n),n.warn(new E(B.InvalidCacheData,"getLocalFileInfo failed to parse. key: "+r))}return o}function Y(r){var n="UpToken "+r;return{Authorization:n}}function Bt(r){var n=Y(r);return J({"content-type":"application/octet-stream"},n)}function Et(r){var n=Y(r);return J({"content-type":"application/json"},n)}function _e(){if(window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)return new window.ActiveXObject("Microsoft.XMLHTTP");throw new E(B.NotAvailableXMLHttpRequest,"the current environment does not support.")}function It(r){return vt(this,void 0,void 0,function(){var n,e;return mt(this,function(o){switch(o.label){case 0:return[4,At(r)];case 1:return n=o.sent(),e=new gt.ArrayBuffer,e.append(n),[2,e.end()]}})})}function At(r){return new Promise(function(n,e){var o=new FileReader;o.onload=function(i){if(i.target){var t=i.target.result;n(t)}else e(new E(B.InvalidProgressEventTarget,"progress event target is undefined"))},o.onerror=function(){e(new E(B.FileReaderReadFailed,"fileReader read failed"))},o.readAsArrayBuffer(r)})}function K(r,n){return new Promise(function(e,o){var i=_e();if(i.open(n.method,r),n.onCreate&&n.onCreate(i),n.headers){var t=n.headers;Object.keys(t).forEach(function(l){i.setRequestHeader(l,t[l])})}i.upload.addEventListener("progress",function(l){l.lengthComputable&&n.onProgress&&n.onProgress({loaded:l.loaded,total:l.total})}),i.onreadystatechange=function(){var l=i.responseText;if(i.readyState===4){var p=i.getResponseHeader("x-reqId")||"";if(i.status===0){o(new it("network error.",p));return}if(i.status!==200){var v="xhr request failed, code: "+i.status;l&&(v+=" response: "+l);var a=void 0;try{a=JSON.parse(l)}catch{}o(new G(i.status,p,v,a));return}try{e({data:JSON.parse(l),reqId:p})}catch(h){o(h)}}},i.send(n.body)})}function Ut(r){if(r&&r.match){var n=r.match(/(^https?)/);if(!n)return"";var e=n[1];return n=r.match(/^https?:\/\/([^:^/]*):(\d*)/),n?n[2]:e==="http"?"80":"443"}return""}function Ft(r){if(r&&r.match){var n=r.match(/^https?:\/\/([^:^/]*)/);return n?n[1]:""}return""}function ie(r){if(!r)throw new E(B.InvalidToken,"invalid token.");var n=r.split(":");if(n.length===1)throw new E(B.InvalidToken,"invalid token segments.");var e=n.length>3?n[1]:n[0];if(!e)throw new E(B.InvalidToken,"missing assess key field.");var o=null;try{o=JSON.parse(pt(n[n.length-1]))}catch{throw new E(B.InvalidToken,"token parse failed.")}if(o==null)throw new E(B.InvalidToken,"putPolicy is null.");if(o.scope==null)throw new E(B.InvalidToken,"scope field is null.");var i=o.scope.split(":")[0];if(!i)throw new E(B.InvalidToken,"resolve bucketName failed.");return{assessKey:e,bucketName:i,scope:o.scope}}var z,P={z0:"z0",z1:"z1",z2:"z2",na0:"na0",as0:"as0",cnEast2:"cn-east-2"},Ot=(z={},z[P.z0]={srcUphost:["up.qiniup.com"],cdnUphost:["upload.qiniup.com"]},z[P.z1]={srcUphost:["up-z1.qiniup.com"],cdnUphost:["upload-z1.qiniup.com"]},z[P.z2]={srcUphost:["up-z2.qiniup.com"],cdnUphost:["upload-z2.qiniup.com"]},z[P.na0]={srcUphost:["up-na0.qiniup.com"],cdnUphost:["upload-na0.qiniup.com"]},z[P.as0]={srcUphost:["up-as0.qiniup.com"],cdnUphost:["upload-as0.qiniup.com"]},z[P.cnEast2]={srcUphost:["up-cn-east-2.qiniup.com"],cdnUphost:["upload-cn-east-2.qiniup.com"]},z),V=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}},zt=function(r,n,e,o){return n=n||"&",e=e||"=",r===null&&(r=void 0),typeof r=="object"?Object.keys(r).map(function(i){var t=encodeURIComponent(V(i))+e;return Array.isArray(r[i])?r[i].map(function(l){return t+encodeURIComponent(V(l))}).join(n):t+encodeURIComponent(V(r[i]))}).filter(Boolean).join(n):o?encodeURIComponent(V(o))+e+encodeURIComponent(V(r)):""},ke;ke=zt;var R=function(){return R=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},R.apply(this,arguments)},Lt=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},Tt=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};function Rt(r,n,e){return Lt(this,void 0,void 0,function(){var o,i;return Tt(this,function(t){return o=ke({ak:r,bucket:n}),i=e+"://api.qiniu.com/v2/query?"+o,[2,K(i,{method:"GET"})]})})}function xe(r,n,e){var o=e.url,i=e.id;return o+"/buckets/"+r+"/objects/"+(n!=null?be(n):"~")+"/uploads/"+i}function Pt(r,n,e,o){var i=o+"/buckets/"+n+"/objects/"+(e!=null?be(e):"~")+"/uploads";return K(i,{method:"POST",headers:Y(r)})}function Dt(r,n,e,o,i){var t=ie(r).bucketName,l=xe(t,n,o)+("/"+e),p=Bt(r);return i.md5&&(p["Content-MD5"]=i.md5),K(l,R(R({},i),{method:"PUT",headers:p}))}function jt(r,n,e,o){var i=ie(r).bucketName,t=xe(i,n,e);return K(t,R(R({},o),{method:"POST",headers:Et(r)}))}function Mt(r,n,e){return K(r,R({method:"POST",body:n},e))}var Z=function(){return Z=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},Z.apply(this,arguments)},ue=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},le=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Vt=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},$t=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Vt(arguments[n]));return r},Ht=4,Ce=[0,502,503,504,599],qt=$t(Ce,[406]),Nt=Math.pow(1024,3),Se=function(){function r(n,e,o,i){this.hostPool=o,this.logger=i,this.aborted=!1,this.retryCount=0,this.xhrList=[],this.config=n.config,i.info("config inited.",this.config),this.putExtra=Z({fname:""},n.putExtra),i.info("putExtra inited.",this.putExtra),this.key=n.key,this.file=n.file,this.token=n.token,this.onData=e.onData,this.onError=e.onError,this.onComplete=e.onComplete;try{var t=ie(this.token);this.bucketName=t.bucketName,this.assessKey=t.assessKey}catch(l){i.error("get putPolicy from token failed.",l),this.onError(l)}}return r.prototype.checkAndUpdateUploadHost=function(){return ue(this,void 0,void 0,function(){var n;return le(this,function(e){switch(e.label){case 0:return this.logger.info("get available upload host."),[4,this.hostPool.getUp(this.assessKey,this.bucketName,this.config.upprotocol)];case 1:if(n=e.sent(),n==null)throw new E(B.NotAvailableUploadHost,"no available upload host.");return this.uploadHost!=null&&this.uploadHost.host!==n.host?this.logger.warn("host switches from "+this.uploadHost.host+" to "+n.host+"."):this.logger.info("use host "+n.host+"."),this.uploadHost=n,[2]}})})},r.prototype.checkAndUnfreezeHost=function(){this.logger.info("check unfreeze host."),this.uploadHost!=null&&this.uploadHost.isFrozen()&&(this.logger.warn(this.uploadHost.host+" will be unfrozen."),this.uploadHost.unfreeze())},r.prototype.checkAndFreezeHost=function(n){this.logger.info("check freeze host."),n instanceof G&&this.uploadHost!=null&&Ce.includes(n.code)&&(this.logger.warn(this.uploadHost.host+" will be temporarily frozen."),this.uploadHost.freeze())},r.prototype.handleError=function(n){this.logger.error(n.message),this.onError(n)},r.prototype.putFile=function(){return ue(this,void 0,void 0,function(){var n,e,o,i;return le(this,function(t){switch(t.label){case 0:if(this.aborted=!1,this.putExtra.fname||(this.logger.info("use file.name as fname."),this.putExtra.fname=this.file.name),this.file.size>1e4*Nt)return this.handleError(new E(B.InvalidFile,"file size exceed maximum value 10000G")),[2];if(this.putExtra.customVars&&!_t(this.putExtra.customVars))return this.handleError(new E(B.InvalidCustomVars,"customVars key should start width x:")),[2];if(this.putExtra.metadata&&!wt(this.putExtra.metadata))return this.handleError(new E(B.InvalidMetadata,"metadata key should start with x-qn-meta-")),[2];t.label=1;case 1:return t.trys.push([1,4,,5]),this.uploadAt=new Date().getTime(),[4,this.checkAndUpdateUploadHost()];case 2:return t.sent(),[4,this.run()];case 3:return n=t.sent(),this.onComplete(n.data),this.checkAndUnfreezeHost(),this.sendLog(n.reqId,200),[2];case 4:return e=t.sent(),this.aborted?(this.logger.warn("upload is aborted."),this.sendLog("",-2),[2]):(this.clear(),this.logger.error(e),e instanceof G&&(this.sendLog(e.reqId,e.code),this.checkAndFreezeHost(e),o=++this.retryCount<=this.config.retryCount,i=qt.includes(e.code),i&&o)?(this.logger.warn("error auto retry: "+this.retryCount+"/"+this.config.retryCount+"."),this.putFile(),[2]):(this.onError(e),[3,5]));case 5:return[2]}})})},r.prototype.clear=function(){this.xhrList.forEach(function(n){n.onreadystatechange=null,n.abort()}),this.xhrList=[],this.logger.info("cleanup uploading xhr.")},r.prototype.stop=function(){this.logger.info("aborted."),this.clear(),this.aborted=!0},r.prototype.addXhr=function(n){this.xhrList.push(n)},r.prototype.sendLog=function(n,e){var o,i;this.logger.report({code:e,reqId:n,remoteIp:"",upType:"jssdk-h5",size:this.file.size,time:Math.floor(this.uploadAt/1e3),port:Ut((o=this.uploadHost)===null||o===void 0?void 0:o.getUrl()),host:Ft((i=this.uploadHost)===null||i===void 0?void 0:i.getUrl()),bytesSent:this.progress?this.progress.total.loaded:0,duration:Math.floor((new Date().getTime()-this.uploadAt)/1e3)})},r.prototype.getProgressInfoItem=function(n,e,o){return Z({size:e,loaded:n,percent:n/e*100},o==null?{}:{fromCache:o})},r}(),Gt=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),N=function(){return N=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},N.apply(this,arguments)},$=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},H=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};function Kt(r){var n=/^[1-9]\d*$/;return n.test(String(r))}var Xt=function(r){Gt(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}return n.prototype.run=function(){return $(this,void 0,void 0,function(){var e,o,i,t,l,p=this;return H(this,function(v){switch(v.label){case 0:if(this.logger.info("start run Resume."),!this.config.chunkSize||!Kt(this.config.chunkSize))throw new E(B.InvalidChunkSize,"chunkSize must be a positive integer");if(this.config.chunkSize>1024)throw new E(B.InvalidChunkSize,"chunkSize maximum value is 1024");return[4,this.initBeforeUploadChunks()];case 1:v.sent(),e=new ot(function(a){return $(p,void 0,void 0,function(){return H(this,function(h){switch(h.label){case 0:if(this.aborted)throw e.abort(),new Error("pool is aborted");return[4,this.uploadChunk(a)];case 1:return h.sent(),[2]}})})},this.config.concurrentRequestLimit),o=null,i=this.getLocalKey(),t=this.chunks.map(function(a,h){return e.enqueue({chunk:a,index:h})}),v.label=2;case 2:return v.trys.push([2,5,,6]),[4,Promise.all(t)];case 3:return v.sent(),[4,this.mkFileReq()];case 4:return o=v.sent(),[3,6];case 5:throw l=v.sent(),l instanceof G&&(l.code===612||l.code===400)&&re(i,this.logger),l;case 6:return re(i,this.logger),[2,o]}})})},n.prototype.uploadChunk=function(e){return $(this,void 0,void 0,function(){var o,i,t,l,p,v,a,h,m,C=this;return H(this,function(k){switch(k.label){case 0:return o=e.index,i=e.chunk,t=this.cachedUploadedList[o],this.logger.info("upload part "+o+", cache:",t),l=this.config.checkByMD5,p=function(){C.usedCacheList[o]=!0,C.updateChunkProgress(i.size,o),C.uploadedList[o]=t,C.updateLocalCache()},t&&!l?(p(),[2]):[4,It(i)];case 1:return v=k.sent(),this.logger.info("computed part md5.",v),t&&v===t.md5?(p(),[2]):(this.usedCacheList[o]=!1,a=function(S){C.updateChunkProgress(S.loaded,o)},h={body:i,md5:this.config.checkByServer?v:void 0,onProgress:a,onCreate:function(S){return C.addXhr(S)}},this.logger.info("part "+o+" start uploading."),[4,Dt(this.token,this.key,e.index+1,this.getUploadInfo(),h)]);case 2:return m=k.sent(),this.logger.info("part "+o+" upload completed."),a({loaded:i.size,total:i.size}),this.uploadedList[o]={etag:m.data.etag,md5:m.data.md5,size:i.size},this.updateLocalCache(),[2]}})})},n.prototype.mkFileReq=function(){return $(this,void 0,void 0,function(){var e,o,i=this;return H(this,function(t){switch(t.label){case 0:return e=N(N(N({parts:this.uploadedList.map(function(l,p){return{etag:l.etag,partNumber:p+1}}),fname:this.putExtra.fname},this.putExtra.mimeType&&{mimeType:this.putExtra.mimeType}),this.putExtra.customVars&&{customVars:this.putExtra.customVars}),this.putExtra.metadata&&{metadata:this.putExtra.metadata}),this.logger.info("parts upload completed, make file.",e),[4,jt(this.token,this.key,this.getUploadInfo(),{onCreate:function(l){return i.addXhr(l)},body:JSON.stringify(e)})];case 1:return o=t.sent(),this.logger.info("finish Resume Progress."),this.updateMkFileProgress(1),[2,o]}})})},n.prototype.initBeforeUploadChunks=function(){return $(this,void 0,void 0,function(){var e,o,i;return H(this,function(t){switch(t.label){case 0:return this.uploadedList=[],this.usedCacheList=[],e=St(this.getLocalKey(),this.logger),e?[3,2]:(this.logger.info("init upload parts from api."),[4,Pt(this.token,this.bucketName,this.key,this.uploadHost.getUrl())]);case 1:return o=t.sent(),this.logger.info("initd upload parts of id: "+o.data.uploadId+"."),this.uploadId=o.data.uploadId,this.cachedUploadedList=[],[3,3];case 2:i=["resume upload parts from local cache,","total "+e.data.length+" part,","id is "+e.id+"."],this.logger.info(i.join(" ")),this.cachedUploadedList=e.data,this.uploadId=e.id,t.label=3;case 3:return this.chunks=bt(this.file,this.config.chunkSize),this.loaded={mkFileProgress:0,chunks:this.chunks.map(function(l){return 0})},this.notifyResumeProgress(),[2]}})})},n.prototype.getUploadInfo=function(){return{id:this.uploadId,url:this.uploadHost.getUrl()}},n.prototype.getLocalKey=function(){return Ct(this.file.name,this.key,this.file.size)},n.prototype.updateLocalCache=function(){xt(this.getLocalKey(),{id:this.uploadId,data:this.uploadedList},this.logger)},n.prototype.updateChunkProgress=function(e,o){this.loaded.chunks[o]=e,this.notifyResumeProgress()},n.prototype.updateMkFileProgress=function(e){this.loaded.mkFileProgress=e,this.notifyResumeProgress()},n.prototype.notifyResumeProgress=function(){var e=this;this.progress={total:this.getProgressInfoItem(kt(this.loaded.chunks)+this.loaded.mkFileProgress,this.file.size+1),chunks:this.chunks.map(function(o,i){var t=e.usedCacheList[i];return e.getProgressInfoItem(e.loaded.chunks[i],o.size,t)}),uploadInfo:{id:this.uploadId,url:this.uploadHost.getUrl()}},this.onData(this.progress)},n}(Se),ce=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},fe=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Wt=function(){function r(){this.crc=-1,this.table=this.makeTable()}return r.prototype.makeTable=function(){for(var n=new Array,e=0;e<256;e++){for(var o=e,i=0;i<8;i++)o&1?o=o>>>1^3988292384:o>>>=1;n[e]=o}return n},r.prototype.append=function(n){for(var e=this.crc,o=0;o<n.byteLength;o++)e=e>>>8^this.table[(e^n[o])&255];this.crc=e},r.prototype.compute=function(){return(this.crc^-1)>>>0},r.prototype.readAsUint8Array=function(n){return ce(this,void 0,void 0,function(){var e;return fe(this,function(o){switch(o.label){case 0:return typeof n.arrayBuffer!="function"?[3,2]:(e=Uint8Array.bind,[4,n.arrayBuffer()]);case 1:return[2,new(e.apply(Uint8Array,[void 0,o.sent()]))];case 2:return[2,new Promise(function(i,t){var l=new FileReader;l.onload=function(){if(l.result==null){t();return}if(typeof l.result=="string"){t();return}i(new Uint8Array(l.result))},l.readAsArrayBuffer(n)})]}})})},r.prototype.file=function(n){return ce(this,void 0,void 0,function(){var e,o,i,t,l,p;return fe(this,function(v){switch(v.label){case 0:return n.size<=D?(e=this.append,[4,this.readAsUint8Array(n)]):[3,2];case 1:return e.apply(this,[v.sent()]),[2,this.compute()];case 2:o=Math.ceil(n.size/D),i=0,v.label=3;case 3:return i<o?(t=i*D,l=i===o-1?n.size:t+D,[4,this.readAsUint8Array(n.slice(t,l))]):[3,6];case 4:p=v.sent(),this.append(new Uint8Array(p)),v.label=5;case 5:return i++,[3,3];case 6:return[2,this.compute()]}})})},r.file=function(n){var e=new r;return e.file(n)},r}(),Jt=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),Zt=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},Yt=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},de=function(r){Jt(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}return n.prototype.run=function(){return Zt(this,void 0,void 0,function(){var e,o,i,t,l,p,v=this;return Yt(this,function(a){switch(a.label){case 0:return this.logger.info("start run Direct."),e=new FormData,this.putExtra.mimeType?(o=this.file.slice(0,this.file.size,this.putExtra.mimeType),e.append("file",o,this.putExtra.fname||this.file.name)):e.append("file",this.file,this.putExtra.fname||this.file.name),e.append("token",this.token),this.key!=null&&e.append("key",this.key),e.append("fname",this.putExtra.fname),this.config.checkByServer?[4,Wt.file(this.file)]:[3,2];case 1:i=a.sent(),e.append("crc32",i.toString()),a.label=2;case 2:return this.putExtra.customVars&&(this.logger.info("init customVars."),t=this.putExtra.customVars,Object.keys(t).forEach(function(h){return e.append(h,t[h].toString())}),this.logger.info("customVars inited.")),this.putExtra.metadata&&(this.logger.info("init metadata."),l=this.putExtra.metadata,Object.keys(l).forEach(function(h){return e.append(h,l[h].toString())})),this.logger.info("formData inited."),[4,Mt(this.uploadHost.getUrl(),e,{onProgress:function(h){v.updateDirectProgress(h.loaded,h.total)},onCreate:function(h){return v.addXhr(h)}})];case 3:return p=a.sent(),this.logger.info("Direct progress finish."),this.finishDirectProgress(),[2,p]}})})},n.prototype.updateDirectProgress=function(e,o){this.progress={total:this.getProgressInfoItem(e,o+1)},this.onData(this.progress)},n.prototype.finishDirectProgress=function(){if(!this.progress){this.logger.warn("progress is null."),this.progress={total:this.getProgressInfoItem(this.file.size,this.file.size)},this.onData(this.progress);return}var e=this.progress.total;this.progress={total:this.getProgressInfoItem(e.loaded+1,e.size)},this.onData(this.progress)},n}(Se);function Be(r,n,e){e===void 0&&(e=3);var o=_e();o.open("POST","https://uplog.qbox.me/log/3"),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.setRequestHeader("Authorization",Y(r).Authorization),o.onreadystatechange=function(){o.readyState===4&&o.status!==200&&e>0&&Be(r,n,e-1)};var i=[n.code||"",n.reqId||"",n.host||"",n.remoteIp||"",n.port||"",n.duration||"",n.time||"",n.bytesSent||"",n.upType||"",n.size||""].join(",");o.send(i)}var Qt=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},ee=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Qt(arguments[n]));return r},en=function(){function r(n,e,o,i){e===void 0&&(e=!0),o===void 0&&(o="OFF"),i===void 0&&(i="UPLOAD"),this.token=n,this.disableReport=e,this.level=o,this.prefix=i,this.id=++r.id}return r.prototype.getPrintPrefix=function(n){return"Qiniu-JS-SDK ["+n+"]["+this.prefix+"#"+this.id+"]:"},r.prototype.report=function(n,e){if(!this.disableReport)try{Be(this.token,n,e)}catch(o){this.warn(o)}},r.prototype.info=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var o=["INFO"];o.includes(this.level)&&console.log.apply(console,ee([this.getPrintPrefix("INFO")],n))},r.prototype.warn=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var o=["INFO","WARN"];o.includes(this.level)&&console.warn.apply(console,ee([this.getPrintPrefix("WARN")],n))},r.prototype.error=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var o=["INFO","WARN","ERROR"];o.includes(this.level)&&console.error.apply(console,ee([this.getPrintPrefix("ERROR")],n))},r.id=0,r}(),he=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},pe=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},tn=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},nn=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(tn(arguments[n]));return r},W=new Map,rn=function(){function r(n,e){this.host=n,this.protocol=e}return r.prototype.isFrozen=function(){var n=new Date().getTime(),e=W.get(this.host);return e!=null&&e>=n},r.prototype.freeze=function(n){n===void 0&&(n=20);var e=new Date().getTime()+n*1e3;W.set(this.host,e)},r.prototype.unfreeze=function(){W.delete(this.host)},r.prototype.getUrl=function(){return this.protocol+"://"+this.host},r.prototype.getUnfreezeTime=function(){return W.get(this.host)},r}(),on=function(){function r(n){n===void 0&&(n=[]),this.initHosts=n,this.cachedHostsMap=new Map}return r.prototype.register=function(n,e,o,i){this.cachedHostsMap.set(n+"@"+e,o.map(function(t){return new rn(t,i)}))},r.prototype.refresh=function(n,e,o){var i,t,l,p;return he(this,void 0,void 0,function(){var v,a,h;return pe(this,function(m){switch(m.label){case 0:return v=this.cachedHostsMap.get(n+"@"+e)||[],v.length>0?[2]:this.initHosts.length>0?(this.register(n,e,this.initHosts,o),[2]):[4,Rt(n,e,o)];case 1:return a=m.sent(),(a==null?void 0:a.data)!=null&&(h=nn(((t=(i=a.data.up)===null||i===void 0?void 0:i.acc)===null||t===void 0?void 0:t.main)||[],((p=(l=a.data.up)===null||l===void 0?void 0:l.acc)===null||p===void 0?void 0:p.backup)||[]),this.register(n,e,h,o)),[2]}})})},r.prototype.getUp=function(n,e,o){return he(this,void 0,void 0,function(){var i,t,l;return pe(this,function(p){switch(p.label){case 0:return[4,this.refresh(n,e,o)];case 1:return p.sent(),i=this.cachedHostsMap.get(n+"@"+e)||[],i.length===0?[2,null]:(t=i.filter(function(v){return!v.isFrozen()}),t.length>0?[2,t[0]]:(l=i.slice().sort(function(v,a){return(v.getUnfreezeTime()||0)-(a.getUnfreezeTime()||0)}),[2,l[0]]))}})})},r}();function an(r,n,e,o){return r.config&&r.config.forceDirect?(o.info("ues forceDirect mode."),new de(r,n,e,o)):r.file.size>4*D?(o.info("file size over 4M, use Resume."),new Xt(r,n,e,o)):(o.info("file size less or equal than 4M, use Direct."),new de(r,n,e,o))}function sn(r,n,e,o,i){var t=new en(e,void 0,void 0,r.name),l={file:r,key:n,token:e,putExtra:o,config:cn(i)},p=new on(l.config.uphost);return new lt(function(v){var a=an(l,{onData:function(h){return v.next(h)},onError:function(h){return v.error(h)},onComplete:function(h){return v.complete(h)}},p,t);return a.putFile(),a.stop.bind(a)})}var j=function(){return j=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},j.apply(this,arguments)},un=function(r,n){var e={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.indexOf(o)<0&&(e[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,o=Object.getOwnPropertySymbols(r);i<o.length;i++)n.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(r,o[i])&&(e[o[i]]=r[o[i]]);return e},ln=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},te=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(ln(arguments[n]));return r};function cn(r,n){var e=j({},r),o=e.upprotocol,i=e.uphost,t=un(e,["upprotocol","uphost"]),l=j({uphost:[],retryCount:3,checkByMD5:!1,forceDirect:!1,useCdnDomain:!0,checkByServer:!0,concurrentRequestLimit:3,chunkSize:Ht,upprotocol:"https",debugLogLevel:"OFF",disableStatisticsReport:!1},t);o&&(l.upprotocol=o.replace(/:$/,""));var p=[];if(i)Array.isArray(i)?p.push.apply(p,te(i)):p.push(i);else if(l!=null&&l.region){var v=Ot[l==null?void 0:l.region];l.useCdnDomain?p.push.apply(p,te(v.cdnUphost)):p.push.apply(p,te(v.srcUphost))}return j(j({},l),{uphost:p.filter(Boolean)})}var ye={PNG:"image/png",JPEG:"image/jpeg",WEBP:"image/webp",BMP:"image/bmp"};Object.keys(ye).map(function(r){return ye[r]});let ne=null;async function fn(r,n,e={}){if(!n){console.error("UID is required to upload file to other user's cloud storage");return}return ne||await i(),await t();async function i(){let{data:p}=await f.globalInject.$axios.get("/v2/form/uploadToken");if(p.status===1)ne=p.result;else throw new Error(p.msg)}async function t(){let p=e.path||"att_file/";const v=ge(e.name||r.name),a=parseInt(Date.now()/1e3).toString(),h=p+n+"/"+a+"_"+l()+"_."+ge(v);return sn(r,h,ne)}function l(){let p="";for(let v=0;v<6;v++){const a=parseInt(Math.random()*10);p+=a}return p}}const ge=r=>r.split(".").pop(),Ee=r=>(f.pushScopeId("data-v-45101ef0"),r=r(),f.popScopeId(),r),dn={class:"ocr-widget-box widget-box"},hn={class:"ocr-header"},pn={key:1,class:"ocr-image-preview"},yn=["src"],gn={key:0,class:"loading-overlay"},vn=Ee(()=>f.createBaseVNode("span",{class:"loading-spinner-icon"},null,-1)),mn=[vn],bn=Ee(()=>f.createBaseVNode("span",{class:"reupload-text"},"重新上传",-1)),wn=[bn],_n={key:0,class:"ocr-error-bar"},kn={class:"error-text"},xn=f.defineComponent({__name:"OcrWidget",props:{id:{},type:{},attrs:{},value:{}},emits:["update:value"],setup(r,{emit:n}){const e=r,o=n,i=f.inject("editable"),t=f.inject("formMode"),l=f.computed(()=>t.value==="answer-preview"),p=f.computed(()=>t.value==="input"||t.value==="preview"),v=f.ref(!1),a=f.ref(""),h=f.ref(!1),m=f.ref(!1),C=f.ref(""),k=["购买方","销售方","货物或应税劳务、服务"],S=f.ref(""),A=f.ref(""),x=f.ref(!1),g=f.computed(()=>{const b={};return e.attrs.sections.forEach(w=>{w.fields.filter(_=>_.visible!==!1&&_.label).forEach(_=>{k.includes(w.name)?b[_.key]=w.name+_.label:b[_.key]=_.label})}),b}),y=f.computed(()=>{const b={};for(const[w,_]of Object.entries(g.value))b[_]=w;return b}),u=f.computed(()=>{const b=e.value;if(!b)return{};if(typeof b=="object"&&"fields"in b)return b.fields||{};const w=b,_={};for(const[U,L]of Object.entries(w)){const T=y.value[U]||U;_[T]=L}return _}),s=f.computed(()=>({imageUrl:S.value,imageKey:A.value,recognized:x.value,fields:u.value}));function d(b){const w={};for(const[_,U]of Object.entries(b)){const L=g.value[_]||_;w[L]=U}return w}const c=f.ref(""),I=f.ref("");async function F(b){const w=await f.getCreateUid(),_=await fn(b,w);return new Promise((U,L)=>{_.subscribe({error:T=>L(T),complete:T=>U(T)})})}const O=f.computed(()=>{const b=[];return e.attrs.sections.forEach(w=>{w.fields.filter(_=>_.visible!==!1).forEach(_=>{if(_.label){let U=_.label;k.includes(w.name)&&(U=w.name+U),b.push(U)}})}),b}),X=f.computed(()=>{const b={};return e.attrs.sections.forEach(w=>{w.fields.filter(_=>_.visible!==!1&&_.label).forEach(_=>{b[_.label]=_.key,k.includes(w.name)&&(b[w.name+_.label]=_.key)})}),b}),oe=f.computed(()=>!!C.value||!!s.value.imageUrl),Ie=f.computed(()=>i||l.value?!1:!!(s.value.recognized||h.value)),Ae=f.computed(()=>{const b={};return e.attrs.sections.forEach(w=>{w.fields.forEach(_=>{b[_.key]=""})}),b}),Ue=f.computed(()=>e.attrs.sections.map(b=>({...b,fields:b.fields.filter(w=>w.visible!==!1).map(w=>{var _;return{...w,value:((_=s.value.fields)==null?void 0:_[w.key])??""}})})).filter(b=>b.fields.length>0));function M(b){b.imageUrl!==void 0&&(S.value=b.imageUrl),b.imageKey!==void 0&&(A.value=b.imageKey),b.recognized!==void 0&&(x.value=b.recognized);const w="fields"in b?b.fields:u.value;o("update:value",d(w))}async function Fe(b){if(!b)return m.value=!0,null;try{const w=await rt({url:b,keys:O.value}),_={};for(const[U,L]of Object.entries(w.fields)){const T=X.value[U]||U;_[T]=L}return _}catch(w){const _=w instanceof Error?w.message:"识别失败";return _.includes("超时")||_.includes("timeout"),m.value=!0,null}}async function Oe(b){C.value=URL.createObjectURL(b),v.value=!0,a.value="",m.value=!1,h.value=!1,M({fields:{},recognized:!1});try{const{key:w}=await F(b);if(!w){f.ElMessage.error("上传失败");return}I.value=w,c.value="https://fatt.bmwax.cn/"+w,M({imageUrl:c.value,imageKey:w});const _=await Fe(c.value);if(v.value=!1,se(),_){const U={...Ae.value,..._};M({fields:U,recognized:!0}),m.value=!1}else a.value="识别失败,请确保图片清晰、无遮挡并重新上传",m.value=!0}catch(w){v.value=!1,se(),a.value=w.message||"识别失败",Q()}}function ze(b,w){M({fields:{...s.value.fields,[b]:w}})}function ae(){M({imageUrl:"",imageKey:"",recognized:!1,fields:{}}),c.value="",I.value="",a.value="",v.value=!1,m.value=!1,h.value=!1,Q()}function Q(){C.value&&(URL.revokeObjectURL(C.value),C.value="")}f.onUnmounted(()=>{Q()});function se(){h.value=!0,a.value=""}return(b,w)=>(f.openBlock(),f.createElementBlock("div",dn,[f.createVNode(f._sfc_main),f.createVNode(f.ChoosenView,null,{default:f.withCtx(()=>[f.createVNode(f._sfc_main$1),f.createBaseVNode("div",{class:f.normalizeClass(["ocr-container",{disabled:f.unref(i)||l.value,"landing-layout":p.value}])},[f.createBaseVNode("div",hn,[oe.value?f.createCommentVNode("",!0):(f.openBlock(),f.createBlock(Ve,{key:0,editable:f.unref(i),"allow-camera":b.attrs.allowCamera,"allow-gallery":b.attrs.allowGallery,"is-landing":p.value,onUpload:Oe},null,8,["editable","allow-camera","allow-gallery","is-landing"])),oe.value?(f.openBlock(),f.createElementBlock("div",pn,[f.createBaseVNode("img",{src:C.value||s.value.imageUrl,alt:"上传图片"},null,8,yn),v.value?(f.openBlock(),f.createElementBlock("div",gn,mn)):a.value?(f.openBlock(),f.createElementBlock("div",{key:1,class:"error-overlay",onClick:ae},wn)):f.createCommentVNode("",!0),a.value?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("span",{key:2,class:"close-icon iconfont icon-form-close",onClick:ae}))])):f.createCommentVNode("",!0)]),a.value?(f.openBlock(),f.createElementBlock("div",_n,[f.createBaseVNode("span",kn,f.toDisplayString(a.value),1)])):f.createCommentVNode("",!0),f.createVNode(nt,{sections:Ue.value,"ocr-data":s.value.fields,"can-edit":Ie.value,"ocr-type":b.attrs.ocrType,"is-landing":p.value,"onUpdate:field":ze},null,8,["sections","ocr-data","can-edit","ocr-type","is-landing"])],2),f.createVNode(f.VerifyTip),f.createVNode(f._sfc_main$2)]),_:1})]))}}),Cn=f._export_sfc(xn,[["__scopeId","data-v-45101ef0"]]);exports.default=Cn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./main-
|
|
1
|
+
"use strict";const e=require("./main-DX3b4SJ1.cjs"),u=require("./index-CftE72_b.cjs"),i=e.defineComponent({__name:"OptionRandom",setup(l){const o=e.computed({get:()=>e.activeWidgetAttrs.value.optionRandom,set:t=>e.setOptionRandom(t)});return(t,n)=>o.value!==void 0?(e.openBlock(),e.createBlock(e.unref(u.SwitchRow),{key:0,label:"选项随机排列",modelValue:o.value,"onUpdate:modelValue":n[0]||(n[0]=a=>o.value=a)},null,8,["modelValue"])):e.createCommentVNode("",!0)}});exports._sfc_main=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),f={class:"page-header-view"},y=e.defineComponent({__name:"PageHeader",props:{attrs:{}},setup(d){const a=d,n=e.inject("editable"),u=e.inject("isMobileSize"),c=e.computed(()=>n?!0:!!a.attrs.desc),p=e.computed(()=>e.headerWidget.value.id===e.activeWidgetId.value),s=e.computed(()=>!n||!p.value),l=e.computed({get:()=>a.attrs.title,set:t=>{e.setPageHeaderAttrs("title",t)}}),i=e.computed({get:()=>a.attrs.desc,set:t=>{e.setPageHeaderAttrs("desc",t)}}),g=e.computed(()=>n?"40px 50px":u.value?"30px 20px 10px":"30px 20px 20px"),m=t=>{n&&t.target.select()},v=()=>{const t=l.value||"";t.trim()===""?e.setPageHeaderAttrs("title",e.getSceneFormTitle()):e.setPageHeaderAttrs("title",t)},x=t=>{n&&t.target.select()};return e.watch(()=>a.attrs.title,t=>{e.globalInject.setFormName(t)}),(t,o)=>(e.openBlock(),e.createElementBlock("div",f,[e.createBaseVNode("div",{class:"title-desc-view",style:e.normalizeStyle({padding:g.value})},[e.createVNode(e.unref(e.ElInput),{type:"textarea",autosize:"",resize:"none",modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=r=>l.value=r),maxlength:64,readonly:!e.unref(n),"input-style":{fontSize:"20px",fontWeight:"600",color:"#333333",textAlign:t.attrs.align,scrollbarWidth:"none",...s.value&&{boxShadow:"none",background:"transparent"}},onFocus:m,onBlur:v},null,8,["modelValue","readonly","input-style"]),c.value?(e.openBlock(),e.createBlock(e.unref(e.ElInput),{key:0,modelValue:i.value,"onUpdate:modelValue":o[1]||(o[1]=r=>i.value=r),type:"textarea",autosize:"",resize:"none",placeholder:"请描述你的问卷",readonly:!e.unref(n),style:e.normalizeStyle({marginTop:e.unref(n)?"10px":"0px"}),"input-style":{padding:"10px",fontSize:"14px",scrollbarWidth:"none",textAlign:t.attrs.align,...s.value&&{boxShadow:"none",background:"transparent"}},onFocus:x},null,8,["modelValue","readonly","style","input-style"])):e.createCommentVNode("",!0)],4)]))}}),b=e._export_sfc(y,[["__scopeId","data-v-87c94f3d"]]);exports.default=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),o=require("./index-CftE72_b.cjs"),n={class:"page-header-setting"},l=e.defineComponent({__name:"PageHeaderSetting",setup(d){e.ref(!1);const r=a=>{e.setPageHeaderAttrs("align",a)};return(a,c)=>{const t=e.resolveComponent("icon");return e.openBlock(),e.createElementBlock("div",n,[e.createVNode(e.unref(o.TitleRow),null,{default:e.withCtx(()=>[e.createTextVNode("标题设置")]),_:1}),e.createVNode(e.unref(o.Row),{wrap:"",label:"标题对齐方式"},{default:e.withCtx(()=>[e.createVNode(e.unref(e.ElRadioGroup),{class:"align-radio-group","model-value":e.unref(e.headerWidget).attrs.align,onChange:r},{default:e.withCtx(()=>[e.createVNode(e.unref(e.ElRadio),{value:"left"},{default:e.withCtx(()=>[e.createVNode(t,{type:"align-left"})]),_:1}),e.createVNode(e.unref(e.ElRadio),{value:"center"},{default:e.withCtx(()=>[e.createVNode(t,{type:"align-center"})]),_:1}),e.createVNode(e.unref(e.ElRadio),{value:"right"},{default:e.withCtx(()=>[e.createVNode(t,{type:"align-right"})]),_:1})]),_:1},8,["model-value"])]),_:1})])}}}),i=e._export_sfc(l,[["__scopeId","data-v-c595fe0e"]]);exports.default=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DX3b4SJ1.cjs"),c=n=>(e.pushScopeId("data-v-f49720f0"),n=n(),e.popScopeId(),n),u={key:0,class:"editor-pagination"},p={class:"line-row"},m=c(()=>e.createBaseVNode("div",{class:"line"},null,-1)),_={class:"info"},v=c(()=>e.createBaseVNode("div",{class:"line"},null,-1)),f={key:1,class:"input-pagination"},g=c(()=>e.createBaseVNode("div",{class:"line-row"},null,-1)),y={key:0,class:"title"},k={key:1,class:"desc"},V=e.defineComponent({__name:"Pagination",setup(n){const a=e.inject("editable"),t=e.inject("widgetStore"),r=e.computed(()=>!a||!t.isActive),s=e.computed({get:()=>t.attrs.title,set:l=>{t.updateAttr("title",l||"")}}),o=e.computed({get:()=>t.attrs.desc,set:l=>{t.updateAttr("desc",l||"")}});return(l,i)=>e.unref(a)?(e.openBlock(),e.createElementBlock("div",u,[e.createBaseVNode("div",p,[m,e.createBaseVNode("div",_,e.toDisplayString(`第${e.unref(t).index+1}页(共${e.unref(e.groupedWidgets).paginationList.length}页)`),1),v]),e.createVNode(e.unref(e.ElInput),{class:"title",modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=d=>s.value=d),type:"textarea",autosize:{minRows:1,maxRows:999},placeholder:"点击输入分页标题",readonly:!e.unref(a),resize:"none","input-style":{padding:"10px",fontSize:"16px",color:"#1a1a1a",scrollbarWidth:"none",...r.value&&{boxShadow:"none",background:"transparent"}}},null,8,["modelValue","readonly","input-style"]),e.unref(t).isActive||o.value?(e.openBlock(),e.createBlock(e.unref(e.ElInput),{key:0,class:"desc",modelValue:o.value,"onUpdate:modelValue":i[1]||(i[1]=d=>o.value=d),type:"textarea",autosize:{minRows:1,maxRows:999},placeholder:"点击输入分页提示",readonly:!e.unref(a),resize:"none","input-style":{padding:"8px 10px",fontSize:"14px",color:"#767676",scrollbarWidth:"none",...r.value&&{boxShadow:"none",background:"transparent"}}},null,8,["modelValue","readonly","input-style"])):e.createCommentVNode("",!0),e.createVNode(e._sfc_main$2)])):(e.openBlock(),e.createElementBlock("div",f,[g,s.value?(e.openBlock(),e.createElementBlock("div",y,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",k,e.toDisplayString(o.value),1)):e.createCommentVNode("",!0)]))}}),h=e._export_sfc(V,[["__scopeId","data-v-f49720f0"]]);exports.default=h;
|