@univerjs-pro/exchange-client 1.3.1 → 1.5.0
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/README.md +8 -13
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/plugin.d.ts +2 -1
- package/lib/types/services/exchange-scope.d.ts +7 -0
- package/lib/types/services/exchange.service.d.ts +9 -4
- package/lib/types/services/ole-collaboration.d.ts +3 -0
- package/lib/types/services/ole-office-converter.d.ts +8 -0
- package/lib/types/services/ole-online-converter.d.ts +4 -0
- package/lib/types/services/request.service.d.ts +15 -4
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +14 -13
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x21dea7=_0x3d2c;(function(_0x5c1f9f,_0x3945d4){const _0xa9cece=_0x3d2c,_0x44db70=_0x5c1f9f();while(!![]){try{const _0x242ea6=parseInt(_0xa9cece(0x21d))/0x1*(-parseInt(_0xa9cece(0x1b1))/0x2)+parseInt(_0xa9cece(0x1e3))/0x3*(parseInt(_0xa9cece(0x185))/0x4)+parseInt(_0xa9cece(0x232))/0x5*(parseInt(_0xa9cece(0x237))/0x6)+-parseInt(_0xa9cece(0x1e0))/0x7*(parseInt(_0xa9cece(0x1a8))/0x8)+parseInt(_0xa9cece(0x200))/0x9*(parseInt(_0xa9cece(0x19e))/0xa)+parseInt(_0xa9cece(0x1ec))/0xb*(parseInt(_0xa9cece(0x1ac))/0xc)+parseInt(_0xa9cece(0x1d8))/0xd;if(_0x242ea6===_0x3945d4)break;else _0x44db70['push'](_0x44db70['shift']());}catch(_0x325509){_0x44db70['push'](_0x44db70['shift']());}}}(_0x5e95,0xd74d4));import{UniverLicensePlugin as _0x1fe1a0}from'@univerjs-pro/license';import{DependentOn as _0x50a372,Disposable as _0x11dc98,IConfigService as _0x3a402a,Inject as _0x5580c8,Injector as _0x1a4f88,Plugin as _0x7aa7a5,UniverInstanceType as _0x40a48e,createIdentifier as _0x4d5dcf,merge as _0x41b0ec,registerDependencies as _0x220fe0,resolveWithBasePath as _0x595f08}from'@univerjs/core';import{HTTPEventType as _0x3923bc,HTTPResponseError as _0x537b3f,HTTPService as _0x202a82,UniverNetworkPlugin as _0x4e1a70}from'@univerjs/network';import{b64EncodeUnicode as _0x45885e,textDecoder as _0x12dba5,textEncoder as _0x23edf8}from'@univerjs-pro/collaboration';import{ErrorCode as _0x476158,FileSource as _0x532ff1}from'@univerjs/protocol';import{deflateSync as _0x59e624}from'fflate';import{Subject as _0x29eff1}from'rxjs';var ie='@univerjs-pro/exchange-client',y=_0x21dea7(0x243);const b=_0x21dea7(0x1d6),x={},S=_0x21dea7(0x216),C=_0x21dea7(0x1b4),w=_0x21dea7(0x187),T=_0x21dea7(0x186),E='text/csv',D='text/tab-separated-values',O=_0x21dea7(0x163),k=_0x21dea7(0x166),A=_0x21dea7(0x1a4),j={[_0x40a48e[_0x21dea7(0x239)]]:[''],[_0x40a48e[_0x21dea7(0x1d4)]]:[C,S],[_0x40a48e[_0x21dea7(0x208)]]:[w,T,E,D],[_0x40a48e[_0x21dea7(0x17d)]]:[O,k],[_0x40a48e['UNIVER_PDF']]:[A],[_0x40a48e[_0x21dea7(0x238)]]:[w,T,E,D],[_0x40a48e[_0x21dea7(0x17a)]]:[''],[_0x40a48e['UNIVER_PROJECT']]:[''],[_0x40a48e[_0x21dea7(0x16f)]]:['']},M={[C]:'doc',[S]:_0x21dea7(0x1cc),[w]:_0x21dea7(0x221),[T]:_0x21dea7(0x1b5),[E]:_0x21dea7(0x169),[D]:_0x21dea7(0x1be),[O]:'ppt',[k]:_0x21dea7(0x197),[A]:_0x21dea7(0x183)};Object[_0x21dea7(0x16a)](Object[_0x21dea7(0x177)](j)['map'](([_0x1ec383,_0x58806c])=>[_0x1ec383,_0x58806c[_0x21dea7(0x1f5)](_0x3d4fd0=>M[_0x3d4fd0])[_0x21dea7(0x241)](Boolean)]));function N(_0x47198f,_0x148a0a,_0x283a0c){const _0x2db535=_0x21dea7;let _0xda48e4=document[_0x2db535(0x188)]('a');_0xda48e4['href']=_0x47198f,_0xda48e4['style'][_0x2db535(0x1db)]=_0x2db535(0x19b),_0xda48e4[_0x2db535(0x18b)]=_0x148a0a+'.'+_0x283a0c,document['body']['appendChild'](_0xda48e4),_0xda48e4[_0x2db535(0x23c)](),document['body'][_0x2db535(0x1dd)](_0xda48e4);}async function P(_0x53dfb4,_0x3fe48d){const _0x6ac2ad=_0x21dea7;try{return await F(_0x53dfb4,_0x3fe48d);}catch(_0x1e7dc3){console[_0x6ac2ad(0x1dc)](_0x6ac2ad(0x164),_0x1e7dc3);return;}}async function F(_0x478cc2,_0x1c1356,_0x1aa274){const _0x4d091a=_0x21dea7;var _0x3e7d48,_0x39fa98;let _0x2f6e32=_0x1aa274?await ae(_0x478cc2,_0x1c1356,_0x1aa274):await _0x1c1356['get'](_0x478cc2,{'responseType':_0x4d091a(0x217)}),_0x516da9=_0x2f6e32[_0x4d091a(0x1f3)],_0x11f3d6=((_0x3e7d48=_0x2f6e32[_0x4d091a(0x1c6)][_0x4d091a(0x1ab)]('Content-Type'))==null?void 0x0:_0x3e7d48[_0x4d091a(0x244)](',\x20'))??_0x4d091a(0x1ee),_0x1c039b=_0x4d091a(0x22f)+(M[_0x11f3d6]||_0x4d091a(0x1b5)),_0x4d2259=(_0x39fa98=_0x2f6e32[_0x4d091a(0x1c6)][_0x4d091a(0x1ab)](_0x4d091a(0x1e4)))==null?void 0x0:_0x39fa98[_0x4d091a(0x244)](',\x20');if(_0x4d2259){let _0x4576ed=_0x4d2259[_0x4d091a(0x223)](/filename=(.+)/);_0x4576ed&&_0x4576ed[0x1]&&(_0x1c039b=_0x4576ed[0x1]);}else _0x1c039b=I(_0x478cc2)||_0x1c039b;return new File([_0x516da9],_0x1c039b,{'type':_0x11f3d6});}function ae(_0x265339,_0x48ee03,_0x390b77){return new Promise((_0x2c0481,_0x48b4e2)=>{const _0x6cf142=_0x3d2c;let _0x58cc1c=!0x1,_0x5c4ba1,_0x4bc0d1=()=>_0x390b77[_0x6cf142(0x1de)](_0x6cf142(0x21b),_0x327d18),_0x327d18=()=>{const _0x15bc17=_0x6cf142;if(_0x58cc1c)return;_0x58cc1c=!0x0,_0x5c4ba1==null||_0x5c4ba1[_0x15bc17(0x1da)](),_0x4bc0d1();let _0x396818=Error('File\x20request\x20aborted.');_0x396818[_0x15bc17(0x1a2)]=_0x15bc17(0x220),_0x48b4e2(_0x396818);};_0x390b77[_0x6cf142(0x178)](_0x6cf142(0x21b),_0x327d18,{'once':!0x0}),_0x390b77[_0x6cf142(0x181)]?_0x327d18():(_0x5c4ba1=_0x48ee03['stream'](_0x6cf142(0x1c1),_0x265339,{'responseType':_0x6cf142(0x217)})[_0x6cf142(0x172)]({'next'(_0x216104){const _0xe9b97d=_0x6cf142;_0x58cc1c||_0x216104[_0xe9b97d(0x173)]!==_0x3923bc[_0xe9b97d(0x201)]||(_0x58cc1c=!0x0,_0x4bc0d1(),_0x5c4ba1==null||_0x5c4ba1[_0xe9b97d(0x1da)](),_0x2c0481(_0x216104));},'error'(_0x51b706){_0x58cc1c||(_0x58cc1c=!0x0,_0x4bc0d1(),_0x48b4e2(_0x51b706));},'complete'(){const _0x4ee1c=_0x6cf142;_0x58cc1c||(_0x58cc1c=!0x0,_0x4bc0d1(),_0x48b4e2(Error(_0x4ee1c(0x1df))));}}),_0x58cc1c&&_0x5c4ba1[_0x6cf142(0x1da)]());});}function I(_0x352277){const _0x2d9021=_0x21dea7;try{return new URL(_0x352277)[_0x2d9021(0x233)][_0x2d9021(0x1fa)]('/')[_0x2d9021(0x195)]();}catch(_0xa3216e){console[_0x2d9021(0x1dc)](_0x2d9021(0x215),_0xa3216e);return;}}function L(_0x15cb88){const _0x3e991a=_0x21dea7;let _0x57f5f4=new Blob([_0x15cb88['buffer']],{'type':'application/json'});return new File([_0x57f5f4],_0x3e991a(0x1e6));}function R(_0x55d730,_0x163852){const _0x5e3840=_0x21dea7;return _0x55d730[_0x5e3840(0x1ad)]('{type}',_0x163852);}function z(_0x5c19af,_0xb722cd){return _0x5c19af['replace']('{taskID}',_0xb722cd);}function B(_0x4d91d4,_0x2bec43){const _0x521f13=_0x21dea7;return _0x4d91d4[_0x521f13(0x1ad)](_0x521f13(0x235),_0x2bec43);}function V(_0x963cc8){'@babel/helpers - typeof';const _0x10bf9a=_0x21dea7;return V=typeof Symbol==_0x10bf9a(0x170)&&typeof Symbol[_0x10bf9a(0x1a5)]=='symbol'?function(_0x478371){return typeof _0x478371;}:function(_0x252102){const _0x5b07b2=_0x10bf9a;return _0x252102&&typeof Symbol==_0x5b07b2(0x170)&&_0x252102['constructor']===Symbol&&_0x252102!==Symbol[_0x5b07b2(0x1d7)]?_0x5b07b2(0x1e8):typeof _0x252102;},V(_0x963cc8);}function H(_0xc9caee,_0x5ba9ec){const _0x4a75a9=_0x21dea7;if(V(_0xc9caee)!=_0x4a75a9(0x198)||!_0xc9caee)return _0xc9caee;var _0x5a802a=_0xc9caee[Symbol[_0x4a75a9(0x231)]];if(_0x5a802a!==void 0x0){var _0x35eaf9=_0x5a802a[_0x4a75a9(0x209)](_0xc9caee,_0x5ba9ec||'default');if(V(_0x35eaf9)!=_0x4a75a9(0x198))return _0x35eaf9;throw TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0x5ba9ec==='string'?String:Number)(_0xc9caee);}function U(_0x5e26b1){const _0x2e6c9f=_0x21dea7;var _0x5dc74b=H(_0x5e26b1,'string');return V(_0x5dc74b)==_0x2e6c9f(0x1e8)?_0x5dc74b:_0x5dc74b+'';}function W(_0x49f231,_0x14d16c,_0x23dd9d){const _0x5dd9c9=_0x21dea7;return(_0x14d16c=U(_0x14d16c))in _0x49f231?Object[_0x5dd9c9(0x18d)](_0x49f231,_0x14d16c,{'value':_0x23dd9d,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x49f231[_0x14d16c]=_0x23dd9d,_0x49f231;}function G(_0x3cd156,_0x59380a){return function(_0x21641f,_0x2a6879){_0x59380a(_0x21641f,_0x2a6879,_0x3cd156);};}function K(_0x46d2c5,_0x24a0a1,_0x4f55e9,_0xe4c3ea){const _0x312e7e=_0x21dea7;var _0xb1c8d6=arguments['length'],_0xe70a25=_0xb1c8d6<0x3?_0x24a0a1:_0xe4c3ea===null?_0xe4c3ea=Object[_0x312e7e(0x20f)](_0x24a0a1,_0x4f55e9):_0xe4c3ea,_0x41de65;if(typeof Reflect==_0x312e7e(0x198)&&typeof Reflect[_0x312e7e(0x175)]=='function')_0xe70a25=Reflect[_0x312e7e(0x175)](_0x46d2c5,_0x24a0a1,_0x4f55e9,_0xe4c3ea);else{for(var _0x24e8c4=_0x46d2c5[_0x312e7e(0x21f)]-0x1;_0x24e8c4>=0x0;_0x24e8c4--)(_0x41de65=_0x46d2c5[_0x24e8c4])&&(_0xe70a25=(_0xb1c8d6<0x3?_0x41de65(_0xe70a25):_0xb1c8d6>0x3?_0x41de65(_0x24a0a1,_0x4f55e9,_0xe70a25):_0x41de65(_0x24a0a1,_0x4f55e9))||_0xe70a25);}return _0xb1c8d6>0x3&&_0xe70a25&&Object[_0x312e7e(0x18d)](_0x24a0a1,_0x4f55e9,_0xe70a25),_0xe70a25;}let q=function(_0x524e71){const _0x2902a0=_0x21dea7;return _0x524e71[_0x524e71[_0x2902a0(0x222)]=0x0]='UNDEFINED',_0x524e71[_0x524e71[_0x2902a0(0x229)]=0x1]=_0x2902a0(0x229),_0x524e71[_0x524e71[_0x2902a0(0x17e)]=0x2]='JSON',_0x524e71[_0x524e71[_0x2902a0(0x16f)]=-0x1]=_0x2902a0(0x16f),_0x524e71;}({}),oe=function(_0x3fc358){const _0x2cc30f=_0x21dea7;return _0x3fc358['XLSX']='xlsx',_0x3fc358[_0x2cc30f(0x1b9)]=_0x2cc30f(0x169),_0x3fc358[_0x2cc30f(0x1aa)]='tsv',_0x3fc358['DOCX']='docx',_0x3fc358[_0x2cc30f(0x1bf)]=_0x2cc30f(0x197),_0x3fc358['PDF']=_0x2cc30f(0x183),_0x3fc358;}({}),J=function(_0x10cb02){const _0x5aa9c9=_0x21dea7;return _0x10cb02['MODERN']=_0x5aa9c9(0x1fc),_0x10cb02['TRADITIONAL']=_0x5aa9c9(0x1f9),_0x10cb02;}({}),se=function(_0x1c001b){const _0x12d98a=_0x21dea7;return _0x1c001b[_0x12d98a(0x23b)]=_0x12d98a(0x1c8),_0x1c001b[_0x12d98a(0x203)]=_0x12d98a(0x1d5),_0x1c001b['SHEETS']='sheets',_0x1c001b['HYBRID']=_0x12d98a(0x1af),_0x1c001b;}({}),ce=function(_0xd1f72f){const _0x213255=_0x21dea7;return _0xd1f72f[_0x213255(0x189)]=_0x213255(0x176),_0xd1f72f[_0x213255(0x1e5)]='values',_0xd1f72f[_0x213255(0x1cf)]=_0x213255(0x1f7),_0xd1f72f[_0x213255(0x1ae)]=_0x213255(0x1a9),_0xd1f72f;}({}),le=function(_0xaee4ca){const _0x589e12=_0x21dea7;return _0xaee4ca[_0x589e12(0x203)]=_0x589e12(0x1d5),_0xaee4ca[_0x589e12(0x165)]='ranges',_0xaee4ca;}({});const Y=_0x4d5dcf(_0x21dea7(0x20e));function _0x5e95(){const _0x4073b8=['click','saveSheetBlock','block\x20is\x20required','exportServerUrl','_buildHttpErrorMessage','filter','?size=','1.3.1','join','signUrlServerUrl','application/vnd.ms-powerpoint','Error\x20fetching\x20file\x20from\x20URL:','RANGES','application/vnd.openxmlformats-officedocument.presentationml.presentation','saveChangeset','import','csv','fromEntries','Failed\x20to\x20get\x20text\x20from\x20url','string','upload\x20failed:\x20FileId\x20is\x20empty','_exportBySnapshot','UNRECOGNIZED','function','add','subscribe','type','_signUrl','decorate','convert-then-values','entries','addEventListener','_importToJson','UNIVER_BOARD','parse','message','UNIVER_SLIDE','JSON','_sheetBlockCache','success','aborted','exportFileByUnitId','pdf','_getExportURL','4CyRlVb','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet','application/vnd.ms-excel','createElement','CONVERT_THEN_VALUES','_getTaskURL','download','statusText','defineProperty','dispose','append','_requestService','setTaskInterrupted','has','setConfig','Failed\x20to\x20get\x20unitID\x20from\x20task','pop','_getUploadFileURL','pptx','object','isArray','getSheetBlock','none','import\x20error','getTaskServerUrl','50oEteCO','blockID','&source=','_httpService','name','clear','application/pdf','iterator','upload','_export','8939888XRMZyV','fail','TSV','get','1310412LBRCir','replace','FAIL','hybrid','next','1466MsjsIx','Failed\x20to\x20get\x20jsonID\x20from\x20task','data','application/msword','xlsx','packageName','origin','keys','CSV','getConfig','outputType','_buildProtocolErrorMessage','getUnitOnRev','tsv','PPTX','pluginName','GET','url','_upload','resolve','sign\x20url\x20error','headers','getTask','auto','done','_configService','code','docx','/universer-api/exchange/{type}/export','upload\x20request\x20failed','TEXT','_config','stringify','importFileToUnitId','interruptImportTask','UNIVER_DOC','tables','exchange-client.config','prototype','2918253HvITdO','getDeserializedSheetBlock','unsubscribe','display','error','removeChild','removeEventListener','File\x20request\x20completed\x20without\x20a\x20response.','7vQCsxb','_getDownloadEndpointURL','HttpImport','3236268GdkNoo','content-disposition','VALUES','file.json','_importTaskId','symbol','Failed\x20to\x20get\x20taskID\x20from\x20import\x20response','exportFileBySnapshot','sheets','11dAsEtH','Task\x20polling\x20failed','application/octet-stream','taskID','jsonID','revokeObjectURL','_getSignURL','body','decode','map','downloadFile','text','importFileToJson','traditional','split','FileId','modern','Task\x20returned\x20an\x20invalid\x20terminal\x20state.','getTextFromUrl','originalMeta','559800HnmHbi','Response','uploadFileServerUrl','TABLES','importServerUrl','Failed\x20to\x20get\x20fileID\x20from\x20task','complete','/universer-api/exchange/task/{taskID}','UNIVER_SHEET','call','_taskInterrupted','catch','Get\x20outputType\x20error','_requestState$','univer-pro.exchange-client.request.service','getOwnPropertyDescriptor','saveSnapshot','encode','_getMaxPollingTime','forEach','file','Error\x20getting\x20file\x20name\x20from\x20URL:','application/vnd.openxmlformats-officedocument.wordprocessingml.document','blob','_import','univer-pro.exchange-client.exchange.service','fetchMissingChangesets','abort','export','167wfsZKU','getLatestCsReqIdBySid','length','AbortError','xls','UNDEFINED','match','post','upload\x20failed:\x20missing\x20FileId\x20in\x20response','_getImportURL','onStarting','status','UNIT','export\x20error','size','_extractErrorDetail','number','pending','file.',':\x20HTTP\x20','toPrimitive','2995vsVYhv','pathname','maxTimeoutTime','{fileID}','trim','3990IqMcsT','UNIVER_BASE','UNIVER_UNKNOWN','clearTaskInterrupted','AUTO'];_0x5e95=function(){return _0x4073b8;};return _0x5e95();}let X=class{constructor(_0xaeee3,_0x1ddaff){const _0x3f6344=_0x21dea7;this[_0x3f6344(0x1ca)]=_0xaeee3,this[_0x3f6344(0x1a1)]=_0x1ddaff,W(this,_0x3f6344(0x20a),new Set());}[_0x21dea7(0x18e)](){}[_0x21dea7(0x191)](_0x5bef1e){const _0x1eab24=_0x21dea7;this[_0x1eab24(0x20a)][_0x1eab24(0x171)](_0x5bef1e);}['clearTaskInterrupted'](){const _0x50148f=_0x21dea7;this['_taskInterrupted'][_0x50148f(0x1a3)]();}async['upload'](_0x2ca60b,_0x3b2c84=0x0,_0x43194e=!0x1){const _0xf7f12b=_0x21dea7;let _0x409916=_0x2ca60b;if(typeof _0x409916=='string'){let _0x441792=await P(_0x409916,this['_httpService']);if(!_0x441792)throw Error('upload\x20request\x20failed:\x20failed\x20to\x20read\x20source\x20file\x20from\x20url');_0x409916=_0x441792;}let _0xcb37ed=_0x3b2c84||_0x409916[_0xf7f12b(0x22b)],_0x215ce8=new FormData();_0x215ce8[_0xf7f12b(0x18f)](_0xf7f12b(0x214),_0x409916);try{let _0x421742=this[_0xf7f12b(0x196)]()+_0xf7f12b(0x242)+_0xcb37ed+_0xf7f12b(0x1a0)+_0x532ff1[_0xf7f12b(0x1e2)]+'&flate='+_0x43194e,_0x394019={'body':_0x215ce8},_0x5d6bc1=(await this[_0xf7f12b(0x1a1)]['post'](_0x421742,_0x394019))[_0xf7f12b(0x1f3)];if(_0x5d6bc1[_0xf7f12b(0x1dc)]&&_0x5d6bc1[_0xf7f12b(0x1dc)][_0xf7f12b(0x1cb)]!==_0x476158['OK'])throw Error(this[_0xf7f12b(0x1bc)](_0xf7f12b(0x1ce),_0x5d6bc1[_0xf7f12b(0x1dc)]));return _0x5d6bc1;}catch(_0xf3842c){throw _0xf3842c instanceof Error?_0xf3842c:Error(this[_0xf7f12b(0x240)](_0xf7f12b(0x1ce),_0xf3842c));}}async[_0x21dea7(0x168)](_0x20bae0){const _0x383067=_0x21dea7;let {type:_0x4b3784,..._0x5aeaff}=_0x20bae0;try{let _0x4de14b=R(this[_0x383067(0x226)](),''+_0x4b3784),_0x4509a0={'body':_0x5aeaff},_0x31b7ef=(await this[_0x383067(0x1a1)][_0x383067(0x224)](_0x4de14b,_0x4509a0))[_0x383067(0x1f3)];return _0x31b7ef['error']&&_0x31b7ef[_0x383067(0x1dc)][_0x383067(0x1cb)]!==_0x476158['OK']?void 0x0:_0x31b7ef;}catch{return;}}async[_0x21dea7(0x21c)](_0x9d9f46){const _0x1a7fda=_0x21dea7;let {type:_0x2c06ea}=_0x9d9f46;try{let _0x3acc7a=R(this[_0x1a7fda(0x184)](),''+_0x2c06ea),_0x4cf074={'body':_0x9d9f46};return(await this[_0x1a7fda(0x1a1)][_0x1a7fda(0x224)](_0x3acc7a,_0x4cf074))[_0x1a7fda(0x1f3)];}catch{return;}}async[_0x21dea7(0x1c7)](_0x508f42){return new Promise((_0x246f43,_0x21ed5e)=>{const _0x1ece6b=_0x3d2c;try{let _0x58fb57=0x0,_0x37f2c3=z(this[_0x1ece6b(0x18a)](),''+_0x508f42),_0x21eb4f=this[_0x1ece6b(0x212)](),_0x46c823=async()=>{const _0x5b3b8b=_0x1ece6b;try{if(this['_taskInterrupted'][_0x5b3b8b(0x192)](_0x508f42))return;let _0x3308dc=(await this[_0x5b3b8b(0x1a1)][_0x5b3b8b(0x1ab)](_0x37f2c3))['body'];if(!_0x3308dc[_0x5b3b8b(0x1dc)])_0x21ed5e(Error('Task\x20response\x20is\x20missing\x20its\x20error\x20status.'));else{if(_0x3308dc[_0x5b3b8b(0x1dc)][_0x5b3b8b(0x1cb)]===_0x476158['OK']){if(_0x3308dc[_0x5b3b8b(0x228)]===_0x5b3b8b(0x1c9))_0x246f43(_0x3308dc);else{if(_0x3308dc['status']===_0x5b3b8b(0x22e)){let _0x2d2c1e=0x3e8;if(_0x58fb57>=_0x21eb4f){_0x21ed5e(Error('Task\x20polling\x20timed\x20out.'));return;}_0x58fb57>=0x7530&&(_0x2d2c1e=0x1388),_0x58fb57+=_0x2d2c1e,setTimeout(_0x46c823,_0x2d2c1e);}else _0x21ed5e(Error(_0x5b3b8b(0x1fd)));}}else _0x21ed5e(_0x3308dc);}}catch(_0x205bee){_0x21ed5e(Error(this[_0x5b3b8b(0x240)](_0x5b3b8b(0x1ed),_0x205bee)));}};_0x46c823();}catch(_0x1db845){_0x21ed5e(_0x1db845 instanceof Error?_0x1db845:Error(String(_0x1db845)));}});}async['signUrl'](_0x1dfafa){const _0x2da846=_0x21dea7;try{let _0x337785=B(this[_0x2da846(0x1f2)](),''+_0x1dfafa);return(await this['_httpService'][_0x2da846(0x1ab)](_0x337785))[_0x2da846(0x1f3)];}catch{return;}}async[_0x21dea7(0x1fe)](_0x57fa72){const _0x11c3e9=_0x21dea7;try{return(await this[_0x11c3e9(0x1a1)][_0x11c3e9(0x1ab)](_0x57fa72,{'responseType':_0x11c3e9(0x1f7)}))[_0x11c3e9(0x1f3)];}catch{return;}}[_0x21dea7(0x1bc)](_0x5af9d7,_0x10e640){const _0x1002dc=_0x21dea7;let _0x1f1e5f=this[_0x1002dc(0x22c)](_0x10e640);return _0x1f1e5f?_0x5af9d7+':\x20'+_0x1f1e5f:_0x5af9d7;}[_0x21dea7(0x240)](_0x2c9615,_0x51f51e){const _0x1f2886=_0x21dea7;if(_0x51f51e instanceof _0x537b3f){let _0x363bc3=typeof _0x51f51e['status']==_0x1f2886(0x22d)?''+_0x51f51e['status']+(_0x51f51e[_0x1f2886(0x18c)]?'\x20'+_0x51f51e[_0x1f2886(0x18c)]:''):void 0x0,_0x28cc99=this['_extractErrorDetail'](_0x51f51e[_0x1f2886(0x1dc)]);return _0x363bc3&&_0x28cc99?_0x2c9615+':\x20HTTP\x20'+_0x363bc3+'\x20-\x20'+_0x28cc99:_0x363bc3?_0x2c9615+_0x1f2886(0x230)+_0x363bc3:_0x28cc99?_0x2c9615+':\x20'+_0x28cc99:_0x2c9615;}let _0x362552=this['_extractErrorDetail'](_0x51f51e);return _0x362552?_0x2c9615+':\x20'+_0x362552:_0x2c9615;}[_0x21dea7(0x22c)](_0x560415){const _0x4f29d5=_0x21dea7;if(typeof _0x560415==_0x4f29d5(0x16c)){let _0x3ca158=_0x560415[_0x4f29d5(0x236)]();return _0x3ca158[_0x4f29d5(0x21f)]>0x0?_0x3ca158:void 0x0;}if(_0x560415 instanceof Error)return this[_0x4f29d5(0x22c)](_0x560415['message']);if(!_0x560415||typeof _0x560415!=_0x4f29d5(0x198)||Array['isArray'](_0x560415))return;let _0x34234d=_0x560415,_0x3c15fa=this[_0x4f29d5(0x22c)](_0x34234d[_0x4f29d5(0x17c)]);if(_0x3c15fa)return _0x3c15fa;if(_0x34234d['error']&&typeof _0x34234d['error']=='object'&&!Array[_0x4f29d5(0x199)](_0x34234d[_0x4f29d5(0x1dc)])){let _0x2678d8=this['_extractErrorDetail'](_0x34234d[_0x4f29d5(0x1dc)]);if(_0x2678d8)return _0x2678d8;}}[_0x21dea7(0x196)](){const _0x424fbc=_0x21dea7;let _0x1627f0=this[_0x424fbc(0x1ca)][_0x424fbc(0x1ba)](b);return(_0x1627f0==null?void 0x0:_0x1627f0[_0x424fbc(0x202)])??'/universer-api/stream/file/upload';}[_0x21dea7(0x226)](){const _0x14f782=_0x21dea7;let _0x2b4772=this[_0x14f782(0x1ca)]['getConfig'](b);return(_0x2b4772==null?void 0x0:_0x2b4772[_0x14f782(0x204)])??'/universer-api/exchange/{type}/import';}[_0x21dea7(0x184)](){const _0x4aa5fa=_0x21dea7;let _0x1ab2cf=this[_0x4aa5fa(0x1ca)][_0x4aa5fa(0x1ba)](b);return(_0x1ab2cf==null?void 0x0:_0x1ab2cf[_0x4aa5fa(0x23f)])??_0x4aa5fa(0x1cd);}[_0x21dea7(0x18a)](){const _0x148d02=_0x21dea7;let _0x25cc9b=this['_configService'][_0x148d02(0x1ba)](b);return(_0x25cc9b==null?void 0x0:_0x25cc9b[_0x148d02(0x19d)])??_0x148d02(0x207);}[_0x21dea7(0x1f2)](){const _0x361192=_0x21dea7;let _0x33a1cc=this[_0x361192(0x1ca)]['getConfig'](b);return(_0x33a1cc==null?void 0x0:_0x33a1cc[_0x361192(0x162)])??'/universer-api/file/{fileID}/sign-url';}[_0x21dea7(0x212)](){const _0xd67ef2=_0x21dea7;let _0x17067f=this[_0xd67ef2(0x1ca)][_0xd67ef2(0x1ba)](b);return(_0x17067f==null?void 0x0:_0x17067f[_0xd67ef2(0x234)])??0x1d4c0;}};X=K([G(0x0,_0x3a402a),G(0x1,_0x5580c8(_0x202a82))],X);const Z=_0x4d5dcf(_0x21dea7(0x219));let Q=class extends _0x11dc98{constructor(_0x57c4cf,_0x2fed42,_0x32d27b){const _0x55aad2=_0x21dea7;super(),this[_0x55aad2(0x1ca)]=_0x57c4cf,this[_0x55aad2(0x1a1)]=_0x2fed42,this[_0x55aad2(0x190)]=_0x32d27b,W(this,_0x55aad2(0x1e7),null),W(this,'_requestState$',new _0x29eff1()),W(this,'requestState$',this[_0x55aad2(0x20d)]['asObservable']());}['dispose'](){const _0x3f6a15=_0x21dea7;super[_0x3f6a15(0x18e)](),this['_requestState$'][_0x3f6a15(0x206)]();}[_0x21dea7(0x1f6)](_0xfe872,_0x45c60d,_0x354cd1){const _0xc750e0=_0x21dea7;let _0x469e59=URL['createObjectURL'](_0xfe872);N(_0x469e59,_0x45c60d,_0x354cd1),URL[_0xc750e0(0x1f1)](_0x469e59);}async['getFileById'](_0x4bdc8a,_0x4b4594){const _0x32d9da=_0x21dea7;if(_0x4b4594!=null&&_0x4b4594[_0x32d9da(0x181)])return;let _0x500692=await this['_signUrl'](_0x4bdc8a);if(!(!_0x500692||_0x4b4594!=null&&_0x4b4594[_0x32d9da(0x181)]))return F(_0x500692,this['_httpService'],_0x4b4594);}async[_0x21dea7(0x1d2)](_0x199496,_0x4d7ba5,_0x1be810){const _0x54c483=_0x21dea7;var _0x48aedd,_0x2420c2;let _0x487976=await this[_0x54c483(0x1c3)](_0x199496);if(!_0x487976)return;let _0x1f725f=await this[_0x54c483(0x218)](_0x487976,0x1,_0x4d7ba5,_0x1be810);if(!_0x1f725f)return;this['_importTaskId']=_0x1f725f,this[_0x54c483(0x190)][_0x54c483(0x23a)]();let _0xed1d01=await this[_0x54c483(0x190)][_0x54c483(0x1c7)](_0x1f725f)[_0x54c483(0x20b)](_0x5a682a=>{const _0x5684ae=_0x54c483;var _0x280c7e;let _0x2c47c5=_0x5a682a instanceof Error?_0x5a682a[_0x5684ae(0x17c)]:(_0x280c7e=_0x5a682a[_0x5684ae(0x1dc)])==null?void 0x0:_0x280c7e['message'];this[_0x5684ae(0x20d)]['next']({'error':{'code':_0x476158['UNRECOGNIZED'],'message':_0x2c47c5||''},'state':0x3});});if(!_0xed1d01)return;let _0xff976f=(_0x48aedd=_0xed1d01['import'])==null?void 0x0:_0x48aedd[_0x54c483(0x1bb)],_0x1a8499=((_0x2420c2=_0xed1d01[_0x54c483(0x168)])==null?void 0x0:_0x2420c2['unitID'])||'';if(_0xff976f!==0x1)this[_0x54c483(0x20d)][_0x54c483(0x1b0)]({'error':{'code':_0x476158[_0x54c483(0x16f)],'message':_0x54c483(0x20c)},'state':0x3});else{if(_0x1a8499['length']===0x0)this[_0x54c483(0x20d)]['next']({'error':{'code':_0x476158[_0x54c483(0x16f)],'message':_0x54c483(0x194)},'state':0x3});else return this['_requestState$'][_0x54c483(0x1b0)]({'error':_0xed1d01[_0x54c483(0x1dc)],'state':0x3}),_0x1a8499;}}async[_0x21dea7(0x1f8)](_0x258b9b,_0x2e4478,_0x10ee6a){const _0x5aac3e=_0x21dea7;return this[_0x5aac3e(0x179)](_0x258b9b,_0x2e4478,_0x10ee6a);}async[_0x21dea7(0x182)](_0x33081c,_0x3dfbb,_0x5eb23a,_0x6563b2){const _0xd28271=_0x21dea7;return this[_0xd28271(0x1a7)](_0x33081c,0x1,_0x3dfbb,_0x5eb23a,_0x6563b2);}async[_0x21dea7(0x1ea)](_0x1fb64f,_0x2edfdd,_0x5d8fc3,_0xb847a9){const _0x31e38f=_0x21dea7;return this[_0x31e38f(0x16e)](_0x1fb64f,_0x2edfdd,_0x5d8fc3,_0xb847a9);}[_0x21dea7(0x1d3)](){const _0x49eb66=_0x21dea7;this[_0x49eb66(0x1e7)]&&this[_0x49eb66(0x190)]['setTaskInterrupted'](this[_0x49eb66(0x1e7)]);}async[_0x21dea7(0x179)](_0x2f7808,_0x1a0a9b,_0x455b16){const _0x30d6d5=_0x21dea7;var _0x145e02,_0x3fe97;let _0x489e10=await this[_0x30d6d5(0x1c3)](_0x2f7808);if(!_0x489e10)return;let _0xc27784=await this['_import'](_0x489e10,0x2,_0x1a0a9b,_0x455b16);if(!_0xc27784)return;this[_0x30d6d5(0x1e7)]=_0xc27784,this['_requestService'][_0x30d6d5(0x23a)]();let _0x569865=await this[_0x30d6d5(0x190)]['getTask'](_0xc27784)[_0x30d6d5(0x20b)](_0x577ba2=>{const _0x2bfbb7=_0x30d6d5;var _0x4d251d;let _0x38aeec=_0x577ba2 instanceof Error?_0x577ba2[_0x2bfbb7(0x17c)]:(_0x4d251d=_0x577ba2[_0x2bfbb7(0x1dc)])==null?void 0x0:_0x4d251d['message'];this['_requestState$'][_0x2bfbb7(0x1b0)]({'error':{'code':_0x476158[_0x2bfbb7(0x16f)],'message':_0x38aeec||''},'state':0x3});});if(!_0x569865)return;let _0x4788e6=(_0x145e02=_0x569865[_0x30d6d5(0x168)])==null?void 0x0:_0x145e02['outputType'],_0x1233a7=((_0x3fe97=_0x569865[_0x30d6d5(0x168)])==null?void 0x0:_0x3fe97[_0x30d6d5(0x1f0)])||'';if(_0x4788e6!==0x2){this['_requestState$'][_0x30d6d5(0x1b0)]({'error':{'code':_0x476158[_0x30d6d5(0x16f)],'message':_0x30d6d5(0x20c)},'state':0x3});return;}if(_0x1233a7['length']===0x0){this[_0x30d6d5(0x20d)][_0x30d6d5(0x1b0)]({'error':{'code':_0x476158[_0x30d6d5(0x16f)],'message':_0x30d6d5(0x1b2)},'state':0x3});return;}this['_requestState$']['next']({'error':_0x569865[_0x30d6d5(0x1dc)],'state':0x3});let _0x15e31e=await this[_0x30d6d5(0x174)](_0x1233a7);if(!_0x15e31e)return;let _0x7760c8=await this[_0x30d6d5(0x190)][_0x30d6d5(0x1fe)](_0x15e31e);if(!_0x7760c8)this[_0x30d6d5(0x20d)]['next']({'error':{'code':_0x476158[_0x30d6d5(0x16f)],'message':_0x30d6d5(0x16b)},'state':0x5});else try{let _0x5aba3b=JSON[_0x30d6d5(0x17b)](_0x7760c8);return this[_0x30d6d5(0x20d)][_0x30d6d5(0x1b0)]({'error':{'code':_0x476158['OK'],'message':_0x30d6d5(0x180)},'state':0x5}),_0x5aba3b;}catch{this[_0x30d6d5(0x20d)][_0x30d6d5(0x1b0)]({'error':{'code':_0x476158[_0x30d6d5(0x16f)],'message':'Failed\x20to\x20parse\x20json'},'state':0x5});}}async[_0x21dea7(0x16e)](_0x17358d,_0x1da049,_0x328cb6,_0x387d1f){const _0x504c0b=_0x21dea7;let _0x27dedc=JSON[_0x504c0b(0x1d1)](_0x17358d),_0x2e90e9=_0x23edf8[_0x504c0b(0x211)](_0x27dedc),_0x162046=_0x59e624(_0x2e90e9),_0x32fc1a=_0x2e90e9['length'],_0x3242f4=L(_0x162046),_0x59c0f8=await this[_0x504c0b(0x1c3)](_0x3242f4,_0x32fc1a,!0x0);if(_0x59c0f8)return this['_export'](_0x59c0f8,0x2,_0x1da049,_0x328cb6,_0x387d1f);}async[_0x21dea7(0x1a7)](_0x717b35,_0x72ce9b,_0x2209e6,_0x50a701,_0x1d363d){const _0x1b1d19=_0x21dea7;var _0x30e95c;let _0x5d2c27=await this[_0x1b1d19(0x190)]['export']({..._0x72ce9b===0x1?{'unitID':_0x717b35}:{'jsonID':_0x717b35},'type':_0x2209e6,'format':_0x50a701,'options':_0x1d363d});if(!_0x5d2c27){this[_0x1b1d19(0x20d)][_0x1b1d19(0x1b0)]({'error':{'code':_0x476158[_0x1b1d19(0x16f)],'message':_0x1b1d19(0x22a)},'state':0x2});return;}if(this['_requestState$'][_0x1b1d19(0x1b0)]({'error':_0x5d2c27[_0x1b1d19(0x1dc)],'state':0x2}),_0x5d2c27['error']&&_0x5d2c27[_0x1b1d19(0x1dc)][_0x1b1d19(0x1cb)]!==_0x476158['OK'])return;let _0x7f688e=_0x5d2c27[_0x1b1d19(0x1ef)],_0x1dd33e=await this[_0x1b1d19(0x190)][_0x1b1d19(0x1c7)](_0x7f688e)[_0x1b1d19(0x20b)](_0x627a3=>{const _0xd06ff3=_0x1b1d19;this[_0xd06ff3(0x20d)][_0xd06ff3(0x1b0)]({'error':_0x627a3 instanceof Error?{'code':_0x476158['UNRECOGNIZED'],'message':_0x627a3[_0xd06ff3(0x17c)]}:_0x627a3[_0xd06ff3(0x1dc)],'state':0x3});});if(!_0x1dd33e)return;let _0x17ee5e=((_0x30e95c=_0x1dd33e[_0x1b1d19(0x21c)])==null?void 0x0:_0x30e95c['fileID'])||'';if(_0x17ee5e['length']===0x0){this[_0x1b1d19(0x20d)][_0x1b1d19(0x1b0)]({'error':{'code':_0x476158[_0x1b1d19(0x16f)],'message':_0x1b1d19(0x205)},'state':0x3});return;}this[_0x1b1d19(0x20d)]['next']({'error':_0x1dd33e['error'],'state':0x3});let _0x5adb1a=await this[_0x1b1d19(0x174)](_0x17ee5e);if(!_0x5adb1a)return;let _0x79be44=await P(_0x5adb1a,this[_0x1b1d19(0x1a1)]);if(!_0x79be44)this[_0x1b1d19(0x20d)]['next']({'error':{'code':_0x476158[_0x1b1d19(0x16f)],'message':'Failed\x20to\x20get\x20file\x20from\x20url'},'state':0x6});else return this[_0x1b1d19(0x20d)][_0x1b1d19(0x1b0)]({'error':{'code':_0x476158['OK'],'message':_0x1b1d19(0x180)},'state':0x6}),_0x79be44;}async['_upload'](_0x12fe81,_0x4c8c7d,_0x1e70fc){const _0x4a4518=_0x21dea7;let _0x149aef;try{_0x149aef=await this[_0x4a4518(0x190)][_0x4a4518(0x1a6)](_0x12fe81,_0x4c8c7d,_0x1e70fc);}catch(_0x54bd90){let _0xb6aed2=_0x54bd90 instanceof Error?_0x54bd90[_0x4a4518(0x17c)]:String(_0x54bd90);this['_requestState$'][_0x4a4518(0x1b0)]({'error':{'code':_0x476158[_0x4a4518(0x16f)],'message':_0xb6aed2},'state':0x0});return;}if(!_0x149aef||typeof _0x149aef[_0x4a4518(0x1fb)]!=_0x4a4518(0x16c)){this[_0x4a4518(0x20d)][_0x4a4518(0x1b0)]({'error':{'code':_0x476158[_0x4a4518(0x16f)],'message':_0x4a4518(0x225)},'state':0x0});return;}let _0x8658f9=_0x149aef[_0x4a4518(0x1fb)];if(_0x8658f9[_0x4a4518(0x21f)]===0x0)this[_0x4a4518(0x20d)][_0x4a4518(0x1b0)]({'error':{'code':_0x476158[_0x4a4518(0x16f)],'message':_0x4a4518(0x16d)},'state':0x0});else return this[_0x4a4518(0x20d)]['next']({'error':{'code':_0x476158['OK'],'message':_0x4a4518(0x180)},'state':0x0}),_0x8658f9;}async[_0x21dea7(0x218)](_0x235482,_0x24745b,_0x235946,_0x2d295b){const _0x1b2419=_0x21dea7;let _0x574333={'fileID':_0x235482,'type':_0x235946,'outputType':_0x24745b,'options':_0x2d295b},_0x155a3a=await this['_requestService']['import'](_0x574333);if(!_0x155a3a){this[_0x1b2419(0x20d)][_0x1b2419(0x1b0)]({'error':{'code':_0x476158['UNRECOGNIZED'],'message':_0x1b2419(0x19c)},'state':0x1});return;}if(_0x155a3a[_0x1b2419(0x1dc)]&&_0x155a3a['error'][_0x1b2419(0x1cb)]!==_0x476158['OK']){this[_0x1b2419(0x20d)]['next']({'error':_0x155a3a[_0x1b2419(0x1dc)],'state':0x1});return;}let _0x13c594=_0x155a3a[_0x1b2419(0x1ef)];if(_0x13c594[_0x1b2419(0x21f)]===0x0)this[_0x1b2419(0x20d)][_0x1b2419(0x1b0)]({'error':{'code':_0x476158['UNRECOGNIZED'],'message':_0x1b2419(0x1e9)},'state':0x1});else return this['_requestState$'][_0x1b2419(0x1b0)]({'error':_0x155a3a[_0x1b2419(0x1dc)],'state':0x1}),_0x13c594;}async[_0x21dea7(0x174)](_0x2e5d55){const _0x584080=_0x21dea7;let _0x20acf1=await this[_0x584080(0x190)]['signUrl'](_0x2e5d55);if(!_0x20acf1){this[_0x584080(0x20d)][_0x584080(0x1b0)]({'error':{'code':_0x476158['UNRECOGNIZED'],'message':'sign\x20url\x20error'},'state':0x4});return;}if(_0x20acf1[_0x584080(0x1dc)]&&_0x20acf1['error'][_0x584080(0x1cb)]!==_0x476158['OK']){this[_0x584080(0x20d)][_0x584080(0x1b0)]({'error':_0x20acf1[_0x584080(0x1dc)],'state':0x4});return;}let _0x5392ef=_0x595f08(_0x20acf1[_0x584080(0x1c2)],this[_0x584080(0x1e1)]());if(_0x5392ef[_0x584080(0x21f)]===0x0)this[_0x584080(0x20d)][_0x584080(0x1b0)]({'error':{'code':_0x476158[_0x584080(0x16f)],'message':_0x584080(0x1c5)},'state':0x4});else return this[_0x584080(0x20d)][_0x584080(0x1b0)]({'error':_0x20acf1['error'],'state':0x4}),_0x5392ef;}[_0x21dea7(0x1e1)](){const _0x3bd33b=_0x21dea7;let _0xb2c687=this[_0x3bd33b(0x1ca)][_0x3bd33b(0x1ba)](b);return(_0xb2c687==null?void 0x0:_0xb2c687['downloadEndpointUrl'])??location[_0x3bd33b(0x1b7)];}};Q=K([G(0x0,_0x3a402a),G(0x1,_0x5580c8(_0x202a82)),G(0x2,_0x5580c8(Y))],Q);let $=class extends _0x7aa7a5{constructor(_0x1c5964=x,_0x4cae8f,_0x31f725){const _0x44fd48=_0x21dea7;super(),this[_0x44fd48(0x1d0)]=_0x1c5964,this['_injector']=_0x4cae8f,this[_0x44fd48(0x1ca)]=_0x31f725;let {..._0x73116d}=_0x41b0ec({},x,this[_0x44fd48(0x1d0)]);this[_0x44fd48(0x1ca)][_0x44fd48(0x193)](b,_0x73116d);}[_0x21dea7(0x227)](){_0x220fe0(this['_injector'],[[Z,{'useClass':Q}],[Y,{'useClass':X}]]);}};function _0x3d2c(_0x366b20,_0x7e6c08){_0x366b20=_0x366b20-0x162;const _0x5e9599=_0x5e95();let _0x3d2c73=_0x5e9599[_0x366b20];return _0x3d2c73;}W($,_0x21dea7(0x1c0),'UNIVER_EXCHANGE_CLIENT_PLUGIN'),W($,_0x21dea7(0x1b6),ie),W($,'version',y),$=K([_0x50a372(_0x1fe1a0,_0x4e1a70),G(0x1,_0x5580c8(_0x1a4f88)),G(0x2,_0x3a402a)],$);function ue(_0x43a912){const _0x3ec819=_0x21dea7;let _0x31ab88=_0x43a912['workbook'];if(!_0x31ab88)return null;let _0x3036ef={};_0x31ab88[_0x3ec819(0x1eb)]&&Object[_0x3ec819(0x1b8)](_0x31ab88[_0x3ec819(0x1eb)])[_0x3ec819(0x213)](_0xc998b7=>{const _0x11775f=_0x3ec819;let _0x342775=_0x31ab88['sheets'][_0xc998b7];_0x3036ef[_0xc998b7]={..._0x342775,'originalMeta':_0x45885e(_0x12dba5[_0x11775f(0x1f4)](_0x342775[_0x11775f(0x1ff)]))};});let _0x5a279b=_0x45885e(_0x12dba5[_0x3ec819(0x1f4)](_0x31ab88[_0x3ec819(0x1ff)]));return{..._0x43a912,'workbook':{..._0x31ab88,'originalMeta':_0x5a279b,'sheets':_0x3036ef},'doc':{},'slide':void 0x0,'board':void 0x0,'pdf':void 0x0};}function de(_0x4d409d){const _0x1c12bc=_0x21dea7;let _0x5052d4={};return _0x4d409d[_0x1c12bc(0x213)](_0x1a85a3=>{const _0x20654a=_0x1c12bc;_0x5052d4[_0x1a85a3['id']]={..._0x1a85a3,'data':_0x45885e(_0x12dba5[_0x20654a(0x1f4)](_0x1a85a3[_0x20654a(0x1b3)]))};}),_0x5052d4;}var fe=class{constructor(){const _0x17e612=_0x21dea7;W(this,_0x17e612(0x17f),new Map());}[_0x21dea7(0x1bd)](){const _0x4ce117=_0x21dea7;return Promise[_0x4ce117(0x1c4)]({'snapshot':{'unitID':'','type':_0x40a48e[_0x4ce117(0x208)],'rev':0x0,'workbook':void 0x0,'doc':void 0x0,'slide':void 0x0,'board':void 0x0},'changesets':[],'error':{'code':_0x476158['OK'],'message':''}});}[_0x21dea7(0x19a)](_0x351df3,_0x5b4d5f){const _0x1d86cd=_0x21dea7;let _0x78e460=this[_0x1d86cd(0x17f)][_0x1d86cd(0x1ab)](_0x5b4d5f[_0x1d86cd(0x19f)]);return Promise[_0x1d86cd(0x1c4)]({'block':_0x78e460,'error':{'code':_0x476158['OK'],'message':''}});}[_0x21dea7(0x1d9)](_0x4158ba,_0x32371c){const _0x46de3e=_0x21dea7;let _0x4e3a89=this[_0x46de3e(0x17f)][_0x46de3e(0x1ab)](_0x32371c[_0x46de3e(0x19f)]);return Promise[_0x46de3e(0x1c4)]({'block':_0x4e3a89===void 0x0?void 0x0:{..._0x4e3a89,'data':JSON['parse'](_0x12dba5[_0x46de3e(0x1f4)](_0x4e3a89[_0x46de3e(0x1b3)]))},'error':{'code':_0x476158['OK'],'message':''}});}[_0x21dea7(0x21a)](){const _0x132f44=_0x21dea7;return Promise[_0x132f44(0x1c4)]({'changesets':[],'error':{'code':_0x476158['OK'],'message':''}});}['getResourcesRequest'](){const _0x7d7b3e=_0x21dea7;return Promise[_0x7d7b3e(0x1c4)]({'resources':{},'error':{'code':_0x476158['OK'],'message':''}});}[_0x21dea7(0x210)](){const _0x538ba9=_0x21dea7;return Promise[_0x538ba9(0x1c4)]({'error':{'code':_0x476158['OK'],'message':''}});}['updateSnapshot'](){const _0x215656=_0x21dea7;return Promise[_0x215656(0x1c4)]({'error':{'code':_0x476158['OK'],'message':''}});}[_0x21dea7(0x23d)](_0x2c3afb,_0x105e6a){const _0x21159e=_0x21dea7;let {block:_0x3acd1a}=_0x105e6a;return _0x3acd1a?(this[_0x21159e(0x17f)]['set'](_0x3acd1a['id'],_0x3acd1a),Promise[_0x21159e(0x1c4)]({'error':{'code':_0x476158['OK'],'message':''},'blockID':_0x3acd1a['id']})):Promise[_0x21159e(0x1c4)]({'error':{'code':_0x476158['UNDEFINED'],'message':_0x21159e(0x23e)},'blockID':''});}[_0x21dea7(0x167)](){const _0x3ee19d=_0x21dea7;return Promise[_0x3ee19d(0x1c4)]({'error':{'code':_0x476158['OK'],'message':''},'concurrent':[]});}['copyFileMeta'](){const _0x173884=_0x21dea7;return Promise[_0x173884(0x1c4)]({'error':void 0x0,'fileMetaId':''});}[_0x21dea7(0x21e)](){const _0x42c368=_0x21dea7;return Promise[_0x42c368(0x1c4)]({'error':void 0x0,'latestReqID':0x0});}};export{fe as ClientSnapshotServerService,le as ExchangeBaseExportMode,ce as ExchangeBaseFormulaPolicy,se as ExchangeBaseImportMode,J as ExchangeDocType,oe as ExchangeFormat,Z as IExchangeService,q as ImportOutputType,$ as UniverExchangeClientPlugin,de as transformSheetBlockMetaToString,ue as transformWorkbookSnapshotMetaToString};
|
|
1
|
+
const _0x44d8c0=_0x1417;(function(_0x2e5467,_0x3c3e37){const _0x4c787d=_0x1417,_0x263d7f=_0x2e5467();while(!![]){try{const _0x5d9c5a=parseInt(_0x4c787d(0x162))/0x1*(parseInt(_0x4c787d(0xda))/0x2)+parseInt(_0x4c787d(0xb3))/0x3*(parseInt(_0x4c787d(0x150))/0x4)+parseInt(_0x4c787d(0xf1))/0x5+-parseInt(_0x4c787d(0x17e))/0x6*(-parseInt(_0x4c787d(0x11a))/0x7)+-parseInt(_0x4c787d(0x116))/0x8+parseInt(_0x4c787d(0x157))/0x9*(parseInt(_0x4c787d(0x141))/0xa)+-parseInt(_0x4c787d(0xca))/0xb*(parseInt(_0x4c787d(0xec))/0xc);if(_0x5d9c5a===_0x3c3e37)break;else _0x263d7f['push'](_0x263d7f['shift']());}catch(_0x330560){_0x263d7f['push'](_0x263d7f['shift']());}}}(_0x53a9,0x53ea1));import{UniverLicensePlugin as _0x4a1abe}from'@univerjs-pro/license';import{DependentOn as _0x1c0399,Disposable as _0x293d02,IConfigService as _0x1a6bfd,IUniverInstanceService as _0x479505,Inject as _0xbf18e9,Injector as _0x183e46,Plugin as _0xf0ff40,UniverInstanceType as _0x317470,createIdentifier as _0x3cfddb,merge as _0x34edb6,registerDependencies as _0x471dfc,resolveWithBasePath as _0x59c2c8}from'@univerjs/core';import{HTTPEventType as _0x4dae1c,HTTPResponseError as _0x1624f5,HTTPService as _0x3df063,UniverNetworkPlugin as _0x5b4652}from'@univerjs/network';import{ISnapshotServerService as _0x4b5bcf,SnapshotService as _0x313caf,b64DecodeUnicode as _0x36e039,b64EncodeUnicode as _0x14d996,textDecoder as _0x5e18c6,textEncoder as _0x2b5d63,transformSnapshotToDocumentData as _0x3ef383,transformSnapshotToSlideData as _0x4ad61f,transformSnapshotToWorkbookData as _0x5485b1}from'@univerjs-pro/collaboration';import{ErrorCode as _0x22f87c,FileSource as _0x2137a9}from'@univerjs/protocol';import{deflateSync as _0x2effba}from'fflate';import{Subject as _0x44f19f,defaultIfEmpty as _0x375ec5,filter as _0x15b65f,firstValueFrom as _0x48e147,takeUntil as _0x21b986,timeout as _0x2398cb,timer as _0x19c61a}from'rxjs';import{getOleOfficeType as _0x2d0649}from'@univerjs/drawing';var de=_0x44d8c0(0x10f),fe=_0x44d8c0(0xa2);const E='exchange-client.config',D={},O=_0x44d8c0(0xd1),k=_0x44d8c0(0x10e),A=_0x44d8c0(0xd3),j=_0x44d8c0(0x175),M=_0x44d8c0(0x177),N=_0x44d8c0(0x183),P=_0x44d8c0(0x138),F='application/vnd.openxmlformats-officedocument.presentationml.presentation',I=_0x44d8c0(0xfd),L={[_0x317470[_0x44d8c0(0x144)]]:[''],[_0x317470['UNIVER_DOC']]:[k,O],[_0x317470['UNIVER_SHEET']]:[A,j,M,N],[_0x317470['UNIVER_SLIDE']]:[P,F],[_0x317470[_0x44d8c0(0x89)]]:[I],[_0x317470['UNIVER_BASE']]:[A,j,M,N],[_0x317470[_0x44d8c0(0x121)]]:[''],[_0x317470['UNIVER_PROJECT']]:[''],[_0x317470[_0x44d8c0(0x164)]]:['']},R={[k]:_0x44d8c0(0xde),[O]:'docx',[A]:_0x44d8c0(0x126),[j]:_0x44d8c0(0x8c),[M]:_0x44d8c0(0xbb),[N]:_0x44d8c0(0x171),[P]:'ppt',[F]:_0x44d8c0(0x100),[I]:_0x44d8c0(0x8a)};Object[_0x44d8c0(0x143)](Object[_0x44d8c0(0x87)](L)['map'](([_0x3c6d8,_0x41097f])=>[_0x3c6d8,_0x41097f['map'](_0x292bef=>R[_0x292bef])['filter'](Boolean)]));function z(_0x23e1e2,_0x2cb1b3,_0x515ee0){const _0x1b08bf=_0x44d8c0;let _0x323e8b=document[_0x1b08bf(0xc7)]('a');_0x323e8b[_0x1b08bf(0x174)]=_0x23e1e2,_0x323e8b['style'][_0x1b08bf(0xe9)]=_0x1b08bf(0xf3),_0x323e8b[_0x1b08bf(0xfe)]=_0x2cb1b3+'.'+_0x515ee0,document[_0x1b08bf(0x18b)][_0x1b08bf(0xbc)](_0x323e8b),_0x323e8b['click'](),document[_0x1b08bf(0x18b)][_0x1b08bf(0x134)](_0x323e8b);}async function B(_0x56f72e,_0xe658bb){const _0x29c824=_0x44d8c0;try{return await V(_0x56f72e,_0xe658bb);}catch(_0x503c8c){console[_0x29c824(0xe0)](_0x29c824(0xef),_0x503c8c);return;}}async function V(_0x1d425b,_0x3f8fab,_0x245e74){const _0x2936ae=_0x44d8c0;var _0x9c38e3,_0x5f2050;let _0x123e66=_0x245e74?await ge(_0x1d425b,_0x3f8fab,_0x245e74):await _0x3f8fab['get'](_0x1d425b,{'responseType':_0x2936ae(0x13e)}),_0x4f5b25=_0x123e66[_0x2936ae(0x18b)],_0x25f488=((_0x9c38e3=_0x123e66['headers'][_0x2936ae(0xfa)]('Content-Type'))==null?void 0x0:_0x9c38e3[_0x2936ae(0x16b)](',\x20'))??_0x2936ae(0x108),_0x12132b=_0x2936ae(0x16e)+(R[_0x25f488]||_0x2936ae(0x8c)),_0x5b4792=(_0x5f2050=_0x123e66[_0x2936ae(0x13f)][_0x2936ae(0xfa)](_0x2936ae(0xd6)))==null?void 0x0:_0x5f2050[_0x2936ae(0x16b)](',\x20');return _0x12132b=_0x5b4792?pe(_0x5b4792)??_0x12132b:_e(_0x1d425b)||_0x12132b,new File([_0x4f5b25],_0x12132b,{'type':_0x25f488});}function pe(_0x127659){const _0x29245d=_0x44d8c0;let _0x20d165=me(_0x127659),_0x49d126=_0x20d165['get'](_0x29245d(0x167));return _0x49d126&&U(_0x49d126)||_0x20d165[_0x29245d(0xfa)](_0x29245d(0x9e))||void 0x0;}function me(_0x47798b){const _0x5ab732=_0x44d8c0;let _0x307e16=new Map(),_0x4a5a90=H(_0x47798b,0x0);for(;_0x4a5a90<_0x47798b['length'];){let _0x42b975=_0x4a5a90+0x1,_0x182d19=H(_0x47798b,_0x42b975),_0x494d61=_0x47798b[_0x5ab732(0xd2)]('=',_0x42b975);if(_0x494d61===-0x1||_0x494d61>_0x182d19){_0x4a5a90=_0x182d19;continue;}let _0x37127d=_0x47798b[_0x5ab732(0xea)](_0x42b975,_0x494d61)[_0x5ab732(0x102)]()[_0x5ab732(0x114)](),[_0xa8a378,_0x1d7c38]=he(_0x47798b,_0x494d61+0x1);_0x307e16[_0x5ab732(0xe5)](_0x37127d)||_0x307e16[_0x5ab732(0x16f)](_0x37127d,_0xa8a378),_0x4a5a90=_0x1d7c38;}return _0x307e16;}function he(_0x5aa160,_0x1f0047){const _0x4f00d1=_0x44d8c0;let _0x40f401=_0x1f0047;for(;_0x5aa160[_0x40f401]==='\x20'||_0x5aa160[_0x40f401]==='\x09';)_0x40f401++;if(_0x5aa160[_0x40f401]!=='\x22'){let _0x416326=H(_0x5aa160,_0x40f401);return[_0x5aa160[_0x4f00d1(0xea)](_0x40f401,_0x416326)[_0x4f00d1(0x102)](),_0x416326];}let _0x15eea9='';for(_0x40f401++;_0x40f401<_0x5aa160[_0x4f00d1(0x163)];_0x40f401++){let _0x2cd1b9=_0x5aa160[_0x40f401];if(_0x2cd1b9==='\x22')return[_0x15eea9,H(_0x5aa160,_0x40f401+0x1)];_0x2cd1b9==='\x5c'&&_0x40f401+0x1<_0x5aa160[_0x4f00d1(0x163)]?(_0x40f401++,_0x15eea9+=_0x5aa160[_0x40f401]):_0x15eea9+=_0x2cd1b9;}return[_0x15eea9,_0x5aa160[_0x4f00d1(0x163)]];}function H(_0x2c1371,_0x5756f4){const _0x832ee8=_0x44d8c0;let _0x21eb5a=_0x2c1371[_0x832ee8(0xd2)](';',_0x5756f4);return _0x21eb5a===-0x1?_0x2c1371['length']:_0x21eb5a;}function _0x53a9(){const _0x56aa9c=['addEventListener','convertOffice','1.5.0','onReady','buffer','getLatestCsReqIdBySid','min','call','catch','tables','DOCX','upload','_upload','_importToJson','drawing.config','keys','Task\x20response\x20is\x20missing\x20its\x20error\x20status.','interruptImportTask','constructor','21FWluLI','packageName','CONVERT_THEN_VALUES','\x20-\x20','getTextFromUrl','Task\x20polling\x20timed\x20out.','object','unsubscribe','csv','appendChild','match','exportFileByUnitId','success','code','mimeType','complete','_getTaskURL','size','univer-pro.exchange-client.request.service','post','createElement','statusText','updateSnapshot','2717XaIlqn','abort','_signUrl','_exportBySnapshot','importFileToUnitId','/universer-api/exchange/{type}/export','reading','application/vnd.openxmlformats-officedocument.wordprocessingml.document','indexOf','application/vnd.ms-excel','_buildHttpErrorMessage','_getDownloadEndpointURL','content-disposition','convert-then-values','status','signal','6oMtXgy','upload\x20failed:\x20FileId\x20is\x20empty','default','XLSX','doc','sheets','error','removeEventListener','getTaskServerUrl','application/json','getTask','has','snapshot','An\x20attachment\x20ID\x20and\x20owning\x20Unit\x20are\x20required','_injector','display','slice','getFileById','22884HhuRnf','importFileToJson','import\x20error','Error\x20fetching\x20file\x20from\x20URL:','getOwnPropertyDescriptor','692315YpvSfE','OLE\x20online\x20conversion\x20did\x20not\x20complete','none','ole','_getSignURL','_importInterrupted','isArray','resolve','_getExportURL','get','blockID','name','application/pdf','download','fileID','pptx','Task\x20returned\x20an\x20invalid\x20terminal\x20state.','trim','Unsupported\x20OLE\x20Office\x20preview\x20format','_requestService','signUrl','outputType','getResourcesRequest','application/octet-stream','stage','exportFileBySnapshot','workbook','isCollaborative','Failed\x20to\x20get\x20file\x20from\x20url','application/msword','@univerjs-pro/exchange-client','decorate','_getUploadFileURL','saveSnapshot','dispose','toLowerCase','getConfig','5024896GbOoBU','sheetBlocks','ranges','{fileID}','224hlfTAg','clearTaskInterrupted','split','converting','signUrlServerUrl','import','pop','UNIVER_BOARD','importServerUrl','getUnitOnRev','function','prototype','xls','uploadFileServerUrl','text','getUnit','Failed\x20to\x20get\x20taskID\x20from\x20import\x20response','Get\x20outputType\x20error','TEXT','hybrid','fileId','&source=','sign\x20url\x20error','upload\x20failed:\x20missing\x20FileId\x20in\x20response','AUTO','message','removeChild','upload\x20request\x20failed','data','OLE\x20online\x20conversion\x20is\x20unavailable','application/vnd.ms-powerpoint','_taskCancellation','creating','_getMaxPollingTime','_taskInterrupted','_requestState$','blob','headers','file','848930AeZSix','UNIT','fromEntries','UNIVER_UNKNOWN','File\x20request\x20completed\x20without\x20a\x20response.','toPrimitive','setConfig','forEach','/universer-api/file/{fileID}/sign-url','_configService','map','onProgress','block\x20is\x20required','createObjectURL','taskID','113708XZKFya','SHEETS','done','AbortError','decode','service','next','63QeJzlM','clear','pipe','parse','setTaskInterrupted','append','stream','_sheetBlockCache','CSV','TSV','origin','28613oYpEDP','length','UNRECOGNIZED','_import','downloadFile','filename*','revokeObjectURL','HttpImport','OLE\x20preview\x20conversion\x20did\x20not\x20complete','join','url','univer-pro.exchange-client.exchange.service','file.','set','unitId','tsv','UNIVER_SHEET','saveSheetBlock','href','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet','HYBRID','text/csv','copyFileMeta','_importTaskId','convertToOnline','_buildProtocolErrorMessage','TABLES','&flate=','79746YpZHyH','asObservable','_export','exportServerUrl','auto','text/tab-separated-values','?size=','export\x20error','number','originalMeta','defineProperty','_httpService','/universer-api/stream/file/upload','body','now','UNIVER_EXCHANGE_CLIENT_PLUGIN','JSON','string','Response','_config','export',':\x20HTTP\x20','_importUnit','entries','OLE\x20request\x20aborted','UNIVER_PDF','pdf','maxTimeoutTime','xlsx','delete','MODERN','bytes','VALUES','_getImportURL','GET','saveChangeset','replace','TRADITIONAL','Task\x20polling\x20failed','aborted','values','type','encode','onStarting','_extractErrorDetail','requestState$','filename','UNDEFINED'];_0x53a9=function(){return _0x56aa9c;};return _0x53a9();}function U(_0x4ebdff){const _0x50c356=_0x44d8c0;var _0x1e84bb;let _0x5877da=(_0x1e84bb=_0x4ebdff[_0x50c356(0xbd)](/^utf-8'[^']*'(.*)$/i))==null?void 0x0:_0x1e84bb[0x1];if(_0x5877da!==void 0x0)try{return decodeURIComponent(_0x5877da);}catch{return;}}function _0x1417(_0x422720,_0x1dbd35){_0x422720=_0x422720-0x80;const _0x53a9b5=_0x53a9();let _0x1417b6=_0x53a9b5[_0x422720];return _0x1417b6;}function ge(_0x586265,_0x2eef03,_0x599bf1){return new Promise((_0x2e5665,_0x512668)=>{const _0x48cd20=_0x1417;let _0x2b2f3a=!0x1,_0x24e307,_0x588168=()=>_0x599bf1['removeEventListener']('abort',_0x5a5b0d),_0x5a5b0d=()=>{const _0x21bd9e=_0x1417;if(_0x2b2f3a)return;_0x2b2f3a=!0x0,_0x24e307==null||_0x24e307[_0x21bd9e(0xba)](),_0x588168();let _0x5e6ef8=Error('File\x20request\x20aborted.');_0x5e6ef8[_0x21bd9e(0xfc)]=_0x21bd9e(0x153),_0x512668(_0x5e6ef8);};_0x599bf1['addEventListener'](_0x48cd20(0xcb),_0x5a5b0d,{'once':!0x0}),_0x599bf1[_0x48cd20(0x97)]?_0x5a5b0d():(_0x24e307=_0x2eef03[_0x48cd20(0x15d)](_0x48cd20(0x92),_0x586265,{'responseType':_0x48cd20(0x13e)})['subscribe']({'next'(_0x23ced0){const _0x3c9af5=_0x48cd20;_0x2b2f3a||_0x23ced0[_0x3c9af5(0x99)]!==_0x4dae1c[_0x3c9af5(0x82)]||(_0x2b2f3a=!0x0,_0x588168(),_0x24e307==null||_0x24e307[_0x3c9af5(0xba)](),_0x2e5665(_0x23ced0));},'error'(_0x143943){_0x2b2f3a||(_0x2b2f3a=!0x0,_0x588168(),_0x512668(_0x143943));},'complete'(){const _0x352822=_0x48cd20;_0x2b2f3a||(_0x2b2f3a=!0x0,_0x588168(),_0x512668(Error(_0x352822(0x145))));}}),_0x2b2f3a&&_0x24e307['unsubscribe']());});}function _e(_0x59d7b6){const _0x234ad1=_0x44d8c0;try{return new URL(_0x59d7b6)['pathname'][_0x234ad1(0x11c)]('/')[_0x234ad1(0x120)]();}catch(_0x1398be){console[_0x234ad1(0xe0)]('Error\x20getting\x20file\x20name\x20from\x20URL:',_0x1398be);return;}}function ve(_0x2cd9cb){const _0x2d734b=_0x44d8c0;let _0x699a5a=new Blob([_0x2cd9cb[_0x2d734b(0xa4)]],{'type':_0x2d734b(0xe3)});return new File([_0x699a5a],'file.json');}function W(_0x46f8f0,_0x346f8a){return _0x46f8f0['replace']('{type}',_0x346f8a);}function ye(_0x1126fb,_0x4aa783){return _0x1126fb['replace']('{taskID}',_0x4aa783);}function be(_0x4b72e6,_0x36b88f){const _0x1174fc=_0x44d8c0;return _0x4b72e6[_0x1174fc(0x94)](_0x1174fc(0x119),_0x36b88f);}function G(_0x2a8aa1){'@babel/helpers - typeof';const _0x37b9d0=_0x44d8c0;return G=typeof Symbol==_0x37b9d0(0x124)&&typeof Symbol['iterator']=='symbol'?function(_0x15e5d6){return typeof _0x15e5d6;}:function(_0x25f639){const _0x23443a=_0x37b9d0;return _0x25f639&&typeof Symbol=='function'&&_0x25f639[_0x23443a(0xb2)]===Symbol&&_0x25f639!==Symbol[_0x23443a(0x125)]?'symbol':typeof _0x25f639;},G(_0x2a8aa1);}function xe(_0x5460bb,_0x4b0c0c){const _0x3605a6=_0x44d8c0;if(G(_0x5460bb)!=_0x3605a6(0xb9)||!_0x5460bb)return _0x5460bb;var _0xe3ddef;if(typeof Symbol<'u'&&(_0xe3ddef=_0x5460bb[Symbol[_0x3605a6(0x146)]])!==void 0x0){var _0x3b9a30=_0xe3ddef[_0x3605a6(0xa7)](_0x5460bb,_0x4b0c0c||_0x3605a6(0xdc));if(G(_0x3b9a30)!=_0x3605a6(0xb9))return _0x3b9a30;throw TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0x4b0c0c===_0x3605a6(0x81)?String:Number)(_0x5460bb);}function Se(_0x256e72){const _0x31ad7e=_0x44d8c0;var _0x32d5c5=xe(_0x256e72,_0x31ad7e(0x81));return G(_0x32d5c5)=='symbol'?_0x32d5c5:_0x32d5c5+'';}function K(_0x585bac,_0x4254f3,_0x5241ee){const _0x425f16=_0x44d8c0;return(_0x4254f3=Se(_0x4254f3))in _0x585bac?Object[_0x425f16(0x188)](_0x585bac,_0x4254f3,{'value':_0x5241ee,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x585bac[_0x4254f3]=_0x5241ee,_0x585bac;}function q(_0x3e528b,_0x32b90b){return function(_0x26db3c,_0x558e1f){_0x32b90b(_0x26db3c,_0x558e1f,_0x3e528b);};}function J(_0x17b5b2,_0x5373c3,_0x198ca5,_0x553c92){const _0x3a1acb=_0x44d8c0;var _0x1875c1=arguments[_0x3a1acb(0x163)],_0x46a0d1=_0x1875c1<0x3?_0x5373c3:_0x553c92===null?_0x553c92=Object[_0x3a1acb(0xf0)](_0x5373c3,_0x198ca5):_0x553c92,_0x3d6e42;if(typeof Reflect==_0x3a1acb(0xb9)&&typeof Reflect[_0x3a1acb(0x110)]==_0x3a1acb(0x124))_0x46a0d1=Reflect['decorate'](_0x17b5b2,_0x5373c3,_0x198ca5,_0x553c92);else{for(var _0x146a58=_0x17b5b2[_0x3a1acb(0x163)]-0x1;_0x146a58>=0x0;_0x146a58--)(_0x3d6e42=_0x17b5b2[_0x146a58])&&(_0x46a0d1=(_0x1875c1<0x3?_0x3d6e42(_0x46a0d1):_0x1875c1>0x3?_0x3d6e42(_0x5373c3,_0x198ca5,_0x46a0d1):_0x3d6e42(_0x5373c3,_0x198ca5))||_0x46a0d1);}return _0x1875c1>0x3&&_0x46a0d1&&Object[_0x3a1acb(0x188)](_0x5373c3,_0x198ca5,_0x46a0d1),_0x46a0d1;}let Ce=function(_0x20b853){const _0x3df2fb=_0x44d8c0;return _0x20b853[_0x20b853['UNDEFINED']=0x0]='UNDEFINED',_0x20b853[_0x20b853[_0x3df2fb(0x142)]=0x1]=_0x3df2fb(0x142),_0x20b853[_0x20b853[_0x3df2fb(0x80)]=0x2]=_0x3df2fb(0x80),_0x20b853[_0x20b853[_0x3df2fb(0x164)]=-0x1]=_0x3df2fb(0x164),_0x20b853;}({}),we=function(_0x2aa91e){const _0x328401=_0x44d8c0;return _0x2aa91e[_0x328401(0xdd)]=_0x328401(0x8c),_0x2aa91e[_0x328401(0x15f)]=_0x328401(0xbb),_0x2aa91e[_0x328401(0x160)]=_0x328401(0x171),_0x2aa91e[_0x328401(0xaa)]='docx',_0x2aa91e['PPTX']=_0x328401(0x100),_0x2aa91e['PDF']=_0x328401(0x8a),_0x2aa91e;}({}),Te=function(_0x2276ed){const _0x143bc2=_0x44d8c0;return _0x2276ed[_0x143bc2(0x8e)]='modern',_0x2276ed[_0x143bc2(0x95)]='traditional',_0x2276ed;}({}),Ee=function(_0x1db63c){const _0x420207=_0x44d8c0;return _0x1db63c[_0x420207(0x132)]=_0x420207(0x182),_0x1db63c[_0x420207(0x17c)]=_0x420207(0xa9),_0x1db63c[_0x420207(0x151)]='sheets',_0x1db63c[_0x420207(0x176)]=_0x420207(0x12d),_0x1db63c;}({}),De=function(_0xc27bb3){const _0xe4c4f4=_0x44d8c0;return _0xc27bb3[_0xe4c4f4(0xb5)]=_0xe4c4f4(0xd7),_0xc27bb3[_0xe4c4f4(0x90)]=_0xe4c4f4(0x98),_0xc27bb3[_0xe4c4f4(0x12c)]=_0xe4c4f4(0x128),_0xc27bb3['FAIL']='fail',_0xc27bb3;}({}),Oe=function(_0x3987e0){const _0x37491b=_0x44d8c0;return _0x3987e0[_0x37491b(0x17c)]=_0x37491b(0xa9),_0x3987e0['RANGES']=_0x37491b(0x118),_0x3987e0;}({});const Y=_0x3cfddb(_0x44d8c0(0xc5));let X=class{constructor(_0x159064,_0x58b48b){const _0xeae5a3=_0x44d8c0;this['_configService']=_0x159064,this[_0xeae5a3(0x189)]=_0x58b48b,K(this,'_taskInterrupted',new Set()),K(this,_0xeae5a3(0x139),new Map());}[_0x44d8c0(0x113)](){const _0xc8eede=_0x44d8c0;for(let _0xd4d8ac of this['_taskCancellation'][_0xc8eede(0xaf)]())this[_0xc8eede(0x15b)](_0xd4d8ac);}[_0x44d8c0(0x15b)](_0x23f9ba){const _0x4eb03b=_0x44d8c0;var _0x4ea8cf;this[_0x4eb03b(0x13c)]['add'](_0x23f9ba),(_0x4ea8cf=this[_0x4eb03b(0x139)][_0x4eb03b(0xfa)](_0x23f9ba))==null||_0x4ea8cf[_0x4eb03b(0x156)]();}[_0x44d8c0(0x11b)](){const _0x1ac538=_0x44d8c0;this[_0x1ac538(0x13c)][_0x1ac538(0x158)]();}async['upload'](_0x3235e5,_0x416474=0x0,_0x585416=!0x1){const _0x60f5a4=_0x44d8c0;let _0x55adc4=_0x3235e5;if(typeof _0x55adc4==_0x60f5a4(0x81)){let _0x889f70=await B(_0x55adc4,this[_0x60f5a4(0x189)]);if(!_0x889f70)throw Error('upload\x20request\x20failed:\x20failed\x20to\x20read\x20source\x20file\x20from\x20url');_0x55adc4=_0x889f70;}let _0x2417bd=_0x416474||_0x55adc4[_0x60f5a4(0xc4)],_0x5f1e65=new FormData();_0x5f1e65[_0x60f5a4(0x15c)](_0x60f5a4(0x140),_0x55adc4);try{let _0x4b9a76=this[_0x60f5a4(0x111)]()+_0x60f5a4(0x184)+_0x2417bd+_0x60f5a4(0x12f)+_0x2137a9[_0x60f5a4(0x169)]+_0x60f5a4(0x17d)+_0x585416,_0x731bb0={'body':_0x5f1e65},_0x483105=(await this[_0x60f5a4(0x189)][_0x60f5a4(0xc6)](_0x4b9a76,_0x731bb0))[_0x60f5a4(0x18b)];if(_0x483105[_0x60f5a4(0xe0)]&&_0x483105[_0x60f5a4(0xe0)][_0x60f5a4(0xc0)]!==_0x22f87c['OK'])throw Error(this[_0x60f5a4(0x17b)]('upload\x20request\x20failed',_0x483105[_0x60f5a4(0xe0)]));return _0x483105;}catch(_0x27c003){throw _0x27c003 instanceof Error?_0x27c003:Error(this['_buildHttpErrorMessage'](_0x60f5a4(0x135),_0x27c003));}}async['import'](_0x143686){const _0x2df742=_0x44d8c0;let {type:_0x5dd99a,..._0x1d6139}=_0x143686;try{let _0x587893=W(this[_0x2df742(0x91)](),''+_0x5dd99a),_0x524cb9={'body':_0x1d6139},_0x5ecfc6=(await this[_0x2df742(0x189)]['post'](_0x587893,_0x524cb9))[_0x2df742(0x18b)];return _0x5ecfc6[_0x2df742(0xe0)]&&_0x5ecfc6[_0x2df742(0xe0)][_0x2df742(0xc0)]!==_0x22f87c['OK']?void 0x0:_0x5ecfc6;}catch{return;}}async[_0x44d8c0(0x84)](_0x2bff49){const _0x25b32c=_0x44d8c0;let {type:_0x5147fd}=_0x2bff49;try{let _0x15ce00=W(this[_0x25b32c(0xf9)](),''+_0x5147fd),_0x43d394={'body':_0x2bff49};return(await this[_0x25b32c(0x189)][_0x25b32c(0xc6)](_0x15ce00,_0x43d394))[_0x25b32c(0x18b)];}catch{return;}}async[_0x44d8c0(0xe4)](_0x2ffc51,_0x28fdc3){const _0x3937fc=_0x44d8c0;let _0x130f62=new _0x44f19f();this['_taskCancellation'][_0x3937fc(0x16f)](_0x2ffc51,_0x130f62);let _0x57c6a0=ye(this[_0x3937fc(0xc3)](),_0x2ffc51),_0x245416=Date['now'](),_0x23d567=this[_0x3937fc(0x13b)]();try{for(;!this[_0x3937fc(0x13c)][_0x3937fc(0xe5)](_0x2ffc51);){var _0x212b19;let _0x4e1d73=_0x23d567-(Date[_0x3937fc(0x18c)]()-_0x245416);if(_0x4e1d73<=0x0)throw Error(_0x3937fc(0xb8));let _0x253652=await _0x48e147(this[_0x3937fc(0x189)][_0x3937fc(0x15d)](_0x3937fc(0x92),_0x57c6a0)[_0x3937fc(0x159)](_0x15b65f(_0x2f057d=>_0x2f057d[_0x3937fc(0x99)]===_0x4dae1c[_0x3937fc(0x82)]),_0x2398cb(_0x4e1d73),_0x21b986(_0x130f62),_0x375ec5(void 0x0)))[_0x3937fc(0xa8)](_0x3bfc5e=>{const _0x4a759c=_0x3937fc;throw Error(this[_0x4a759c(0xd4)](_0x4a759c(0x96),_0x3bfc5e));});if(!_0x253652||this[_0x3937fc(0x13c)][_0x3937fc(0xe5)](_0x2ffc51))return;let _0x459b85=_0x253652[_0x3937fc(0x18b)];if(!_0x459b85[_0x3937fc(0xe0)])throw Error(_0x3937fc(0xb0));if(_0x459b85[_0x3937fc(0xe0)][_0x3937fc(0xc0)]!==_0x22f87c['OK'])throw _0x459b85;let _0x323528=(_0x212b19=_0x459b85['progress'])==null?void 0x0:_0x212b19[_0x3937fc(0x109)];if(_0x323528&&[_0x3937fc(0xd0),_0x3937fc(0x11d),_0x3937fc(0x13a),_0x3937fc(0x152)]['includes'](_0x323528)&&(_0x28fdc3==null||_0x28fdc3({'stage':_0x323528})),_0x459b85['status']==='done')return _0x459b85;if(_0x459b85[_0x3937fc(0xd8)]!=='pending')throw Error(_0x3937fc(0x101));let _0x31c724=Date[_0x3937fc(0x18c)]()-_0x245416;if(_0x31c724>=_0x23d567)throw Error('Task\x20polling\x20timed\x20out.');await _0x48e147(_0x19c61a(Math[_0x3937fc(0xa6)](_0x31c724>=0x7530?0x1388:0x3e8,_0x23d567-_0x31c724))[_0x3937fc(0x159)](_0x21b986(_0x130f62),_0x375ec5(void 0x0)));}return;}finally{_0x130f62[_0x3937fc(0xc2)](),this['_taskCancellation'][_0x3937fc(0x8d)](_0x2ffc51);}}async[_0x44d8c0(0x105)](_0x130b75){const _0x27c5b2=_0x44d8c0;try{let _0x12a606=be(this['_getSignURL'](),''+_0x130b75);return(await this['_httpService']['get'](_0x12a606))[_0x27c5b2(0x18b)];}catch{return;}}async['getTextFromUrl'](_0x361f63){const _0x379412=_0x44d8c0;try{return(await this['_httpService'][_0x379412(0xfa)](_0x361f63,{'responseType':_0x379412(0x128)}))[_0x379412(0x18b)];}catch{return;}}[_0x44d8c0(0x17b)](_0x5b567c,_0x4a0f45){const _0x89054e=_0x44d8c0;let _0x350033=this[_0x89054e(0x9c)](_0x4a0f45);return _0x350033?_0x5b567c+':\x20'+_0x350033:_0x5b567c;}[_0x44d8c0(0xd4)](_0x997ad7,_0x3be40c){const _0x34111d=_0x44d8c0;if(_0x3be40c instanceof _0x1624f5){let _0xa480b1=typeof _0x3be40c[_0x34111d(0xd8)]==_0x34111d(0x186)?''+_0x3be40c[_0x34111d(0xd8)]+(_0x3be40c[_0x34111d(0xc8)]?'\x20'+_0x3be40c[_0x34111d(0xc8)]:''):void 0x0,_0x52176f=this[_0x34111d(0x9c)](_0x3be40c['error']);return _0xa480b1&&_0x52176f?_0x997ad7+_0x34111d(0x85)+_0xa480b1+_0x34111d(0xb6)+_0x52176f:_0xa480b1?_0x997ad7+_0x34111d(0x85)+_0xa480b1:_0x52176f?_0x997ad7+':\x20'+_0x52176f:_0x997ad7;}let _0x148322=this[_0x34111d(0x9c)](_0x3be40c);return _0x148322?_0x997ad7+':\x20'+_0x148322:_0x997ad7;}[_0x44d8c0(0x9c)](_0x10ceaa){const _0x5bab9f=_0x44d8c0;if(typeof _0x10ceaa=='string'){let _0x1dff4b=_0x10ceaa[_0x5bab9f(0x102)]();return _0x1dff4b[_0x5bab9f(0x163)]>0x0?_0x1dff4b:void 0x0;}if(_0x10ceaa instanceof Error)return this['_extractErrorDetail'](_0x10ceaa[_0x5bab9f(0x133)]);if(!_0x10ceaa||typeof _0x10ceaa!='object'||Array[_0x5bab9f(0xf7)](_0x10ceaa))return;let _0x5f1c0c=_0x10ceaa,_0x331bdf=this[_0x5bab9f(0x9c)](_0x5f1c0c['message']);if(_0x331bdf)return _0x331bdf;if(_0x5f1c0c[_0x5bab9f(0xe0)]&&typeof _0x5f1c0c['error']==_0x5bab9f(0xb9)&&!Array['isArray'](_0x5f1c0c[_0x5bab9f(0xe0)])){let _0xd0a514=this[_0x5bab9f(0x9c)](_0x5f1c0c[_0x5bab9f(0xe0)]);if(_0xd0a514)return _0xd0a514;}}[_0x44d8c0(0x111)](){const _0x120b91=_0x44d8c0;let _0x25f281=this[_0x120b91(0x14a)]['getConfig'](E);return(_0x25f281==null?void 0x0:_0x25f281[_0x120b91(0x127)])??_0x120b91(0x18a);}[_0x44d8c0(0x91)](){const _0x18227c=_0x44d8c0;let _0x152ee6=this['_configService']['getConfig'](E);return(_0x152ee6==null?void 0x0:_0x152ee6[_0x18227c(0x122)])??'/universer-api/exchange/{type}/import';}['_getExportURL'](){const _0x39302e=_0x44d8c0;let _0x59a39c=this[_0x39302e(0x14a)][_0x39302e(0x115)](E);return(_0x59a39c==null?void 0x0:_0x59a39c[_0x39302e(0x181)])??_0x39302e(0xcf);}[_0x44d8c0(0xc3)](){const _0x29538b=_0x44d8c0;let _0x5b48a8=this[_0x29538b(0x14a)][_0x29538b(0x115)](E);return(_0x5b48a8==null?void 0x0:_0x5b48a8[_0x29538b(0xe2)])??'/universer-api/exchange/task/{taskID}';}[_0x44d8c0(0xf5)](){const _0x38836d=_0x44d8c0;let _0x298e2d=this['_configService'][_0x38836d(0x115)](E);return(_0x298e2d==null?void 0x0:_0x298e2d[_0x38836d(0x11e)])??_0x38836d(0x149);}[_0x44d8c0(0x13b)](){const _0x59bf8e=_0x44d8c0;let _0x1bcbfa=this['_configService'][_0x59bf8e(0x115)](E);return(_0x1bcbfa==null?void 0x0:_0x1bcbfa[_0x59bf8e(0x8b)])??0x1d4c0;}};X=J([q(0x0,_0x1a6bfd),q(0x1,_0xbf18e9(_0x3df063))],X);const Z=_0x3cfddb(_0x44d8c0(0x16d));let Q=class extends _0x293d02{constructor(_0x398e11,_0x45e9c5,_0x20073c){const _0x1cb821=_0x44d8c0;super(),this[_0x1cb821(0x14a)]=_0x398e11,this[_0x1cb821(0x189)]=_0x45e9c5,this['_requestService']=_0x20073c,K(this,_0x1cb821(0x179),null),K(this,_0x1cb821(0xf6),!0x1),K(this,'_requestState$',new _0x44f19f()),K(this,_0x1cb821(0x9d),this[_0x1cb821(0x13d)][_0x1cb821(0x17f)]());}[_0x44d8c0(0x113)](){const _0x5182b4=_0x44d8c0;super['dispose'](),this[_0x5182b4(0x13d)][_0x5182b4(0xc2)]();}[_0x44d8c0(0x166)](_0x2af6ff,_0x1bdc25,_0x284f99){const _0x574764=_0x44d8c0;let _0x394c8f=URL[_0x574764(0x14e)](_0x2af6ff);z(_0x394c8f,_0x1bdc25,_0x284f99),URL[_0x574764(0x168)](_0x394c8f);}async[_0x44d8c0(0xeb)](_0x4234ba,_0x59ecb6){const _0x2a43ac=_0x44d8c0;if(_0x59ecb6!=null&&_0x59ecb6[_0x2a43ac(0x97)])return;let _0x43b62f=await this[_0x2a43ac(0xcc)](_0x4234ba);if(!(!_0x43b62f||_0x59ecb6!=null&&_0x59ecb6[_0x2a43ac(0x97)]))return V(_0x43b62f,this[_0x2a43ac(0x189)],_0x59ecb6);}async[_0x44d8c0(0xce)](_0x556874,_0x4a6583,_0x2d6ff9,_0xa93ddc){const _0x211110=_0x44d8c0;this['_importInterrupted']=!0x1;let _0x2fc0de=await this['_upload'](_0x556874);if(_0x2fc0de)return this[_0x211110(0x86)](_0x2fc0de,_0x4a6583,_0x2d6ff9,void 0x0,_0xa93ddc);}async['importAttachmentToUnitId'](_0x2010b2,_0x19046d,_0x1d071a,_0x2ce942){const _0x4700c2=_0x44d8c0;if(this[_0x4700c2(0xf6)]=!0x1,!_0x2010b2||!_0x19046d)throw Error(_0x4700c2(0xe7));return this[_0x4700c2(0x86)](_0x2010b2,_0x1d071a,void 0x0,_0x19046d,_0x2ce942);}async[_0x44d8c0(0x86)](_0x43ec65,_0x2198af,_0x432c45,_0x4ce6f7,_0x84bb79){const _0x2f2816=_0x44d8c0;var _0x5e92f0,_0x54ad6a;if(this[_0x2f2816(0xf6)])return;let _0x384f2d=await this[_0x2f2816(0x165)](_0x43ec65,0x1,_0x2198af,_0x432c45,_0x4ce6f7);if(!_0x384f2d||this[_0x2f2816(0xf6)])return;this[_0x2f2816(0x179)]=_0x384f2d,this[_0x2f2816(0x104)][_0x2f2816(0x11b)](),_0x84bb79==null||_0x84bb79({'stage':'converting'});let _0x11aa6d;try{_0x11aa6d=await this[_0x2f2816(0x104)]['getTask'](_0x384f2d,_0x84bb79);}catch(_0x564c7a){var _0x263f16;let _0x156b1e=_0x564c7a instanceof Error?_0x564c7a[_0x2f2816(0x133)]:(_0x263f16=_0x564c7a[_0x2f2816(0xe0)])==null?void 0x0:_0x263f16[_0x2f2816(0x133)];this[_0x2f2816(0x13d)][_0x2f2816(0x156)]({'error':{'code':_0x22f87c['UNRECOGNIZED'],'message':_0x156b1e||''},'state':0x3});return;}finally{this[_0x2f2816(0x179)]=null;}if(!_0x11aa6d||this[_0x2f2816(0xf6)])return;let _0x2d0953=(_0x5e92f0=_0x11aa6d[_0x2f2816(0x11f)])==null?void 0x0:_0x5e92f0['outputType'],_0x44ee54=((_0x54ad6a=_0x11aa6d[_0x2f2816(0x11f)])==null?void 0x0:_0x54ad6a['unitID'])||'';if(_0x2d0953!==0x1)this[_0x2f2816(0x13d)][_0x2f2816(0x156)]({'error':{'code':_0x22f87c['UNRECOGNIZED'],'message':_0x2f2816(0x12b)},'state':0x3});else{if(_0x44ee54[_0x2f2816(0x163)]===0x0)this[_0x2f2816(0x13d)][_0x2f2816(0x156)]({'error':{'code':_0x22f87c[_0x2f2816(0x164)],'message':'Failed\x20to\x20get\x20unitID\x20from\x20task'},'state':0x3});else return this[_0x2f2816(0x13d)][_0x2f2816(0x156)]({'error':_0x11aa6d['error'],'state':0x3}),_0x44ee54;}}async['importFileToJson'](_0x3ad6b3,_0x3991e9,_0x5df72b){return this['_importToJson'](_0x3ad6b3,_0x3991e9,_0x5df72b);}async[_0x44d8c0(0xbe)](_0x5f472a,_0x283a63,_0x2f209b,_0x4b7260){const _0x2e45d3=_0x44d8c0;return this[_0x2e45d3(0x180)](_0x5f472a,0x1,_0x283a63,_0x2f209b,_0x4b7260);}async[_0x44d8c0(0x10a)](_0xe4f5d3,_0x393206,_0x4bd3aa,_0x1761ab){const _0x7b7732=_0x44d8c0;return this[_0x7b7732(0xcd)](_0xe4f5d3,_0x393206,_0x4bd3aa,_0x1761ab);}[_0x44d8c0(0xb1)](){const _0x3f845d=_0x44d8c0;this[_0x3f845d(0xf6)]=!0x0,this[_0x3f845d(0x179)]&&this[_0x3f845d(0x104)]['setTaskInterrupted'](this[_0x3f845d(0x179)]);}async[_0x44d8c0(0xad)](_0x110b74,_0x56c93a,_0x2301da){const _0x3efe0d=_0x44d8c0;var _0x9b9da5,_0x3a1f2a;this[_0x3efe0d(0xf6)]=!0x1;let _0x52534b=await this['_upload'](_0x110b74);if(!_0x52534b||this[_0x3efe0d(0xf6)])return;let _0x4f7a95=await this[_0x3efe0d(0x165)](_0x52534b,0x2,_0x56c93a,_0x2301da);if(!_0x4f7a95||this['_importInterrupted'])return;this[_0x3efe0d(0x179)]=_0x4f7a95,this['_requestService'][_0x3efe0d(0x11b)]();let _0x26f503=await this[_0x3efe0d(0x104)]['getTask'](_0x4f7a95)['catch'](_0x5b5b91=>{const _0x391f61=_0x3efe0d;var _0x4cbb2f;let _0x31d047=_0x5b5b91 instanceof Error?_0x5b5b91[_0x391f61(0x133)]:(_0x4cbb2f=_0x5b5b91[_0x391f61(0xe0)])==null?void 0x0:_0x4cbb2f[_0x391f61(0x133)];this[_0x391f61(0x13d)][_0x391f61(0x156)]({'error':{'code':_0x22f87c[_0x391f61(0x164)],'message':_0x31d047||''},'state':0x3});});if(!_0x26f503)return;let _0x4db5d7=(_0x9b9da5=_0x26f503[_0x3efe0d(0x11f)])==null?void 0x0:_0x9b9da5[_0x3efe0d(0x106)],_0x95c94f=((_0x3a1f2a=_0x26f503['import'])==null?void 0x0:_0x3a1f2a['jsonID'])||'';if(_0x4db5d7!==0x2){this['_requestState$']['next']({'error':{'code':_0x22f87c[_0x3efe0d(0x164)],'message':_0x3efe0d(0x12b)},'state':0x3});return;}if(_0x95c94f['length']===0x0){this[_0x3efe0d(0x13d)]['next']({'error':{'code':_0x22f87c[_0x3efe0d(0x164)],'message':'Failed\x20to\x20get\x20jsonID\x20from\x20task'},'state':0x3});return;}this['_requestState$'][_0x3efe0d(0x156)]({'error':_0x26f503[_0x3efe0d(0xe0)],'state':0x3});let _0xec3187=await this[_0x3efe0d(0xcc)](_0x95c94f);if(!_0xec3187)return;let _0x222338=await this['_requestService'][_0x3efe0d(0xb7)](_0xec3187);if(!_0x222338)this[_0x3efe0d(0x13d)][_0x3efe0d(0x156)]({'error':{'code':_0x22f87c['UNRECOGNIZED'],'message':'Failed\x20to\x20get\x20text\x20from\x20url'},'state':0x5});else try{let _0x3dc5f1=JSON[_0x3efe0d(0x15a)](_0x222338);return this[_0x3efe0d(0x13d)][_0x3efe0d(0x156)]({'error':{'code':_0x22f87c['OK'],'message':_0x3efe0d(0xbf)},'state':0x5}),_0x3dc5f1;}catch{this[_0x3efe0d(0x13d)][_0x3efe0d(0x156)]({'error':{'code':_0x22f87c[_0x3efe0d(0x164)],'message':'Failed\x20to\x20parse\x20json'},'state':0x5});}}async[_0x44d8c0(0xcd)](_0xcb0b94,_0x4a2689,_0x5ed526,_0x4fce31){const _0x739d4a=_0x44d8c0;let _0x571c74=JSON['stringify'](_0xcb0b94),_0x22ef4e=_0x2b5d63[_0x739d4a(0x9a)](_0x571c74),_0x18e6ba=_0x2effba(_0x22ef4e),_0x1e8619=_0x22ef4e[_0x739d4a(0x163)],_0x85923b=ve(_0x18e6ba),_0x46b577=await this[_0x739d4a(0xac)](_0x85923b,_0x1e8619,!0x0);if(_0x46b577)return this[_0x739d4a(0x180)](_0x46b577,0x2,_0x4a2689,_0x5ed526,_0x4fce31);}async[_0x44d8c0(0x180)](_0x59e840,_0x4a5b1e,_0x14d1eb,_0x32c613,_0x41f1f8){const _0x49bcfd=_0x44d8c0;var _0x151f3c;let _0x3e30d4=await this['_requestService'][_0x49bcfd(0x84)]({..._0x4a5b1e===0x1?{'unitID':_0x59e840}:{'jsonID':_0x59e840},'type':_0x14d1eb,'format':_0x32c613,'options':_0x41f1f8});if(!_0x3e30d4){this['_requestState$'][_0x49bcfd(0x156)]({'error':{'code':_0x22f87c[_0x49bcfd(0x164)],'message':_0x49bcfd(0x185)},'state':0x2});return;}if(this[_0x49bcfd(0x13d)]['next']({'error':_0x3e30d4[_0x49bcfd(0xe0)],'state':0x2}),_0x3e30d4[_0x49bcfd(0xe0)]&&_0x3e30d4[_0x49bcfd(0xe0)][_0x49bcfd(0xc0)]!==_0x22f87c['OK'])return;let _0x1f9b95=_0x3e30d4[_0x49bcfd(0x14f)],_0x3f287a=await this[_0x49bcfd(0x104)]['getTask'](_0x1f9b95)['catch'](_0x5742e5=>{const _0x45c247=_0x49bcfd;this[_0x45c247(0x13d)]['next']({'error':_0x5742e5 instanceof Error?{'code':_0x22f87c[_0x45c247(0x164)],'message':_0x5742e5[_0x45c247(0x133)]}:_0x5742e5['error'],'state':0x3});});if(!_0x3f287a)return;let _0x3c5b87=((_0x151f3c=_0x3f287a['export'])==null?void 0x0:_0x151f3c[_0x49bcfd(0xff)])||'';if(_0x3c5b87[_0x49bcfd(0x163)]===0x0){this[_0x49bcfd(0x13d)]['next']({'error':{'code':_0x22f87c[_0x49bcfd(0x164)],'message':'Failed\x20to\x20get\x20fileID\x20from\x20task'},'state':0x3});return;}this[_0x49bcfd(0x13d)]['next']({'error':_0x3f287a[_0x49bcfd(0xe0)],'state':0x3});let _0x35c195=await this['_signUrl'](_0x3c5b87);if(!_0x35c195)return;let _0x741c08=await B(_0x35c195,this[_0x49bcfd(0x189)]);if(!_0x741c08)this[_0x49bcfd(0x13d)][_0x49bcfd(0x156)]({'error':{'code':_0x22f87c['UNRECOGNIZED'],'message':_0x49bcfd(0x10d)},'state':0x6});else return this[_0x49bcfd(0x13d)]['next']({'error':{'code':_0x22f87c['OK'],'message':_0x49bcfd(0xbf)},'state':0x6}),_0x741c08;}async['_upload'](_0x36699b,_0x33b147,_0x200596){const _0x3f75bc=_0x44d8c0;let _0xdffbef;try{_0xdffbef=await this['_requestService'][_0x3f75bc(0xab)](_0x36699b,_0x33b147,_0x200596);}catch(_0xdf83e4){let _0x314869=_0xdf83e4 instanceof Error?_0xdf83e4[_0x3f75bc(0x133)]:String(_0xdf83e4);this[_0x3f75bc(0x13d)][_0x3f75bc(0x156)]({'error':{'code':_0x22f87c[_0x3f75bc(0x164)],'message':_0x314869},'state':0x0});return;}if(!_0xdffbef||typeof _0xdffbef['FileId']!=_0x3f75bc(0x81)){this['_requestState$'][_0x3f75bc(0x156)]({'error':{'code':_0x22f87c[_0x3f75bc(0x164)],'message':_0x3f75bc(0x131)},'state':0x0});return;}let _0x2ab5f2=_0xdffbef['FileId'];if(_0x2ab5f2[_0x3f75bc(0x163)]===0x0)this['_requestState$'][_0x3f75bc(0x156)]({'error':{'code':_0x22f87c['UNRECOGNIZED'],'message':_0x3f75bc(0xdb)},'state':0x0});else return this['_requestState$'][_0x3f75bc(0x156)]({'error':{'code':_0x22f87c['OK'],'message':'success'},'state':0x0}),_0x2ab5f2;}async['_import'](_0x33ba68,_0xcd1806,_0x30e039,_0x52c372,_0x428592){const _0x397a12=_0x44d8c0;let _0x3937a4={'fileID':_0x33ba68,'type':_0x30e039,'outputType':_0xcd1806,'options':_0x52c372,..._0x428592?{'sourceUnitID':_0x428592}:{}},_0x14148d=await this[_0x397a12(0x104)]['import'](_0x3937a4);if(!_0x14148d){this[_0x397a12(0x13d)][_0x397a12(0x156)]({'error':{'code':_0x22f87c[_0x397a12(0x164)],'message':_0x397a12(0xee)},'state':0x1});return;}if(_0x14148d[_0x397a12(0xe0)]&&_0x14148d[_0x397a12(0xe0)]['code']!==_0x22f87c['OK']){this[_0x397a12(0x13d)][_0x397a12(0x156)]({'error':_0x14148d[_0x397a12(0xe0)],'state':0x1});return;}let _0x590433=_0x14148d[_0x397a12(0x14f)];if(_0x590433['length']===0x0)this[_0x397a12(0x13d)][_0x397a12(0x156)]({'error':{'code':_0x22f87c[_0x397a12(0x164)],'message':_0x397a12(0x12a)},'state':0x1});else return this[_0x397a12(0x13d)][_0x397a12(0x156)]({'error':_0x14148d[_0x397a12(0xe0)],'state':0x1}),_0x590433;}async['_signUrl'](_0x281f69){const _0x1c869c=_0x44d8c0;let _0x5402b1=await this[_0x1c869c(0x104)][_0x1c869c(0x105)](_0x281f69);if(!_0x5402b1){this[_0x1c869c(0x13d)]['next']({'error':{'code':_0x22f87c[_0x1c869c(0x164)],'message':_0x1c869c(0x130)},'state':0x4});return;}if(_0x5402b1[_0x1c869c(0xe0)]&&_0x5402b1[_0x1c869c(0xe0)]['code']!==_0x22f87c['OK']){this[_0x1c869c(0x13d)][_0x1c869c(0x156)]({'error':_0x5402b1['error'],'state':0x4});return;}let _0x5e090e=_0x59c2c8(_0x5402b1[_0x1c869c(0x16c)],this[_0x1c869c(0xd5)]());if(_0x5e090e['length']===0x0)this[_0x1c869c(0x13d)][_0x1c869c(0x156)]({'error':{'code':_0x22f87c['UNRECOGNIZED'],'message':'sign\x20url\x20error'},'state':0x4});else return this[_0x1c869c(0x13d)]['next']({'error':_0x5402b1[_0x1c869c(0xe0)],'state':0x4}),_0x5e090e;}[_0x44d8c0(0xd5)](){const _0x14cc50=_0x44d8c0;let _0x5ab2f3=this[_0x14cc50(0x14a)][_0x14cc50(0x115)](E);return(_0x5ab2f3==null?void 0x0:_0x5ab2f3['downloadEndpointUrl'])??location[_0x14cc50(0x161)];}};Q=J([q(0x0,_0x1a6bfd),q(0x1,_0xbf18e9(_0x3df063)),q(0x2,_0xbf18e9(Y))],Q);function ke(_0x41efba){const _0x409064=_0x44d8c0;let _0x404514=_0x41efba['createChild']([[Y,{'useClass':X}],[Z,{'useClass':Q}]]);return{'service':_0x404514[_0x409064(0xfa)](Z),'dispose':()=>_0x404514[_0x409064(0x113)]()};}function Ae(_0x168a2b,_0x34db05){const _0x912b81=_0x44d8c0;let _0x2a14ae=_0x168a2b['get'](_0x479505)[_0x912b81(0x129)](_0x34db05);return!!_0x2a14ae&&_0x168a2b[_0x912b81(0xe5)](_0x313caf)&&_0x168a2b[_0x912b81(0xe5)](_0x4b5bcf)&&_0x168a2b[_0x912b81(0xfa)](_0x313caf)['isUnitLoadedFromServer'](_0x2a14ae);}function je(_0x2d7088){return async _0x40a31e=>{const _0x324cdf=_0x1417;let _0x4d049c=_0x2d0649(_0x40a31e['mimeType']);if(_0x4d049c==null)throw Error(_0x324cdf(0x103));if(_0x40a31e['signal'][_0x324cdf(0x97)])throw Error(_0x324cdf(0x88));let _0x2d697a=_0x2d7088(),_0x426297=()=>_0x2d697a[_0x324cdf(0x155)][_0x324cdf(0xb1)]();_0x40a31e[_0x324cdf(0xd9)][_0x324cdf(0xa0)](_0x324cdf(0xcb),_0x426297,{'once':!0x0});try{let _0x3214ef=await _0x2d697a[_0x324cdf(0x155)][_0x324cdf(0xed)](new File([_0x40a31e[_0x324cdf(0x8f)]],_0x40a31e[_0x324cdf(0xfc)],{'type':_0x40a31e[_0x324cdf(0xc1)]}),_0x4d049c);if(!_0x3214ef||_0x40a31e[_0x324cdf(0xd9)][_0x324cdf(0x97)])throw Error(_0x324cdf(0x16a));if(_0x4d049c===_0x317470['UNIVER_SHEET']){let _0x4d2e08=Object[_0x324cdf(0x98)](_0x3214ef[_0x324cdf(0x117)]??{})[_0x324cdf(0x14b)](_0x56b096=>({..._0x56b096,'data':typeof _0x56b096[_0x324cdf(0x136)]==_0x324cdf(0x81)?JSON[_0x324cdf(0x15a)](_0x36e039(_0x56b096['data'])):_0x56b096[_0x324cdf(0x136)]}));return{'type':_0x4d049c,'data':await _0x5485b1(_0x3214ef[_0x324cdf(0xe6)],_0x4d2e08)};}return{'type':_0x4d049c,'data':_0x4d049c===_0x317470['UNIVER_DOC']?_0x3ef383(_0x3214ef['snapshot']):_0x4ad61f(_0x3214ef['snapshot'])};}finally{_0x40a31e[_0x324cdf(0xd9)][_0x324cdf(0xe1)](_0x324cdf(0xcb),_0x426297),_0x2d697a[_0x324cdf(0x113)]();}};}function Me(_0xe75f14){return async _0x2a7d7a=>{const _0x1b78b3=_0x1417;let _0x361fed=_0x2d0649(_0x2a7d7a[_0x1b78b3(0xc1)]);if(_0x361fed==null||_0x2a7d7a[_0x1b78b3(0xd9)][_0x1b78b3(0x97)])throw Error(_0x1b78b3(0x137));let _0x4b6993=_0xe75f14(),_0x1a4883=()=>_0x4b6993[_0x1b78b3(0x155)][_0x1b78b3(0xb1)]();_0x2a7d7a[_0x1b78b3(0xd9)]['addEventListener'](_0x1b78b3(0xcb),_0x1a4883,{'once':!0x0});try{let _0x7dec56=_0x292e1c=>{const _0x26ac66=_0x1b78b3;var _0x4829f8;_0x292e1c[_0x26ac66(0x109)]!==_0x26ac66(0x152)&&((_0x4829f8=_0x2a7d7a[_0x26ac66(0x14c)])==null||_0x4829f8[_0x26ac66(0xa7)](_0x2a7d7a,_0x292e1c[_0x26ac66(0x109)]));},_0x3e060a;if(_0x2a7d7a[_0x1b78b3(0x12e)]){var _0x48b5ae;(_0x48b5ae=_0x2a7d7a[_0x1b78b3(0x14c)])==null||_0x48b5ae[_0x1b78b3(0xa7)](_0x2a7d7a,_0x1b78b3(0xd0)),_0x3e060a=await _0x4b6993[_0x1b78b3(0x155)]['importAttachmentToUnitId'](_0x2a7d7a['fileId'],_0x2a7d7a[_0x1b78b3(0x170)],_0x361fed,_0x7dec56);}else{var _0x9eb0b6;(_0x9eb0b6=_0x2a7d7a[_0x1b78b3(0x14c)])==null||_0x9eb0b6[_0x1b78b3(0xa7)](_0x2a7d7a,'uploading');let _0x259fee=new File([_0x2a7d7a['bytes']],_0x2a7d7a['name'],{'type':_0x2a7d7a[_0x1b78b3(0xc1)]});_0x3e060a=await _0x4b6993[_0x1b78b3(0x155)][_0x1b78b3(0xce)](_0x259fee,_0x361fed,void 0x0,_0x7dec56);}if(!_0x3e060a||_0x2a7d7a[_0x1b78b3(0xd9)][_0x1b78b3(0x97)])throw Error(_0x1b78b3(0xf2));return{'unitId':_0x3e060a,'type':_0x361fed};}finally{_0x2a7d7a[_0x1b78b3(0xd9)][_0x1b78b3(0xe1)](_0x1b78b3(0xcb),_0x1a4883),_0x4b6993[_0x1b78b3(0x113)]();}};}let $=class extends _0xf0ff40{constructor(_0x7b5ee8=D,_0x593bd5,_0x2b49ce){const _0x28be12=_0x44d8c0;super(),this[_0x28be12(0x83)]=_0x7b5ee8,this[_0x28be12(0xe8)]=_0x593bd5,this[_0x28be12(0x14a)]=_0x2b49ce;let {..._0x42139a}=_0x34edb6({},D,this[_0x28be12(0x83)]);this['_configService'][_0x28be12(0x147)](E,_0x42139a);}[_0x44d8c0(0x9b)](){const _0x496ea0=_0x44d8c0;_0x471dfc(this[_0x496ea0(0xe8)],[[Z,{'useClass':Q}],[Y,{'useClass':X}]]);}[_0x44d8c0(0xa3)](){const _0xd37c1=_0x44d8c0;var _0x224f14,_0x3a15e5,_0x59369d;let _0x1ff45b=this[_0xd37c1(0x14a)][_0xd37c1(0x115)]('drawing.config')??{},_0xea9c93=()=>ke(this[_0xd37c1(0xe8)]);this['_configService'][_0xd37c1(0x147)](_0xd37c1(0xae),{..._0x1ff45b,'ole':{..._0x1ff45b[_0xd37c1(0xf4)],'convertOffice':((_0x224f14=_0x1ff45b[_0xd37c1(0xf4)])==null?void 0x0:_0x224f14[_0xd37c1(0xa1)])??je(_0xea9c93),'convertToOnline':((_0x3a15e5=_0x1ff45b[_0xd37c1(0xf4)])==null?void 0x0:_0x3a15e5[_0xd37c1(0x17a)])??Me(_0xea9c93),'isCollaborative':((_0x59369d=_0x1ff45b['ole'])==null?void 0x0:_0x59369d[_0xd37c1(0x10c)])??(_0x3add0d=>Ae(this[_0xd37c1(0xe8)],_0x3add0d))}});}};K($,'pluginName',_0x44d8c0(0x18d)),K($,_0x44d8c0(0xb4),de),K($,'version',fe),$=J([_0x1c0399(_0x4a1abe,_0x5b4652),q(0x1,_0xbf18e9(_0x183e46)),q(0x2,_0x1a6bfd)],$);function Ne(_0x18878b){const _0x8b5fc1=_0x44d8c0;let _0x617211=_0x18878b[_0x8b5fc1(0x10b)];if(!_0x617211)return null;let _0x59f53f={};_0x617211[_0x8b5fc1(0xdf)]&&Object[_0x8b5fc1(0xaf)](_0x617211[_0x8b5fc1(0xdf)])['forEach'](_0x19c9ee=>{const _0x2c6923=_0x8b5fc1;let _0x13483c=_0x617211[_0x2c6923(0xdf)][_0x19c9ee];_0x59f53f[_0x19c9ee]={..._0x13483c,'originalMeta':_0x14d996(_0x5e18c6['decode'](_0x13483c[_0x2c6923(0x187)]))};});let _0x5dd0c5=_0x14d996(_0x5e18c6[_0x8b5fc1(0x154)](_0x617211[_0x8b5fc1(0x187)]));return{..._0x18878b,'workbook':{..._0x617211,'originalMeta':_0x5dd0c5,'sheets':_0x59f53f},'doc':{},'slide':void 0x0,'board':void 0x0,'pdf':void 0x0};}function Pe(_0x3387e7){const _0x2ff3a0=_0x44d8c0;let _0x34cada={};return _0x3387e7[_0x2ff3a0(0x148)](_0x5df536=>{const _0x5a0119=_0x2ff3a0;_0x34cada[_0x5df536['id']]={..._0x5df536,'data':_0x14d996(_0x5e18c6[_0x5a0119(0x154)](_0x5df536[_0x5a0119(0x136)]))};}),_0x34cada;}var Fe=class{constructor(){const _0x57008f=_0x44d8c0;K(this,_0x57008f(0x15e),new Map());}[_0x44d8c0(0x123)](){const _0x4412f6=_0x44d8c0;return Promise['resolve']({'snapshot':{'unitID':'','type':_0x317470[_0x4412f6(0x172)],'rev':0x0,'workbook':void 0x0,'doc':void 0x0,'slide':void 0x0,'board':void 0x0},'changesets':[],'error':{'code':_0x22f87c['OK'],'message':''}});}['getSheetBlock'](_0xd27bdb,_0x2c9fed){const _0x40814d=_0x44d8c0;let _0x3d94fc=this[_0x40814d(0x15e)][_0x40814d(0xfa)](_0x2c9fed[_0x40814d(0xfb)]);return Promise[_0x40814d(0xf8)]({'block':_0x3d94fc,'error':{'code':_0x22f87c['OK'],'message':''}});}['getDeserializedSheetBlock'](_0x1c814a,_0x46afa2){const _0x4cba6f=_0x44d8c0;let _0xb9ccda=this[_0x4cba6f(0x15e)][_0x4cba6f(0xfa)](_0x46afa2[_0x4cba6f(0xfb)]);return Promise[_0x4cba6f(0xf8)]({'block':_0xb9ccda===void 0x0?void 0x0:{..._0xb9ccda,'data':JSON[_0x4cba6f(0x15a)](_0x5e18c6[_0x4cba6f(0x154)](_0xb9ccda[_0x4cba6f(0x136)]))},'error':{'code':_0x22f87c['OK'],'message':''}});}['fetchMissingChangesets'](){return Promise['resolve']({'changesets':[],'error':{'code':_0x22f87c['OK'],'message':''}});}[_0x44d8c0(0x107)](){const _0x3a3bdd=_0x44d8c0;return Promise[_0x3a3bdd(0xf8)]({'resources':{},'error':{'code':_0x22f87c['OK'],'message':''}});}[_0x44d8c0(0x112)](){const _0x506181=_0x44d8c0;return Promise[_0x506181(0xf8)]({'error':{'code':_0x22f87c['OK'],'message':''}});}[_0x44d8c0(0xc9)](){const _0x123bda=_0x44d8c0;return Promise[_0x123bda(0xf8)]({'error':{'code':_0x22f87c['OK'],'message':''}});}[_0x44d8c0(0x173)](_0x5c332d,_0x22fa4a){const _0x1d159e=_0x44d8c0;let {block:_0x260dce}=_0x22fa4a;return _0x260dce?(this[_0x1d159e(0x15e)]['set'](_0x260dce['id'],_0x260dce),Promise['resolve']({'error':{'code':_0x22f87c['OK'],'message':''},'blockID':_0x260dce['id']})):Promise['resolve']({'error':{'code':_0x22f87c[_0x1d159e(0x9f)],'message':_0x1d159e(0x14d)},'blockID':''});}[_0x44d8c0(0x93)](){const _0x31fb75=_0x44d8c0;return Promise[_0x31fb75(0xf8)]({'error':{'code':_0x22f87c['OK'],'message':''},'concurrent':[]});}[_0x44d8c0(0x178)](){return Promise['resolve']({'error':void 0x0,'fileMetaId':''});}[_0x44d8c0(0xa5)](){return Promise['resolve']({'error':void 0x0,'latestReqID':0x0});}};export{Fe as ClientSnapshotServerService,Oe as ExchangeBaseExportMode,De as ExchangeBaseFormulaPolicy,Ee as ExchangeBaseImportMode,Te as ExchangeDocType,we as ExchangeFormat,Z as IExchangeService,Ce as ImportOutputType,$ as UniverExchangeClientPlugin,Pe as transformSheetBlockMetaToString,Ne as transformWorkbookSnapshotMetaToString};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { UniverExchangeClientPlugin } from './plugin';
|
|
2
2
|
export { IExchangeService } from './services/exchange.service';
|
|
3
3
|
export { ExchangeBaseExportMode, ExchangeBaseFormulaPolicy, ExchangeBaseImportMode, ExchangeDocType, ExchangeFormat, ImportOutputType, } from './services/request.service';
|
|
4
|
-
export type { IExchangeBaseExportOption, IExchangeBaseImportOption, IExchangeDocImportOption, IExchangeExportOptions, IExchangeImportOptions, IExchangeSheetExportOption, IExchangeSheetImportOption, IExportRequest, IImportRequest, } from './services/request.service';
|
|
4
|
+
export type { IExchangeBaseExportOption, IExchangeBaseImportOption, IExchangeDocImportOption, IExchangeExportOptions, IExchangeImportOptions, IExchangeOleExportOption, IExchangeSheetExportOption, IExchangeSheetImportOption, IExchangeTaskProgress, IExportRequest, IImportRequest, } from './services/request.service';
|
|
5
5
|
export { ClientSnapshotServerService, transformSheetBlockMetaToString, transformWorkbookSnapshotMetaToString, } from './services/utils/snapshot';
|
|
6
6
|
export type { ISnapshotBlockJson, ISnapshotBlockJsonResponse, ISnapshotJson, } from './services/utils/snapshot';
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IUniverExchangeClientConfig } from './config/config';
|
|
2
1
|
import { IConfigService, Injector, Plugin } from '@univerjs/core';
|
|
2
|
+
import type { IUniverExchangeClientConfig } from './config/config';
|
|
3
3
|
export declare class UniverExchangeClientPlugin extends Plugin {
|
|
4
4
|
private readonly _config;
|
|
5
5
|
readonly _injector: Injector;
|
|
@@ -9,4 +9,5 @@ export declare class UniverExchangeClientPlugin extends Plugin {
|
|
|
9
9
|
static version: string;
|
|
10
10
|
constructor(_config: IUniverExchangeClientConfig | undefined, _injector: Injector, _configService: IConfigService);
|
|
11
11
|
onStarting(): void;
|
|
12
|
+
onReady(): void;
|
|
12
13
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Injector } from '@univerjs/core';
|
|
2
|
+
import { IExchangeService } from './exchange.service';
|
|
3
|
+
/** Allocate an independent task lifecycle for previews and explicit attachment conversions. */
|
|
4
|
+
export declare function createExchangeScope(injector: Injector): {
|
|
5
|
+
service: IExchangeService;
|
|
6
|
+
dispose: () => void;
|
|
7
|
+
};
|
|
@@ -3,7 +3,7 @@ import type { IError } from '@univerjs/protocol';
|
|
|
3
3
|
import type { Observable } from 'rxjs';
|
|
4
4
|
import { Disposable, IConfigService } from '@univerjs/core';
|
|
5
5
|
import { HTTPService } from '@univerjs/network';
|
|
6
|
-
import type { ExchangeFormat, IExchangeExportOptions, IExchangeImportOptions, RequestService } from './request.service';
|
|
6
|
+
import type { ExchangeFormat, IExchangeExportOptions, IExchangeImportOptions, IExchangeTaskProgress, RequestService } from './request.service';
|
|
7
7
|
import type { ISnapshotBlockJson } from './utils/snapshot';
|
|
8
8
|
export declare enum RequestState {
|
|
9
9
|
UPLOAD = 0,
|
|
@@ -31,26 +31,31 @@ export interface IExchangeService {
|
|
|
31
31
|
/**
|
|
32
32
|
* Import file to unit id
|
|
33
33
|
*/
|
|
34
|
-
importFileToUnitId(file: File | string, univerType: UniverInstanceType, options?: IExchangeImportOptions): Promise<string | undefined>;
|
|
34
|
+
importFileToUnitId(file: File | string, univerType: UniverInstanceType, options?: IExchangeImportOptions, onProgress?: (progress: IExchangeTaskProgress) => void): Promise<string | undefined>;
|
|
35
35
|
/**
|
|
36
36
|
* Import file to json without creating a unit
|
|
37
37
|
*/
|
|
38
38
|
importFileToJson<T = unknown>(file: File | string, univerType: UniverInstanceType, options?: IExchangeImportOptions): Promise<T | undefined>;
|
|
39
|
+
/** Import a persistent attachment without downloading or uploading its bytes in the browser. */
|
|
40
|
+
importAttachmentToUnitId(fileID: string, sourceUnitID: string, type: UniverInstanceType, onProgress?: (progress: IExchangeTaskProgress) => void): Promise<string | undefined>;
|
|
39
41
|
interruptImportTask(): void;
|
|
40
42
|
}
|
|
41
|
-
export declare const IExchangeService: import("@
|
|
43
|
+
export declare const IExchangeService: import("@univerjs/core").IdentifierDecorator<IExchangeService>;
|
|
42
44
|
export declare class ExchangeService extends Disposable implements IExchangeService, IDisposable {
|
|
43
45
|
private readonly _configService;
|
|
44
46
|
private readonly _httpService;
|
|
45
47
|
private readonly _requestService;
|
|
46
48
|
private _importTaskId;
|
|
49
|
+
private _importInterrupted;
|
|
47
50
|
private readonly _requestState$;
|
|
48
51
|
readonly requestState$: Observable<IRequestState>;
|
|
49
52
|
constructor(_configService: IConfigService, _httpService: HTTPService, _requestService: RequestService);
|
|
50
53
|
dispose(): void;
|
|
51
54
|
downloadFile(file: File | Blob, filename: string, fileExt: string): void;
|
|
52
55
|
getFileById(fileId: string, signal?: AbortSignal): Promise<File | undefined>;
|
|
53
|
-
importFileToUnitId(file: File | string, univerType: UniverInstanceType, options?: IExchangeImportOptions): Promise<string | undefined>;
|
|
56
|
+
importFileToUnitId(file: File | string, univerType: UniverInstanceType, options?: IExchangeImportOptions, onProgress?: (progress: IExchangeTaskProgress) => void): Promise<string | undefined>;
|
|
57
|
+
importAttachmentToUnitId(fileID: string, sourceUnitID: string, type: UniverInstanceType, onProgress?: (progress: IExchangeTaskProgress) => void): Promise<string | undefined>;
|
|
58
|
+
private _importUnit;
|
|
54
59
|
importFileToJson<T = unknown>(file: File | string, univerType: UniverInstanceType, options?: IExchangeImportOptions): Promise<T | undefined>;
|
|
55
60
|
exportFileByUnitId(unitId: string, univerType: UniverInstanceType, format: ExchangeFormat, options?: IExchangeExportOptions): Promise<File | undefined>;
|
|
56
61
|
exportFileBySnapshot(snapshot: ISnapshotBlockJson, univerType: UniverInstanceType, format: ExchangeFormat, options?: IExchangeExportOptions): Promise<File | undefined>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IOleConfig } from '@univerjs/drawing';
|
|
2
|
+
import type { IExchangeService } from './exchange.service';
|
|
3
|
+
export interface IOleExchangeScope {
|
|
4
|
+
service: IExchangeService;
|
|
5
|
+
dispose: () => void;
|
|
6
|
+
}
|
|
7
|
+
/** Uses the existing JSON import endpoint. No online child Unit is created. */
|
|
8
|
+
export declare function createOleOfficeConverter(createScope: () => IOleExchangeScope): NonNullable<IOleConfig['convertOffice']>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IOleConfig } from '@univerjs/drawing';
|
|
2
|
+
import type { IOleExchangeScope } from './ole-office-converter';
|
|
3
|
+
/** Explicit online import returns only the durable Unit identity in its own task scope. */
|
|
4
|
+
export declare function createOleOnlineConverter(createScope: () => IOleExchangeScope): NonNullable<IOleConfig['convertToOnline']>;
|
|
@@ -92,12 +92,18 @@ export interface IExchangeImportOptions {
|
|
|
92
92
|
base?: IExchangeBaseImportOption;
|
|
93
93
|
doc?: IExchangeDocImportOption;
|
|
94
94
|
}
|
|
95
|
-
export interface
|
|
95
|
+
export interface IExchangeOleExportOption {
|
|
96
|
+
/** Defaults to original. Online embeds current confirmed Unit versions in this export only. */
|
|
97
|
+
oleAttachmentSource?: 'original' | 'online';
|
|
98
|
+
}
|
|
99
|
+
export interface IExchangeExportOptions extends IExchangeOleExportOption {
|
|
96
100
|
sheet?: IExchangeSheetExportOption;
|
|
97
101
|
base?: IExchangeBaseExportOption;
|
|
98
102
|
}
|
|
99
103
|
export interface IImportRequest {
|
|
100
104
|
fileID: string;
|
|
105
|
+
/** Owning Unit for an existing persistent attachment. The server must authorize this reference. */
|
|
106
|
+
sourceUnitID?: string;
|
|
101
107
|
type: UniverInstanceType;
|
|
102
108
|
outputType: ImportOutputType;
|
|
103
109
|
options?: IExchangeImportOptions;
|
|
@@ -119,7 +125,11 @@ export interface IExportResponse {
|
|
|
119
125
|
error: IError | undefined;
|
|
120
126
|
taskID: string;
|
|
121
127
|
}
|
|
128
|
+
export interface IExchangeTaskProgress {
|
|
129
|
+
stage: 'reading' | 'converting' | 'creating' | 'done';
|
|
130
|
+
}
|
|
122
131
|
export interface IGetTaskResponse {
|
|
132
|
+
progress?: IExchangeTaskProgress;
|
|
123
133
|
error: IError | undefined;
|
|
124
134
|
taskID: string;
|
|
125
135
|
status: string;
|
|
@@ -153,11 +163,11 @@ export interface IRequestService {
|
|
|
153
163
|
import(importRequest: IImportRequest): Promise<IImportResponse | undefined>;
|
|
154
164
|
export(exportRequest: IExportRequest): Promise<IExportResponse | undefined>;
|
|
155
165
|
/** Rejects a non-OK task response as received; client and transport failures reject with Error. */
|
|
156
|
-
getTask(taskID: string): Promise<IGetTaskResponse | undefined>;
|
|
166
|
+
getTask(taskID: string, onProgress?: (progress: IExchangeTaskProgress) => void): Promise<IGetTaskResponse | undefined>;
|
|
157
167
|
signUrl(fileID: string): Promise<ISignUrlResponse | undefined>;
|
|
158
168
|
getTextFromUrl(url: string): Promise<string | undefined>;
|
|
159
169
|
}
|
|
160
|
-
export declare const IRequestService: import("@
|
|
170
|
+
export declare const IRequestService: import("@univerjs/core").IdentifierDecorator<IRequestService>;
|
|
161
171
|
/**
|
|
162
172
|
* TODO@Dushusir maybe move to ExchangeClientPlugin plugin for reuse
|
|
163
173
|
*/
|
|
@@ -165,6 +175,7 @@ export declare class RequestService implements IRequestService, IDisposable {
|
|
|
165
175
|
private readonly _configService;
|
|
166
176
|
private readonly _httpService;
|
|
167
177
|
private _taskInterrupted;
|
|
178
|
+
private readonly _taskCancellation;
|
|
168
179
|
constructor(_configService: IConfigService, _httpService: HTTPService);
|
|
169
180
|
dispose(): void;
|
|
170
181
|
setTaskInterrupted(taskID: string): void;
|
|
@@ -176,7 +187,7 @@ export declare class RequestService implements IRequestService, IDisposable {
|
|
|
176
187
|
upload(file: File | string, size?: number, flate?: boolean): Promise<IFileUploadResponse>;
|
|
177
188
|
import(importRequest: IImportRequest): Promise<IImportResponse | undefined>;
|
|
178
189
|
export(exportRequest: IExportRequest): Promise<IExportResponse | undefined>;
|
|
179
|
-
getTask(taskID: string): Promise<IGetTaskResponse | undefined>;
|
|
190
|
+
getTask(taskID: string, onProgress?: (progress: IExchangeTaskProgress) => void): Promise<IGetTaskResponse | undefined>;
|
|
180
191
|
signUrl(fileID: string): Promise<ISignUrlResponse | undefined>;
|
|
181
192
|
getTextFromUrl(url: string): Promise<string | undefined>;
|
|
182
193
|
private _buildProtocolErrorMessage;
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x53acbd,_0x3ab7bf){var _0x133223=_0x1007,_0x4de70f=_0x53acbd();while(!![]){try{var _0x40a01d=parseInt(_0x133223(0x19e))/0x1*(-parseInt(_0x133223(0x1a9))/0x2)+parseInt(_0x133223(0x1a8))/0x3*(parseInt(_0x133223(0x1af))/0x4)+-parseInt(_0x133223(0x1a1))/0x5*(parseInt(_0x133223(0x1a7))/0x6)+-parseInt(_0x133223(0x1a5))/0x7*(parseInt(_0x133223(0x1ad))/0x8)+parseInt(_0x133223(0x1a4))/0x9+-parseInt(_0x133223(0x1ae))/0xa+-parseInt(_0x133223(0x1b0))/0xb*(-parseInt(_0x133223(0x1b1))/0xc);if(_0x40a01d===_0x3ab7bf)break;else _0x4de70f['push'](_0x4de70f['shift']());}catch(_0x4d80e1){_0x4de70f['push'](_0x4de70f['shift']());}}}(_0x203f,0xc9289),function(_0x2adbee,_0x3ac407){var _0x434ec3=_0x1007;typeof exports==_0x434ec3(0x1a0)&&typeof module<'u'?_0x3ac407(require('@univerjs-pro/exchange-client'),require('@univerjs/core/facade')):typeof define==_0x434ec3(0x1ab)&&define[_0x434ec3(0x1a2)]?define(['@univerjs-pro/exchange-client',_0x434ec3(0x1a6)],_0x3ac407):(_0x2adbee=typeof globalThis<'u'?globalThis:_0x2adbee||self,_0x3ac407(_0x2adbee[_0x434ec3(0x19d)],_0x2adbee[_0x434ec3(0x1b2)]));}(this,function(_0x4e6322,_0x4a7a79){var _0x5b8b1b=_0x1007,_0x15cc49=class extends _0x4a7a79['FUniver']{[_0x5b8b1b(0x1aa)](_0x39d254,_0x52f782,_0xe6d685){var _0x584bd5=_0x5b8b1b;this[_0x584bd5(0x19f)]['get'](_0x4e6322[_0x584bd5(0x1a3)])[_0x584bd5(0x1aa)](_0x39d254,_0x52f782,_0xe6d685);}};_0x4a7a79[_0x5b8b1b(0x1ac)]['extend'](_0x15cc49);}));function _0x1007(_0x2f71a5,_0x41f20d){_0x2f71a5=_0x2f71a5-0x19d;var _0x203f51=_0x203f();var _0x100766=_0x203f51[_0x2f71a5];return _0x100766;}function _0x203f(){var _0x1b16ef=['_injector','object','3601145zbneto','amd','IExchangeService','13308921kbOzFI','3402oLuNSZ','@univerjs/core/facade','12lxdWiG','9ChuXxU','70294gxorMK','downloadFile','function','FUniver','7600DQEgNy','4263320pJJbSL','267892rsTzMt','44CunIPi','8952204bfmPIc','UniverCoreFacade','UniverProExchangeClient','43EWFtka'];_0x203f=function(){return _0x1b16ef;};return _0x203f();}
|